Converts YOLO label files into pixel object sizes and reports what fraction falls below the 32px and 16px thresholds.
widths, heights = [], []
for label_file in glob.glob(os.path.join(VISDRONE_LABEL, '*.txt')):
with open(label_file) as f:
for line in f:
parts = line.strip().split()
if len(parts) == 5:
# Normalised coords — convert to pixels (1920x1080 images)
widths.append(float(parts[3]) * 1920)
heights.append(float(parts[4]) * 1080)
sizes = np.sqrt(np.array(widths) * np.array(heights))
pct_below_32 = (sizes < 32).mean() * 100
pct_below_16 = (sizes < 16).mean() * 100