Xuban commited on
Commit
48e3e9e
·
verified ·
1 Parent(s): 9df7922

Add LibreYOLO9P2s VisDrone research preview (weights + model card + reproduction scripts)

Browse files
Files changed (5) hide show
  1. LibreYOLO9P2s-visdrone.pt +3 -0
  2. README.md +94 -0
  3. build_visdrone.py +99 -0
  4. results.csv +60 -0
  5. train_visdrone.py +58 -0
LibreYOLO9P2s-visdrone.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:89f05165ecb7f0749d87e6bdfddeb2418f9abecf506ff22e23b205314904b9e0
3
+ size 32163545
README.md ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-sa-3.0
3
+ pipeline_tag: object-detection
4
+ library_name: libreyolo
5
+ tags:
6
+ - object-detection
7
+ - small-object-detection
8
+ - tiny-object-detection
9
+ - aerial
10
+ - drone
11
+ - visdrone
12
+ - yolov9
13
+ - libreyolo
14
+ ---
15
+
16
+ # LibreYOLO9P2s-visdrone — small-object aerial detector (research preview)
17
+
18
+ **yolo9_p2** is a LibreYOLO model family: YOLOv9 with an added **stride-4 (P2)
19
+ detection scale**. Stock YOLOv9 detects at strides 8/16/32; the P2 head adds a
20
+ fourth scale at stride 4, so objects in the 4–16 px range land on a grid fine
21
+ enough to be found. This checkpoint is the **s** size (7.2M params) trained on
22
+ **VisDrone2019-DET** at **768 px**.
23
+
24
+ > **Research preview.** These weights are trained on VisDrone2019-DET, which is
25
+ > licensed **CC BY-NC-SA 3.0** — they are for **non-commercial use only** and
26
+ > are **not** covered by LibreYOLO's permissive license. The checkpoint detects
27
+ > the 10 VisDrone aerial classes, not COCO.
28
+
29
+ ## Results (VisDrone2019-DET val, 548 images, pycocotools)
30
+
31
+ | model | AP | AP50 | AP_small | AP_med | AP_large |
32
+ |---|---|---|---|---|---|
33
+ | stock yolo9-t (control, 640) | 0.123 | 0.220 | 0.047 | 0.199 | 0.375 |
34
+ | yolo9_p2-t 640 (same-recipe A/B) | 0.138 | 0.254 | 0.070 | 0.213 | 0.352 |
35
+ | yolo9_p2-t 960 | 0.209 | 0.358 | 0.129 | 0.300 | 0.397 |
36
+ | **yolo9_p2-s 768 (this model)** | **0.226** | **0.385** | **0.141** | 0.324 | 0.484 |
37
+
38
+ In a controlled A/B (same recipe, resolution, and transfer init — the only
39
+ difference being the P2 head), yolo9_p2-t beat stock yolo9-t by **+49%
40
+ AP_small**, with the textbook size signature: large wins on small objects,
41
+ slight loss on large ones. Across the project (P2 head + higher resolution +
42
+ bigger size), small-object AP roughly **doubled** (0.070 → 0.141).
43
+
44
+ The full per-epoch metric history is in [`results.csv`](results.csv).
45
+
46
+ ## Honest scope notes
47
+
48
+ - **Match the architecture to the arena.** On COCO, the same architecture is
49
+ *worse* than stock YOLOv9 (COCO "small" is 16–32 px, already covered by the
50
+ stride-8 level). Use this for aerial/tiny-object imagery where objects fall
51
+ below ~16 px; it is not a general-purpose detector.
52
+ - **Not SOTA.** Transformer-based small-object detectors (e.g. TinyFormer)
53
+ reach higher AP on VisDrone at lower resolution. The value here is a simple,
54
+ fast CNN that substantially improves its own small-object AP.
55
+ - **Single seed.** Every number is one training run; treat ±1 point as noise.
56
+ - **Evaluate at 768.** Train/test resolution mismatch tanks the numbers.
57
+
58
+ ## Usage
59
+
60
+ ```python
61
+ from libreyolo import LibreYOLO
62
+
63
+ model = LibreYOLO("LibreYOLO9P2s-visdrone.pt") # auto-downloads from this repo
64
+ results = model.predict("aerial.jpg", imgsz=768, conf=0.25)
65
+ results[0].show()
66
+ ```
67
+
68
+ Classes: `pedestrian, people, bicycle, car, van, truck, tricycle,
69
+ awning-tricycle, bus, motor`.
70
+
71
+ ## Reproduce
72
+
73
+ 1. Download VisDrone2019-DET (train + val) from the official source
74
+ (https://github.com/VisDrone/VisDrone-Dataset). The images are **not**
75
+ redistributed here.
76
+ 2. Convert to YOLO layout with [`build_visdrone.py`](build_visdrone.py)
77
+ (clean-room converter written from the public annotation spec).
78
+ 3. Train with [`train_visdrone.py`](train_visdrone.py) — the exact recipe that
79
+ produced this checkpoint (60 epochs, transfer init from stock
80
+ `LibreYOLO9s.pt`, lr0=0.005, mosaic/mixup off, hsv+flip on, max_labels=600,
81
+ imgsz=768, effective batch 16). Roughly 10 min/epoch on an RTX 5070 Ti.
82
+
83
+ Training notes that matter: the family default `lr0=0.01` **diverges** on
84
+ transfer init — use 0.005. Mosaic **hurts** on VisDrone (tiling shrinks tiny
85
+ objects below detectability); keep it off.
86
+
87
+ ## Attribution
88
+
89
+ - **Dataset:** VisDrone2019-DET, AISKYEYE team, Lab of Machine Learning and
90
+ Data Mining, Tianjin University, China (CC BY-NC-SA 3.0).
91
+ - **Base architecture:** YOLOv9 (MIT, MultimediaTechLab/YOLO); P2 extension by
92
+ LibreYOLO.
93
+ - **Transfer init:** stock `LibreYOLO9s.pt` (converted upstream YOLOv9-s
94
+ weights).
build_visdrone.py ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Clean-room VisDrone2019-DET -> YOLO builder.
2
+
3
+ Written from the public VisDrone annotation spec (no third-party converter
4
+ code copied). Each annotation line is:
5
+ bbox_left,bbox_top,bbox_width,bbox_height,score,category,truncation,occlusion
6
+ Categories: 0=ignored-regions 1=pedestrian 2=people 3=bicycle 4=car 5=van
7
+ 6=truck 7=tricycle 8=awning-tricycle 9=bus 10=motor 11=others. We keep 1..10
8
+ (remapped to 0..9) and drop 0/11 and score==0 (ignored) boxes.
9
+
10
+ Builds: <datasets>/visdrone/{images,labels}/{train,val}/ + train.txt/val.txt
11
+ + visdrone.yaml
12
+ from the extracted <datasets>/visdrone_raw/VisDrone2019-DET-{train,val}/.
13
+
14
+ Usage:
15
+ python build_visdrone.py --datasets /path/to/datasets
16
+ """
17
+
18
+ import argparse
19
+ import shutil
20
+ from pathlib import Path
21
+
22
+ from PIL import Image
23
+
24
+ SPLITS = {"train": "VisDrone2019-DET-train", "val": "VisDrone2019-DET-val"}
25
+ NAMES = ["pedestrian", "people", "bicycle", "car", "van", "truck",
26
+ "tricycle", "awning-tricycle", "bus", "motor"] # VisDrone 1..10 -> 0..9
27
+
28
+
29
+ def convert_split(raw: Path, out: Path, split: str, raw_name: str) -> int:
30
+ src = raw / raw_name
31
+ img_src, ann_src = src / "images", src / "annotations"
32
+ img_dst = out / "images" / split
33
+ lbl_dst = out / "labels" / split
34
+ img_dst.mkdir(parents=True, exist_ok=True)
35
+ lbl_dst.mkdir(parents=True, exist_ok=True)
36
+
37
+ listing = []
38
+ n_imgs = n_boxes = n_dropped = 0
39
+ for img_path in sorted(img_src.glob("*.jpg")):
40
+ with Image.open(img_path) as im:
41
+ W, H = im.size
42
+ ann = ann_src / (img_path.stem + ".txt")
43
+ lines = []
44
+ if ann.exists():
45
+ for raw in ann.read_text().splitlines():
46
+ raw = raw.strip().rstrip(",")
47
+ if not raw:
48
+ continue
49
+ p = raw.split(",")
50
+ if len(p) < 6:
51
+ continue
52
+ left, top, w, h, score, cat = (int(float(x)) for x in p[:6])
53
+ if score == 0 or cat < 1 or cat > 10 or w <= 0 or h <= 0:
54
+ n_dropped += 1
55
+ continue
56
+ cx = (left + w / 2) / W
57
+ cy = (top + h / 2) / H
58
+ nw, nh = w / W, h / H
59
+ # clip to [0,1] (a few VisDrone boxes bleed past the edge)
60
+ cx, cy = min(max(cx, 0), 1), min(max(cy, 0), 1)
61
+ nw, nh = min(nw, 1), min(nh, 1)
62
+ lines.append(f"{cat - 1} {cx:.6f} {cy:.6f} {nw:.6f} {nh:.6f}")
63
+ n_boxes += 1
64
+ # copy image into the YOLO tree (move would empty the raw dir; copy is safe)
65
+ shutil.copy2(img_path, img_dst / img_path.name)
66
+ (lbl_dst / (img_path.stem + ".txt")).write_text("\n".join(lines))
67
+ listing.append(f"images/{split}/{img_path.name}")
68
+ n_imgs += 1
69
+
70
+ (out / f"{split}.txt").write_text("\n".join(listing))
71
+ print(f"{split}: {n_imgs} imgs, {n_boxes} boxes kept, {n_dropped} dropped")
72
+ return n_imgs
73
+
74
+
75
+ def main():
76
+ parser = argparse.ArgumentParser(description=__doc__)
77
+ parser.add_argument(
78
+ "--datasets",
79
+ required=True,
80
+ help="Directory containing visdrone_raw/ with the extracted official zips",
81
+ )
82
+ args = parser.parse_args()
83
+ datasets = Path(args.datasets)
84
+ raw = datasets / "visdrone_raw"
85
+ out = datasets / "visdrone"
86
+
87
+ for split, raw_name in SPLITS.items():
88
+ convert_split(raw, out, split, raw_name)
89
+ names_block = "\n".join(f" {i}: {n}" for i, n in enumerate(NAMES))
90
+ (out / "visdrone.yaml").write_text(
91
+ f"# VisDrone2019-DET (research/non-commercial license)\n"
92
+ f"path: visdrone\ntrain: train.txt\nval: val.txt\n"
93
+ f"nc: {len(NAMES)}\nnames:\n{names_block}\n"
94
+ )
95
+ print("WROTE", out / "visdrone.yaml")
96
+
97
+
98
+ if __name__ == "__main__":
99
+ main()
results.csv ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ epoch,time,train/loss,validated,is_best,current_metric,current_metric_name,best_metric,best_metric_name,best_epoch,train/box_loss,train/cls_loss,train/dfl_loss,lr/group0,lr/group1,lr/group2,metrics/precision,metrics/recall,metrics/mAP50-95,metrics/mAP50,metrics/mAP75,metrics/precision(B),metrics/recall(B),metrics/mAP50(B),metrics/mAP50-95(B),metrics/mAP_small,metrics/mAP_medium,metrics/mAP_large,metrics/AR1,metrics/AR10,metrics/AR100,metrics/AR_small,metrics/AR_medium,metrics/AR_large,speed/preprocess_ms,speed/inference_ms,speed/postprocess_ms,speed/total_ms,speed/total_s,speed/images_seen
2
+ 1,581.0468983650208,6.467273455019896,0,0,,,,,,2.139360265624947,2.9322218135114433,1.395691378278747,0.00108,0.00108,0.00108,,,,,,,,,,,,,,,,,,,,,,,,
3
+ 2,579.6109590530396,4.548500323848341,0,0,,,,,,1.6193091755303939,1.8227112817064135,1.1064798648795904,0.0020599999999999998,0.0020599999999999998,0.0020599999999999998,,,,,,,,,,,,,,,,,,,,,,,,
4
+ 3,578.7212500572205,4.131825894218692,0,0,,,,,,1.5175411366605684,1.5536792108964699,1.0606055432346173,0.0030399999999999997,0.0030399999999999997,0.0030399999999999997,,,,,,,,,,,,,,,,,,,,,,,,
5
+ 4,578.2872953414917,3.957550748385823,0,0,,,,,,1.4834279984005452,1.4323826781933238,1.0417400706680333,0.00402,0.00402,0.00402,,,,,,,,,,,,,,,,,,,,,,,,
6
+ 5,616.7266795635223,3.956325003168498,1,1,0.13021400903362507,metrics/mAP50-95,0.13021400903362507,metrics/mAP50-95,5,1.494923888181424,1.39952072316012,1.061880387939294,0.005,0.005,0.005,0.13021400903362507,0.27342355130711316,0.13021400903362507,0.22124158582330855,0.1305055609310616,0.13021400903362507,0.27342355130711316,0.22124158582330855,0.13021400903362507,0.058063869225183536,0.21730069410003972,0.3562609554224732,0.07142794010699982,0.20198906612541567,0.27342355130711316,0.16242644823336455,0.4282709899595469,0.6301873407636454,0.23252685574719503,20.565163915174722,3.4389613318617323,36.66115894804906,20.090315103530884,548.0
7
+ 6,579.3072962760925,4.229265687122964,0,0,,,0.13021400903362507,metrics/mAP50-95,5,1.5923558735958023,1.5173034289152214,1.1196063846672153,0.00491,0.00491,0.00491,,,,,,,,,,,,,,,,,,,,,,,,
8
+ 7,578.4099447727203,4.1447938641219455,0,0,,,0.13021400903362507,metrics/mAP50-95,5,1.5611453652013398,1.4745143370982114,1.1091341623567172,0.0048200000000000005,0.0048200000000000005,0.0048200000000000005,,,,,,,,,,,,,,,,,,,,,,,,
9
+ 8,580.2210857868195,4.077907898989859,0,0,,,0.13021400903362507,metrics/mAP50-95,5,1.5407429284806229,1.4350232952344915,1.1021416746482966,0.00473,0.00473,0.00473,,,,,,,,,,,,,,,,,,,,,,,,
10
+ 9,580.1384325027466,4.019386766351172,0,0,,,0.13021400903362507,metrics/mAP50-95,5,1.523123163123035,1.3998572416062334,1.0964063593740625,0.00464,0.00464,0.00464,,,,,,,,,,,,,,,,,,,,,,,,
11
+ 10,621.1280484199524,3.9807340506976687,1,1,0.16727309520654726,metrics/mAP50-95,0.16727309520654726,metrics/mAP50-95,10,1.5104275464643098,1.3767111279864952,1.0935953770207105,0.00455,0.00455,0.00455,0.16727309520654726,0.3224257755187977,0.16727309520654726,0.28830071267497936,0.1648917703727233,0.16727309520654726,0.3224257755187977,0.28830071267497936,0.16727309520654726,0.09022132427382983,0.2544517345236705,0.4318555738733,0.08005532564890054,0.2359470467917462,0.3224257755187977,0.21861929731322596,0.4651299285550807,0.7118284416039734,0.21851106281698185,20.38664408843883,4.445758179156449,37.09809101411026,20.329753875732422,548.0
12
+ 11,581.2895812988281,3.934742018428431,0,0,,,0.16727309520654726,metrics/mAP50-95,10,1.4973996080976366,1.3487480604206392,1.0885943495508692,0.00446,0.00446,0.00446,,,,,,,,,,,,,,,,,,,,,,,,
13
+ 12,580.9261772632599,3.8867370814038944,0,0,,,0.16727309520654726,metrics/mAP50-95,10,1.4842701118364585,1.317586470055617,1.0848805003593658,0.00437,0.00437,0.00437,,,,,,,,,,,,,,,,,,,,,,,,
14
+ 13,578.9717311859131,3.864124383071475,0,0,,,0.16727309520654726,metrics/mAP50-95,10,1.477139098548447,1.3056940145802092,1.08129126699483,0.00428,0.00428,0.00428,,,,,,,,,,,,,,,,,,,,,,,,
15
+ 14,578.7674126625061,3.82418705315273,0,0,,,0.16727309520654726,metrics/mAP50-95,10,1.4632700875516653,1.2835168157607733,1.0774001513419231,0.00419,0.00419,0.00419,,,,,,,,,,,,,,,,,,,,,,,,
16
+ 15,616.9372866153717,3.805740963915216,1,1,0.18974587570125367,metrics/mAP50-95,0.18974587570125367,metrics/mAP50-95,15,1.4597400622997991,1.2699773888775885,1.0760235126272788,0.0041,0.0041,0.0041,0.18974587570125367,0.34581093027459525,0.18974587570125367,0.3259393830839885,0.18568455863779706,0.18974587570125367,0.34581093027459525,0.3259393830839885,0.18974587570125367,0.10878875511970168,0.2830667511643713,0.46683692685864947,0.08743731676789775,0.2561448448165256,0.34581093027459525,0.24882992159772152,0.48312308094569667,0.664729518149416,0.2113498040359386,20.424509135475997,3.8977191396003223,37.068566266637646,20.31357431411743,548.0
17
+ 16,582.0479474067688,3.7796334617473244,0,0,,,0.18974587570125367,metrics/mAP50-95,15,1.4530508377636786,1.2536310546917746,1.0729515696050949,0.00401,0.00401,0.00401,,,,,,,,,,,,,,,,,,,,,,,,
18
+ 17,579.483433008194,3.7586819858786864,0,0,,,0.18974587570125367,metrics/mAP50-95,15,1.445085538004797,1.243441529454551,1.0701549176454912,0.00392,0.00392,0.00392,,,,,,,,,,,,,,,,,,,,,,,,
19
+ 18,580.1625220775604,3.7359531645059953,0,0,,,0.18974587570125367,metrics/mAP50-95,15,1.4392189453337254,1.2298778795569536,1.0668563430239282,0.00383,0.00383,0.00383,,,,,,,,,,,,,,,,,,,,,,,,
20
+ 19,578.984676361084,3.7085227326963563,0,0,,,0.18974587570125367,metrics/mAP50-95,15,1.4291476099623779,1.2152329060449114,1.0641422166337922,0.0037400000000000003,0.0037400000000000003,0.0037400000000000003,,,,,,,,,,,,,,,,,,,,,,,,
21
+ 20,617.6775407791138,3.701960176588763,1,1,0.2019359835556651,metrics/mAP50-95,0.2019359835556651,metrics/mAP50-95,20,1.428612118268492,1.208201593077717,1.0651464636948598,0.00365,0.00365,0.00365,0.2019359835556651,0.35820063184905393,0.2019359835556651,0.34422762602465423,0.1979514768411169,0.2019359835556651,0.35820063184905393,0.34422762602465423,0.2019359835556651,0.1197168232161776,0.29752428154574295,0.4626963077505484,0.09038988056293824,0.26359804696658073,0.35820063184905393,0.26396343900979025,0.49133473947932615,0.6714304082199227,0.24443212216787966,20.298029819544215,4.216688392806227,36.733249678228894,20.129820823669434,548.0
22
+ 21,579.8468177318573,3.6807533709674933,0,0,,,0.2019359835556651,metrics/mAP50-95,20,1.4208268095573648,1.197845102259328,1.0620814631858602,0.00356,0.00356,0.00356,,,,,,,,,,,,,,,,,,,,,,,,
23
+ 22,579.097039937973,3.667654684632786,0,0,,,0.2019359835556651,metrics/mAP50-95,20,1.4185131653014806,1.1889626682081031,1.06017885436599,0.00347,0.00347,0.00347,,,,,,,,,,,,,,,,,,,,,,,,
24
+ 23,614.402740240097,3.654226279848326,0,0,,,0.2019359835556651,metrics/mAP50-95,20,1.413752213327741,1.181483954292545,1.0589901146969802,0.00338,0.00338,0.00338,,,,,,,,,,,,,,,,,,,,,,,,
25
+ 24,618.9838998317719,3.6288079549577175,0,0,,,0.2019359835556651,metrics/mAP50-95,20,1.4052986790444788,1.167667439206859,1.0558418340992521,0.00329,0.00329,0.00329,,,,,,,,,,,,,,,,,,,,,,,,
26
+ 25,658.140353679657,3.6177940090804417,1,1,0.21049783334046077,metrics/mAP50-95,0.21049783334046077,metrics/mAP50-95,25,1.4021077674175892,1.1611628510391878,1.0545233873716646,0.0031999999999999997,0.0031999999999999997,0.0031999999999999997,0.21049783334046077,0.36885289325823956,0.21049783334046077,0.3599223981943343,0.20643886990553215,0.21049783334046077,0.36885289325823956,0.3599223981943343,0.21049783334046077,0.12836296340009207,0.3059276604766988,0.4651168083930025,0.09269468825991947,0.27363861591620303,0.36885289325823956,0.2765640696874458,0.49727581827191275,0.6818581944586114,0.2221621736122744,22.37705114114023,4.099567441174584,38.95898195948914,21.34952211380005,548.0
27
+ 26,608.474527835846,3.6090784274813195,0,0,,,0.21049783334046077,metrics/mAP50-95,25,1.4004411490844244,1.1542885566605299,1.0543487172591077,0.00311,0.00311,0.00311,,,,,,,,,,,,,,,,,,,,,,,,
28
+ 27,605.9508357048035,3.594602405748559,0,0,,,0.21049783334046077,metrics/mAP50-95,25,1.3963410996672174,1.1463025199574701,1.0519587838115427,0.0030199999999999997,0.0030199999999999997,0.0030199999999999997,,,,,,,,,,,,,,,,,,,,,,,,
29
+ 28,617.3790922164917,3.580884557676831,0,0,,,0.21049783334046077,metrics/mAP50-95,25,1.3891365668688898,1.1412508946390019,1.050497097209948,0.00293,0.00293,0.00293,,,,,,,,,,,,,,,,,,,,,,,,
30
+ 29,615.8551180362701,3.564543497838782,0,0,,,0.21049783334046077,metrics/mAP50-95,25,1.3849095935799423,1.1296132693887677,1.0500206374495622,0.00284,0.00284,0.00284,,,,,,,,,,,,,,,,,,,,,,,,
31
+ 30,649.5258402824402,3.5540071917464595,1,1,0.21607618024470363,metrics/mAP50-95,0.21607618024470363,metrics/mAP50-95,30,1.3807312746228537,1.125965913775531,1.0473100015700691,0.00275,0.00275,0.00275,0.21607618024470363,0.3753805633168343,0.21607618024470363,0.3692473616197735,0.21192081653826236,0.21607618024470363,0.3753805633168343,0.3692473616197735,0.21607618024470363,0.1324071232588683,0.31363602715209665,0.47729086190868586,0.09343451637800147,0.278781941828218,0.3753805633168343,0.28316374040556747,0.5040060189536555,0.7015212794070598,0.21980800767884637,21.935707896295256,4.031368850791541,38.42663416897293,21.057795524597168,548.0
32
+ 31,603.5046191215515,3.5522417140707168,0,0,,,0.21607618024470363,metrics/mAP50-95,30,1.3821487863612876,1.1232194446246075,1.0468734813620908,0.00266,0.00266,0.00266,,,,,,,,,,,,,,,,,,,,,,,,
33
+ 32,604.2157664299011,3.5344597889430003,0,0,,,0.21607618024470363,metrics/mAP50-95,30,1.3744726496649304,1.1139418130772192,1.0460453257862898,0.00257,0.00257,0.00257,,,,,,,,,,,,,,,,,,,,,,,,
34
+ 33,621.6799237728119,3.525513040669366,0,0,,,0.21607618024470363,metrics/mAP50-95,30,1.3721337177653954,1.1087602964877346,1.0446190274480323,0.00248,0.00248,0.00248,,,,,,,,,,,,,,,,,,,,,,,,
35
+ 34,601.1847171783447,3.523610618272926,0,0,,,0.21607618024470363,metrics/mAP50-95,30,1.3722053498167897,1.1069109549017557,1.0444943138215421,0.00239,0.00239,0.00239,,,,,,,,,,,,,,,,,,,,,,,,
36
+ 35,680.7806603908539,3.5124916338662646,1,1,0.21978544026908808,metrics/mAP50-95,0.21978544026908808,metrics/mAP50-95,35,1.369846706117692,1.0989021421031568,1.0437427834159994,0.0023,0.0023,0.0023,0.21978544026908808,0.37979382633123004,0.21978544026908808,0.3752500256379589,0.2152006037203521,0.21978544026908808,0.37979382633123004,0.3752500256379589,0.21978544026908808,0.13569458736520343,0.3168812138505226,0.476888076061031,0.09480316640508267,0.2825806310221773,0.37979382633123004,0.28889031164072004,0.5083958799542581,0.6945222762839194,0.25882251071233814,22.70544401920625,4.388988888176688,41.093255916651145,22.51910424232483,548.0
37
+ 36,605.080137014389,3.4998274471144404,0,0,,,0.21978544026908808,metrics/mAP50-95,35,1.3629666483015328,1.095238922414308,1.0416218785082538,0.00221,0.00221,0.00221,,,,,,,,,,,,,,,,,,,,,,,,
38
+ 37,727.1930735111237,3.4897887348575973,0,0,,,0.21978544026908808,metrics/mAP50-95,35,1.3609115978020605,1.0893304621970634,1.0395466745544621,0.00212,0.00212,0.00212,,,,,,,,,,,,,,,,,,,,,,,,
39
+ 38,810.1135499477386,3.4866030034178745,0,0,,,0.21978544026908808,metrics/mAP50-95,35,1.359620175479553,1.0870646542614726,1.0399181747547073,0.00203,0.00203,0.00203,,,,,,,,,,,,,,,,,,,,,,,,
40
+ 39,596.2787673473358,3.4706448150381237,0,0,,,0.21978544026908808,metrics/mAP50-95,35,1.353734966849986,1.0773967080359481,1.039513139359918,0.0019399999999999999,0.0019399999999999999,0.0019399999999999999,,,,,,,,,,,,,,,,,,,,,,,,
41
+ 40,649.5351369380951,3.463658558272136,1,1,0.22182683019684515,metrics/mAP50-95,0.22182683019684515,metrics/mAP50-95,40,1.3513404482114812,1.0746703901467773,1.037647722456518,0.00185,0.00185,0.00185,0.22182683019684515,0.3822029729891822,0.22182683019684515,0.37856771039942744,0.21858697698500348,0.22182683019684515,0.3822029729891822,0.37856771039942744,0.22182683019684515,0.13778366758668822,0.3208113913243718,0.47747501209696186,0.09564770956874784,0.2857005206521395,0.3822029729891822,0.2898547622224493,0.5123974685676889,0.6882778328536997,0.2245524503888875,21.955108555564042,3.709227934370946,47.63696881106301,26.105058908462524,548.0
42
+ 41,618.3365159034729,3.45463020075602,0,0,,,0.22182683019684515,metrics/mAP50-95,40,1.349416707103735,1.0689078637308094,1.0363056292858153,0.0017599999999999998,0.0017599999999999998,0.0017599999999999998,,,,,,,,,,,,,,,,,,,,,,,,
43
+ 42,627.8866767883301,3.4481143822441513,0,0,,,0.22182683019684515,metrics/mAP50-95,40,1.3454724209386009,1.0667533001262217,1.0358886614833402,0.0016699999999999996,0.0016699999999999996,0.0016699999999999996,,,,,,,,,,,,,,,,,,,,,,,,
44
+ 43,624.6375756263733,3.4499195400677287,0,0,,,0.22182683019684515,metrics/mAP50-95,40,1.3486336990891505,1.0651094237564152,1.0361764158310809,0.0015799999999999998,0.0015799999999999998,0.0015799999999999998,,,,,,,,,,,,,,,,,,,,,,,,
45
+ 44,627.1083295345306,3.4390305373915564,0,0,,,0.22182683019684515,metrics/mAP50-95,40,1.3449436290002497,1.0587702495605904,1.0353166588859912,0.0014899999999999996,0.0014899999999999996,0.0014899999999999996,,,,,,,,,,,,,,,,,,,,,,,,
46
+ 45,670.9660575389862,3.4367117984954505,1,1,0.22297042031524134,metrics/mAP50-95,0.22297042031524134,metrics/mAP50-95,45,1.3443166136741638,1.0578412287662717,1.0345539588832413,0.0013999999999999998,0.0013999999999999998,0.0013999999999999998,0.22297042031524134,0.3830063039653438,0.22297042031524134,0.3808311871321708,0.2181395031731674,0.22297042031524134,0.3830063039653438,0.3808311871321708,0.22297042031524134,0.13831358611942457,0.32215726216102214,0.48172540358601634,0.0961111087154722,0.28717925282377,0.3830063039653438,0.29018891313079437,0.5136604608722445,0.6860507838587125,0.24219194467920457,22.985364833887477,4.1706509833788346,40.44421919941032,22.163432121276855,548.0
47
+ 46,662.9278614521027,3.411917964899927,0,0,,,0.22297042031524134,metrics/mAP50-95,45,1.3340403203065097,1.04677961619781,1.0310980313528082,0.0013099999999999995,0.0013099999999999995,0.0013099999999999995,,,,,,,,,,,,,,,,,,,,,,,,
48
+ 47,643.6962695121765,3.4137106515156246,0,0,,,0.22297042031524134,metrics/mAP50-95,45,1.3355226942892238,1.0455991035266858,1.032588852723194,0.0012199999999999997,0.0012199999999999997,0.0012199999999999997,,,,,,,,,,,,,,,,,,,,,,,,
49
+ 48,623.3924865722656,3.406946384851494,0,0,,,0.22297042031524134,metrics/mAP50-95,45,1.3332576440511936,1.0426149787913888,1.031073762828821,0.0011299999999999995,0.0011299999999999995,0.0011299999999999995,,,,,,,,,,,,,,,,,,,,,,,,
50
+ 49,627.8817176818848,3.3965825804602785,0,0,,,0.22297042031524134,metrics/mAP50-95,45,1.329665762379512,1.0365970778041498,1.0303197394567074,0.0010399999999999993,0.0010399999999999993,0.0010399999999999993,,,,,,,,,,,,,,,,,,,,,,,,
51
+ 50,697.2481467723846,3.3970961452451705,1,1,0.22414914749881612,metrics/mAP50-95,0.22414914749881612,metrics/mAP50-95,50,1.330993222084812,1.0358690376720252,1.0302338900300783,0.0009499999999999995,0.0009499999999999995,0.0009499999999999995,0.22414914749881612,0.3838331814005218,0.22414914749881612,0.3839175521134637,0.21911782257544452,0.22414914749881612,0.3838331814005218,0.3839175521134637,0.22414914749881612,0.13935179904320102,0.32254880212125975,0.47960943811474294,0.09615688210090984,0.28838979952642935,0.3838331814005218,0.2914267336853914,0.5125606755775591,0.6963201793278586,0.22168577152447108,21.27898392016,3.645292598835743,38.009258952454054,20.829073905944824,548.0
52
+ 51,620.2217309474945,3.3877850040954636,0,0,,,0.22414914749881612,metrics/mAP50-95,50,1.3273349702266122,1.031414392438517,1.0290356372570881,0.0008599999999999997,0.0008599999999999997,0.0008599999999999997,,,,,,,,,,,,,,,,,,,,,,,,
53
+ 52,636.6025638580322,3.3814166179211838,0,0,,,0.22414914749881612,metrics/mAP50-95,50,1.326096592712255,1.027136283652307,1.0281837423028313,0.0007699999999999999,0.0007699999999999999,0.0007699999999999999,,,,,,,,,,,,,,,,,,,,,,,,
54
+ 53,614.5205361843109,3.3712698925775944,0,0,,,0.22414914749881612,metrics/mAP50-95,50,1.3213163095795575,1.0228809446787355,1.0270726361820097,0.00068,0.00068,0.00068,,,,,,,,,,,,,,,,,,,,,,,,
55
+ 54,635.7824327945709,3.3786457871358953,0,0,,,0.22414914749881612,metrics/mAP50-95,50,1.3241019157022007,1.0266528323960635,1.0278910404379253,0.0005900000000000002,0.0005900000000000002,0.0005900000000000002,,,,,,,,,,,,,,,,,,,,,,,,
56
+ 55,837.094584941864,3.362147716908403,1,1,0.22573438907373788,metrics/mAP50-95,0.22573438907373788,metrics/mAP50-95,55,1.31857472877414,1.0170835055929064,1.026489478377323,0.0004999999999999996,0.0004999999999999996,0.0004999999999999996,0.22573438907373788,0.38556150847938575,0.22573438907373788,0.3851720790133383,0.22142023538976296,0.22573438907373788,0.38556150847938575,0.3851720790133383,0.22573438907373788,0.14060115518739127,0.3235082840262072,0.4836393816372824,0.09682875423669028,0.2889696366987454,0.38556150847938575,0.29265688025862474,0.5145309169402408,0.6996892444342657,0.2303467179736952,23.01817131738593,4.201147678124644,44.10554457754984,24.169838428497314,548.0
57
+ 56,677.1178669929504,3.361326914187377,0,0,,,0.22573438907373788,metrics/mAP50-95,55,1.3187909752452944,1.0168987101620464,1.0256372284483872,0.0004099999999999998,0.0004099999999999998,0.0004099999999999998,,,,,,,,,,,,,,,,,,,,,,,,
58
+ 57,646.1733732223511,3.3524787689839854,0,0,,,0.22573438907373788,metrics/mAP50-95,55,1.3144553431219075,1.0124133256432446,1.0256100993067994,0.00031999999999999997,0.00031999999999999997,0.00031999999999999997,,,,,,,,,,,,,,,,,,,,,,,,
59
+ 58,627.2003083229065,3.3499912169469748,0,0,,,0.22573438907373788,metrics/mAP50-95,55,1.314030037873311,1.0115149511896662,1.0244462280037598,0.00023000000000000017,0.00023000000000000017,0.00023000000000000017,,,,,,,,,,,,,,,,,,,,,,,,
60
+ 59,695.4417939186096,3.345285373493177,0,0,,,0.22573438907373788,metrics/mAP50-95,55,1.3136947123307903,1.006542188260802,1.025048470607681,0.0001399999999999995,0.0001399999999999995,0.0001399999999999995,,,,,,,,,,,,,,,,,,,,,,,,
train_visdrone.py ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Exact training recipe for LibreYOLO9P2s-visdrone.
2
+
3
+ Reproduces the released checkpoint: yolo9_p2-s, VisDrone2019-DET, 768 px,
4
+ 60 epochs, transfer init from stock LibreYOLO9s.pt.
5
+
6
+ Prepare the dataset first with build_visdrone.py, then:
7
+
8
+ python train_visdrone.py --data /abs/path/to/visdrone/visdrone.yaml
9
+
10
+ Notes discovered the hard way:
11
+ - lr0=0.01 (the family default) DIVERGES on transfer init; 0.005 is stable.
12
+ - Mosaic/mixup HURT on VisDrone (tiling shrinks tiny objects below
13
+ detectability); mild hsv + horizontal flip help.
14
+ - max_labels must be raised: dense aerial frames exceed the default 100-box
15
+ cap, silently dropping ground truth.
16
+ - Pass the dataset yaml by ABSOLUTE path.
17
+ """
18
+
19
+ import argparse
20
+
21
+ from libreyolo import LibreYOLO9P2
22
+
23
+
24
+ def main() -> None:
25
+ parser = argparse.ArgumentParser(description=__doc__)
26
+ parser.add_argument("--data", required=True, help="Absolute path to visdrone.yaml")
27
+ parser.add_argument("--epochs", type=int, default=60)
28
+ parser.add_argument("--batch", type=int, default=2)
29
+ parser.add_argument("--imgsz", type=int, default=768)
30
+ parser.add_argument("--workers", type=int, default=2)
31
+ parser.add_argument("--name", default="visdrone_p2s_768")
32
+ args = parser.parse_args()
33
+
34
+ model = LibreYOLO9P2(None, size="s")
35
+ model.train(
36
+ data=args.data,
37
+ epochs=args.epochs,
38
+ batch=args.batch,
39
+ nbs=16, # effective batch 16 via gradient accumulation
40
+ imgsz=args.imgsz,
41
+ workers=args.workers,
42
+ lr0=0.005,
43
+ warmup_epochs=5,
44
+ mosaic_prob=0.0,
45
+ mixup_prob=0.0,
46
+ hsv_prob=1.0,
47
+ flip_prob=0.5,
48
+ max_labels=600,
49
+ pretrained="LibreYOLO9s.pt",
50
+ name=args.name,
51
+ exist_ok=True,
52
+ eval_interval=5,
53
+ save_period=5,
54
+ )
55
+
56
+
57
+ if __name__ == "__main__":
58
+ main()