|
| 1 | +# Drone object detection |
| 2 | + |
| 3 | +People and vehicles seen from a drone are small: of the 75,102 objects in VisDrone's test-dev |
| 4 | +split, 68 % are under 32 x 32 pixels in the original photo, and a 2000 x 1500 image shrunk to the |
| 5 | +usual 640 px input keeps a third of each object's width. This project trains YOLO26s three ways |
| 6 | +and asks which helps small objects more: more pixels in training, more pixels at inference, or |
| 7 | +both. |
| 8 | + |
| 9 | +- **Whole image at 640 px**, the default setting. |
| 10 | +- **Whole image at 1280 px**, four times the pixels, four times the compute. |
| 11 | +- **640 px tiles** with 20 % overlap (slicing-aided inference, Akyon et al., ICIP 2022), trained on |
| 12 | + tiles cut from the training images, predicted tile by tile and merged with class-wise NMS. |
| 13 | + |
| 14 | + |
| 15 | +<sub>Tile-trained YOLO26s on unseen VisDrone test-dev photos. Images: VisDrone (AISKYEYE, |
| 16 | +Tianjin University), for academic use.</sub> |
| 17 | + |
| 18 | +Scores follow the VisDrone toolkit, not plain COCO: ignored regions (crowds, far clutter) and the |
| 19 | +"others" class are crowd boxes that neither reward nor punish a detection, and AP counts up to |
| 20 | +500 detections per image. |
| 21 | + |
| 22 | +## Results |
| 23 | + |
| 24 | +VisDrone2019-DET test-dev (1610 images), YOLO26s from COCO weights, AP in % over IoU 0.50:0.95; |
| 25 | +small objects are under 32 x 32 px in the original image. Time per image on one H100 GPU: |
| 26 | + |
| 27 | +| Training | Inference | AP | AP50 | AP small | AP medium | AP large | ms / image | |
| 28 | +|---|---|---|---|---|---|---|---| |
| 29 | +| whole image, 640 | whole image, 640 | 17.4 | 30.4 | 8.8 | 26.2 | 38.3 | 7 | |
| 30 | +| whole image, 1280 | whole image, 1280 | 25.6 | 43.3 | 15.7 | 36.4 | 47.2 | 8 | |
| 31 | +| whole image, 640 | tiles | 18.5 | 33.7 | 12.4 | 25.8 | 22.6 | 13 | |
| 32 | +| tiles | tiles | 26.2 | **45.3** | **16.3** | 37.5 | 46.5 | 15 (A100) | |
| 33 | +| **tiles** | **tiles + whole image** | **26.5** | **45.3** | 16.2 | **37.7** | **49.6** | 14 | |
| 34 | + |
| 35 | +- **More pixels are what small objects need.** At 1280 px the same network reaches 25.6 AP |
| 36 | + instead of 17.4, and nearly doubles the AP on small objects (15.7 against 8.8), for one |
| 37 | + millisecond more per image on an H100. |
| 38 | +- **Tiles need to be trained on.** The 640 model predicted on tiles finds more small objects |
| 39 | + (12.4) but loses large ones that the tile borders cut. Trained on tiles, the same network |
| 40 | + reaches 26.2 AP, and one extra pass over the whole image recovers the large objects: **26.5 AP, |
| 41 | + 45.3 AP50 and 49.6 AP on large objects**, the best of all five, at 14 ms per image. |
| 42 | +- **Which one to deploy.** Tiles keep a 640 px input, so one model works on any camera |
| 43 | + resolution, from a 2.7K drone camera to a 4K one, by adding tiles. The 1280 model is the |
| 44 | + simpler choice when the camera resolution is fixed and the onboard computer is tight. |
| 45 | + |
| 46 | +The third row uses the same weights as the first row, only predicted on tiles, which separates |
| 47 | +the effect of training from the effect of inference. |
| 48 | + |
| 49 | +## Quickstart |
| 50 | + |
| 51 | +```bash |
| 52 | +pip install -e ".[train]" |
| 53 | +bash scripts/download_models.sh # COCO-pretrained YOLO26 weights |
| 54 | +bash scripts/download_data.sh # VisDrone train / val / test-dev, 1.8 GB |
| 55 | +aerial-slice --data data/visdrone # 640 px tiles of train and val + tiles640.yaml |
| 56 | +aerial-train --data data/visdrone/visdrone.yaml --imgsz 640 --batch 32 --name visdrone_640 |
| 57 | +aerial-train --data data/visdrone/tiles640.yaml --imgsz 640 --batch 32 --epochs 40 --name visdrone_tiles640 |
| 58 | +aerial-eval --model runs/visdrone_640/weights/best.pt --data data/visdrone --split test |
| 59 | +aerial-eval --model runs/visdrone_tiles640/weights/best.pt --data data/visdrone --split test --tiled |
| 60 | +``` |
| 61 | + |
| 62 | +## Training on a GPU cluster (Slurm) |
| 63 | + |
| 64 | +```bash |
| 65 | +bash scripts/setup_cluster.sh && bash scripts/download_models.sh && bash scripts/download_data.sh |
| 66 | +python3 slurm/generate.py slice --submit # CPU |
| 67 | +python3 slurm/generate.py train --submit # array: 640, 1280, tiles |
| 68 | +python3 slurm/generate.py evaluate --submit # array: the five rows of the table |
| 69 | +``` |
| 70 | + |
| 71 | +Account and paths come from `slurm/cluster.toml`; put your account in the git-ignored |
| 72 | +`slurm/cluster.local.toml`. Downloads run on a login node, jobs run offline. |
| 73 | + |
| 74 | +## Project layout |
| 75 | + |
| 76 | +``` |
| 77 | +src/aerial/ |
| 78 | + visdrone.py download, YOLO labels for training, COCO JSON with ignore regions for scoring |
| 79 | + tiling.py tile grid, training tiles, tiled prediction + merging |
| 80 | + train.py Ultralytics training with resume |
| 81 | + evaluate.py COCO AP by object size with 500 detections per image, time per image |
| 82 | +``` |
| 83 | + |
| 84 | +## Data and licence |
| 85 | + |
| 86 | +The code is MIT-licensed. VisDrone (Zhu et al., TPAMI 2021, AISKYEYE team, Tianjin University) is |
| 87 | +for academic use; it is downloaded by the script and never committed. |
| 88 | + |
| 89 | +## References |
| 90 | + |
| 91 | +- P. Zhu et al., *Detection and Tracking Meet Drones Challenge*, TPAMI 2021 (VisDrone). |
| 92 | +- F. C. Akyon, S. O. Altinuc, A. Temizel, *Slicing Aided Hyper Inference and Fine-tuning for |
| 93 | + Small Object Detection*, ICIP 2022. |
| 94 | +- Ultralytics YOLO26 (2026). |
0 commit comments