soyeollee
commited on
Commit
·
ab39d95
1
Parent(s):
1585b3e
init repo
Browse files- README.md +43 -3
- events.out.tfevents.1733563914.ultralytics-ms.57.0 +3 -0
- model.pt +3 -0
- train.py +51 -0
- yolo11-p2.yaml +56 -0
README.md
CHANGED
|
@@ -1,3 +1,43 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: agpl-3.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: agpl-3.0
|
| 3 |
+
library: ultralytics
|
| 4 |
+
tags:
|
| 5 |
+
- object-detection
|
| 6 |
+
- pytorch
|
| 7 |
+
- coco
|
| 8 |
+
- p2-layer
|
| 9 |
+
- yolo11
|
| 10 |
+
- yolov11
|
| 11 |
+
- yolox11-p2
|
| 12 |
+
- yolovx11-p2
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# YOLO11-p2 COCO Pretrained Model
|
| 16 |
+
|
| 17 |
+
This model is a YOLO11-p2 model trained on the COCO dataset, **with P2-P5 output layers.**
|
| 18 |
+
|
| 19 |
+
## Example Usage
|
| 20 |
+
|
| 21 |
+
```angular2html
|
| 22 |
+
from huggingface_hub import hf_hub_download
|
| 23 |
+
from ultralytics import YOLO
|
| 24 |
+
from PIL import Image
|
| 25 |
+
|
| 26 |
+
model_path = hf_hub_download("soyeollee/yolo11x-p2-coco", "model.pt")
|
| 27 |
+
model = YOLO(model_path)
|
| 28 |
+
|
| 29 |
+
image_path = "/path/to/image"
|
| 30 |
+
output = model(Image.open(image_path))
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
## Performance
|
| 35 |
+
|
| 36 |
+
| metric (maxDets=100) | yolov8x <br/>(official) | [yolov8x-p2](https://huggingface.co/soyeollee/yolov8x-p2-coco) | [yolov8x-p26](https://huggingface.co/soyeollee/yolov8x-p26-coco) | yolov11x <br/>(official) | yolo11x-p2<br/>(this repo) |
|
| 37 |
+
|--------------------------------------------------------|--------------------|----------------------------|------------------------------------------------------------------|---------------------|----------------------------|
|
| 38 |
+
| AP @[ IoU=0.50:0.95 / area= all ] | **0.540** | **0.541** | **0.544** | **0.546** | **0.553** |
|
| 39 |
+
| AP @[ IoU=0.50 / area= all ] | 0.710 | 0.712 | 0.713 | 0.716 | 0.722 |
|
| 40 |
+
| AP @[ IoU=0.75 / area= all ] | 0.588 | 0.590 | 0.593 | 0.595 | 0.606 |
|
| 41 |
+
| AP @[ IoU=0.50:0.95 / area= small ] | 0.360 | 0.386 | 0.381 | 0.377 | 0.386 |
|
| 42 |
+
| AP @[ IoU=0.50:0.95 /area=medium ] | 0.594 | 0.586 | 0.586 | 0.597 | 0.595 |
|
| 43 |
+
| AP @[ IoU=0.50:0.95 / area= large ] | 0.707 | 0.686 | 0.691 | 0.702 | 0.702 |
|
events.out.tfevents.1733563914.ultralytics-ms.57.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:629b4d9b3c646a863db2382c1f2e462738621405c5e919b7b3867b7b86a0f838
|
| 3 |
+
size 1020946
|
model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:093dd42ff8c32843030ecfca8c390f22bf023c503247e6046dbd8da3d801b426
|
| 3 |
+
size 116568922
|
train.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from ultralytics import YOLO
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
config = {
|
| 5 |
+
# project
|
| 6 |
+
'name': 'v11x-p2_coco_pretrained',
|
| 7 |
+
'model': 'yolo11x-p2.yaml',
|
| 8 |
+
'pretrained': None,
|
| 9 |
+
|
| 10 |
+
# hyperparams
|
| 11 |
+
'lr0': 0.01,
|
| 12 |
+
'lrf': 0.01,
|
| 13 |
+
'momentum': 0.937,
|
| 14 |
+
'weight_decay': 0.0005,
|
| 15 |
+
'epochs': 600,
|
| 16 |
+
'imgsz': 640,
|
| 17 |
+
'batch': 48,
|
| 18 |
+
'cos_lr': False,
|
| 19 |
+
'close_mosaic': 10,
|
| 20 |
+
'warmup_epochs': 3.0,
|
| 21 |
+
'warmup_momentum': 0.8,
|
| 22 |
+
'warmup_bias_lr': 0.0,
|
| 23 |
+
'box': 7.5,
|
| 24 |
+
'cls': 0.5,
|
| 25 |
+
'dfl': 1.5,
|
| 26 |
+
'hsv_h': 0.015,
|
| 27 |
+
'hsv_s': 0.7,
|
| 28 |
+
'hsv_v': 0.4,
|
| 29 |
+
'translate': 0.1,
|
| 30 |
+
'scale': 0.9, # coco=0.9
|
| 31 |
+
'fliplr': 0.5,
|
| 32 |
+
'optimizer': 'SGD',
|
| 33 |
+
'patience': 100,
|
| 34 |
+
# augment: https://github.com/ultralytics/ultralytics/issues/16607
|
| 35 |
+
'mixup': 0.15,
|
| 36 |
+
'mosaic': 1.0,
|
| 37 |
+
'copy_paste': 0.3,
|
| 38 |
+
|
| 39 |
+
# system
|
| 40 |
+
'seed': 0,
|
| 41 |
+
'deterministic': True,
|
| 42 |
+
'data': 'ultralytics/cfg/datasets/coco.yaml',
|
| 43 |
+
'cache': 'disk',
|
| 44 |
+
'device': [0, 1, 2, 3],
|
| 45 |
+
'workers': 16,
|
| 46 |
+
'project': 'runs/train',
|
| 47 |
+
'val': True,
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
model = YOLO(config['model'])
|
| 51 |
+
model.train(**config)
|
yolo11-p2.yaml
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
| 2 |
+
# YOLO11 object detection model with P2-P5 outputs. For Usage examples see https://docs.ultralytics.com/tasks/detect
|
| 3 |
+
# from: https://github.com/ultralytics/ultralytics/pull/16558/files
|
| 4 |
+
|
| 5 |
+
# Parameters
|
| 6 |
+
nc: 80 # number of classes
|
| 7 |
+
scales: # model compound scaling constants, i.e. 'model=yolo11n.yaml' will call yolo11.yaml with scale 'n'
|
| 8 |
+
# [depth, width, max_channels]
|
| 9 |
+
n: [0.50, 0.25, 1024]
|
| 10 |
+
s: [0.50, 0.50, 1024]
|
| 11 |
+
m: [0.50, 1.00, 512]
|
| 12 |
+
l: [1.00, 1.00, 512]
|
| 13 |
+
x: [1.00, 1.50, 512]
|
| 14 |
+
|
| 15 |
+
# YOLO11-P2 backbone
|
| 16 |
+
backbone:
|
| 17 |
+
# [from, repeats, module, args]
|
| 18 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
| 19 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
| 20 |
+
- [-1, 2, C3k2, [256, False, 0.25]]
|
| 21 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
| 22 |
+
- [-1, 2, C3k2, [512, False, 0.25]]
|
| 23 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
| 24 |
+
- [-1, 2, C3k2, [512, True]]
|
| 25 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
| 26 |
+
- [-1, 2, C3k2, [1024, True]]
|
| 27 |
+
- [-1, 1, SPPF, [1024, 5]] # 9
|
| 28 |
+
- [-1, 2, C2PSA, [1024]] # 10
|
| 29 |
+
|
| 30 |
+
# YOLO11-P2 head
|
| 31 |
+
head:
|
| 32 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
| 33 |
+
- [[-1, 6], 1, Concat, [1]] # cat backbone P4
|
| 34 |
+
- [-1, 2, C3k2, [512, False]] # 13
|
| 35 |
+
|
| 36 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
| 37 |
+
- [[-1, 4], 1, Concat, [1]] # cat backbone P3
|
| 38 |
+
- [-1, 2, C3k2, [256, False]] # 16 (P3/8-small)
|
| 39 |
+
|
| 40 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
| 41 |
+
- [[-1, 2], 1, Concat, [1]] # cat backbone P2
|
| 42 |
+
- [-1, 2, C3k2, [128, False]] # 19 (P2/4-xsmall)
|
| 43 |
+
|
| 44 |
+
- [-1, 1, Conv, [128, 3, 2]]
|
| 45 |
+
- [[-1, 16], 1, Concat, [1]] # cat head P4
|
| 46 |
+
- [-1, 2, C3k2, [256, False]] # 22 (P3/8-small)
|
| 47 |
+
|
| 48 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 49 |
+
- [[-1, 13], 1, Concat, [1]] # cat head P4
|
| 50 |
+
- [-1, 2, C3k2, [512, False]] # 25 (P4/16-medium)
|
| 51 |
+
|
| 52 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 53 |
+
- [[-1, 10], 1, Concat, [1]] # cat head P5
|
| 54 |
+
- [-1, 2, C3k2, [1024, True]] # 28 (P5/32-large)
|
| 55 |
+
|
| 56 |
+
- [[19, 22, 25, 28], 1, Detect, [nc]] # Detect(P3, P4, P5)
|