Upload custom YOLO code
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- models_related/custom_blocks/custom_blocks.py +54 -0
- models_related/models_config/yolov10_varroa_custom.yaml +42 -0
- models_related/models_config/yolov8_varroa_bra_original.yaml +38 -0
- models_related/models_config/yolov8_varroa_bralite.yaml +38 -0
- models_related/models_config/yolov8_varroa_c2fkv.yaml +36 -0
- models_related/models_config/yolov8_varroa_custom.yaml +43 -0
- models_related/models_config/yolov8_varroa_kvca.yaml +38 -0
- models_related/models_config/yolov8_varroa_p2.yaml +49 -0
- models_related/models_config/yolov8_varroa_p2_c2fkv.yaml +51 -0
- models_related/models_config/yolov8_varroa_p2_dcnhead.yaml +54 -0
- models_related/models_config/yolov8_varroa_p4_dcnhead.yaml +45 -0
- models_related/models_config/yolov8_varroa_p4_regmax24.yaml +42 -0
- models_related/models_config/yolov8_varroa_p4_regmax24_topk15.yaml +43 -0
- models_related/models_config/yolov8_varroa_p4csla.yaml +48 -0
- models_related/models_config/yolov8_varroa_topk_adaptive_kv.yaml +38 -0
- models_related/models_config/yolov8_varroa_topk_global_kv.yaml +38 -0
- models_related/train_eval/eval.py +217 -0
- models_related/train_eval/train.py +81 -0
- models_related/ultralytics/.dockerignore +35 -0
- models_related/ultralytics/.gitignore +208 -0
- models_related/ultralytics/CITATION.cff +53 -0
- models_related/ultralytics/CONTRIBUTING.md +267 -0
- models_related/ultralytics/LICENSE +661 -0
- models_related/ultralytics/README.md +274 -0
- models_related/ultralytics/README.zh-CN.md +274 -0
- models_related/ultralytics/docker/Dockerfile +59 -0
- models_related/ultralytics/docker/Dockerfile-arm64 +56 -0
- models_related/ultralytics/docker/Dockerfile-conda +43 -0
- models_related/ultralytics/docker/Dockerfile-cpu +19 -0
- models_related/ultralytics/docker/Dockerfile-export +23 -0
- models_related/ultralytics/docker/Dockerfile-jetson-jetpack4 +69 -0
- models_related/ultralytics/docker/Dockerfile-jetson-jetpack5 +59 -0
- models_related/ultralytics/docker/Dockerfile-jetson-jetpack6 +66 -0
- models_related/ultralytics/docker/Dockerfile-jupyter +27 -0
- models_related/ultralytics/docker/Dockerfile-nvidia-arm64 +52 -0
- models_related/ultralytics/docker/Dockerfile-python +52 -0
- models_related/ultralytics/docker/Dockerfile-python-export +31 -0
- models_related/ultralytics/docker/Dockerfile-runner +38 -0
- models_related/ultralytics/docker/Dockerfile-runner-cpu +39 -0
- models_related/ultralytics/mkdocs.yml +945 -0
- models_related/ultralytics/pyproject.toml +231 -0
- models_related/ultralytics/ultralytics/__init__.py +48 -0
- models_related/ultralytics/ultralytics/assets/bus.jpg +3 -0
- models_related/ultralytics/ultralytics/assets/zidane.jpg +3 -0
- models_related/ultralytics/ultralytics/cfg/__init__.py +1060 -0
- models_related/ultralytics/ultralytics/cfg/default.yaml +134 -0
- models_related/ultralytics/ultralytics/cfg/models/11/yolo11-cls-resnet18.yaml +17 -0
- models_related/ultralytics/ultralytics/cfg/models/11/yolo11-cls.yaml +33 -0
- models_related/ultralytics/ultralytics/cfg/models/11/yolo11-obb.yaml +50 -0
- models_related/ultralytics/ultralytics/cfg/models/11/yolo11-pose.yaml +51 -0
models_related/custom_blocks/custom_blocks.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Example PyTorch blocks for editable Ultralytics custom models.
|
| 2 |
+
|
| 3 |
+
Copy these classes into an editable Ultralytics checkout, or import/expose them
|
| 4 |
+
there, before referencing them from a model YAML.
|
| 5 |
+
|
| 6 |
+
YAML usage after registration:
|
| 7 |
+
- [-1, 1, VarroaConvBlock, [256, 3, True]]
|
| 8 |
+
- [-1, 1, VarroaSEBlock, [256, 8]]
|
| 9 |
+
|
| 10 |
+
For both blocks, add a parse_model() case in Ultralytics so the YAML's first
|
| 11 |
+
arg is c2 and Ultralytics injects c1 from the previous layer:
|
| 12 |
+
c1, c2 = ch[f], args[0]
|
| 13 |
+
args = [c1, c2, *args[1:]]
|
| 14 |
+
"""
|
| 15 |
+
|
| 16 |
+
from __future__ import annotations
|
| 17 |
+
|
| 18 |
+
from torch import nn
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
class VarroaConvBlock(nn.Module):
|
| 22 |
+
"""Small Conv-BN-SiLU residual-friendly block with c1/c2 constructor."""
|
| 23 |
+
|
| 24 |
+
def __init__(self, c1: int, c2: int, kernel_size: int = 3, shortcut: bool = True):
|
| 25 |
+
super().__init__()
|
| 26 |
+
padding = kernel_size // 2
|
| 27 |
+
self.conv = nn.Conv2d(c1, c2, kernel_size, stride=1, padding=padding, bias=False)
|
| 28 |
+
self.bn = nn.BatchNorm2d(c2)
|
| 29 |
+
self.act = nn.SiLU(inplace=True)
|
| 30 |
+
self.shortcut = shortcut and c1 == c2
|
| 31 |
+
|
| 32 |
+
def forward(self, x):
|
| 33 |
+
y = self.act(self.bn(self.conv(x)))
|
| 34 |
+
return x + y if self.shortcut else y
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
class VarroaSEBlock(nn.Module):
|
| 38 |
+
"""Lightweight squeeze-excitation block useful after C2f/SPPF stages."""
|
| 39 |
+
|
| 40 |
+
def __init__(self, c1: int, c2: int, reduction: int = 8):
|
| 41 |
+
super().__init__()
|
| 42 |
+
hidden = max(c2 // reduction, 8)
|
| 43 |
+
self.proj = nn.Identity() if c1 == c2 else nn.Conv2d(c1, c2, 1, bias=False)
|
| 44 |
+
self.pool = nn.AdaptiveAvgPool2d(1)
|
| 45 |
+
self.fc = nn.Sequential(
|
| 46 |
+
nn.Conv2d(c2, hidden, 1),
|
| 47 |
+
nn.SiLU(inplace=True),
|
| 48 |
+
nn.Conv2d(hidden, c2, 1),
|
| 49 |
+
nn.Sigmoid(),
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
def forward(self, x):
|
| 53 |
+
x = self.proj(x)
|
| 54 |
+
return x * self.fc(self.pool(x))
|
models_related/models_config/yolov10_varroa_custom.yaml
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOLOv10 Varroa custom template for Ultralytics.
|
| 2 |
+
# Keep v10Detect intact first; customize backbone/neck blocks incrementally.
|
| 3 |
+
# Example custom blocks live in yolo_related/custom_blocks.py and must be
|
| 4 |
+
# registered inside editable Ultralytics before YAML can reference them.
|
| 5 |
+
|
| 6 |
+
nc: 1
|
| 7 |
+
scales:
|
| 8 |
+
n: [0.33, 0.25, 1024]
|
| 9 |
+
s: [0.33, 0.50, 1024]
|
| 10 |
+
m: [0.67, 0.75, 768]
|
| 11 |
+
b: [0.67, 1.00, 512]
|
| 12 |
+
l: [1.00, 1.00, 512]
|
| 13 |
+
x: [1.00, 1.25, 512]
|
| 14 |
+
|
| 15 |
+
backbone:
|
| 16 |
+
# [from, repeats, module, args]
|
| 17 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
| 18 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
| 19 |
+
- [-1, 3, C2f, [128, True]]
|
| 20 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
| 21 |
+
- [-1, 6, C2f, [256, True]]
|
| 22 |
+
- [-1, 1, SCDown, [512, 3, 2]] # 5-P4/16; cautious custom point
|
| 23 |
+
- [-1, 6, C2f, [512, True]]
|
| 24 |
+
- [-1, 1, SCDown, [1024, 3, 2]] # 7-P5/32; cautious custom point
|
| 25 |
+
- [-1, 3, C2f, [1024, True]]
|
| 26 |
+
- [-1, 1, SPPF, [1024, 5]]
|
| 27 |
+
- [-1, 1, PSA, [1024]] # attention custom point
|
| 28 |
+
|
| 29 |
+
head:
|
| 30 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 31 |
+
- [[-1, 6], 1, Concat, [1]]
|
| 32 |
+
- [-1, 3, C2f, [512]]
|
| 33 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 34 |
+
- [[-1, 4], 1, Concat, [1]]
|
| 35 |
+
- [-1, 3, C2f, [256]] # 16-P3/8 small
|
| 36 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 37 |
+
- [[-1, 13], 1, Concat, [1]]
|
| 38 |
+
- [-1, 3, C2f, [512]] # 19-P4/16 medium
|
| 39 |
+
- [-1, 1, SCDown, [512, 3, 2]]
|
| 40 |
+
- [[-1, 10], 1, Concat, [1]]
|
| 41 |
+
- [-1, 3, C2fCIB, [1024, True, True]] # 22-P5/32 large
|
| 42 |
+
- [[16, 19, 22], 1, v10Detect, [nc]]
|
models_related/models_config/yolov8_varroa_bra_original.yaml
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOLOv8 Varroa ablation with original-style bi-level routing attention after neck P3/P4 C2f.
|
| 2 |
+
|
| 3 |
+
nc: 1
|
| 4 |
+
scales:
|
| 5 |
+
n: [0.33, 0.25, 1024]
|
| 6 |
+
s: [0.33, 0.50, 1024]
|
| 7 |
+
m: [0.67, 0.75, 768]
|
| 8 |
+
l: [1.00, 1.00, 512]
|
| 9 |
+
x: [1.00, 1.25, 512]
|
| 10 |
+
|
| 11 |
+
backbone:
|
| 12 |
+
- [-1, 1, Conv, [64, 3, 2]]
|
| 13 |
+
- [-1, 1, Conv, [128, 3, 2]]
|
| 14 |
+
- [-1, 3, C2f, [128, True]]
|
| 15 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 16 |
+
- [-1, 6, C2f, [256, True]]
|
| 17 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 18 |
+
- [-1, 6, C2f, [512, True]]
|
| 19 |
+
- [-1, 1, Conv, [1024, 3, 2]]
|
| 20 |
+
- [-1, 3, C2f, [1024, True]]
|
| 21 |
+
- [-1, 1, SPPF, [1024, 5]]
|
| 22 |
+
|
| 23 |
+
head:
|
| 24 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 25 |
+
- [[-1, 6], 1, Concat, [1]]
|
| 26 |
+
- [-1, 3, C2f, [512]]
|
| 27 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 28 |
+
- [[-1, 4], 1, Concat, [1]]
|
| 29 |
+
- [-1, 3, C2f, [256]]
|
| 30 |
+
- [-1, 1, BiLevelRoutingAttention, [256, 4, 7, 4, 3]]
|
| 31 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 32 |
+
- [[-1, 12], 1, Concat, [1]]
|
| 33 |
+
- [-1, 3, C2f, [512]]
|
| 34 |
+
- [-1, 1, BiLevelRoutingAttention, [512, 4, 7, 4, 3]]
|
| 35 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 36 |
+
- [[-1, 9], 1, Concat, [1]]
|
| 37 |
+
- [-1, 3, C2f, [1024]]
|
| 38 |
+
- [[16, 20, 23], 1, Detect, [nc]]
|
models_related/models_config/yolov8_varroa_bralite.yaml
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOLOv8 Varroa ablation with region routing attention after neck P3/P4 C2f.
|
| 2 |
+
|
| 3 |
+
nc: 1
|
| 4 |
+
scales:
|
| 5 |
+
n: [0.33, 0.25, 1024]
|
| 6 |
+
s: [0.33, 0.50, 1024]
|
| 7 |
+
m: [0.67, 0.75, 768]
|
| 8 |
+
l: [1.00, 1.00, 512]
|
| 9 |
+
x: [1.00, 1.25, 512]
|
| 10 |
+
|
| 11 |
+
backbone:
|
| 12 |
+
- [-1, 1, Conv, [64, 3, 2]]
|
| 13 |
+
- [-1, 1, Conv, [128, 3, 2]]
|
| 14 |
+
- [-1, 3, C2f, [128, True]]
|
| 15 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 16 |
+
- [-1, 6, C2f, [256, True]]
|
| 17 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 18 |
+
- [-1, 6, C2f, [512, True]]
|
| 19 |
+
- [-1, 1, Conv, [1024, 3, 2]]
|
| 20 |
+
- [-1, 3, C2f, [1024, True]]
|
| 21 |
+
- [-1, 1, SPPF, [1024, 5]]
|
| 22 |
+
|
| 23 |
+
head:
|
| 24 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 25 |
+
- [[-1, 6], 1, Concat, [1]]
|
| 26 |
+
- [-1, 3, C2f, [512]]
|
| 27 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 28 |
+
- [[-1, 4], 1, Concat, [1]]
|
| 29 |
+
- [-1, 3, C2f, [256]]
|
| 30 |
+
- [-1, 1, RegionRoutingAttentionLite, [256, 4, 10, 4]]
|
| 31 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 32 |
+
- [[-1, 12], 1, Concat, [1]]
|
| 33 |
+
- [-1, 3, C2f, [512]]
|
| 34 |
+
- [-1, 1, RegionRoutingAttentionLite, [512, 4, 10, 4]]
|
| 35 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 36 |
+
- [[-1, 9], 1, Concat, [1]]
|
| 37 |
+
- [-1, 3, C2f, [1024]]
|
| 38 |
+
- [[16, 20, 23], 1, Detect, [nc]]
|
models_related/models_config/yolov8_varroa_c2fkv.yaml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOLOv8 Varroa ablation with C2f blocks followed by KV-compressed attention in the P3/P4 head.
|
| 2 |
+
|
| 3 |
+
nc: 1
|
| 4 |
+
scales:
|
| 5 |
+
n: [0.33, 0.25, 1024]
|
| 6 |
+
s: [0.33, 0.50, 1024]
|
| 7 |
+
m: [0.67, 0.75, 768]
|
| 8 |
+
l: [1.00, 1.00, 512]
|
| 9 |
+
x: [1.00, 1.25, 512]
|
| 10 |
+
|
| 11 |
+
backbone:
|
| 12 |
+
- [-1, 1, Conv, [64, 3, 2]]
|
| 13 |
+
- [-1, 1, Conv, [128, 3, 2]]
|
| 14 |
+
- [-1, 3, C2f, [128, True]]
|
| 15 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 16 |
+
- [-1, 6, C2f, [256, True]]
|
| 17 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 18 |
+
- [-1, 6, C2f, [512, True]]
|
| 19 |
+
- [-1, 1, Conv, [1024, 3, 2]]
|
| 20 |
+
- [-1, 3, C2f, [1024, True]]
|
| 21 |
+
- [-1, 1, SPPF, [1024, 5]]
|
| 22 |
+
|
| 23 |
+
head:
|
| 24 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 25 |
+
- [[-1, 6], 1, Concat, [1]]
|
| 26 |
+
- [-1, 3, C2f, [512]]
|
| 27 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 28 |
+
- [[-1, 4], 1, Concat, [1]]
|
| 29 |
+
- [-1, 3, C2fKV, [256, False, 1, 0.5, 4, 2, dwconv]]
|
| 30 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 31 |
+
- [[-1, 12], 1, Concat, [1]]
|
| 32 |
+
- [-1, 3, C2fKV, [512, False, 1, 0.5, 4, 2, dwconv]]
|
| 33 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 34 |
+
- [[-1, 9], 1, Concat, [1]]
|
| 35 |
+
- [-1, 3, C2f, [1024]]
|
| 36 |
+
- [[15, 18, 21], 1, Detect, [nc]]
|
models_related/models_config/yolov8_varroa_custom.yaml
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOLOv8 Varroa custom template for Ultralytics.
|
| 2 |
+
# Replace selected C2f/SPPF-adjacent blocks with registered custom modules.
|
| 3 |
+
# Example custom blocks live in yolo_related/custom_blocks.py.
|
| 4 |
+
# They must be registered inside editable Ultralytics before these names work:
|
| 5 |
+
# Add custom modules here only after registering them in the local Ultralytics clone.
|
| 6 |
+
|
| 7 |
+
nc: 1
|
| 8 |
+
scales:
|
| 9 |
+
n: [0.33, 0.25, 1024]
|
| 10 |
+
s: [0.33, 0.50, 1024]
|
| 11 |
+
m: [0.67, 0.75, 768]
|
| 12 |
+
l: [1.00, 1.00, 512]
|
| 13 |
+
x: [1.00, 1.25, 512]
|
| 14 |
+
|
| 15 |
+
backbone:
|
| 16 |
+
# [from, repeats, module, args]
|
| 17 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
| 18 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
| 19 |
+
- [-1, 3, C2f, [128, True]]
|
| 20 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
| 21 |
+
- [-1, 6, C2f, [256, True]]
|
| 22 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
| 23 |
+
- [-1, 6, C2f, [512, True]]
|
| 24 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
| 25 |
+
- [-1, 3, C2f, [1024, True]]
|
| 26 |
+
- [-1, 1, SPPF, [1024, 5]] # good insert point for attention/SE blocks
|
| 27 |
+
# Insert custom blocks after SPPF only after registration. Adding a layer
|
| 28 |
+
# shifts later head indices such as [-1, 9] and [15, 18, 21].
|
| 29 |
+
|
| 30 |
+
head:
|
| 31 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 32 |
+
- [[-1, 6], 1, Concat, [1]]
|
| 33 |
+
- [-1, 3, C2f, [512]]
|
| 34 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 35 |
+
- [[-1, 4], 1, Concat, [1]]
|
| 36 |
+
- [-1, 3, C2f, [256]] # 15-P3/8 small
|
| 37 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 38 |
+
- [[-1, 12], 1, Concat, [1]]
|
| 39 |
+
- [-1, 3, C2f, [512]] # 18-P4/16 medium
|
| 40 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 41 |
+
- [[-1, 9], 1, Concat, [1]]
|
| 42 |
+
- [-1, 3, C2f, [1024]] # 21-P5/32 large
|
| 43 |
+
- [[15, 18, 21], 1, Detect, [nc]]
|
models_related/models_config/yolov8_varroa_kvca.yaml
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOLOv8 Varroa ablation with KV-compressed attention after neck P3/P4 C2f.
|
| 2 |
+
|
| 3 |
+
nc: 1
|
| 4 |
+
scales:
|
| 5 |
+
n: [0.33, 0.25, 1024]
|
| 6 |
+
s: [0.33, 0.50, 1024]
|
| 7 |
+
m: [0.67, 0.75, 768]
|
| 8 |
+
l: [1.00, 1.00, 512]
|
| 9 |
+
x: [1.00, 1.25, 512]
|
| 10 |
+
|
| 11 |
+
backbone:
|
| 12 |
+
- [-1, 1, Conv, [64, 3, 2]]
|
| 13 |
+
- [-1, 1, Conv, [128, 3, 2]]
|
| 14 |
+
- [-1, 3, C2f, [128, True]]
|
| 15 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 16 |
+
- [-1, 6, C2f, [256, True]]
|
| 17 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 18 |
+
- [-1, 6, C2f, [512, True]]
|
| 19 |
+
- [-1, 1, Conv, [1024, 3, 2]]
|
| 20 |
+
- [-1, 3, C2f, [1024, True]]
|
| 21 |
+
- [-1, 1, SPPF, [1024, 5]]
|
| 22 |
+
|
| 23 |
+
head:
|
| 24 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 25 |
+
- [[-1, 6], 1, Concat, [1]]
|
| 26 |
+
- [-1, 3, C2f, [512]]
|
| 27 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 28 |
+
- [[-1, 4], 1, Concat, [1]]
|
| 29 |
+
- [-1, 3, C2f, [256]]
|
| 30 |
+
- [-1, 1, KVCompressedAttention, [256, 4, 2, dwconv]]
|
| 31 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 32 |
+
- [[-1, 12], 1, Concat, [1]]
|
| 33 |
+
- [-1, 3, C2f, [512]]
|
| 34 |
+
- [-1, 1, KVCompressedAttention, [512, 4, 2, dwconv]]
|
| 35 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 36 |
+
- [[-1, 9], 1, Concat, [1]]
|
| 37 |
+
- [-1, 3, C2f, [1024]]
|
| 38 |
+
- [[16, 20, 23], 1, Detect, [nc]]
|
models_related/models_config/yolov8_varroa_p2.yaml
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOLOv8 Varroa P2 ablation:
|
| 2 |
+
# Plain 4-head detector [P2, P3, P4, P5] without attention/KV blocks.
|
| 3 |
+
|
| 4 |
+
nc: 1
|
| 5 |
+
scales:
|
| 6 |
+
n: [0.33, 0.25, 1024]
|
| 7 |
+
s: [0.33, 0.50, 1024]
|
| 8 |
+
m: [0.67, 0.75, 768]
|
| 9 |
+
l: [1.00, 1.00, 512]
|
| 10 |
+
x: [1.00, 1.25, 512]
|
| 11 |
+
|
| 12 |
+
backbone:
|
| 13 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
| 14 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
| 15 |
+
- [-1, 3, C2f, [128, True]] # 2-P2/4
|
| 16 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
| 17 |
+
- [-1, 6, C2f, [256, True]] # 4-P3/8
|
| 18 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
| 19 |
+
- [-1, 6, C2f, [512, True]] # 6-P4/16
|
| 20 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
| 21 |
+
- [-1, 3, C2f, [1024, True]] # 8-P5/32
|
| 22 |
+
- [-1, 1, SPPF, [1024, 5]] # 9
|
| 23 |
+
|
| 24 |
+
head:
|
| 25 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 26 |
+
- [[-1, 6], 1, Concat, [1]]
|
| 27 |
+
- [-1, 3, C2f, [512]] # 12-P4/16 top-down
|
| 28 |
+
|
| 29 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 30 |
+
- [[-1, 4], 1, Concat, [1]]
|
| 31 |
+
- [-1, 3, C2f, [256]] # 15-P3/8 top-down
|
| 32 |
+
|
| 33 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 34 |
+
- [[-1, 2], 1, Concat, [1]]
|
| 35 |
+
- [-1, 3, C2f, [128]] # 18-P2/4 small-object head
|
| 36 |
+
|
| 37 |
+
- [-1, 1, Conv, [128, 3, 2]]
|
| 38 |
+
- [[-1, 15], 1, Concat, [1]]
|
| 39 |
+
- [-1, 3, C2f, [256]] # 21-P3/8
|
| 40 |
+
|
| 41 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 42 |
+
- [[-1, 12], 1, Concat, [1]]
|
| 43 |
+
- [-1, 3, C2f, [512]] # 24-P4/16
|
| 44 |
+
|
| 45 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 46 |
+
- [[-1, 9], 1, Concat, [1]]
|
| 47 |
+
- [-1, 3, C2f, [1024]] # 27-P5/32
|
| 48 |
+
|
| 49 |
+
- [[18, 21, 24, 27], 1, Detect, [nc]]
|
models_related/models_config/yolov8_varroa_p2_c2fkv.yaml
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOLOv8 Varroa ablation with a P2 detection head and PSA-style C2fKV on P2/P3 features.
|
| 2 |
+
|
| 3 |
+
nc: 1
|
| 4 |
+
scales:
|
| 5 |
+
n: [0.33, 0.25, 1024]
|
| 6 |
+
s: [0.33, 0.50, 1024]
|
| 7 |
+
m: [0.67, 0.75, 768]
|
| 8 |
+
l: [1.00, 1.00, 512]
|
| 9 |
+
x: [1.00, 1.25, 512]
|
| 10 |
+
|
| 11 |
+
backbone:
|
| 12 |
+
- [-1, 1, Conv, [64, 3, 2]]
|
| 13 |
+
- [-1, 1, Conv, [128, 3, 2]]
|
| 14 |
+
- [-1, 3, C2f, [128, True]]
|
| 15 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 16 |
+
- [-1, 6, C2f, [256, True]]
|
| 17 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 18 |
+
- [-1, 6, C2f, [512, True]]
|
| 19 |
+
- [-1, 1, Conv, [1024, 3, 2]]
|
| 20 |
+
- [-1, 3, C2f, [1024, True]]
|
| 21 |
+
- [-1, 1, SPPF, [1024, 5]]
|
| 22 |
+
|
| 23 |
+
head:
|
| 24 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 25 |
+
- [[-1, 6], 1, Concat, [1]]
|
| 26 |
+
- [-1, 3, C2f, [512]]
|
| 27 |
+
|
| 28 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 29 |
+
- [[-1, 4], 1, Concat, [1]]
|
| 30 |
+
# P3 uses sr_ratio=2: enough KV compression while keeping more context detail than P2.
|
| 31 |
+
- [-1, 3, C2fKV, [256, False, 1, 0.5, 4, 2, dwconv]]
|
| 32 |
+
|
| 33 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 34 |
+
- [[-1, 2], 1, Concat, [1]]
|
| 35 |
+
# P2 is 160x160 at imgsz=640, so sr_ratio=4 keeps KV attention affordable.
|
| 36 |
+
- [-1, 3, C2fKV, [128, False, 1, 0.5, 4, 4, dwconv]]
|
| 37 |
+
|
| 38 |
+
- [-1, 1, Conv, [128, 3, 2]]
|
| 39 |
+
- [[-1, 15], 1, Concat, [1]]
|
| 40 |
+
- [-1, 3, C2fKV, [256, False, 1, 0.5, 4, 2, dwconv]]
|
| 41 |
+
|
| 42 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 43 |
+
- [[-1, 12], 1, Concat, [1]]
|
| 44 |
+
# P4/P5 stay regular C2f here; KVCA is focused on small-object scales.
|
| 45 |
+
- [-1, 3, C2f, [512]]
|
| 46 |
+
|
| 47 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 48 |
+
- [[-1, 9], 1, Concat, [1]]
|
| 49 |
+
- [-1, 3, C2f, [1024]]
|
| 50 |
+
|
| 51 |
+
- [[18, 21, 24, 27], 1, Detect, [nc]]
|
models_related/models_config/yolov8_varroa_p2_dcnhead.yaml
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOLOv8 Varroa P2 + A8 ablation:
|
| 2 |
+
# 4-head detector [P2, P3, P4, P5] with deformable refinement before Detect.
|
| 3 |
+
|
| 4 |
+
nc: 1
|
| 5 |
+
scales:
|
| 6 |
+
n: [0.33, 0.25, 1024]
|
| 7 |
+
s: [0.33, 0.50, 1024]
|
| 8 |
+
m: [0.67, 0.75, 768]
|
| 9 |
+
l: [1.00, 1.00, 512]
|
| 10 |
+
x: [1.00, 1.25, 512]
|
| 11 |
+
|
| 12 |
+
backbone:
|
| 13 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
| 14 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
| 15 |
+
- [-1, 3, C2f, [128, True]] # 2-P2/4
|
| 16 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
| 17 |
+
- [-1, 6, C2f, [256, True]] # 4-P3/8
|
| 18 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
| 19 |
+
- [-1, 6, C2f, [512, True]] # 6-P4/16
|
| 20 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
| 21 |
+
- [-1, 3, C2f, [1024, True]] # 8-P5/32
|
| 22 |
+
- [-1, 1, SPPF, [1024, 5]] # 9
|
| 23 |
+
|
| 24 |
+
head:
|
| 25 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 26 |
+
- [[-1, 6], 1, Concat, [1]]
|
| 27 |
+
- [-1, 3, C2f, [512]] # 12-P4/16 top-down
|
| 28 |
+
|
| 29 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 30 |
+
- [[-1, 4], 1, Concat, [1]]
|
| 31 |
+
- [-1, 3, C2f, [256]] # 15-P3/8 top-down
|
| 32 |
+
|
| 33 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 34 |
+
- [[-1, 2], 1, Concat, [1]]
|
| 35 |
+
- [-1, 3, C2f, [128]] # 18-P2/4 small-object head
|
| 36 |
+
|
| 37 |
+
- [-1, 1, Conv, [128, 3, 2]]
|
| 38 |
+
- [[-1, 15], 1, Concat, [1]]
|
| 39 |
+
- [-1, 3, C2f, [256]] # 21-P3/8
|
| 40 |
+
|
| 41 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 42 |
+
- [[-1, 12], 1, Concat, [1]]
|
| 43 |
+
- [-1, 3, C2f, [512]] # 24-P4/16
|
| 44 |
+
|
| 45 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 46 |
+
- [[-1, 9], 1, Concat, [1]]
|
| 47 |
+
- [-1, 3, C2f, [1024]] # 27-P5/32
|
| 48 |
+
|
| 49 |
+
- [18, 1, DeformableHeadConv, [128, 3, 0.0]] # 28-P2*
|
| 50 |
+
- [21, 1, DeformableHeadConv, [256, 3, 0.0]] # 29-P3*
|
| 51 |
+
- [24, 1, DeformableHeadConv, [512, 3, 0.0]] # 30-P4*
|
| 52 |
+
- [27, 1, DeformableHeadConv, [1024, 3, 0.0]] # 31-P5*
|
| 53 |
+
|
| 54 |
+
- [[28, 29, 30, 31], 1, Detect, [nc]]
|
models_related/models_config/yolov8_varroa_p4_dcnhead.yaml
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOLOv8 Varroa A8 ablation:
|
| 2 |
+
# 3-head detector with lightweight deformable refinement before Detect.
|
| 3 |
+
|
| 4 |
+
nc: 1
|
| 5 |
+
scales:
|
| 6 |
+
n: [0.33, 0.25, 1024]
|
| 7 |
+
s: [0.33, 0.50, 1024]
|
| 8 |
+
m: [0.67, 0.75, 768]
|
| 9 |
+
l: [1.00, 1.00, 512]
|
| 10 |
+
x: [1.00, 1.25, 512]
|
| 11 |
+
|
| 12 |
+
backbone:
|
| 13 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
| 14 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
| 15 |
+
- [-1, 3, C2f, [128, True]] # 2-P2/4
|
| 16 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
| 17 |
+
- [-1, 6, C2f, [256, True]] # 4-P3/8
|
| 18 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
| 19 |
+
- [-1, 6, C2f, [512, True]] # 6-P4/16
|
| 20 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
| 21 |
+
- [-1, 3, C2f, [1024, True]] # 8-P5/32
|
| 22 |
+
- [-1, 1, SPPF, [1024, 5]] # 9
|
| 23 |
+
|
| 24 |
+
head:
|
| 25 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 26 |
+
- [[-1, 6], 1, Concat, [1]]
|
| 27 |
+
- [-1, 3, C2f, [512]] # 12-P4/16 top-down
|
| 28 |
+
|
| 29 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 30 |
+
- [[-1, 4], 1, Concat, [1]]
|
| 31 |
+
- [-1, 3, C2f, [256]] # 15-P3/8 small
|
| 32 |
+
|
| 33 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 34 |
+
- [[-1, 12], 1, Concat, [1]]
|
| 35 |
+
- [-1, 3, C2f, [512]] # 18-P4/16 medium
|
| 36 |
+
|
| 37 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 38 |
+
- [[-1, 9], 1, Concat, [1]]
|
| 39 |
+
- [-1, 3, C2f, [1024]] # 21-P5/32 large
|
| 40 |
+
|
| 41 |
+
- [15, 1, DeformableHeadConv, [256, 3, 0.0]] # 22-P3*
|
| 42 |
+
- [18, 1, DeformableHeadConv, [512, 3, 0.0]] # 23-P4*
|
| 43 |
+
- [21, 1, DeformableHeadConv, [1024, 3, 0.0]] # 24-P5*
|
| 44 |
+
|
| 45 |
+
- [[22, 23, 24], 1, Detect, [nc]]
|
models_related/models_config/yolov8_varroa_p4_regmax24.yaml
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOLOv8 Varroa A9a ablation:
|
| 2 |
+
# Baseline 3-head detector with higher DFL regression resolution.
|
| 3 |
+
|
| 4 |
+
nc: 1
|
| 5 |
+
reg_max: 24
|
| 6 |
+
scales:
|
| 7 |
+
n: [0.33, 0.25, 1024]
|
| 8 |
+
s: [0.33, 0.50, 1024]
|
| 9 |
+
m: [0.67, 0.75, 768]
|
| 10 |
+
l: [1.00, 1.00, 512]
|
| 11 |
+
x: [1.00, 1.25, 512]
|
| 12 |
+
|
| 13 |
+
backbone:
|
| 14 |
+
- [-1, 1, Conv, [64, 3, 2]]
|
| 15 |
+
- [-1, 1, Conv, [128, 3, 2]]
|
| 16 |
+
- [-1, 3, C2f, [128, True]]
|
| 17 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 18 |
+
- [-1, 6, C2f, [256, True]]
|
| 19 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 20 |
+
- [-1, 6, C2f, [512, True]]
|
| 21 |
+
- [-1, 1, Conv, [1024, 3, 2]]
|
| 22 |
+
- [-1, 3, C2f, [1024, True]]
|
| 23 |
+
- [-1, 1, SPPF, [1024, 5]]
|
| 24 |
+
|
| 25 |
+
head:
|
| 26 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 27 |
+
- [[-1, 6], 1, Concat, [1]]
|
| 28 |
+
- [-1, 3, C2f, [512]]
|
| 29 |
+
|
| 30 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 31 |
+
- [[-1, 4], 1, Concat, [1]]
|
| 32 |
+
- [-1, 3, C2f, [256]] # 15-P3/8
|
| 33 |
+
|
| 34 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 35 |
+
- [[-1, 12], 1, Concat, [1]]
|
| 36 |
+
- [-1, 3, C2f, [512]] # 18-P4/16
|
| 37 |
+
|
| 38 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 39 |
+
- [[-1, 9], 1, Concat, [1]]
|
| 40 |
+
- [-1, 3, C2f, [1024]] # 21-P5/32
|
| 41 |
+
|
| 42 |
+
- [[15, 18, 21], 1, Detect, [nc]]
|
models_related/models_config/yolov8_varroa_p4_regmax24_topk15.yaml
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOLOv8 Varroa A9 ablation:
|
| 2 |
+
# Higher DFL regression resolution plus wider Task-Aligned Assigner top-k.
|
| 3 |
+
|
| 4 |
+
nc: 1
|
| 5 |
+
reg_max: 24
|
| 6 |
+
tal_topk: 15
|
| 7 |
+
scales:
|
| 8 |
+
n: [0.33, 0.25, 1024]
|
| 9 |
+
s: [0.33, 0.50, 1024]
|
| 10 |
+
m: [0.67, 0.75, 768]
|
| 11 |
+
l: [1.00, 1.00, 512]
|
| 12 |
+
x: [1.00, 1.25, 512]
|
| 13 |
+
|
| 14 |
+
backbone:
|
| 15 |
+
- [-1, 1, Conv, [64, 3, 2]]
|
| 16 |
+
- [-1, 1, Conv, [128, 3, 2]]
|
| 17 |
+
- [-1, 3, C2f, [128, True]]
|
| 18 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 19 |
+
- [-1, 6, C2f, [256, True]]
|
| 20 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 21 |
+
- [-1, 6, C2f, [512, True]]
|
| 22 |
+
- [-1, 1, Conv, [1024, 3, 2]]
|
| 23 |
+
- [-1, 3, C2f, [1024, True]]
|
| 24 |
+
- [-1, 1, SPPF, [1024, 5]]
|
| 25 |
+
|
| 26 |
+
head:
|
| 27 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 28 |
+
- [[-1, 6], 1, Concat, [1]]
|
| 29 |
+
- [-1, 3, C2f, [512]]
|
| 30 |
+
|
| 31 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 32 |
+
- [[-1, 4], 1, Concat, [1]]
|
| 33 |
+
- [-1, 3, C2f, [256]] # 15-P3/8
|
| 34 |
+
|
| 35 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 36 |
+
- [[-1, 12], 1, Concat, [1]]
|
| 37 |
+
- [-1, 3, C2f, [512]] # 18-P4/16
|
| 38 |
+
|
| 39 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 40 |
+
- [[-1, 9], 1, Concat, [1]]
|
| 41 |
+
- [-1, 3, C2f, [1024]] # 21-P5/32
|
| 42 |
+
|
| 43 |
+
- [[15, 18, 21], 1, Detect, [nc]]
|
models_related/models_config/yolov8_varroa_p4csla.yaml
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOLOv8 Varroa B3 ablation:
|
| 2 |
+
# P4-centered cross-scale local attention with P2 localization gating.
|
| 3 |
+
# Detect remains 3-head [P3, enhanced P4, P5], so this isolates P4 fusion
|
| 4 |
+
# from the separate "add P2 detection head" ablation.
|
| 5 |
+
|
| 6 |
+
nc: 1
|
| 7 |
+
scales:
|
| 8 |
+
n: [0.33, 0.25, 1024]
|
| 9 |
+
s: [0.33, 0.50, 1024]
|
| 10 |
+
m: [0.67, 0.75, 768]
|
| 11 |
+
l: [1.00, 1.00, 512]
|
| 12 |
+
x: [1.00, 1.25, 512]
|
| 13 |
+
|
| 14 |
+
backbone:
|
| 15 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
| 16 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
| 17 |
+
- [-1, 3, C2f, [128, True]] # 2-P2/4 localization detail
|
| 18 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
| 19 |
+
- [-1, 6, C2f, [256, True]] # 4-P3/8
|
| 20 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
| 21 |
+
- [-1, 6, C2f, [512, True]] # 6-P4/16
|
| 22 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
| 23 |
+
- [-1, 3, C2f, [1024, True]] # 8-P5/32
|
| 24 |
+
- [-1, 1, SPPF, [1024, 5]] # 9
|
| 25 |
+
|
| 26 |
+
head:
|
| 27 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 28 |
+
- [[-1, 6], 1, Concat, [1]]
|
| 29 |
+
- [-1, 3, C2f, [512]] # 12-P4/16 top-down
|
| 30 |
+
|
| 31 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 32 |
+
- [[-1, 4], 1, Concat, [1]]
|
| 33 |
+
- [-1, 3, C2f, [256]] # 15-P3/8 small
|
| 34 |
+
|
| 35 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 36 |
+
- [[-1, 12], 1, Concat, [1]]
|
| 37 |
+
- [-1, 3, C2f, [512]] # 18-P4/16 medium
|
| 38 |
+
|
| 39 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 40 |
+
- [[-1, 9], 1, Concat, [1]]
|
| 41 |
+
- [-1, 3, C2f, [1024]] # 21-P5/32 large
|
| 42 |
+
|
| 43 |
+
# B3 core block:
|
| 44 |
+
# inputs are [P2 detail, P3 local, P4 balanced query, P5 semantic context].
|
| 45 |
+
# args: [c2, num_heads, local_window, p2_gate_scale]
|
| 46 |
+
- [[2, 15, 18, 21], 1, P4CrossScaleLocalAttention, [512, 4, 7, 0.1]] # 22-P4*
|
| 47 |
+
|
| 48 |
+
- [[15, 22, 21], 1, Detect, [nc]]
|
models_related/models_config/yolov8_varroa_topk_adaptive_kv.yaml
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOLOv8 Varroa ablation with adaptive top-k grouped K/V attention after neck P3/P4 C2f.
|
| 2 |
+
|
| 3 |
+
nc: 1
|
| 4 |
+
scales:
|
| 5 |
+
n: [0.33, 0.25, 1024]
|
| 6 |
+
s: [0.33, 0.50, 1024]
|
| 7 |
+
m: [0.67, 0.75, 768]
|
| 8 |
+
l: [1.00, 1.00, 512]
|
| 9 |
+
x: [1.00, 1.25, 512]
|
| 10 |
+
|
| 11 |
+
backbone:
|
| 12 |
+
- [-1, 1, Conv, [64, 3, 2]]
|
| 13 |
+
- [-1, 1, Conv, [128, 3, 2]]
|
| 14 |
+
- [-1, 3, C2f, [128, True]]
|
| 15 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 16 |
+
- [-1, 6, C2f, [256, True]]
|
| 17 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 18 |
+
- [-1, 6, C2f, [512, True]]
|
| 19 |
+
- [-1, 1, Conv, [1024, 3, 2]]
|
| 20 |
+
- [-1, 3, C2f, [1024, True]]
|
| 21 |
+
- [-1, 1, SPPF, [1024, 5]]
|
| 22 |
+
|
| 23 |
+
head:
|
| 24 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 25 |
+
- [[-1, 6], 1, Concat, [1]]
|
| 26 |
+
- [-1, 3, C2f, [512]]
|
| 27 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 28 |
+
- [[-1, 4], 1, Concat, [1]]
|
| 29 |
+
- [-1, 3, C2f, [256]]
|
| 30 |
+
- [-1, 1, TopKAdaptiveGroupKVAttention, [256, 4, 4, 10, 8]]
|
| 31 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 32 |
+
- [[-1, 12], 1, Concat, [1]]
|
| 33 |
+
- [-1, 3, C2f, [512]]
|
| 34 |
+
- [-1, 1, TopKAdaptiveGroupKVAttention, [512, 4, 4, 10, 8]]
|
| 35 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 36 |
+
- [[-1, 9], 1, Concat, [1]]
|
| 37 |
+
- [-1, 3, C2f, [1024]]
|
| 38 |
+
- [[16, 20, 23], 1, Detect, [nc]]
|
models_related/models_config/yolov8_varroa_topk_global_kv.yaml
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOLOv8 Varroa ablation with global top-k grouped K/V attention after neck P3/P4 C2f.
|
| 2 |
+
|
| 3 |
+
nc: 1
|
| 4 |
+
scales:
|
| 5 |
+
n: [0.33, 0.25, 1024]
|
| 6 |
+
s: [0.33, 0.50, 1024]
|
| 7 |
+
m: [0.67, 0.75, 768]
|
| 8 |
+
l: [1.00, 1.00, 512]
|
| 9 |
+
x: [1.00, 1.25, 512]
|
| 10 |
+
|
| 11 |
+
backbone:
|
| 12 |
+
- [-1, 1, Conv, [64, 3, 2]]
|
| 13 |
+
- [-1, 1, Conv, [128, 3, 2]]
|
| 14 |
+
- [-1, 3, C2f, [128, True]]
|
| 15 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 16 |
+
- [-1, 6, C2f, [256, True]]
|
| 17 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 18 |
+
- [-1, 6, C2f, [512, True]]
|
| 19 |
+
- [-1, 1, Conv, [1024, 3, 2]]
|
| 20 |
+
- [-1, 3, C2f, [1024, True]]
|
| 21 |
+
- [-1, 1, SPPF, [1024, 5]]
|
| 22 |
+
|
| 23 |
+
head:
|
| 24 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 25 |
+
- [[-1, 6], 1, Concat, [1]]
|
| 26 |
+
- [-1, 3, C2f, [512]]
|
| 27 |
+
- [-1, 1, nn.Upsample, [None, 2, nearest]]
|
| 28 |
+
- [[-1, 4], 1, Concat, [1]]
|
| 29 |
+
- [-1, 3, C2f, [256]]
|
| 30 |
+
- [-1, 1, TopKGlobalGroupKVAttention, [256, 4, 4, 100]]
|
| 31 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 32 |
+
- [[-1, 12], 1, Concat, [1]]
|
| 33 |
+
- [-1, 3, C2f, [512]]
|
| 34 |
+
- [-1, 1, TopKGlobalGroupKVAttention, [512, 4, 4, 50]]
|
| 35 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 36 |
+
- [[-1, 9], 1, Concat, [1]]
|
| 37 |
+
- [-1, 3, C2f, [1024]]
|
| 38 |
+
- [[16, 20, 23], 1, Detect, [nc]]
|
models_related/train_eval/eval.py
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Evaluate an Ultralytics YOLO checkpoint on the standalone Varroa YOLO dataset."""
|
| 3 |
+
|
| 4 |
+
from __future__ import annotations
|
| 5 |
+
|
| 6 |
+
import argparse
|
| 7 |
+
import csv
|
| 8 |
+
import os
|
| 9 |
+
import sys
|
| 10 |
+
import time
|
| 11 |
+
from pathlib import Path
|
| 12 |
+
|
| 13 |
+
from PIL import Image
|
| 14 |
+
|
| 15 |
+
from prepare_dataset import (
|
| 16 |
+
clamp_xyxy_boxes,
|
| 17 |
+
label_path_for,
|
| 18 |
+
prepare_dataset,
|
| 19 |
+
read_original_boxes,
|
| 20 |
+
resolve_repo_root,
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
os.environ.setdefault("MPLCONFIGDIR", "/tmp/matplotlib")
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def prefer_local_ultralytics() -> None:
|
| 28 |
+
local_ultralytics = Path(__file__).resolve().parents[1] / "ultralytics"
|
| 29 |
+
if (local_ultralytics / "ultralytics" / "__init__.py").is_file():
|
| 30 |
+
sys.path.insert(0, str(local_ultralytics))
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def box_iou(a: list[float], b: list[float]) -> float:
|
| 34 |
+
ax1, ay1, ax2, ay2 = a
|
| 35 |
+
bx1, by1, bx2, by2 = b
|
| 36 |
+
ix1 = max(ax1, bx1)
|
| 37 |
+
iy1 = max(ay1, by1)
|
| 38 |
+
ix2 = min(ax2, bx2)
|
| 39 |
+
iy2 = min(ay2, by2)
|
| 40 |
+
inter = max(0.0, ix2 - ix1) * max(0.0, iy2 - iy1)
|
| 41 |
+
if inter <= 0.0:
|
| 42 |
+
return 0.0
|
| 43 |
+
area_a = max(0.0, ax2 - ax1) * max(0.0, ay2 - ay1)
|
| 44 |
+
area_b = max(0.0, bx2 - bx1) * max(0.0, by2 - by1)
|
| 45 |
+
return inter / max(area_a + area_b - inter, 1e-12)
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
def match_counts(pred_boxes: list[list[float]], gt_boxes: list[list[float]], iou_threshold: float) -> tuple[int, int, int]:
|
| 49 |
+
matched_gt: set[int] = set()
|
| 50 |
+
true_positive = 0
|
| 51 |
+
for pred in pred_boxes:
|
| 52 |
+
best_idx = -1
|
| 53 |
+
best_iou = 0.0
|
| 54 |
+
for idx, gt in enumerate(gt_boxes):
|
| 55 |
+
if idx in matched_gt:
|
| 56 |
+
continue
|
| 57 |
+
iou = box_iou(pred, gt)
|
| 58 |
+
if iou > best_iou:
|
| 59 |
+
best_idx = idx
|
| 60 |
+
best_iou = iou
|
| 61 |
+
if best_idx >= 0 and best_iou >= iou_threshold:
|
| 62 |
+
matched_gt.add(best_idx)
|
| 63 |
+
true_positive += 1
|
| 64 |
+
false_positive = len(pred_boxes) - true_positive
|
| 65 |
+
false_negative = len(gt_boxes) - true_positive
|
| 66 |
+
return true_positive, false_positive, false_negative
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
def model_profile(model, imgsz: int) -> tuple[int, float]:
|
| 70 |
+
"""Return parameter count and GFLOPs for an Ultralytics model."""
|
| 71 |
+
torch_model = getattr(model, "model", None)
|
| 72 |
+
if torch_model is None:
|
| 73 |
+
raise TypeError("Expected an Ultralytics PyTorch model with a .model attribute.")
|
| 74 |
+
params = sum(p.numel() for p in torch_model.parameters())
|
| 75 |
+
from ultralytics.utils.torch_utils import get_flops
|
| 76 |
+
|
| 77 |
+
gflops = get_flops(torch_model, imgsz)
|
| 78 |
+
return params, gflops
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
def run_eval(args: argparse.Namespace) -> None:
|
| 82 |
+
prefer_local_ultralytics()
|
| 83 |
+
from ultralytics import YOLO
|
| 84 |
+
|
| 85 |
+
data_yaml = Path(args.data_yaml) if args.data_yaml else prepare_dataset(args.root, args.yolo_dir, limit=args.limit)
|
| 86 |
+
model = YOLO(args.weights)
|
| 87 |
+
params, gflops = model_profile(model, args.imgsz)
|
| 88 |
+
|
| 89 |
+
val_metrics = model.val(
|
| 90 |
+
data=str(data_yaml),
|
| 91 |
+
split=args.split,
|
| 92 |
+
imgsz=args.imgsz,
|
| 93 |
+
batch=args.batch_size,
|
| 94 |
+
device=args.device,
|
| 95 |
+
workers=args.workers,
|
| 96 |
+
conf=args.map_conf,
|
| 97 |
+
iou=args.nms_iou,
|
| 98 |
+
project=args.project,
|
| 99 |
+
name=f"{args.name}_val",
|
| 100 |
+
)
|
| 101 |
+
|
| 102 |
+
root = resolve_repo_root(args.root)
|
| 103 |
+
split_root = root / args.split
|
| 104 |
+
image_dir = split_root / "videos"
|
| 105 |
+
label_dir = split_root / "labels"
|
| 106 |
+
images = sorted(image_dir.rglob("*.png"))
|
| 107 |
+
if args.limit > 0:
|
| 108 |
+
images = images[: args.limit]
|
| 109 |
+
|
| 110 |
+
out_dir = Path(args.project) / args.name
|
| 111 |
+
out_dir.mkdir(parents=True, exist_ok=True)
|
| 112 |
+
rows: list[dict[str, object]] = []
|
| 113 |
+
totals = {"tp": 0, "fp": 0, "fn": 0}
|
| 114 |
+
inference_seconds = 0.0
|
| 115 |
+
|
| 116 |
+
for image_path in images:
|
| 117 |
+
with Image.open(image_path) as image:
|
| 118 |
+
width, height = image.size
|
| 119 |
+
gt_boxes = clamp_xyxy_boxes(read_original_boxes(label_path_for(image_path, image_dir, label_dir)), width, height)
|
| 120 |
+
start_time = time.perf_counter()
|
| 121 |
+
result = model.predict(
|
| 122 |
+
str(image_path),
|
| 123 |
+
imgsz=args.imgsz,
|
| 124 |
+
conf=args.conf,
|
| 125 |
+
iou=args.nms_iou,
|
| 126 |
+
device=args.device,
|
| 127 |
+
verbose=False,
|
| 128 |
+
)[0]
|
| 129 |
+
inference_seconds += time.perf_counter() - start_time
|
| 130 |
+
|
| 131 |
+
pred_boxes = result.boxes.xyxy.detach().cpu().tolist() if result.boxes is not None else []
|
| 132 |
+
pred_scores = result.boxes.conf.detach().cpu().tolist() if result.boxes is not None else []
|
| 133 |
+
tp, fp, fn = match_counts(pred_boxes, gt_boxes, args.match_iou)
|
| 134 |
+
totals["tp"] += tp
|
| 135 |
+
totals["fp"] += fp
|
| 136 |
+
totals["fn"] += fn
|
| 137 |
+
rows.append(
|
| 138 |
+
{
|
| 139 |
+
"path": str(image_path),
|
| 140 |
+
"gt": len(gt_boxes),
|
| 141 |
+
"pred": len(pred_boxes),
|
| 142 |
+
"max_score": max(pred_scores) if pred_scores else "",
|
| 143 |
+
"tp": tp,
|
| 144 |
+
"fp": fp,
|
| 145 |
+
"fn": fn,
|
| 146 |
+
}
|
| 147 |
+
)
|
| 148 |
+
|
| 149 |
+
precision = totals["tp"] / max(totals["tp"] + totals["fp"], 1)
|
| 150 |
+
recall = totals["tp"] / max(totals["tp"] + totals["fn"], 1)
|
| 151 |
+
f1 = 2 * precision * recall / max(precision + recall, 1e-12)
|
| 152 |
+
fps = len(images) / inference_seconds if inference_seconds > 0 else ""
|
| 153 |
+
avg_ms = (inference_seconds / len(images) * 1000.0) if images and inference_seconds > 0 else ""
|
| 154 |
+
|
| 155 |
+
per_image_path = out_dir / f"{args.split}_per_image.csv"
|
| 156 |
+
summary_path = out_dir / f"{args.split}_summary.csv"
|
| 157 |
+
with per_image_path.open("w", newline="", encoding="utf-8") as handle:
|
| 158 |
+
writer = csv.DictWriter(handle, fieldnames=["path", "gt", "pred", "max_score", "tp", "fp", "fn"])
|
| 159 |
+
writer.writeheader()
|
| 160 |
+
writer.writerows(rows)
|
| 161 |
+
|
| 162 |
+
summary = {
|
| 163 |
+
"split": args.split,
|
| 164 |
+
"weights": args.weights,
|
| 165 |
+
"conf": args.conf,
|
| 166 |
+
"match_iou": args.match_iou,
|
| 167 |
+
"precision": precision,
|
| 168 |
+
"recall": recall,
|
| 169 |
+
"f1": f1,
|
| 170 |
+
"params": params,
|
| 171 |
+
"gflops": gflops,
|
| 172 |
+
"fps": fps,
|
| 173 |
+
"avg_inference_ms": avg_ms,
|
| 174 |
+
**totals,
|
| 175 |
+
"map50": getattr(val_metrics.box, "map50", ""),
|
| 176 |
+
"map50_95": getattr(val_metrics.box, "map", ""),
|
| 177 |
+
}
|
| 178 |
+
with summary_path.open("w", newline="", encoding="utf-8") as handle:
|
| 179 |
+
writer = csv.DictWriter(handle, fieldnames=list(summary.keys()))
|
| 180 |
+
writer.writeheader()
|
| 181 |
+
writer.writerow(summary)
|
| 182 |
+
|
| 183 |
+
print(
|
| 184 |
+
f"Eval {args.split}: mAP50 {summary['map50']} | mAP50-95 {summary['map50_95']} | "
|
| 185 |
+
f"P {precision:.4f} R {recall:.4f} F1 {f1:.4f} | TP {totals['tp']} FP {totals['fp']} FN {totals['fn']} | "
|
| 186 |
+
f"Params {params} GFLOPs {gflops} FPS {fps if fps == '' else f'{fps:.2f}'}"
|
| 187 |
+
)
|
| 188 |
+
print(f"Wrote {per_image_path} and {summary_path}")
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
def parse_args() -> argparse.Namespace:
|
| 192 |
+
parser = argparse.ArgumentParser(description="Evaluate a YOLO Varroa checkpoint on CPU by default.")
|
| 193 |
+
parser.add_argument("--root", default=".")
|
| 194 |
+
parser.add_argument("--yolo-dir", default="yolo_related/datasets/varroa_yolo")
|
| 195 |
+
parser.add_argument("--data-yaml", default=None)
|
| 196 |
+
parser.add_argument("--split", default="test", choices=("train", "val", "test"))
|
| 197 |
+
parser.add_argument("--weights", required=True)
|
| 198 |
+
parser.add_argument("--imgsz", type=int, default=640)
|
| 199 |
+
parser.add_argument("--batch-size", type=int, default=4)
|
| 200 |
+
parser.add_argument("--conf", type=float, default=0.25)
|
| 201 |
+
parser.add_argument("--map-conf", type=float, default=0.001)
|
| 202 |
+
parser.add_argument("--match-iou", type=float, default=0.5)
|
| 203 |
+
parser.add_argument("--nms-iou", type=float, default=0.5)
|
| 204 |
+
parser.add_argument("--project", default="yolo_related/runs/eval")
|
| 205 |
+
parser.add_argument("--name", default="varroa_eval")
|
| 206 |
+
parser.add_argument("--workers", type=int, default=2)
|
| 207 |
+
parser.add_argument("--device", default="cpu")
|
| 208 |
+
parser.add_argument("--limit", type=int, default=0, help="Optional max images per split for smoke tests.")
|
| 209 |
+
return parser.parse_args()
|
| 210 |
+
|
| 211 |
+
|
| 212 |
+
def main() -> None:
|
| 213 |
+
run_eval(parse_args())
|
| 214 |
+
|
| 215 |
+
|
| 216 |
+
if __name__ == "__main__":
|
| 217 |
+
main()
|
models_related/train_eval/train.py
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Train Ultralytics YOLO baselines or custom YAML models on CPU by default."""
|
| 3 |
+
|
| 4 |
+
from __future__ import annotations
|
| 5 |
+
|
| 6 |
+
import argparse
|
| 7 |
+
import os
|
| 8 |
+
import sys
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
from prepare_dataset import prepare_dataset
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
os.environ.setdefault("MPLCONFIGDIR", "/tmp/matplotlib")
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def prefer_local_ultralytics() -> None:
|
| 18 |
+
local_ultralytics = Path(__file__).resolve().parents[1] / "ultralytics"
|
| 19 |
+
if (local_ultralytics / "ultralytics" / "__init__.py").is_file():
|
| 20 |
+
sys.path.insert(0, str(local_ultralytics))
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def load_model(args: argparse.Namespace):
|
| 24 |
+
prefer_local_ultralytics()
|
| 25 |
+
from ultralytics import YOLO
|
| 26 |
+
|
| 27 |
+
if args.model_yaml:
|
| 28 |
+
model = YOLO(args.model_yaml)
|
| 29 |
+
if args.pretrained:
|
| 30 |
+
model.load(args.pretrained)
|
| 31 |
+
return model
|
| 32 |
+
|
| 33 |
+
return YOLO(args.weights)
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def train(args: argparse.Namespace) -> None:
|
| 37 |
+
data_yaml = Path(args.data_yaml) if args.data_yaml else prepare_dataset(args.root, args.yolo_dir, limit=args.limit)
|
| 38 |
+
model = load_model(args)
|
| 39 |
+
model.train(
|
| 40 |
+
data=str(data_yaml),
|
| 41 |
+
epochs=args.epochs,
|
| 42 |
+
imgsz=args.imgsz,
|
| 43 |
+
batch=args.batch_size,
|
| 44 |
+
project=args.project,
|
| 45 |
+
name=args.name,
|
| 46 |
+
device=args.device,
|
| 47 |
+
patience=args.patience,
|
| 48 |
+
workers=args.workers,
|
| 49 |
+
)
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def parse_args() -> argparse.Namespace:
|
| 53 |
+
parser = argparse.ArgumentParser(description="Train YOLOv8/YOLOv10 Varroa models with Ultralytics.")
|
| 54 |
+
parser.add_argument("--root", default=".", help="Repo root containing train/val/test folders.")
|
| 55 |
+
parser.add_argument("--yolo-dir", default="yolo_related/datasets/varroa_yolo")
|
| 56 |
+
parser.add_argument("--data-yaml", default=None, help="Use an existing Ultralytics dataset YAML.")
|
| 57 |
+
parser.add_argument("--limit", type=int, default=0, help="Optional max images per split during conversion.")
|
| 58 |
+
|
| 59 |
+
model_group = parser.add_argument_group("model")
|
| 60 |
+
model_group.add_argument("--weights", default="yolov8n.pt", help="Baseline pretrained model, e.g. yolov8n.pt.")
|
| 61 |
+
model_group.add_argument("--model-yaml", default=None, help="Custom architecture YAML.")
|
| 62 |
+
model_group.add_argument("--pretrained", default=None, help="Weights to partial-load into --model-yaml.")
|
| 63 |
+
|
| 64 |
+
train_group = parser.add_argument_group("training")
|
| 65 |
+
train_group.add_argument("--epochs", type=int, default=100)
|
| 66 |
+
train_group.add_argument("--imgsz", type=int, default=640)
|
| 67 |
+
train_group.add_argument("--batch-size", type=int, default=4)
|
| 68 |
+
train_group.add_argument("--project", default="yolo_related/runs/train")
|
| 69 |
+
train_group.add_argument("--name", default="yolov8n_varroa_cpu")
|
| 70 |
+
train_group.add_argument("--patience", type=int, default=20)
|
| 71 |
+
train_group.add_argument("--workers", type=int, default=2)
|
| 72 |
+
train_group.add_argument("--device", default="cpu", help="Defaults to CPU because this project target has no GPU.")
|
| 73 |
+
return parser.parse_args()
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
def main() -> None:
|
| 77 |
+
train(parse_args())
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
if __name__ == "__main__":
|
| 81 |
+
main()
|
models_related/ultralytics/.dockerignore
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Python
|
| 2 |
+
__pycache__
|
| 3 |
+
*.pyc
|
| 4 |
+
*.pyo
|
| 5 |
+
*.pyd
|
| 6 |
+
.Python
|
| 7 |
+
*.py[cod]
|
| 8 |
+
*$py.class
|
| 9 |
+
.pytest_cache
|
| 10 |
+
.coverage
|
| 11 |
+
coverage.xml
|
| 12 |
+
.ruff_cache
|
| 13 |
+
*.egg-info
|
| 14 |
+
dist
|
| 15 |
+
build
|
| 16 |
+
|
| 17 |
+
# Development
|
| 18 |
+
.env
|
| 19 |
+
.venv
|
| 20 |
+
env/
|
| 21 |
+
venv/
|
| 22 |
+
ENV/
|
| 23 |
+
.idea
|
| 24 |
+
.vscode
|
| 25 |
+
*.swp
|
| 26 |
+
*.swo
|
| 27 |
+
.DS_Store
|
| 28 |
+
|
| 29 |
+
# Project specific
|
| 30 |
+
*.log
|
| 31 |
+
benchmarks.log
|
| 32 |
+
runs/
|
| 33 |
+
|
| 34 |
+
# Dependencies
|
| 35 |
+
node_modules/
|
models_related/ultralytics/.gitignore
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Byte-compiled / optimized / DLL files
|
| 2 |
+
__pycache__/
|
| 3 |
+
*.py[cod]
|
| 4 |
+
*$py.class
|
| 5 |
+
|
| 6 |
+
# C extensions
|
| 7 |
+
*.so
|
| 8 |
+
|
| 9 |
+
# Distribution / packaging
|
| 10 |
+
.Python
|
| 11 |
+
build/
|
| 12 |
+
develop-eggs/
|
| 13 |
+
dist/
|
| 14 |
+
downloads/
|
| 15 |
+
eggs/
|
| 16 |
+
.eggs/
|
| 17 |
+
lib/
|
| 18 |
+
lib64/
|
| 19 |
+
parts/
|
| 20 |
+
sdist/
|
| 21 |
+
var/
|
| 22 |
+
wheels/
|
| 23 |
+
pip-wheel-metadata/
|
| 24 |
+
share/python-wheels/
|
| 25 |
+
*.egg-info/
|
| 26 |
+
.installed.cfg
|
| 27 |
+
*.egg
|
| 28 |
+
MANIFEST
|
| 29 |
+
requirements.txt
|
| 30 |
+
!examples/**/requirements.txt
|
| 31 |
+
setup.py
|
| 32 |
+
ultralytics.egg-info
|
| 33 |
+
|
| 34 |
+
# PyInstaller
|
| 35 |
+
# Usually these files are written by a python script from a template
|
| 36 |
+
# before PyInstaller builds the exe, so as to inject date/other info into it.
|
| 37 |
+
*.manifest
|
| 38 |
+
*.spec
|
| 39 |
+
|
| 40 |
+
# Installer logs
|
| 41 |
+
pip-log.txt
|
| 42 |
+
pip-delete-this-directory.txt
|
| 43 |
+
|
| 44 |
+
# Unit test / coverage reports
|
| 45 |
+
htmlcov/
|
| 46 |
+
.tox/
|
| 47 |
+
.nox/
|
| 48 |
+
.coverage
|
| 49 |
+
.coverage.*
|
| 50 |
+
.cache
|
| 51 |
+
nosetests.xml
|
| 52 |
+
coverage.xml
|
| 53 |
+
*.cover
|
| 54 |
+
*.py,cover
|
| 55 |
+
.hypothesis/
|
| 56 |
+
.pytest_cache/
|
| 57 |
+
mlruns/
|
| 58 |
+
|
| 59 |
+
# Translations
|
| 60 |
+
*.mo
|
| 61 |
+
*.pot
|
| 62 |
+
|
| 63 |
+
# Django stuff:
|
| 64 |
+
*.log
|
| 65 |
+
local_settings.py
|
| 66 |
+
db.sqlite3
|
| 67 |
+
db.sqlite3-journal
|
| 68 |
+
|
| 69 |
+
# Flask stuff:
|
| 70 |
+
instance/
|
| 71 |
+
.webassets-cache
|
| 72 |
+
|
| 73 |
+
# Scrapy stuff:
|
| 74 |
+
.scrapy
|
| 75 |
+
|
| 76 |
+
# Sphinx documentation
|
| 77 |
+
docs/_build/
|
| 78 |
+
|
| 79 |
+
# PyBuilder
|
| 80 |
+
target/
|
| 81 |
+
|
| 82 |
+
# Jupyter Notebook
|
| 83 |
+
.ipynb_checkpoints
|
| 84 |
+
|
| 85 |
+
# IPython
|
| 86 |
+
profile_default/
|
| 87 |
+
ipython_config.py
|
| 88 |
+
|
| 89 |
+
# Profiling
|
| 90 |
+
*.pclprof
|
| 91 |
+
|
| 92 |
+
# pyenv
|
| 93 |
+
.python-version
|
| 94 |
+
|
| 95 |
+
# pipenv
|
| 96 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
| 97 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
| 98 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
| 99 |
+
# install all needed dependencies.
|
| 100 |
+
#Pipfile.lock
|
| 101 |
+
|
| 102 |
+
# UV
|
| 103 |
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
| 104 |
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
| 105 |
+
# commonly ignored for libraries.
|
| 106 |
+
uv.lock
|
| 107 |
+
|
| 108 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
| 109 |
+
__pypackages__/
|
| 110 |
+
|
| 111 |
+
# Celery stuff
|
| 112 |
+
celerybeat-schedule
|
| 113 |
+
celerybeat.pid
|
| 114 |
+
|
| 115 |
+
# SageMath parsed files
|
| 116 |
+
*.sage.py
|
| 117 |
+
|
| 118 |
+
# Environments
|
| 119 |
+
.env
|
| 120 |
+
.venv
|
| 121 |
+
.idea
|
| 122 |
+
env/
|
| 123 |
+
venv/
|
| 124 |
+
ENV/
|
| 125 |
+
env.bak/
|
| 126 |
+
venv.bak/
|
| 127 |
+
|
| 128 |
+
# Spyder project settings
|
| 129 |
+
.spyderproject
|
| 130 |
+
.spyproject
|
| 131 |
+
|
| 132 |
+
# VSCode project settings
|
| 133 |
+
.vscode/
|
| 134 |
+
.devcontainer/
|
| 135 |
+
|
| 136 |
+
# Rope project settings
|
| 137 |
+
.ropeproject
|
| 138 |
+
|
| 139 |
+
# mkdocs documentation
|
| 140 |
+
/site
|
| 141 |
+
|
| 142 |
+
# mypy
|
| 143 |
+
.mypy_cache/
|
| 144 |
+
.dmypy.json
|
| 145 |
+
dmypy.json
|
| 146 |
+
|
| 147 |
+
# Pyre type checker
|
| 148 |
+
.pyre/
|
| 149 |
+
|
| 150 |
+
# datasets and projects (ignore /datasets dir at root only to allow for docs/en/datasets dir)
|
| 151 |
+
/datasets
|
| 152 |
+
runs/
|
| 153 |
+
wandb/
|
| 154 |
+
.DS_Store
|
| 155 |
+
|
| 156 |
+
# Neural Network weights -----------------------------------------------------------------------------------------------
|
| 157 |
+
weights/
|
| 158 |
+
*.weights
|
| 159 |
+
*.pt
|
| 160 |
+
*.ts
|
| 161 |
+
*.pb
|
| 162 |
+
*.onnx
|
| 163 |
+
*.engine
|
| 164 |
+
*.mlmodel
|
| 165 |
+
*.mlpackage
|
| 166 |
+
*.torchscript
|
| 167 |
+
*.tflite
|
| 168 |
+
*.h5
|
| 169 |
+
*.mnn
|
| 170 |
+
*_saved_model/
|
| 171 |
+
*_web_model/
|
| 172 |
+
*_openvino_model/
|
| 173 |
+
*_paddle_model/
|
| 174 |
+
*_ncnn_model/
|
| 175 |
+
*_imx_model/
|
| 176 |
+
pnnx*
|
| 177 |
+
*.rknn
|
| 178 |
+
|
| 179 |
+
# Autogenerated files for tests
|
| 180 |
+
/ultralytics/assets/
|
| 181 |
+
|
| 182 |
+
# calibration image
|
| 183 |
+
calibration_*.npy
|
| 184 |
+
|
| 185 |
+
# Videos and Pictures
|
| 186 |
+
*.mp4
|
| 187 |
+
*.avi
|
| 188 |
+
*.mov
|
| 189 |
+
*.mkv
|
| 190 |
+
*.webm
|
| 191 |
+
*.jpg
|
| 192 |
+
*.jpeg
|
| 193 |
+
*.png
|
| 194 |
+
*.bmp
|
| 195 |
+
*.tiff
|
| 196 |
+
*.gif
|
| 197 |
+
*.svg
|
| 198 |
+
*.webp
|
| 199 |
+
*.heic
|
| 200 |
+
*.ico
|
| 201 |
+
*.raw
|
| 202 |
+
|
| 203 |
+
# Training logs
|
| 204 |
+
args.yaml
|
| 205 |
+
results.csv
|
| 206 |
+
|
| 207 |
+
# CI test asset cache
|
| 208 |
+
.ultralytics_cache/
|
models_related/ultralytics/CITATION.cff
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This CITATION.cff file was generated with https://bit.ly/cffinit
|
| 2 |
+
|
| 3 |
+
cff-version: 1.2.0
|
| 4 |
+
title: Ultralytics YOLO
|
| 5 |
+
message: >-
|
| 6 |
+
If you use this software, please cite it using the
|
| 7 |
+
metadata from this file.
|
| 8 |
+
type: software
|
| 9 |
+
authors:
|
| 10 |
+
- given-names: Glenn
|
| 11 |
+
family-names: Jocher
|
| 12 |
+
affiliation: Ultralytics
|
| 13 |
+
orcid: "https://orcid.org/0000-0001-5950-6979"
|
| 14 |
+
- family-names: Qiu
|
| 15 |
+
given-names: Jing
|
| 16 |
+
affiliation: Ultralytics
|
| 17 |
+
orcid: "https://orcid.org/0000-0003-3783-7069"
|
| 18 |
+
- given-names: Ayush
|
| 19 |
+
family-names: Chaurasia
|
| 20 |
+
affiliation: Ultralytics
|
| 21 |
+
orcid: "https://orcid.org/0000-0002-7603-6750"
|
| 22 |
+
repository-code: "https://github.com/ultralytics/ultralytics"
|
| 23 |
+
url: "https://ultralytics.com"
|
| 24 |
+
license: AGPL-3.0
|
| 25 |
+
version: 8.0.0
|
| 26 |
+
date-released: "2023-01-10"
|
| 27 |
+
preferred-citation:
|
| 28 |
+
type: article
|
| 29 |
+
title: "Ultralytics YOLO26: Unified Real-Time End-to-End Vision Models"
|
| 30 |
+
authors:
|
| 31 |
+
- given-names: Glenn
|
| 32 |
+
family-names: Jocher
|
| 33 |
+
affiliation: Ultralytics
|
| 34 |
+
orcid: "https://orcid.org/0000-0001-5950-6979"
|
| 35 |
+
- given-names: Jing
|
| 36 |
+
family-names: Qiu
|
| 37 |
+
affiliation: Ultralytics
|
| 38 |
+
orcid: "https://orcid.org/0000-0003-3783-7069"
|
| 39 |
+
- given-names: Mengyu
|
| 40 |
+
family-names: Liu
|
| 41 |
+
affiliation: Ultralytics
|
| 42 |
+
- given-names: Shuai
|
| 43 |
+
family-names: Lyu
|
| 44 |
+
affiliation: Ultralytics
|
| 45 |
+
- given-names: Fatih Cagatay
|
| 46 |
+
family-names: Akyon
|
| 47 |
+
affiliation: Ultralytics
|
| 48 |
+
- given-names: Muhammet Esat
|
| 49 |
+
family-names: Kalfaoglu
|
| 50 |
+
affiliation: Ultralytics
|
| 51 |
+
doi: "10.48550/arXiv.2606.03748"
|
| 52 |
+
url: "https://arxiv.org/abs/2606.03748"
|
| 53 |
+
year: 2026
|
models_related/ultralytics/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<a href="https://www.ultralytics.com/" target="_blank"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a>
|
| 2 |
+
|
| 3 |
+
# Contributing to Ultralytics Open-Source Projects
|
| 4 |
+
|
| 5 |
+
Welcome! We're thrilled that you're considering contributing to our [Ultralytics](https://www.ultralytics.com/) [open-source](https://github.com/ultralytics) projects. Your involvement not only helps enhance the quality of our repositories but also benefits the entire [computer vision](https://www.ultralytics.com/glossary/computer-vision-cv) community. This guide provides clear guidelines and best practices to help you get started.
|
| 6 |
+
|
| 7 |
+
[](https://github.com/ultralytics/ultralytics/graphs/contributors)
|
| 8 |
+
|
| 9 |
+
## 🤝 Code of Conduct
|
| 10 |
+
|
| 11 |
+
To ensure a welcoming and inclusive environment for everyone, all contributors must adhere to our [Code of Conduct](https://docs.ultralytics.com/help/code-of-conduct). **Respect**, **kindness**, and **professionalism** are at the heart of our community.
|
| 12 |
+
|
| 13 |
+
## 🚀 Contributing via Pull Requests
|
| 14 |
+
|
| 15 |
+
We greatly appreciate contributions in the form of [pull requests (PRs)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests). To make the review process as smooth as possible, please follow these steps:
|
| 16 |
+
|
| 17 |
+
1. **[Fork the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo):** Start by forking the relevant Ultralytics repository (e.g., [ultralytics/ultralytics](https://github.com/ultralytics/ultralytics)) to your GitHub account.
|
| 18 |
+
2. **[Create a branch](https://docs.github.com/en/desktop/making-changes-in-a-branch/managing-branches-in-github-desktop):** Create a new branch in your forked repository with a clear, descriptive name reflecting your changes (e.g., `fix-issue-123`, `add-feature-xyz`).
|
| 19 |
+
3. **Make your changes:** Implement your improvements or fixes. Ensure your code adheres to the project's style guidelines and doesn't introduce new errors or warnings.
|
| 20 |
+
4. **Test your changes:** Before submitting, test your changes locally to confirm they work as expected and don't cause [regressions](https://en.wikipedia.org/wiki/Software_regression). Add tests if you're introducing new functionality.
|
| 21 |
+
5. **[Commit your changes](https://docs.github.com/en/desktop/making-changes-in-a-branch/committing-and-reviewing-changes-to-your-project-in-github-desktop):** Commit your changes with concise and descriptive commit messages. If your changes address a specific issue, include the issue number (e.g., `Fix #123: Corrected calculation error.`).
|
| 22 |
+
6. **[Create a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request):** Submit a pull request from your branch to the `main` branch of the original Ultralytics repository. Provide a clear title and a detailed description explaining the purpose and scope of your changes.
|
| 23 |
+
|
| 24 |
+
### 📏 Contribution Scope & PR Size Guidelines
|
| 25 |
+
|
| 26 |
+
#### First-time Contributors
|
| 27 |
+
|
| 28 |
+
First-time contributors are expected to submit small, well-scoped pull requests. Large PRs (more than ~50 lines of change) are generally not accepted at this stage, except when the size is driven primarily by docstrings, documentation, or formatting rather than substantive code changes. Contributions should focus on speed improvements, bug fixes, documentation updates, and other minor issues. Feature PRs are not encouraged for first-time contributors. However, if you still wish to contribute a feature, follow the guidelines outlined in the [Feature PRs](#feature-prs) section below.
|
| 29 |
+
|
| 30 |
+
#### Established Contributors
|
| 31 |
+
|
| 32 |
+
Pull requests from established contributors generally receive higher review priority. Actions and results are fundamental to the [Ultralytics Mission & Values](https://handbook.ultralytics.com/mission-vision-values). There is no specific threshold to becoming an 'established contributor' as it's impossible to fit all individuals to the same standard. The Ultralytics Team notices those who make consistent, high-quality contributions that follow the Ultralytics standards.
|
| 33 |
+
|
| 34 |
+
Following our [contributing guidelines](./CONTRIBUTING.md) and [our Development Workflow](https://handbook.ultralytics.com/workflows/development) is the best way to improve your chances for your work to be reviewed, accepted, and/or recognized; this is not a guarantee. In addition, contributors with a strong track record of meaningful contributions to notable open-source projects may be treated as established contributors, even if they are technically first-time contributors to Ultralytics.
|
| 35 |
+
|
| 36 |
+
#### Feature PRs
|
| 37 |
+
|
| 38 |
+
Feature pull requests must be preceded by a feature request GitHub issue that has been sufficiently discussed and explicitly approved by the maintainers. This process helps avoid unnecessary effort on changes that are unlikely to be merged. Even after approval, feature PRs are expected to remain well-scoped and focused. All feature contributions are evaluated with attention to long-term maintenance costs and their overall usefulness to the Ultralytics user base.
|
| 39 |
+
|
| 40 |
+
#### PR Size and Review Time
|
| 41 |
+
|
| 42 |
+
The larger the proposed changes to the code, the longer the review process will take. Smaller, narrowly-scoped PRs that align with the style and structure of the Ultralytics codebase have significantly higher likelihood of timely review and merge.
|
| 43 |
+
|
| 44 |
+
### 📝 CLA Signing
|
| 45 |
+
|
| 46 |
+
Before we can merge your pull request, you must sign our [Contributor License Agreement (CLA)](https://docs.ultralytics.com/help/CLA). This legal agreement ensures that your contributions are properly licensed, allowing the project to continue being distributed under the [AGPL-3.0 license](https://www.ultralytics.com/legal/agpl-3-0-software-license).
|
| 47 |
+
|
| 48 |
+
After submitting your pull request, the CLA bot will guide you through the signing process. To sign the CLA, simply add a comment in your PR stating:
|
| 49 |
+
|
| 50 |
+
```text
|
| 51 |
+
I have read the CLA Document and I sign the CLA
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
### ✍️ Google-Style Docstrings
|
| 55 |
+
|
| 56 |
+
When adding new functions or classes, please include [Google-style docstrings](https://google.github.io/styleguide/pyguide.html). These docstrings provide clear, standardized documentation that helps other developers understand and maintain your code.
|
| 57 |
+
|
| 58 |
+
#### Example Google-style
|
| 59 |
+
|
| 60 |
+
This example illustrates a Google-style docstring. Ensure that both input and output `types` are always enclosed in parentheses, e.g., `(bool)`.
|
| 61 |
+
|
| 62 |
+
```python
|
| 63 |
+
def example_function(arg1, arg2=4):
|
| 64 |
+
"""Example function demonstrating Google-style docstrings.
|
| 65 |
+
|
| 66 |
+
Args:
|
| 67 |
+
arg1 (int): The first argument.
|
| 68 |
+
arg2 (int): The second argument, with a default value of 4.
|
| 69 |
+
|
| 70 |
+
Returns:
|
| 71 |
+
(bool): True if successful, False otherwise.
|
| 72 |
+
|
| 73 |
+
Examples:
|
| 74 |
+
>>> result = example_function(1, 2) # returns False
|
| 75 |
+
"""
|
| 76 |
+
if arg1 == arg2:
|
| 77 |
+
return True
|
| 78 |
+
return False
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
#### Example Google-style with type hints
|
| 82 |
+
|
| 83 |
+
This example includes both a Google-style docstring and [type hints](https://docs.python.org/3/library/typing.html) for arguments and returns, though using either independently is also acceptable.
|
| 84 |
+
|
| 85 |
+
```python
|
| 86 |
+
def example_function(arg1: int, arg2: int = 4) -> bool:
|
| 87 |
+
"""Example function demonstrating Google-style docstrings.
|
| 88 |
+
|
| 89 |
+
Args:
|
| 90 |
+
arg1: The first argument.
|
| 91 |
+
arg2: The second argument, with a default value of 4.
|
| 92 |
+
|
| 93 |
+
Returns:
|
| 94 |
+
True if successful, False otherwise.
|
| 95 |
+
|
| 96 |
+
Examples:
|
| 97 |
+
>>> result = example_function(1, 2) # returns False
|
| 98 |
+
"""
|
| 99 |
+
if arg1 == arg2:
|
| 100 |
+
return True
|
| 101 |
+
return False
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
#### Example Single-line
|
| 105 |
+
|
| 106 |
+
For smaller or simpler functions, a single-line docstring may be sufficient. The docstring must use three double-quotes, be a complete sentence, start with a capital letter, and end with a period.
|
| 107 |
+
|
| 108 |
+
```python
|
| 109 |
+
def example_small_function(arg1: int, arg2: int = 4) -> bool:
|
| 110 |
+
"""Example function with a single-line docstring."""
|
| 111 |
+
return arg1 == arg2
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
### ✅ GitHub Actions CI Tests
|
| 115 |
+
|
| 116 |
+
All pull requests must pass the [GitHub Actions](https://github.com/features/actions) [Continuous Integration](https://docs.ultralytics.com/help/CI) (CI) tests before they can be merged. These tests include linting, unit tests, and other checks to ensure that your changes meet the project's quality standards. Review the CI output and address any issues that arise.
|
| 117 |
+
|
| 118 |
+
## ✨ Best Practices for Code Contributions
|
| 119 |
+
|
| 120 |
+
When contributing code to Ultralytics projects, keep these best practices in mind:
|
| 121 |
+
|
| 122 |
+
- **Avoid code duplication:** Reuse existing code wherever possible and minimize unnecessary arguments.
|
| 123 |
+
- **Make smaller, focused changes:** Focus on targeted modifications rather than large-scale changes. Smaller, narrow-scope pull requests are easier to review, less error-prone, and have a higher chance of being merged.
|
| 124 |
+
- **Simplify when possible:** Look for opportunities to simplify the code or remove unnecessary parts.
|
| 125 |
+
- **Consider compatibility:** Before making changes, consider whether they might break existing code using Ultralytics.
|
| 126 |
+
- **Use consistent formatting:** Tools like [Ruff Formatter](https://github.com/astral-sh/ruff) can help maintain stylistic consistency.
|
| 127 |
+
- **Add appropriate tests:** Include [tests](https://docs.ultralytics.com/guides/model-testing) for new features to ensure they work as expected. New tests should be added to existing test files rather than creating new test files. Tests do not need to be exhaustive, but must be able to reasonably confirm correct behavior and detect regressions.
|
| 128 |
+
|
| 129 |
+
## 👀 Reviewing Pull Requests
|
| 130 |
+
|
| 131 |
+
Reviewing pull requests is another valuable way to contribute. When reviewing PRs:
|
| 132 |
+
|
| 133 |
+
- **Check for unit tests:** Verify that the PR includes tests for new features or changes.
|
| 134 |
+
- **Review documentation updates:** Ensure [documentation](https://docs.ultralytics.com/) is updated to reflect changes.
|
| 135 |
+
- **Evaluate performance impact:** Consider how changes might affect [performance](https://docs.ultralytics.com/guides/yolo-performance-metrics).
|
| 136 |
+
- **Verify CI tests:** Confirm all [Continuous Integration tests](https://docs.ultralytics.com/help/CI) are passing.
|
| 137 |
+
- **Provide constructive feedback:** Offer specific, clear feedback about any issues or concerns.
|
| 138 |
+
- **Recognize effort:** Acknowledge the author's work to maintain a positive collaborative atmosphere.
|
| 139 |
+
|
| 140 |
+
### 🤖 Automated Review
|
| 141 |
+
|
| 142 |
+
All pull requests undergo an automatic review by Ultralytics Assistant. Each suggestion from Ultralytics Assistant includes an associated level of importance. Contributors are expected to review all suggestions and either apply them or explicitly explain in a PR comment why a given suggestion is not applicable or should not be adopted.
|
| 143 |
+
|
| 144 |
+
If needed, you may re-request a review from Ultralytics Assistant via the GitHub reviewers panel.
|
| 145 |
+
|
| 146 |
+
## 🐞 Reporting Bugs
|
| 147 |
+
|
| 148 |
+
We highly value bug reports as they help us improve the quality and reliability of our projects. When reporting a bug via [GitHub Issues](https://github.com/ultralytics/ultralytics/issues):
|
| 149 |
+
|
| 150 |
+
- **Check existing issues:** Search first to see if the bug has already been reported.
|
| 151 |
+
- **Provide a [Minimum Reproducible Example](https://docs.ultralytics.com/help/minimum-reproducible-example/):** Create a small, self-contained code snippet that consistently reproduces the issue. This is crucial for efficient debugging.
|
| 152 |
+
- **Describe the environment:** Specify your operating system, Python version, relevant library versions (e.g., [`torch`](https://pytorch.org/), [`ultralytics`](https://github.com/ultralytics/ultralytics)), and hardware ([CPU](https://en.wikipedia.org/wiki/Central_processing_unit)/[GPU](https://www.ultralytics.com/glossary/gpu-graphics-processing-unit)).
|
| 153 |
+
- **Explain expected vs. actual behavior:** Clearly state what you expected to happen and what actually occurred. Include any error messages or tracebacks.
|
| 154 |
+
|
| 155 |
+
## 📜 License
|
| 156 |
+
|
| 157 |
+
Ultralytics uses the [GNU Affero General Public License v3.0 (AGPL-3.0)](https://www.ultralytics.com/legal/agpl-3-0-software-license) for its repositories. This license promotes [openness](https://en.wikipedia.org/wiki/Openness), [transparency](https://www.ultralytics.com/glossary/transparency-in-ai), and [collaborative improvement](https://en.wikipedia.org/wiki/Collaborative_software) in software development. It ensures that all users have the freedom to use, modify, and share the software, fostering a strong community of collaboration and innovation.
|
| 158 |
+
|
| 159 |
+
We encourage all contributors to familiarize themselves with the terms of the [AGPL-3.0 license](https://opensource.org/license/agpl-3.0) to contribute effectively and ethically to the Ultralytics open-source community.
|
| 160 |
+
|
| 161 |
+
## 🌍 Open-Sourcing Your YOLO Project Under AGPL-3.0
|
| 162 |
+
|
| 163 |
+
Using Ultralytics YOLO models or code in your project? The [AGPL-3.0 license](https://opensource.org/license/agpl-3.0) requires that your entire derivative work also be open-sourced under AGPL-3.0. This ensures modifications and larger projects built upon open-source foundations remain open.
|
| 164 |
+
|
| 165 |
+
### Why AGPL-3.0 Compliance Matters
|
| 166 |
+
|
| 167 |
+
- **Keeps Software Open:** Ensures that improvements and derivative works benefit the community.
|
| 168 |
+
- **Legal Requirement:** Using AGPL-3.0 licensed code binds your project to its terms.
|
| 169 |
+
- **Fosters Collaboration:** Encourages sharing and transparency.
|
| 170 |
+
|
| 171 |
+
If you prefer not to open-source your project, consider obtaining an [Enterprise License](https://www.ultralytics.com/license).
|
| 172 |
+
|
| 173 |
+
### How to Comply with AGPL-3.0
|
| 174 |
+
|
| 175 |
+
Complying means making the **complete corresponding source code** of your project publicly available under the AGPL-3.0 license.
|
| 176 |
+
|
| 177 |
+
1. **Choose Your Starting Point:**
|
| 178 |
+
- **Fork Ultralytics YOLO:** Directly fork the [Ultralytics YOLO repository](https://github.com/ultralytics/ultralytics) if building closely upon it.
|
| 179 |
+
- **Use Ultralytics Template:** Start with the [Ultralytics template repository](https://github.com/ultralytics/template) for a clean, modular setup integrating YOLO.
|
| 180 |
+
|
| 181 |
+
2. **License Your Project:**
|
| 182 |
+
- Add a `LICENSE` file containing the full text of the [AGPL-3.0 license](https://opensource.org/license/agpl-3.0).
|
| 183 |
+
- Add a notice at the top of each source file indicating the license.
|
| 184 |
+
|
| 185 |
+
3. **Publish Your Source Code:**
|
| 186 |
+
- Make your **entire project's source code** publicly accessible (e.g., on GitHub). This includes:
|
| 187 |
+
- The complete larger application or system that incorporates the YOLO model or code.
|
| 188 |
+
- Any modifications made to the original Ultralytics YOLO code.
|
| 189 |
+
- Scripts for training, validation, inference.
|
| 190 |
+
- [Model weights](https://www.ultralytics.com/glossary/model-weights) if modified or fine-tuned.
|
| 191 |
+
- [Configuration files](https://docs.ultralytics.com/usage/cfg), environment setups (`requirements.txt`, [`Dockerfiles`](https://docs.docker.com/reference/dockerfile/)).
|
| 192 |
+
- Backend and frontend code if it's part of a [web application](https://en.wikipedia.org/wiki/Web_application).
|
| 193 |
+
- Any [third-party libraries](<https://en.wikipedia.org/wiki/Library_(computing)#Third-party>) you've modified.
|
| 194 |
+
- [Training data](https://www.ultralytics.com/glossary/training-data) if required to run/retrain _and_ redistributable.
|
| 195 |
+
|
| 196 |
+
4. **Document Clearly:**
|
| 197 |
+
- Update your `README.md` to state that the project is licensed under AGPL-3.0.
|
| 198 |
+
- Include clear instructions on how to set up, build, and run your project from the source code.
|
| 199 |
+
- Attribute Ultralytics YOLO appropriately, linking back to the [original repository](https://github.com/ultralytics/ultralytics). Example:
|
| 200 |
+
```markdown
|
| 201 |
+
This project utilizes code from [Ultralytics YOLO](https://github.com/ultralytics/ultralytics), licensed under AGPL-3.0.
|
| 202 |
+
```
|
| 203 |
+
|
| 204 |
+
### Example Repository Structure
|
| 205 |
+
|
| 206 |
+
Refer to the [Ultralytics Template Repository](https://github.com/ultralytics/template) for a practical example structure:
|
| 207 |
+
|
| 208 |
+
```
|
| 209 |
+
my-yolo-project/
|
| 210 |
+
│
|
| 211 |
+
├── LICENSE # Full AGPL-3.0 license text
|
| 212 |
+
├── README.md # Project description, setup, usage, license info & attribution
|
| 213 |
+
├── pyproject.toml # Dependencies (or requirements.txt)
|
| 214 |
+
├── scripts/ # Training/inference scripts
|
| 215 |
+
│ └── train.py
|
| 216 |
+
├── src/ # Your project's source code
|
| 217 |
+
│ ├── __init__.py
|
| 218 |
+
│ ├── data_loader.py
|
| 219 |
+
│ └── model_wrapper.py # Code interacting with YOLO
|
| 220 |
+
├── tests/ # Unit/integration tests
|
| 221 |
+
├── configs/ # YAML/JSON config files
|
| 222 |
+
├── docker/ # Dockerfiles, if used
|
| 223 |
+
│ └── Dockerfile
|
| 224 |
+
└── .github/ # GitHub specific files (e.g., workflows for CI)
|
| 225 |
+
└── workflows/
|
| 226 |
+
└── ci.yml
|
| 227 |
+
```
|
| 228 |
+
|
| 229 |
+
By following these guidelines, you ensure compliance with AGPL-3.0, supporting the open-source ecosystem that enables powerful tools like Ultralytics YOLO.
|
| 230 |
+
|
| 231 |
+
## 🎉 Conclusion
|
| 232 |
+
|
| 233 |
+
Thank you for your interest in contributing to [Ultralytics](https://www.ultralytics.com/) [open-source](https://github.com/ultralytics) YOLO projects. Your participation is essential in shaping the future of our software and building a vibrant community of innovation and collaboration. Whether you're enhancing code, reporting bugs, or suggesting new features, your contributions are invaluable.
|
| 234 |
+
|
| 235 |
+
We're excited to see your ideas come to life and appreciate your commitment to advancing [object detection](https://www.ultralytics.com/glossary/object-detection) technology. Together, let's continue to grow and innovate in this exciting open-source journey. Happy coding! 🚀🌟
|
| 236 |
+
|
| 237 |
+
## FAQ
|
| 238 |
+
|
| 239 |
+
### Why should I contribute to Ultralytics YOLO open-source repositories?
|
| 240 |
+
|
| 241 |
+
Contributing to Ultralytics YOLO open-source repositories improves the software, making it more robust and feature-rich for the entire community. Contributions can include code enhancements, bug fixes, documentation improvements, and new feature implementations. Additionally, contributing allows you to collaborate with other skilled developers and experts in the field, enhancing your own skills and reputation. For details on how to get started, refer to the [Contributing via Pull Requests](#-contributing-via-pull-requests) section.
|
| 242 |
+
|
| 243 |
+
### How do I sign the Contributor License Agreement (CLA) for Ultralytics YOLO?
|
| 244 |
+
|
| 245 |
+
To sign the Contributor License Agreement (CLA), follow the instructions provided by the CLA bot after submitting your pull request. This process ensures that your contributions are properly licensed under the AGPL-3.0 license, maintaining the legal integrity of the open-source project. Add a comment in your pull request stating:
|
| 246 |
+
|
| 247 |
+
```text
|
| 248 |
+
I have read the CLA Document and I sign the CLA
|
| 249 |
+
```
|
| 250 |
+
|
| 251 |
+
For more information, see the [CLA Signing](#-cla-signing) section.
|
| 252 |
+
|
| 253 |
+
### What are Google-style docstrings, and why are they required for Ultralytics YOLO contributions?
|
| 254 |
+
|
| 255 |
+
Google-style docstrings provide clear, concise documentation for functions and classes, improving code readability and maintainability. These docstrings outline the function's purpose, arguments, and return values with specific formatting rules. When contributing to Ultralytics YOLO, following Google-style docstrings ensures that your additions are well-documented and easily understood. For examples and guidelines, visit the [Google-Style Docstrings](#-google-style-docstrings) section.
|
| 256 |
+
|
| 257 |
+
### How can I ensure my changes pass the GitHub Actions CI tests?
|
| 258 |
+
|
| 259 |
+
Before your pull request can be merged, it must pass all GitHub Actions Continuous Integration (CI) tests. These tests include linting, unit tests, and other checks to ensure the code meets the project's quality standards. Review the CI output and fix any issues. For detailed information on the CI process and troubleshooting tips, see the [GitHub Actions CI Tests](#-github-actions-ci-tests) section.
|
| 260 |
+
|
| 261 |
+
### How do I report a bug in Ultralytics YOLO repositories?
|
| 262 |
+
|
| 263 |
+
To report a bug, provide a clear and concise [Minimum Reproducible Example](https://docs.ultralytics.com/help/minimum-reproducible-example/) along with your bug report. This helps developers quickly identify and fix the issue. Ensure your example is minimal yet sufficient to replicate the problem. For more detailed steps on reporting bugs, refer to the [Reporting Bugs](#-reporting-bugs) section.
|
| 264 |
+
|
| 265 |
+
### What does the AGPL-3.0 license mean if I use Ultralytics YOLO in my own project?
|
| 266 |
+
|
| 267 |
+
If you use Ultralytics YOLO code or models (licensed under AGPL-3.0) in your project, the AGPL-3.0 license requires that your entire project (the derivative work) must also be licensed under AGPL-3.0 and its complete source code must be made publicly available. This ensures that the open-source nature of the software is preserved throughout its derivatives. If you cannot meet these requirements, you need to obtain an [Enterprise License](https://www.ultralytics.com/license). See the [Open-Sourcing Your Project](#-open-sourcing-your-yolo-project-under-agpl-30) section for details.
|
models_related/ultralytics/LICENSE
ADDED
|
@@ -0,0 +1,661 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
GNU AFFERO GENERAL PUBLIC LICENSE
|
| 2 |
+
Version 3, 19 November 2007
|
| 3 |
+
|
| 4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
| 5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
| 6 |
+
of this license document, but changing it is not allowed.
|
| 7 |
+
|
| 8 |
+
Preamble
|
| 9 |
+
|
| 10 |
+
The GNU Affero General Public License is a free, copyleft license for
|
| 11 |
+
software and other kinds of works, specifically designed to ensure
|
| 12 |
+
cooperation with the community in the case of network server software.
|
| 13 |
+
|
| 14 |
+
The licenses for most software and other practical works are designed
|
| 15 |
+
to take away your freedom to share and change the works. By contrast,
|
| 16 |
+
our General Public Licenses are intended to guarantee your freedom to
|
| 17 |
+
share and change all versions of a program--to make sure it remains free
|
| 18 |
+
software for all its users.
|
| 19 |
+
|
| 20 |
+
When we speak of free software, we are referring to freedom, not
|
| 21 |
+
price. Our General Public Licenses are designed to make sure that you
|
| 22 |
+
have the freedom to distribute copies of free software (and charge for
|
| 23 |
+
them if you wish), that you receive source code or can get it if you
|
| 24 |
+
want it, that you can change the software or use pieces of it in new
|
| 25 |
+
free programs, and that you know you can do these things.
|
| 26 |
+
|
| 27 |
+
Developers that use our General Public Licenses protect your rights
|
| 28 |
+
with two steps: (1) assert copyright on the software, and (2) offer
|
| 29 |
+
you this License which gives you legal permission to copy, distribute
|
| 30 |
+
and/or modify the software.
|
| 31 |
+
|
| 32 |
+
A secondary benefit of defending all users' freedom is that
|
| 33 |
+
improvements made in alternate versions of the program, if they
|
| 34 |
+
receive widespread use, become available for other developers to
|
| 35 |
+
incorporate. Many developers of free software are heartened and
|
| 36 |
+
encouraged by the resulting cooperation. However, in the case of
|
| 37 |
+
software used on network servers, this result may fail to come about.
|
| 38 |
+
The GNU General Public License permits making a modified version and
|
| 39 |
+
letting the public access it on a server without ever releasing its
|
| 40 |
+
source code to the public.
|
| 41 |
+
|
| 42 |
+
The GNU Affero General Public License is designed specifically to
|
| 43 |
+
ensure that, in such cases, the modified source code becomes available
|
| 44 |
+
to the community. It requires the operator of a network server to
|
| 45 |
+
provide the source code of the modified version running there to the
|
| 46 |
+
users of that server. Therefore, public use of a modified version, on
|
| 47 |
+
a publicly accessible server, gives the public access to the source
|
| 48 |
+
code of the modified version.
|
| 49 |
+
|
| 50 |
+
An older license, called the Affero General Public License and
|
| 51 |
+
published by Affero, was designed to accomplish similar goals. This is
|
| 52 |
+
a different license, not a version of the Affero GPL, but Affero has
|
| 53 |
+
released a new version of the Affero GPL which permits relicensing under
|
| 54 |
+
this license.
|
| 55 |
+
|
| 56 |
+
The precise terms and conditions for copying, distribution and
|
| 57 |
+
modification follow.
|
| 58 |
+
|
| 59 |
+
TERMS AND CONDITIONS
|
| 60 |
+
|
| 61 |
+
0. Definitions.
|
| 62 |
+
|
| 63 |
+
"This License" refers to version 3 of the GNU Affero General Public License.
|
| 64 |
+
|
| 65 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
| 66 |
+
works, such as semiconductor masks.
|
| 67 |
+
|
| 68 |
+
"The Program" refers to any copyrightable work licensed under this
|
| 69 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
| 70 |
+
"recipients" may be individuals or organizations.
|
| 71 |
+
|
| 72 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
| 73 |
+
in a fashion requiring copyright permission, other than the making of an
|
| 74 |
+
exact copy. The resulting work is called a "modified version" of the
|
| 75 |
+
earlier work or a work "based on" the earlier work.
|
| 76 |
+
|
| 77 |
+
A "covered work" means either the unmodified Program or a work based
|
| 78 |
+
on the Program.
|
| 79 |
+
|
| 80 |
+
To "propagate" a work means to do anything with it that, without
|
| 81 |
+
permission, would make you directly or secondarily liable for
|
| 82 |
+
infringement under applicable copyright law, except executing it on a
|
| 83 |
+
computer or modifying a private copy. Propagation includes copying,
|
| 84 |
+
distribution (with or without modification), making available to the
|
| 85 |
+
public, and in some countries other activities as well.
|
| 86 |
+
|
| 87 |
+
To "convey" a work means any kind of propagation that enables other
|
| 88 |
+
parties to make or receive copies. Mere interaction with a user through
|
| 89 |
+
a computer network, with no transfer of a copy, is not conveying.
|
| 90 |
+
|
| 91 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
| 92 |
+
to the extent that it includes a convenient and prominently visible
|
| 93 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
| 94 |
+
tells the user that there is no warranty for the work (except to the
|
| 95 |
+
extent that warranties are provided), that licensees may convey the
|
| 96 |
+
work under this License, and how to view a copy of this License. If
|
| 97 |
+
the interface presents a list of user commands or options, such as a
|
| 98 |
+
menu, a prominent item in the list meets this criterion.
|
| 99 |
+
|
| 100 |
+
1. Source Code.
|
| 101 |
+
|
| 102 |
+
The "source code" for a work means the preferred form of the work
|
| 103 |
+
for making modifications to it. "Object code" means any non-source
|
| 104 |
+
form of a work.
|
| 105 |
+
|
| 106 |
+
A "Standard Interface" means an interface that either is an official
|
| 107 |
+
standard defined by a recognized standards body, or, in the case of
|
| 108 |
+
interfaces specified for a particular programming language, one that
|
| 109 |
+
is widely used among developers working in that language.
|
| 110 |
+
|
| 111 |
+
The "System Libraries" of an executable work include anything, other
|
| 112 |
+
than the work as a whole, that (a) is included in the normal form of
|
| 113 |
+
packaging a Major Component, but which is not part of that Major
|
| 114 |
+
Component, and (b) serves only to enable use of the work with that
|
| 115 |
+
Major Component, or to implement a Standard Interface for which an
|
| 116 |
+
implementation is available to the public in source code form. A
|
| 117 |
+
"Major Component", in this context, means a major essential component
|
| 118 |
+
(kernel, window system, and so on) of the specific operating system
|
| 119 |
+
(if any) on which the executable work runs, or a compiler used to
|
| 120 |
+
produce the work, or an object code interpreter used to run it.
|
| 121 |
+
|
| 122 |
+
The "Corresponding Source" for a work in object code form means all
|
| 123 |
+
the source code needed to generate, install, and (for an executable
|
| 124 |
+
work) run the object code and to modify the work, including scripts to
|
| 125 |
+
control those activities. However, it does not include the work's
|
| 126 |
+
System Libraries, or general-purpose tools or generally available free
|
| 127 |
+
programs which are used unmodified in performing those activities but
|
| 128 |
+
which are not part of the work. For example, Corresponding Source
|
| 129 |
+
includes interface definition files associated with source files for
|
| 130 |
+
the work, and the source code for shared libraries and dynamically
|
| 131 |
+
linked subprograms that the work is specifically designed to require,
|
| 132 |
+
such as by intimate data communication or control flow between those
|
| 133 |
+
subprograms and other parts of the work.
|
| 134 |
+
|
| 135 |
+
The Corresponding Source need not include anything that users
|
| 136 |
+
can regenerate automatically from other parts of the Corresponding
|
| 137 |
+
Source.
|
| 138 |
+
|
| 139 |
+
The Corresponding Source for a work in source code form is that
|
| 140 |
+
same work.
|
| 141 |
+
|
| 142 |
+
2. Basic Permissions.
|
| 143 |
+
|
| 144 |
+
All rights granted under this License are granted for the term of
|
| 145 |
+
copyright on the Program, and are irrevocable provided the stated
|
| 146 |
+
conditions are met. This License explicitly affirms your unlimited
|
| 147 |
+
permission to run the unmodified Program. The output from running a
|
| 148 |
+
covered work is covered by this License only if the output, given its
|
| 149 |
+
content, constitutes a covered work. This License acknowledges your
|
| 150 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
| 151 |
+
|
| 152 |
+
You may make, run and propagate covered works that you do not
|
| 153 |
+
convey, without conditions so long as your license otherwise remains
|
| 154 |
+
in force. You may convey covered works to others for the sole purpose
|
| 155 |
+
of having them make modifications exclusively for you, or provide you
|
| 156 |
+
with facilities for running those works, provided that you comply with
|
| 157 |
+
the terms of this License in conveying all material for which you do
|
| 158 |
+
not control copyright. Those thus making or running the covered works
|
| 159 |
+
for you must do so exclusively on your behalf, under your direction
|
| 160 |
+
and control, on terms that prohibit them from making any copies of
|
| 161 |
+
your copyrighted material outside their relationship with you.
|
| 162 |
+
|
| 163 |
+
Conveying under any other circumstances is permitted solely under
|
| 164 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
| 165 |
+
makes it unnecessary.
|
| 166 |
+
|
| 167 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
| 168 |
+
|
| 169 |
+
No covered work shall be deemed part of an effective technological
|
| 170 |
+
measure under any applicable law fulfilling obligations under article
|
| 171 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
| 172 |
+
similar laws prohibiting or restricting circumvention of such
|
| 173 |
+
measures.
|
| 174 |
+
|
| 175 |
+
When you convey a covered work, you waive any legal power to forbid
|
| 176 |
+
circumvention of technological measures to the extent such circumvention
|
| 177 |
+
is effected by exercising rights under this License with respect to
|
| 178 |
+
the covered work, and you disclaim any intention to limit operation or
|
| 179 |
+
modification of the work as a means of enforcing, against the work's
|
| 180 |
+
users, your or third parties' legal rights to forbid circumvention of
|
| 181 |
+
technological measures.
|
| 182 |
+
|
| 183 |
+
4. Conveying Verbatim Copies.
|
| 184 |
+
|
| 185 |
+
You may convey verbatim copies of the Program's source code as you
|
| 186 |
+
receive it, in any medium, provided that you conspicuously and
|
| 187 |
+
appropriately publish on each copy an appropriate copyright notice;
|
| 188 |
+
keep intact all notices stating that this License and any
|
| 189 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
| 190 |
+
keep intact all notices of the absence of any warranty; and give all
|
| 191 |
+
recipients a copy of this License along with the Program.
|
| 192 |
+
|
| 193 |
+
You may charge any price or no price for each copy that you convey,
|
| 194 |
+
and you may offer support or warranty protection for a fee.
|
| 195 |
+
|
| 196 |
+
5. Conveying Modified Source Versions.
|
| 197 |
+
|
| 198 |
+
You may convey a work based on the Program, or the modifications to
|
| 199 |
+
produce it from the Program, in the form of source code under the
|
| 200 |
+
terms of section 4, provided that you also meet all of these conditions:
|
| 201 |
+
|
| 202 |
+
a) The work must carry prominent notices stating that you modified
|
| 203 |
+
it, and giving a relevant date.
|
| 204 |
+
|
| 205 |
+
b) The work must carry prominent notices stating that it is
|
| 206 |
+
released under this License and any conditions added under section
|
| 207 |
+
7. This requirement modifies the requirement in section 4 to
|
| 208 |
+
"keep intact all notices".
|
| 209 |
+
|
| 210 |
+
c) You must license the entire work, as a whole, under this
|
| 211 |
+
License to anyone who comes into possession of a copy. This
|
| 212 |
+
License will therefore apply, along with any applicable section 7
|
| 213 |
+
additional terms, to the whole of the work, and all its parts,
|
| 214 |
+
regardless of how they are packaged. This License gives no
|
| 215 |
+
permission to license the work in any other way, but it does not
|
| 216 |
+
invalidate such permission if you have separately received it.
|
| 217 |
+
|
| 218 |
+
d) If the work has interactive user interfaces, each must display
|
| 219 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
| 220 |
+
interfaces that do not display Appropriate Legal Notices, your
|
| 221 |
+
work need not make them do so.
|
| 222 |
+
|
| 223 |
+
A compilation of a covered work with other separate and independent
|
| 224 |
+
works, which are not by their nature extensions of the covered work,
|
| 225 |
+
and which are not combined with it such as to form a larger program,
|
| 226 |
+
in or on a volume of a storage or distribution medium, is called an
|
| 227 |
+
"aggregate" if the compilation and its resulting copyright are not
|
| 228 |
+
used to limit the access or legal rights of the compilation's users
|
| 229 |
+
beyond what the individual works permit. Inclusion of a covered work
|
| 230 |
+
in an aggregate does not cause this License to apply to the other
|
| 231 |
+
parts of the aggregate.
|
| 232 |
+
|
| 233 |
+
6. Conveying Non-Source Forms.
|
| 234 |
+
|
| 235 |
+
You may convey a covered work in object code form under the terms
|
| 236 |
+
of sections 4 and 5, provided that you also convey the
|
| 237 |
+
machine-readable Corresponding Source under the terms of this License,
|
| 238 |
+
in one of these ways:
|
| 239 |
+
|
| 240 |
+
a) Convey the object code in, or embodied in, a physical product
|
| 241 |
+
(including a physical distribution medium), accompanied by the
|
| 242 |
+
Corresponding Source fixed on a durable physical medium
|
| 243 |
+
customarily used for software interchange.
|
| 244 |
+
|
| 245 |
+
b) Convey the object code in, or embodied in, a physical product
|
| 246 |
+
(including a physical distribution medium), accompanied by a
|
| 247 |
+
written offer, valid for at least three years and valid for as
|
| 248 |
+
long as you offer spare parts or customer support for that product
|
| 249 |
+
model, to give anyone who possesses the object code either (1) a
|
| 250 |
+
copy of the Corresponding Source for all the software in the
|
| 251 |
+
product that is covered by this License, on a durable physical
|
| 252 |
+
medium customarily used for software interchange, for a price no
|
| 253 |
+
more than your reasonable cost of physically performing this
|
| 254 |
+
conveying of source, or (2) access to copy the
|
| 255 |
+
Corresponding Source from a network server at no charge.
|
| 256 |
+
|
| 257 |
+
c) Convey individual copies of the object code with a copy of the
|
| 258 |
+
written offer to provide the Corresponding Source. This
|
| 259 |
+
alternative is allowed only occasionally and noncommercially, and
|
| 260 |
+
only if you received the object code with such an offer, in accord
|
| 261 |
+
with subsection 6b.
|
| 262 |
+
|
| 263 |
+
d) Convey the object code by offering access from a designated
|
| 264 |
+
place (gratis or for a charge), and offer equivalent access to the
|
| 265 |
+
Corresponding Source in the same way through the same place at no
|
| 266 |
+
further charge. You need not require recipients to copy the
|
| 267 |
+
Corresponding Source along with the object code. If the place to
|
| 268 |
+
copy the object code is a network server, the Corresponding Source
|
| 269 |
+
may be on a different server (operated by you or a third party)
|
| 270 |
+
that supports equivalent copying facilities, provided you maintain
|
| 271 |
+
clear directions next to the object code saying where to find the
|
| 272 |
+
Corresponding Source. Regardless of what server hosts the
|
| 273 |
+
Corresponding Source, you remain obligated to ensure that it is
|
| 274 |
+
available for as long as needed to satisfy these requirements.
|
| 275 |
+
|
| 276 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
| 277 |
+
you inform other peers where the object code and Corresponding
|
| 278 |
+
Source of the work are being offered to the general public at no
|
| 279 |
+
charge under subsection 6d.
|
| 280 |
+
|
| 281 |
+
A separable portion of the object code, whose source code is excluded
|
| 282 |
+
from the Corresponding Source as a System Library, need not be
|
| 283 |
+
included in conveying the object code work.
|
| 284 |
+
|
| 285 |
+
A "User Product" is either (1) a "consumer product", which means any
|
| 286 |
+
tangible personal property which is normally used for personal, family,
|
| 287 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
| 288 |
+
into a dwelling. In determining whether a product is a consumer product,
|
| 289 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
| 290 |
+
product received by a particular user, "normally used" refers to a
|
| 291 |
+
typical or common use of that class of product, regardless of the status
|
| 292 |
+
of the particular user or of the way in which the particular user
|
| 293 |
+
actually uses, or expects or is expected to use, the product. A product
|
| 294 |
+
is a consumer product regardless of whether the product has substantial
|
| 295 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
| 296 |
+
the only significant mode of use of the product.
|
| 297 |
+
|
| 298 |
+
"Installation Information" for a User Product means any methods,
|
| 299 |
+
procedures, authorization keys, or other information required to install
|
| 300 |
+
and execute modified versions of a covered work in that User Product from
|
| 301 |
+
a modified version of its Corresponding Source. The information must
|
| 302 |
+
suffice to ensure that the continued functioning of the modified object
|
| 303 |
+
code is in no case prevented or interfered with solely because
|
| 304 |
+
modification has been made.
|
| 305 |
+
|
| 306 |
+
If you convey an object code work under this section in, or with, or
|
| 307 |
+
specifically for use in, a User Product, and the conveying occurs as
|
| 308 |
+
part of a transaction in which the right of possession and use of the
|
| 309 |
+
User Product is transferred to the recipient in perpetuity or for a
|
| 310 |
+
fixed term (regardless of how the transaction is characterized), the
|
| 311 |
+
Corresponding Source conveyed under this section must be accompanied
|
| 312 |
+
by the Installation Information. But this requirement does not apply
|
| 313 |
+
if neither you nor any third party retains the ability to install
|
| 314 |
+
modified object code on the User Product (for example, the work has
|
| 315 |
+
been installed in ROM).
|
| 316 |
+
|
| 317 |
+
The requirement to provide Installation Information does not include a
|
| 318 |
+
requirement to continue to provide support service, warranty, or updates
|
| 319 |
+
for a work that has been modified or installed by the recipient, or for
|
| 320 |
+
the User Product in which it has been modified or installed. Access to a
|
| 321 |
+
network may be denied when the modification itself materially and
|
| 322 |
+
adversely affects the operation of the network or violates the rules and
|
| 323 |
+
protocols for communication across the network.
|
| 324 |
+
|
| 325 |
+
Corresponding Source conveyed, and Installation Information provided,
|
| 326 |
+
in accord with this section must be in a format that is publicly
|
| 327 |
+
documented (and with an implementation available to the public in
|
| 328 |
+
source code form), and must require no special password or key for
|
| 329 |
+
unpacking, reading or copying.
|
| 330 |
+
|
| 331 |
+
7. Additional Terms.
|
| 332 |
+
|
| 333 |
+
"Additional permissions" are terms that supplement the terms of this
|
| 334 |
+
License by making exceptions from one or more of its conditions.
|
| 335 |
+
Additional permissions that are applicable to the entire Program shall
|
| 336 |
+
be treated as though they were included in this License, to the extent
|
| 337 |
+
that they are valid under applicable law. If additional permissions
|
| 338 |
+
apply only to part of the Program, that part may be used separately
|
| 339 |
+
under those permissions, but the entire Program remains governed by
|
| 340 |
+
this License without regard to the additional permissions.
|
| 341 |
+
|
| 342 |
+
When you convey a copy of a covered work, you may at your option
|
| 343 |
+
remove any additional permissions from that copy, or from any part of
|
| 344 |
+
it. (Additional permissions may be written to require their own
|
| 345 |
+
removal in certain cases when you modify the work.) You may place
|
| 346 |
+
additional permissions on material, added by you to a covered work,
|
| 347 |
+
for which you have or can give appropriate copyright permission.
|
| 348 |
+
|
| 349 |
+
Notwithstanding any other provision of this License, for material you
|
| 350 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
| 351 |
+
that material) supplement the terms of this License with terms:
|
| 352 |
+
|
| 353 |
+
a) Disclaiming warranty or limiting liability differently from the
|
| 354 |
+
terms of sections 15 and 16 of this License; or
|
| 355 |
+
|
| 356 |
+
b) Requiring preservation of specified reasonable legal notices or
|
| 357 |
+
author attributions in that material or in the Appropriate Legal
|
| 358 |
+
Notices displayed by works containing it; or
|
| 359 |
+
|
| 360 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
| 361 |
+
requiring that modified versions of such material be marked in
|
| 362 |
+
reasonable ways as different from the original version; or
|
| 363 |
+
|
| 364 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
| 365 |
+
authors of the material; or
|
| 366 |
+
|
| 367 |
+
e) Declining to grant rights under trademark law for use of some
|
| 368 |
+
trade names, trademarks, or service marks; or
|
| 369 |
+
|
| 370 |
+
f) Requiring indemnification of licensors and authors of that
|
| 371 |
+
material by anyone who conveys the material (or modified versions of
|
| 372 |
+
it) with contractual assumptions of liability to the recipient, for
|
| 373 |
+
any liability that these contractual assumptions directly impose on
|
| 374 |
+
those licensors and authors.
|
| 375 |
+
|
| 376 |
+
All other non-permissive additional terms are considered "further
|
| 377 |
+
restrictions" within the meaning of section 10. If the Program as you
|
| 378 |
+
received it, or any part of it, contains a notice stating that it is
|
| 379 |
+
governed by this License along with a term that is a further
|
| 380 |
+
restriction, you may remove that term. If a license document contains
|
| 381 |
+
a further restriction but permits relicensing or conveying under this
|
| 382 |
+
License, you may add to a covered work material governed by the terms
|
| 383 |
+
of that license document, provided that the further restriction does
|
| 384 |
+
not survive such relicensing or conveying.
|
| 385 |
+
|
| 386 |
+
If you add terms to a covered work in accord with this section, you
|
| 387 |
+
must place, in the relevant source files, a statement of the
|
| 388 |
+
additional terms that apply to those files, or a notice indicating
|
| 389 |
+
where to find the applicable terms.
|
| 390 |
+
|
| 391 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
| 392 |
+
form of a separately written license, or stated as exceptions;
|
| 393 |
+
the above requirements apply either way.
|
| 394 |
+
|
| 395 |
+
8. Termination.
|
| 396 |
+
|
| 397 |
+
You may not propagate or modify a covered work except as expressly
|
| 398 |
+
provided under this License. Any attempt otherwise to propagate or
|
| 399 |
+
modify it is void, and will automatically terminate your rights under
|
| 400 |
+
this License (including any patent licenses granted under the third
|
| 401 |
+
paragraph of section 11).
|
| 402 |
+
|
| 403 |
+
However, if you cease all violation of this License, then your
|
| 404 |
+
license from a particular copyright holder is reinstated (a)
|
| 405 |
+
provisionally, unless and until the copyright holder explicitly and
|
| 406 |
+
finally terminates your license, and (b) permanently, if the copyright
|
| 407 |
+
holder fails to notify you of the violation by some reasonable means
|
| 408 |
+
prior to 60 days after the cessation.
|
| 409 |
+
|
| 410 |
+
Moreover, your license from a particular copyright holder is
|
| 411 |
+
reinstated permanently if the copyright holder notifies you of the
|
| 412 |
+
violation by some reasonable means, this is the first time you have
|
| 413 |
+
received notice of violation of this License (for any work) from that
|
| 414 |
+
copyright holder, and you cure the violation prior to 30 days after
|
| 415 |
+
your receipt of the notice.
|
| 416 |
+
|
| 417 |
+
Termination of your rights under this section does not terminate the
|
| 418 |
+
licenses of parties who have received copies or rights from you under
|
| 419 |
+
this License. If your rights have been terminated and not permanently
|
| 420 |
+
reinstated, you do not qualify to receive new licenses for the same
|
| 421 |
+
material under section 10.
|
| 422 |
+
|
| 423 |
+
9. Acceptance Not Required for Having Copies.
|
| 424 |
+
|
| 425 |
+
You are not required to accept this License in order to receive or
|
| 426 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
| 427 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
| 428 |
+
to receive a copy likewise does not require acceptance. However,
|
| 429 |
+
nothing other than this License grants you permission to propagate or
|
| 430 |
+
modify any covered work. These actions infringe copyright if you do
|
| 431 |
+
not accept this License. Therefore, by modifying or propagating a
|
| 432 |
+
covered work, you indicate your acceptance of this License to do so.
|
| 433 |
+
|
| 434 |
+
10. Automatic Licensing of Downstream Recipients.
|
| 435 |
+
|
| 436 |
+
Each time you convey a covered work, the recipient automatically
|
| 437 |
+
receives a license from the original licensors, to run, modify and
|
| 438 |
+
propagate that work, subject to this License. You are not responsible
|
| 439 |
+
for enforcing compliance by third parties with this License.
|
| 440 |
+
|
| 441 |
+
An "entity transaction" is a transaction transferring control of an
|
| 442 |
+
organization, or substantially all assets of one, or subdividing an
|
| 443 |
+
organization, or merging organizations. If propagation of a covered
|
| 444 |
+
work results from an entity transaction, each party to that
|
| 445 |
+
transaction who receives a copy of the work also receives whatever
|
| 446 |
+
licenses to the work the party's predecessor in interest had or could
|
| 447 |
+
give under the previous paragraph, plus a right to possession of the
|
| 448 |
+
Corresponding Source of the work from the predecessor in interest, if
|
| 449 |
+
the predecessor has it or can get it with reasonable efforts.
|
| 450 |
+
|
| 451 |
+
You may not impose any further restrictions on the exercise of the
|
| 452 |
+
rights granted or affirmed under this License. For example, you may
|
| 453 |
+
not impose a license fee, royalty, or other charge for exercise of
|
| 454 |
+
rights granted under this License, and you may not initiate litigation
|
| 455 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
| 456 |
+
any patent claim is infringed by making, using, selling, offering for
|
| 457 |
+
sale, or importing the Program or any portion of it.
|
| 458 |
+
|
| 459 |
+
11. Patents.
|
| 460 |
+
|
| 461 |
+
A "contributor" is a copyright holder who authorizes use under this
|
| 462 |
+
License of the Program or a work on which the Program is based. The
|
| 463 |
+
work thus licensed is called the contributor's "contributor version".
|
| 464 |
+
|
| 465 |
+
A contributor's "essential patent claims" are all patent claims
|
| 466 |
+
owned or controlled by the contributor, whether already acquired or
|
| 467 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
| 468 |
+
by this License, of making, using, or selling its contributor version,
|
| 469 |
+
but do not include claims that would be infringed only as a
|
| 470 |
+
consequence of further modification of the contributor version. For
|
| 471 |
+
purposes of this definition, "control" includes the right to grant
|
| 472 |
+
patent sublicenses in a manner consistent with the requirements of
|
| 473 |
+
this License.
|
| 474 |
+
|
| 475 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
| 476 |
+
patent license under the contributor's essential patent claims, to
|
| 477 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
| 478 |
+
propagate the contents of its contributor version.
|
| 479 |
+
|
| 480 |
+
In the following three paragraphs, a "patent license" is any express
|
| 481 |
+
agreement or commitment, however denominated, not to enforce a patent
|
| 482 |
+
(such as an express permission to practice a patent or covenant not to
|
| 483 |
+
sue for patent infringement). To "grant" such a patent license to a
|
| 484 |
+
party means to make such an agreement or commitment not to enforce a
|
| 485 |
+
patent against the party.
|
| 486 |
+
|
| 487 |
+
If you convey a covered work, knowingly relying on a patent license,
|
| 488 |
+
and the Corresponding Source of the work is not available for anyone
|
| 489 |
+
to copy, free of charge and under the terms of this License, through a
|
| 490 |
+
publicly available network server or other readily accessible means,
|
| 491 |
+
then you must either (1) cause the Corresponding Source to be so
|
| 492 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
| 493 |
+
patent license for this particular work, or (3) arrange, in a manner
|
| 494 |
+
consistent with the requirements of this License, to extend the patent
|
| 495 |
+
license to downstream recipients. "Knowingly relying" means you have
|
| 496 |
+
actual knowledge that, but for the patent license, your conveying the
|
| 497 |
+
covered work in a country, or your recipient's use of the covered work
|
| 498 |
+
in a country, would infringe one or more identifiable patents in that
|
| 499 |
+
country that you have reason to believe are valid.
|
| 500 |
+
|
| 501 |
+
If, pursuant to or in connection with a single transaction or
|
| 502 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
| 503 |
+
covered work, and grant a patent license to some of the parties
|
| 504 |
+
receiving the covered work authorizing them to use, propagate, modify
|
| 505 |
+
or convey a specific copy of the covered work, then the patent license
|
| 506 |
+
you grant is automatically extended to all recipients of the covered
|
| 507 |
+
work and works based on it.
|
| 508 |
+
|
| 509 |
+
A patent license is "discriminatory" if it does not include within
|
| 510 |
+
the scope of its coverage, prohibits the exercise of, or is
|
| 511 |
+
conditioned on the non-exercise of one or more of the rights that are
|
| 512 |
+
specifically granted under this License. You may not convey a covered
|
| 513 |
+
work if you are a party to an arrangement with a third party that is
|
| 514 |
+
in the business of distributing software, under which you make payment
|
| 515 |
+
to the third party based on the extent of your activity of conveying
|
| 516 |
+
the work, and under which the third party grants, to any of the
|
| 517 |
+
parties who would receive the covered work from you, a discriminatory
|
| 518 |
+
patent license (a) in connection with copies of the covered work
|
| 519 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
| 520 |
+
for and in connection with specific products or compilations that
|
| 521 |
+
contain the covered work, unless you entered into that arrangement,
|
| 522 |
+
or that patent license was granted, prior to 28 March 2007.
|
| 523 |
+
|
| 524 |
+
Nothing in this License shall be construed as excluding or limiting
|
| 525 |
+
any implied license or other defenses to infringement that may
|
| 526 |
+
otherwise be available to you under applicable patent law.
|
| 527 |
+
|
| 528 |
+
12. No Surrender of Others' Freedom.
|
| 529 |
+
|
| 530 |
+
If conditions are imposed on you (whether by court order, agreement or
|
| 531 |
+
otherwise) that contradict the conditions of this License, they do not
|
| 532 |
+
excuse you from the conditions of this License. If you cannot convey a
|
| 533 |
+
covered work so as to satisfy simultaneously your obligations under this
|
| 534 |
+
License and any other pertinent obligations, then as a consequence you may
|
| 535 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
| 536 |
+
to collect a royalty for further conveying from those to whom you convey
|
| 537 |
+
the Program, the only way you could satisfy both those terms and this
|
| 538 |
+
License would be to refrain entirely from conveying the Program.
|
| 539 |
+
|
| 540 |
+
13. Remote Network Interaction; Use with the GNU General Public License.
|
| 541 |
+
|
| 542 |
+
Notwithstanding any other provision of this License, if you modify the
|
| 543 |
+
Program, your modified version must prominently offer all users
|
| 544 |
+
interacting with it remotely through a computer network (if your version
|
| 545 |
+
supports such interaction) an opportunity to receive the Corresponding
|
| 546 |
+
Source of your version by providing access to the Corresponding Source
|
| 547 |
+
from a network server at no charge, through some standard or customary
|
| 548 |
+
means of facilitating copying of software. This Corresponding Source
|
| 549 |
+
shall include the Corresponding Source for any work covered by version 3
|
| 550 |
+
of the GNU General Public License that is incorporated pursuant to the
|
| 551 |
+
following paragraph.
|
| 552 |
+
|
| 553 |
+
Notwithstanding any other provision of this License, you have
|
| 554 |
+
permission to link or combine any covered work with a work licensed
|
| 555 |
+
under version 3 of the GNU General Public License into a single
|
| 556 |
+
combined work, and to convey the resulting work. The terms of this
|
| 557 |
+
License will continue to apply to the part which is the covered work,
|
| 558 |
+
but the work with which it is combined will remain governed by version
|
| 559 |
+
3 of the GNU General Public License.
|
| 560 |
+
|
| 561 |
+
14. Revised Versions of this License.
|
| 562 |
+
|
| 563 |
+
The Free Software Foundation may publish revised and/or new versions of
|
| 564 |
+
the GNU Affero General Public License from time to time. Such new versions
|
| 565 |
+
will be similar in spirit to the present version, but may differ in detail to
|
| 566 |
+
address new problems or concerns.
|
| 567 |
+
|
| 568 |
+
Each version is given a distinguishing version number. If the
|
| 569 |
+
Program specifies that a certain numbered version of the GNU Affero General
|
| 570 |
+
Public License "or any later version" applies to it, you have the
|
| 571 |
+
option of following the terms and conditions either of that numbered
|
| 572 |
+
version or of any later version published by the Free Software
|
| 573 |
+
Foundation. If the Program does not specify a version number of the
|
| 574 |
+
GNU Affero General Public License, you may choose any version ever published
|
| 575 |
+
by the Free Software Foundation.
|
| 576 |
+
|
| 577 |
+
If the Program specifies that a proxy can decide which future
|
| 578 |
+
versions of the GNU Affero General Public License can be used, that proxy's
|
| 579 |
+
public statement of acceptance of a version permanently authorizes you
|
| 580 |
+
to choose that version for the Program.
|
| 581 |
+
|
| 582 |
+
Later license versions may give you additional or different
|
| 583 |
+
permissions. However, no additional obligations are imposed on any
|
| 584 |
+
author or copyright holder as a result of your choosing to follow a
|
| 585 |
+
later version.
|
| 586 |
+
|
| 587 |
+
15. Disclaimer of Warranty.
|
| 588 |
+
|
| 589 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
| 590 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
| 591 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
| 592 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
| 593 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
| 594 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
| 595 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
| 596 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
| 597 |
+
|
| 598 |
+
16. Limitation of Liability.
|
| 599 |
+
|
| 600 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
| 601 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
| 602 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
| 603 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
| 604 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
| 605 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
| 606 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
| 607 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
| 608 |
+
SUCH DAMAGES.
|
| 609 |
+
|
| 610 |
+
17. Interpretation of Sections 15 and 16.
|
| 611 |
+
|
| 612 |
+
If the disclaimer of warranty and limitation of liability provided
|
| 613 |
+
above cannot be given local legal effect according to their terms,
|
| 614 |
+
reviewing courts shall apply local law that most closely approximates
|
| 615 |
+
an absolute waiver of all civil liability in connection with the
|
| 616 |
+
Program, unless a warranty or assumption of liability accompanies a
|
| 617 |
+
copy of the Program in return for a fee.
|
| 618 |
+
|
| 619 |
+
END OF TERMS AND CONDITIONS
|
| 620 |
+
|
| 621 |
+
How to Apply These Terms to Your New Programs
|
| 622 |
+
|
| 623 |
+
If you develop a new program, and you want it to be of the greatest
|
| 624 |
+
possible use to the public, the best way to achieve this is to make it
|
| 625 |
+
free software which everyone can redistribute and change under these terms.
|
| 626 |
+
|
| 627 |
+
To do so, attach the following notices to the program. It is safest
|
| 628 |
+
to attach them to the start of each source file to most effectively
|
| 629 |
+
state the exclusion of warranty; and each file should have at least
|
| 630 |
+
the "copyright" line and a pointer to where the full notice is found.
|
| 631 |
+
|
| 632 |
+
<one line to give the program's name and a brief idea of what it does.>
|
| 633 |
+
Copyright (C) <year> <name of author>
|
| 634 |
+
|
| 635 |
+
This program is free software: you can redistribute it and/or modify
|
| 636 |
+
it under the terms of the GNU Affero General Public License as published by
|
| 637 |
+
the Free Software Foundation, either version 3 of the License, or
|
| 638 |
+
(at your option) any later version.
|
| 639 |
+
|
| 640 |
+
This program is distributed in the hope that it will be useful,
|
| 641 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 642 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 643 |
+
GNU Affero General Public License for more details.
|
| 644 |
+
|
| 645 |
+
You should have received a copy of the GNU Affero General Public License
|
| 646 |
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
| 647 |
+
|
| 648 |
+
Also add information on how to contact you by electronic and paper mail.
|
| 649 |
+
|
| 650 |
+
If your software can interact with users remotely through a computer
|
| 651 |
+
network, you should also make sure that it provides a way for users to
|
| 652 |
+
get its source. For example, if your program is a web application, its
|
| 653 |
+
interface could display a "Source" link that leads users to an archive
|
| 654 |
+
of the code. There are many ways you could offer source, and different
|
| 655 |
+
solutions will be better for different programs; see section 13 for the
|
| 656 |
+
specific requirements.
|
| 657 |
+
|
| 658 |
+
You should also get your employer (if you work as a programmer) or school,
|
| 659 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
| 660 |
+
For more information on this, and how to apply and follow the GNU AGPL, see
|
| 661 |
+
<https://www.gnu.org/licenses/>.
|
models_related/ultralytics/README.md
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div align="center">
|
| 2 |
+
<p>
|
| 3 |
+
<a href="https://platform.ultralytics.com/?utm_source=github&utm_medium=referral&utm_campaign=platform_launch&utm_content=banner&utm_term=ultralytics_github" target="_blank">
|
| 4 |
+
<img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov8/banner-yolov8.png" alt="Ultralytics YOLO banner"></a>
|
| 5 |
+
</p>
|
| 6 |
+
|
| 7 |
+
[中文](https://docs.ultralytics.com/zh) | [한국어](https://docs.ultralytics.com/ko) | [日本語](https://docs.ultralytics.com/ja) | [Русский](https://docs.ultralytics.com/ru) | [Deutsch](https://docs.ultralytics.com/de) | [Français](https://docs.ultralytics.com/fr) | [Español](https://docs.ultralytics.com/es) | [Português](https://docs.ultralytics.com/pt) | [Türkçe](https://docs.ultralytics.com/tr) | [Tiếng Việt](https://docs.ultralytics.com/vi) | [العربية](https://docs.ultralytics.com/ar) <br>
|
| 8 |
+
|
| 9 |
+
<div>
|
| 10 |
+
<a href="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yml"><img src="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yml/badge.svg" alt="Ultralytics CI"></a>
|
| 11 |
+
<a href="https://clickpy.clickhouse.com/dashboard/ultralytics"><img src="https://static.pepy.tech/badge/ultralytics" alt="Ultralytics Downloads"></a>
|
| 12 |
+
<a href="https://discord.com/invite/ultralytics"><img alt="Ultralytics Discord" src="https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue"></a>
|
| 13 |
+
<a href="https://community.ultralytics.com/"><img alt="Ultralytics Forums" src="https://img.shields.io/discourse/users?server=https%3A%2F%2Fcommunity.ultralytics.com&logo=discourse&label=Forums&color=blue"></a>
|
| 14 |
+
<a href="https://www.reddit.com/r/ultralytics/"><img alt="Ultralytics Reddit" src="https://img.shields.io/reddit/subreddit-subscribers/ultralytics?style=flat&logo=reddit&logoColor=white&label=Reddit&color=blue"></a>
|
| 15 |
+
<br>
|
| 16 |
+
<a href="https://console.paperspace.com/github/ultralytics/ultralytics"><img src="https://assets.paperspace.io/img/gradient-badge.svg" alt="Run Ultralytics on Gradient"></a>
|
| 17 |
+
<a href="https://colab.research.google.com/github/ultralytics/ultralytics/blob/main/examples/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open Ultralytics In Colab"></a>
|
| 18 |
+
<a href="https://www.kaggle.com/models/ultralytics/yolo26"><img src="https://kaggle.com/static/images/open-in-kaggle.svg" alt="Open Ultralytics In Kaggle"></a>
|
| 19 |
+
<a href="https://mybinder.org/v2/gh/ultralytics/ultralytics/HEAD?labpath=examples%2Ftutorial.ipynb"><img src="https://mybinder.org/badge_logo.svg" alt="Open Ultralytics In Binder"></a>
|
| 20 |
+
</div>
|
| 21 |
+
</div>
|
| 22 |
+
<br>
|
| 23 |
+
|
| 24 |
+
[Ultralytics](https://www.ultralytics.com/) creates cutting-edge, state-of-the-art (SOTA) [YOLO models](https://www.ultralytics.com/yolo) built on years of foundational research in computer vision and AI. Constantly updated for performance and flexibility, our models are **fast**, **accurate**, and **easy to use**. They excel at [object detection](https://docs.ultralytics.com/tasks/detect), [tracking](https://docs.ultralytics.com/modes/track), [instance segmentation](https://docs.ultralytics.com/tasks/segment), [semantic segmentation](https://docs.ultralytics.com/tasks/semantic), [image classification](https://docs.ultralytics.com/tasks/classify), and [pose estimation](https://docs.ultralytics.com/tasks/pose) tasks.
|
| 25 |
+
|
| 26 |
+
Find detailed documentation in the [Ultralytics Docs](https://docs.ultralytics.com/). Get support via [GitHub Issues](https://github.com/ultralytics/ultralytics/issues/new/choose). Join discussions on [Discord](https://discord.com/invite/ultralytics), [Reddit](https://www.reddit.com/r/ultralytics/), and the [Ultralytics Community Forums](https://community.ultralytics.com/)!
|
| 27 |
+
|
| 28 |
+
Request an Enterprise License for commercial use at [Ultralytics Licensing](https://www.ultralytics.com/license).
|
| 29 |
+
|
| 30 |
+
<a href="https://platform.ultralytics.com/ultralytics/yolo26" target="_blank">
|
| 31 |
+
<img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/refs/heads/main/yolo/performance-comparison.png" alt="YOLO26 performance plots">
|
| 32 |
+
</a>
|
| 33 |
+
|
| 34 |
+
<div align="center">
|
| 35 |
+
<a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="2%" alt="Ultralytics GitHub"></a>
|
| 36 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
| 37 |
+
<a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="2%" alt="Ultralytics LinkedIn"></a>
|
| 38 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
| 39 |
+
<a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="2%" alt="Ultralytics Twitter"></a>
|
| 40 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
| 41 |
+
<a href="https://www.youtube.com/ultralytics?sub_confirmation=1"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="2%" alt="Ultralytics YouTube"></a>
|
| 42 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
| 43 |
+
<a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="2%" alt="Ultralytics TikTok"></a>
|
| 44 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
| 45 |
+
<a href="https://ultralytics.com/bilibili"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-bilibili.png" width="2%" alt="Ultralytics BiliBili"></a>
|
| 46 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
| 47 |
+
<a href="https://discord.com/invite/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="2%" alt="Ultralytics Discord"></a>
|
| 48 |
+
</div>
|
| 49 |
+
|
| 50 |
+
## 📄 Documentation
|
| 51 |
+
|
| 52 |
+
See below for quickstart installation and usage examples. For comprehensive guidance on training, validation, prediction, and deployment, refer to our full [Ultralytics Docs](https://docs.ultralytics.com/).
|
| 53 |
+
|
| 54 |
+
<details open>
|
| 55 |
+
<summary>Install</summary>
|
| 56 |
+
|
| 57 |
+
Install the `ultralytics` package, including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml), in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
|
| 58 |
+
|
| 59 |
+
[](https://pypi.org/project/ultralytics/) [](https://clickpy.clickhouse.com/dashboard/ultralytics) [](https://pypi.org/project/ultralytics/)
|
| 60 |
+
|
| 61 |
+
```bash
|
| 62 |
+
pip install ultralytics
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
For alternative installation methods, including [Conda](https://anaconda.org/conda-forge/ultralytics), [Docker](https://hub.docker.com/r/ultralytics/ultralytics), and building from source via Git, please consult the [Quickstart Guide](https://docs.ultralytics.com/quickstart).
|
| 66 |
+
|
| 67 |
+
[](https://anaconda.org/conda-forge/ultralytics) [](https://hub.docker.com/r/ultralytics/ultralytics) [](https://hub.docker.com/r/ultralytics/ultralytics)
|
| 68 |
+
|
| 69 |
+
</details>
|
| 70 |
+
|
| 71 |
+
<details open>
|
| 72 |
+
<summary>Usage</summary>
|
| 73 |
+
|
| 74 |
+
### CLI
|
| 75 |
+
|
| 76 |
+
You can use Ultralytics YOLO directly from the Command Line Interface (CLI) with the `yolo` command:
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
# Predict using a pretrained YOLO model (e.g., YOLO26n) on an image
|
| 80 |
+
yolo predict model=yolo26n.pt source='https://ultralytics.com/images/bus.jpg'
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
The `yolo` command supports various tasks and modes, accepting additional arguments like `imgsz=640`. Explore the YOLO [CLI Docs](https://docs.ultralytics.com/usage/cli) for more examples.
|
| 84 |
+
|
| 85 |
+
### Python
|
| 86 |
+
|
| 87 |
+
Ultralytics YOLO can also be integrated directly into your Python projects. It accepts the same [configuration arguments](https://docs.ultralytics.com/usage/cfg) as the CLI:
|
| 88 |
+
|
| 89 |
+
```python
|
| 90 |
+
from ultralytics import YOLO
|
| 91 |
+
|
| 92 |
+
# Load a pretrained YOLO26n model
|
| 93 |
+
model = YOLO("yolo26n.pt")
|
| 94 |
+
|
| 95 |
+
# Train the model on the COCO8 dataset for 100 epochs
|
| 96 |
+
train_results = model.train(
|
| 97 |
+
data="coco8.yaml", # Path to dataset configuration file
|
| 98 |
+
epochs=100, # Number of training epochs
|
| 99 |
+
imgsz=640, # Image size for training
|
| 100 |
+
device="cpu", # Device to run on (e.g., 'cpu', 0, [0,1,2,3])
|
| 101 |
+
)
|
| 102 |
+
|
| 103 |
+
# Evaluate the model's performance on the validation set
|
| 104 |
+
metrics = model.val()
|
| 105 |
+
|
| 106 |
+
# Perform object detection on an image
|
| 107 |
+
results = model("path/to/image.jpg") # Predict on an image
|
| 108 |
+
results[0].show() # Display results
|
| 109 |
+
|
| 110 |
+
# Export the model to ONNX format for deployment
|
| 111 |
+
path = model.export(format="onnx") # Returns the path to the exported model
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
Discover more examples in the YOLO [Python Docs](https://docs.ultralytics.com/usage/python).
|
| 115 |
+
|
| 116 |
+
</details>
|
| 117 |
+
|
| 118 |
+
## ✨ Models
|
| 119 |
+
|
| 120 |
+
Ultralytics supports a wide range of YOLO models, from early versions like [YOLOv3](https://docs.ultralytics.com/models/yolov3) to the latest [YOLO26](https://docs.ultralytics.com/models/yolo26). The tables below showcase YOLO26 models pretrained on [COCO](https://docs.ultralytics.com/datasets/detect/coco) for [Detection](https://docs.ultralytics.com/tasks/detect), [Segmentation](https://docs.ultralytics.com/tasks/segment), and [Pose Estimation](https://docs.ultralytics.com/tasks/pose). [Semantic Segmentation](https://docs.ultralytics.com/tasks/semantic) models are pretrained on [Cityscapes](https://docs.ultralytics.com/datasets/semantic/cityscapes), and [Classification](https://docs.ultralytics.com/tasks/classify) models are pretrained on [ImageNet](https://docs.ultralytics.com/datasets/classify/imagenet). [Tracking](https://docs.ultralytics.com/modes/track) mode is compatible with Detection, Segmentation, and Pose models. All [Models](https://docs.ultralytics.com/models) download automatically from the latest Ultralytics [release](https://github.com/ultralytics/assets/releases) on first use.
|
| 121 |
+
|
| 122 |
+
<a href="https://docs.ultralytics.com/tasks" target="_blank">
|
| 123 |
+
<img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/docs/ultralytics-yolov8-tasks-banner.avif" alt="Ultralytics YOLO supported tasks">
|
| 124 |
+
</a>
|
| 125 |
+
<br>
|
| 126 |
+
<br>
|
| 127 |
+
|
| 128 |
+
<details open><summary>Detection (COCO)</summary>
|
| 129 |
+
|
| 130 |
+
Explore the [Detection Docs](https://docs.ultralytics.com/tasks/detect) for usage examples. These models are trained on the [COCO dataset](https://cocodataset.org/), featuring 80 object classes.
|
| 131 |
+
|
| 132 |
+
| Model | size<br><sup>(pixels)</sup> | mAP<sup>val<br>50-95</sup> | mAP<sup>val<br>50-95(e2e)</sup> | Speed<br><sup>CPU ONNX<br>(ms)</sup> | Speed<br><sup>T4 TensorRT10<br>(ms)</sup> | params<br><sup>(M)</sup> | FLOPs<br><sup>(B)</sup> |
|
| 133 |
+
| ------------------------------------------------------------------------------------ | --------------------------- | -------------------------- | ------------------------------- | ------------------------------------ | ----------------------------------------- | ------------------------ | ----------------------- |
|
| 134 |
+
| [YOLO26n](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n.pt) | 640 | 40.9 | 40.1 | 38.9 ± 0.7 | 1.7 ± 0.0 | 2.4 | 5.4 |
|
| 135 |
+
| [YOLO26s](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26s.pt) | 640 | 48.6 | 47.8 | 87.2 ± 0.9 | 2.5 ± 0.0 | 9.5 | 20.7 |
|
| 136 |
+
| [YOLO26m](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26m.pt) | 640 | 53.1 | 52.5 | 220.0 ± 1.4 | 4.7 ± 0.1 | 20.4 | 68.2 |
|
| 137 |
+
| [YOLO26l](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26l.pt) | 640 | 55.0 | 54.4 | 286.2 ± 2.0 | 6.2 ± 0.2 | 24.8 | 86.4 |
|
| 138 |
+
| [YOLO26x](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26x.pt) | 640 | 57.5 | 56.9 | 525.8 ± 4.0 | 11.8 ± 0.2 | 55.7 | 193.9 |
|
| 139 |
+
|
| 140 |
+
- **mAP<sup>val</sup>** values refer to single-model single-scale performance on the [COCO val2017](https://cocodataset.org/) dataset. See [YOLO Performance Metrics](https://docs.ultralytics.com/guides/yolo-performance-metrics) for details. <br>Reproduce with `yolo val detect data=coco.yaml device=0`
|
| 141 |
+
- **Speed** metrics are averaged over COCO val images using an [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) instance. CPU speeds measured with [ONNX](https://onnx.ai/) export. GPU speeds measured with [TensorRT](https://developer.nvidia.com/tensorrt) export. <br>Reproduce with `yolo val detect data=coco.yaml batch=1 device=0|cpu`
|
| 142 |
+
|
| 143 |
+
</details>
|
| 144 |
+
|
| 145 |
+
<details><summary>Segmentation (COCO)</summary>
|
| 146 |
+
|
| 147 |
+
Refer to the [Segmentation Docs](https://docs.ultralytics.com/tasks/segment) for usage examples. These models are trained on [COCO-Seg](https://docs.ultralytics.com/datasets/segment/coco), including 80 classes.
|
| 148 |
+
|
| 149 |
+
| Model | size<br><sup>(pixels)</sup> | mAP<sup>box<br>50-95(e2e)</sup> | mAP<sup>mask<br>50-95(e2e)</sup> | Speed<br><sup>CPU ONNX<br>(ms)</sup> | Speed<br><sup>T4 TensorRT10<br>(ms)</sup> | params<br><sup>(M)</sup> | FLOPs<br><sup>(B)</sup> |
|
| 150 |
+
| -------------------------------------------------------------------------------------------- | --------------------------- | ------------------------------- | -------------------------------- | ------------------------------------ | ----------------------------------------- | ------------------------ | ----------------------- |
|
| 151 |
+
| [YOLO26n-seg](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n-seg.pt) | 640 | 39.6 | 33.9 | 53.3 ± 0.5 | 2.1 ± 0.0 | 2.7 | 9.1 |
|
| 152 |
+
| [YOLO26s-seg](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26s-seg.pt) | 640 | 47.3 | 40.0 | 118.4 ± 0.9 | 3.3 ± 0.0 | 10.4 | 34.2 |
|
| 153 |
+
| [YOLO26m-seg](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26m-seg.pt) | 640 | 52.5 | 44.1 | 328.2 ± 2.4 | 6.7 ± 0.1 | 23.6 | 121.5 |
|
| 154 |
+
| [YOLO26l-seg](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26l-seg.pt) | 640 | 54.4 | 45.5 | 387.0 ± 3.7 | 8.0 ± 0.1 | 28.0 | 139.8 |
|
| 155 |
+
| [YOLO26x-seg](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26x-seg.pt) | 640 | 56.5 | 47.0 | 787.0 ± 6.8 | 16.4 ± 0.1 | 62.8 | 313.5 |
|
| 156 |
+
|
| 157 |
+
- **mAP<sup>val</sup>** values are for single-model single-scale on the [COCO val2017](https://cocodataset.org/) dataset. See [YOLO Performance Metrics](https://docs.ultralytics.com/guides/yolo-performance-metrics) for details. <br>Reproduce with `yolo val segment data=coco.yaml device=0`
|
| 158 |
+
- **Speed** metrics are averaged over COCO val images using an [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) instance. CPU speeds measured with [ONNX](https://onnx.ai/) export. GPU speeds measured with [TensorRT](https://developer.nvidia.com/tensorrt) export. <br>Reproduce with `yolo val segment data=coco.yaml batch=1 device=0|cpu`
|
| 159 |
+
|
| 160 |
+
</details>
|
| 161 |
+
|
| 162 |
+
<details><summary>Semantic Segmentation (Cityscapes)</summary>
|
| 163 |
+
|
| 164 |
+
See the [Semantic Segmentation Docs](https://docs.ultralytics.com/tasks/semantic) for usage examples. These models are trained on [Cityscapes](https://docs.ultralytics.com/datasets/semantic/cityscapes), including 19 classes.
|
| 165 |
+
|
| 166 |
+
| Model | size<br><sup>(pixels)</sup> | mIoU<sup>val</sup> | Speed<br><sup>RTX3090 PyTorch<br>(ms)</sup> | params<br><sup>(M)</sup> | FLOPs<br><sup>(B)</sup> |
|
| 167 |
+
| -------------------------------------------------------------------------------------------- | --------------------------- | ------------------ | ------------------------------------------- | ------------------------ | ----------------------- |
|
| 168 |
+
| [YOLO26n-sem](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n-sem.pt) | 1024 × 2048 | 78.3 | 4.4 ± 0.0 | 1.6 | 22.7 |
|
| 169 |
+
| [YOLO26s-sem](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26s-sem.pt) | 1024 × 2048 | 80.8 | 8.4 ± 0.0 | 6.5 | 88.8 |
|
| 170 |
+
| [YOLO26m-sem](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26m-sem.pt) | 1024 × 2048 | 82.0 | 19.9 ± 0.1 | 14.3 | 304.5 |
|
| 171 |
+
| [YOLO26l-sem](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26l-sem.pt) | 1024 × 2048 | 82.9 | 26.5 ± 0.1 | 17.9 | 384.7 |
|
| 172 |
+
| [YOLO26x-sem](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26x-sem.pt) | 1024 × 2048 | 83.6 | 48.9 ± 0.2 | 40.2 | 861.7 |
|
| 173 |
+
|
| 174 |
+
- **mIoU<sup>val</sup>** values are for single-model single-scale on the [Cityscapes](https://www.cityscapes-dataset.com/) validation set. <br>Reproduce with `yolo semantic val data=cityscapes.yaml device=0 imgsz=2048`
|
| 175 |
+
- **Speed** metrics are averaged over Cityscapes validation images using an RTX3090 instance. <br>Reproduce with `yolo semantic val data=cityscapes.yaml batch=1 device=0|cpu imgsz=2048`
|
| 176 |
+
|
| 177 |
+
</details>
|
| 178 |
+
|
| 179 |
+
<details><summary>Classification (ImageNet)</summary>
|
| 180 |
+
|
| 181 |
+
Consult the [Classification Docs](https://docs.ultralytics.com/tasks/classify) for usage examples. These models are trained on [ImageNet](https://docs.ultralytics.com/datasets/classify/imagenet), covering 1000 classes.
|
| 182 |
+
|
| 183 |
+
| Model | size<br><sup>(pixels)</sup> | acc<br><sup>top1</sup> | acc<br><sup>top5</sup> | Speed<br><sup>CPU ONNX<br>(ms)</sup> | Speed<br><sup>T4 TensorRT10<br>(ms)</sup> | params<br><sup>(M)</sup> | FLOPs<br><sup>(B) at 224</sup> |
|
| 184 |
+
| -------------------------------------------------------------------------------------------- | --------------------------- | ---------------------- | ---------------------- | ------------------------------------ | ----------------------------------------- | ------------------------ | ------------------------------ |
|
| 185 |
+
| [YOLO26n-cls](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n-cls.pt) | 224 | 71.4 | 90.1 | 5.0 ± 0.3 | 1.1 ± 0.0 | 2.8 | 0.5 |
|
| 186 |
+
| [YOLO26s-cls](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26s-cls.pt) | 224 | 76.0 | 92.9 | 7.9 ± 0.2 | 1.3 ± 0.0 | 6.7 | 1.6 |
|
| 187 |
+
| [YOLO26m-cls](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26m-cls.pt) | 224 | 78.1 | 94.2 | 17.2 ± 0.4 | 2.0 ± 0.0 | 11.6 | 4.9 |
|
| 188 |
+
| [YOLO26l-cls](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26l-cls.pt) | 224 | 79.0 | 94.6 | 23.2 ± 0.3 | 2.8 ± 0.0 | 14.1 | 6.2 |
|
| 189 |
+
| [YOLO26x-cls](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26x-cls.pt) | 224 | 79.9 | 95.0 | 41.4 ± 0.9 | 3.8 ± 0.0 | 29.6 | 13.6 |
|
| 190 |
+
|
| 191 |
+
- **acc** values represent model accuracy on the [ImageNet](https://www.image-net.org/) dataset validation set. <br>Reproduce with `yolo val classify data=path/to/ImageNet device=0`
|
| 192 |
+
- **Speed** metrics are averaged over ImageNet val images using an [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) instance. CPU speeds measured with [ONNX](https://onnx.ai/) export. GPU speeds measured with [TensorRT](https://developer.nvidia.com/tensorrt) export. <br>Reproduce with `yolo val classify data=path/to/ImageNet batch=1 device=0|cpu`
|
| 193 |
+
|
| 194 |
+
</details>
|
| 195 |
+
|
| 196 |
+
<details><summary>Pose (COCO)</summary>
|
| 197 |
+
|
| 198 |
+
See the [Pose Estimation Docs](https://docs.ultralytics.com/tasks/pose) for usage examples. These models are trained on [COCO-Pose](https://docs.ultralytics.com/datasets/pose/coco), focusing on the 'person' class.
|
| 199 |
+
|
| 200 |
+
| Model | size<br><sup>(pixels)</sup> | mAP<sup>pose<br>50-95(e2e)</sup> | mAP<sup>pose<br>50(e2e)</sup> | Speed<br><sup>CPU ONNX<br>(ms)</sup> | Speed<br><sup>T4 TensorRT10<br>(ms)</sup> | params<br><sup>(M)</sup> | FLOPs<br><sup>(B)</sup> |
|
| 201 |
+
| ---------------------------------------------------------------------------------------------- | --------------------------- | -------------------------------- | ----------------------------- | ------------------------------------ | ----------------------------------------- | ------------------------ | ----------------------- |
|
| 202 |
+
| [YOLO26n-pose](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n-pose.pt) | 640 | 57.2 | 83.3 | 40.3 ± 0.5 | 1.8 ± 0.0 | 2.9 | 7.5 |
|
| 203 |
+
| [YOLO26s-pose](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26s-pose.pt) | 640 | 63.0 | 86.6 | 85.3 ± 0.9 | 2.7 ± 0.0 | 10.4 | 23.9 |
|
| 204 |
+
| [YOLO26m-pose](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26m-pose.pt) | 640 | 68.8 | 89.6 | 218.0 ± 1.5 | 5.0 ± 0.1 | 21.5 | 73.1 |
|
| 205 |
+
| [YOLO26l-pose](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26l-pose.pt) | 640 | 70.4 | 90.5 | 275.4 ± 2.4 | 6.5 ± 0.1 | 25.9 | 91.3 |
|
| 206 |
+
| [YOLO26x-pose](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26x-pose.pt) | 640 | 71.6 | 91.6 | 565.4 ± 3.0 | 12.2 ± 0.2 | 57.6 | 201.7 |
|
| 207 |
+
|
| 208 |
+
- **mAP<sup>val</sup>** values are for single-model single-scale on the [COCO Keypoints val2017](https://docs.ultralytics.com/datasets/pose/coco) dataset. See [YOLO Performance Metrics](https://docs.ultralytics.com/guides/yolo-performance-metrics) for details. <br>Reproduce with `yolo val pose data=coco-pose.yaml device=0`
|
| 209 |
+
- **Speed** metrics are averaged over COCO val images using an [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) instance. CPU speeds measured with [ONNX](https://onnx.ai/) export. GPU speeds measured with [TensorRT](https://developer.nvidia.com/tensorrt) export. <br>Reproduce with `yolo val pose data=coco-pose.yaml batch=1 device=0|cpu`
|
| 210 |
+
|
| 211 |
+
</details>
|
| 212 |
+
|
| 213 |
+
<details><summary>Oriented Bounding Boxes (DOTAv1)</summary>
|
| 214 |
+
|
| 215 |
+
Check the [OBB Docs](https://docs.ultralytics.com/tasks/obb) for usage examples. These models are trained on [DOTAv1](https://docs.ultralytics.com/datasets/obb/dota-v2#dota-v10), including 15 classes.
|
| 216 |
+
|
| 217 |
+
| Model | size<br><sup>(pixels)</sup> | mAP<sup>test<br>50-95(e2e)</sup> | mAP<sup>test<br>50(e2e)</sup> | Speed<br><sup>CPU ONNX<br>(ms)</sup> | Speed<br><sup>T4 TensorRT10<br>(ms)</sup> | params<br><sup>(M)</sup> | FLOPs<br><sup>(B)</sup> |
|
| 218 |
+
| -------------------------------------------------------------------------------------------- | --------------------------- | -------------------------------- | ----------------------------- | ------------------------------------ | ----------------------------------------- | ------------------------ | ----------------------- |
|
| 219 |
+
| [YOLO26n-obb](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n-obb.pt) | 1024 | 52.4 | 78.9 | 97.7 ± 0.9 | 2.8 ± 0.0 | 2.5 | 14.0 |
|
| 220 |
+
| [YOLO26s-obb](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26s-obb.pt) | 1024 | 54.8 | 80.9 | 218.0 ± 1.4 | 4.9 ± 0.1 | 9.8 | 55.1 |
|
| 221 |
+
| [YOLO26m-obb](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26m-obb.pt) | 1024 | 55.3 | 81.0 | 579.2 ± 3.8 | 10.2 ± 0.3 | 21.2 | 183.3 |
|
| 222 |
+
| [YOLO26l-obb](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26l-obb.pt) | 1024 | 56.2 | 81.6 | 735.6 ± 3.1 | 13.0 ± 0.2 | 25.6 | 230.0 |
|
| 223 |
+
| [YOLO26x-obb](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26x-obb.pt) | 1024 | 56.7 | 81.7 | 1485.7 ± 11.5 | 30.5 ± 0.9 | 57.6 | 516.5 |
|
| 224 |
+
|
| 225 |
+
- **mAP<sup>test</sup>** values are for single-model multiscale performance on the [DOTAv1 test set](https://captain-whu.github.io/DOTA/dataset.html). <br>Reproduce by `yolo val obb data=DOTAv1.yaml device=0 split=test` and submit merged results to the [DOTA evaluation server](https://captain-whu.github.io/DOTA/evaluation.html).
|
| 226 |
+
- **Speed** metrics are averaged over [DOTAv1 val images](https://docs.ultralytics.com/datasets/obb/dota-v2#dota-v10) using an [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) instance. CPU speeds measured with [ONNX](https://onnx.ai/) export. GPU speeds measured with [TensorRT](https://developer.nvidia.com/tensorrt) export. <br>Reproduce by `yolo val obb data=DOTAv1.yaml batch=1 device=0|cpu`
|
| 227 |
+
|
| 228 |
+
</details>
|
| 229 |
+
|
| 230 |
+
## 🧩 Integrations
|
| 231 |
+
|
| 232 |
+
Our key integrations with leading AI platforms extend the functionality of Ultralytics' offerings, enhancing tasks like dataset labeling, training, visualization, and model management. Discover how Ultralytics, in collaboration with partners like [Weights & Biases](https://docs.ultralytics.com/integrations/weights-biases), [Comet ML](https://docs.ultralytics.com/integrations/comet), [Roboflow](https://docs.ultralytics.com/integrations/roboflow), and [Intel OpenVINO](https://docs.ultralytics.com/integrations/openvino), can optimize your AI workflow. Explore more at [Ultralytics Integrations](https://docs.ultralytics.com/integrations).
|
| 233 |
+
|
| 234 |
+
<a href="https://platform.ultralytics.com" target="_blank">
|
| 235 |
+
<img width="100%" src="https://github.com/ultralytics/assets/raw/main/yolov8/banner-integrations.png" alt="Ultralytics active learning integrations">
|
| 236 |
+
</a>
|
| 237 |
+
|
| 238 |
+
## 🤝 Contribute
|
| 239 |
+
|
| 240 |
+
We thrive on community collaboration! Ultralytics YOLO wouldn't be the SOTA framework it is without contributions from developers like you. Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing) to get started. We also welcome your feedback—share your experience by completing our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey). A huge **Thank You** 🙏 to everyone who contributes!
|
| 241 |
+
|
| 242 |
+
<!-- SVG image from https://opencollective.com/ultralytics/contributors.svg?width=1280 -->
|
| 243 |
+
|
| 244 |
+
[](https://github.com/ultralytics/ultralytics/graphs/contributors)
|
| 245 |
+
|
| 246 |
+
We look forward to your contributions to help make the Ultralytics ecosystem even better!
|
| 247 |
+
|
| 248 |
+
## 📜 License
|
| 249 |
+
|
| 250 |
+
Ultralytics offers two licensing options to suit different needs:
|
| 251 |
+
|
| 252 |
+
- **AGPL-3.0 License**: This [OSI-approved](https://opensource.org/license/agpl-3.0) open-source license is perfect for students, researchers, and enthusiasts. It encourages open collaboration and knowledge sharing. See the [LICENSE](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) file for full details.
|
| 253 |
+
- **Ultralytics Enterprise License**: For development and production use, this license enables seamless integration of Ultralytics software and AI models into business products and services, including internal tools, automated workflows, and production deployments, bypassing the open-source requirements of AGPL-3.0. To get started, please contact us via [Ultralytics Licensing](https://www.ultralytics.com/license).
|
| 254 |
+
|
| 255 |
+
## 📞 Contact
|
| 256 |
+
|
| 257 |
+
For bug reports and feature requests related to Ultralytics software, please visit [GitHub Issues](https://github.com/ultralytics/ultralytics/issues). For questions, discussions, and community support, join our active communities on [Discord](https://discord.com/invite/ultralytics), [Reddit](https://www.reddit.com/r/ultralytics/), and the [Ultralytics Community Forums](https://community.ultralytics.com/). We're here to help with all things Ultralytics!
|
| 258 |
+
|
| 259 |
+
<br>
|
| 260 |
+
<div align="center">
|
| 261 |
+
<a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="3%" alt="Ultralytics GitHub"></a>
|
| 262 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
| 263 |
+
<a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="3%" alt="Ultralytics LinkedIn"></a>
|
| 264 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
| 265 |
+
<a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="3%" alt="Ultralytics Twitter"></a>
|
| 266 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
| 267 |
+
<a href="https://www.youtube.com/ultralytics?sub_confirmation=1"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="3%" alt="Ultralytics YouTube"></a>
|
| 268 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
| 269 |
+
<a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="3%" alt="Ultralytics TikTok"></a>
|
| 270 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
| 271 |
+
<a href="https://ultralytics.com/bilibili"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-bilibili.png" width="3%" alt="Ultralytics BiliBili"></a>
|
| 272 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
| 273 |
+
<a href="https://discord.com/invite/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="3%" alt="Ultralytics Discord"></a>
|
| 274 |
+
</div>
|
models_related/ultralytics/README.zh-CN.md
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div align="center">
|
| 2 |
+
<p>
|
| 3 |
+
<a href="https://platform.ultralytics.com/?utm_source=github&utm_medium=referral&utm_campaign=platform_launch&utm_content=banner&utm_term=ultralytics_github" target="_blank">
|
| 4 |
+
<img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov8/banner-yolov8.png" alt="Ultralytics YOLO banner"></a>
|
| 5 |
+
</p>
|
| 6 |
+
|
| 7 |
+
[中文](https://docs.ultralytics.com/zh) | [한국어](https://docs.ultralytics.com/ko) | [日本語](https://docs.ultralytics.com/ja) | [Русский](https://docs.ultralytics.com/ru) | [Deutsch](https://docs.ultralytics.com/de) | [Français](https://docs.ultralytics.com/fr) | [Español](https://docs.ultralytics.com/es) | [Português](https://docs.ultralytics.com/pt) | [Türkçe](https://docs.ultralytics.com/tr) | [Tiếng Việt](https://docs.ultralytics.com/vi) | [العربية](https://docs.ultralytics.com/ar) <br>
|
| 8 |
+
|
| 9 |
+
<div>
|
| 10 |
+
<a href="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yml"><img src="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yml/badge.svg" alt="Ultralytics CI"></a>
|
| 11 |
+
<a href="https://clickpy.clickhouse.com/dashboard/ultralytics"><img src="https://static.pepy.tech/badge/ultralytics" alt="Ultralytics Downloads"></a>
|
| 12 |
+
<a href="https://discord.com/invite/ultralytics"><img alt="Ultralytics Discord" src="https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue"></a>
|
| 13 |
+
<a href="https://community.ultralytics.com/"><img alt="Ultralytics Forums" src="https://img.shields.io/discourse/users?server=https%3A%2F%2Fcommunity.ultralytics.com&logo=discourse&label=Forums&color=blue"></a>
|
| 14 |
+
<a href="https://www.reddit.com/r/ultralytics/"><img alt="Ultralytics Reddit" src="https://img.shields.io/reddit/subreddit-subscribers/ultralytics?style=flat&logo=reddit&logoColor=white&label=Reddit&color=blue"></a>
|
| 15 |
+
<br>
|
| 16 |
+
<a href="https://console.paperspace.com/github/ultralytics/ultralytics"><img src="https://assets.paperspace.io/img/gradient-badge.svg" alt="Run Ultralytics on Gradient"></a>
|
| 17 |
+
<a href="https://colab.research.google.com/github/ultralytics/ultralytics/blob/main/examples/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open Ultralytics In Colab"></a>
|
| 18 |
+
<a href="https://www.kaggle.com/models/ultralytics/yolo26"><img src="https://kaggle.com/static/images/open-in-kaggle.svg" alt="Open Ultralytics In Kaggle"></a>
|
| 19 |
+
<a href="https://mybinder.org/v2/gh/ultralytics/ultralytics/HEAD?labpath=examples%2Ftutorial.ipynb"><img src="https://mybinder.org/badge_logo.svg" alt="Open Ultralytics In Binder"></a>
|
| 20 |
+
</div>
|
| 21 |
+
</div>
|
| 22 |
+
<br>
|
| 23 |
+
|
| 24 |
+
[Ultralytics](https://www.ultralytics.com/) 基于多年在计算机视觉和人工智能领域的基础研究,创造了尖端的、最先进的 (SOTA) [YOLO 模型](https://www.ultralytics.com/yolo)。我们的模型不断更新以提高性能和灵活性,具有**速度快**、**精度高**和**易于使用**的特点。它们在[目标检测](https://docs.ultralytics.com/tasks/detect)、[跟踪](https://docs.ultralytics.com/modes/track)、[实例分割](https://docs.ultralytics.com/tasks/segment)、[语义分割](https://docs.ultralytics.com/tasks/semantic)、[图像分类](https://docs.ultralytics.com/tasks/classify)和[姿态估计](https://docs.ultralytics.com/tasks/pose)任务中表现出色。
|
| 25 |
+
|
| 26 |
+
在 [Ultralytics 文档](https://docs.ultralytics.com/)中查找详细文档。通过 [GitHub Issues](https://github.com/ultralytics/ultralytics/issues/new/choose) 获取支持。加入 [Discord](https://discord.com/invite/ultralytics)、[Reddit](https://www.reddit.com/r/ultralytics/) 和 [Ultralytics 社区论坛](https://community.ultralytics.com/)参与讨论!
|
| 27 |
+
|
| 28 |
+
如需商业用途,请在 [Ultralytics 授权许可](https://www.ultralytics.com/license)申请企业许可证。
|
| 29 |
+
|
| 30 |
+
<a href="https://platform.ultralytics.com/ultralytics/yolo26" target="_blank">
|
| 31 |
+
<img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/refs/heads/main/yolo/performance-comparison.png" alt="YOLO26 performance plots">
|
| 32 |
+
</a>
|
| 33 |
+
|
| 34 |
+
<div align="center">
|
| 35 |
+
<a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="2%" alt="Ultralytics GitHub"></a>
|
| 36 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
| 37 |
+
<a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="2%" alt="Ultralytics LinkedIn"></a>
|
| 38 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
| 39 |
+
<a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="2%" alt="Ultralytics Twitter"></a>
|
| 40 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
| 41 |
+
<a href="https://www.youtube.com/ultralytics?sub_confirmation=1"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="2%" alt="Ultralytics YouTube"></a>
|
| 42 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
| 43 |
+
<a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="2%" alt="Ultralytics TikTok"></a>
|
| 44 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
| 45 |
+
<a href="https://ultralytics.com/bilibili"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-bilibili.png" width="2%" alt="Ultralytics BiliBili"></a>
|
| 46 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
| 47 |
+
<a href="https://discord.com/invite/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="2%" alt="Ultralytics Discord"></a>
|
| 48 |
+
</div>
|
| 49 |
+
|
| 50 |
+
## 📄 文档
|
| 51 |
+
|
| 52 |
+
请参阅下文了解快速安装和使用示例。有关训练、验证、预测和部署的全面指南,请参阅我们的完整 [Ultralytics 文档](https://docs.ultralytics.com/)。
|
| 53 |
+
|
| 54 |
+
<details open>
|
| 55 |
+
<summary>安装</summary>
|
| 56 |
+
|
| 57 |
+
在 [**Python>=3.8**](https://www.python.org/) 环境中安装 `ultralytics` 包,包括所有[依赖项](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml),并确保 [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/)。
|
| 58 |
+
|
| 59 |
+
[](https://pypi.org/project/ultralytics/) [](https://clickpy.clickhouse.com/dashboard/ultralytics) [](https://pypi.org/project/ultralytics/)
|
| 60 |
+
|
| 61 |
+
```bash
|
| 62 |
+
pip install ultralytics
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
有关其他安装方法,包括 [Conda](https://anaconda.org/conda-forge/ultralytics)、[Docker](https://hub.docker.com/r/ultralytics/ultralytics) 以及通过 Git 从源代码构建,请查阅[快速入门指南](https://docs.ultralytics.com/quickstart)。
|
| 66 |
+
|
| 67 |
+
[](https://anaconda.org/conda-forge/ultralytics) [](https://hub.docker.com/r/ultralytics/ultralytics) [](https://hub.docker.com/r/ultralytics/ultralytics)
|
| 68 |
+
|
| 69 |
+
</details>
|
| 70 |
+
|
| 71 |
+
<details open>
|
| 72 |
+
<summary>使用方法</summary>
|
| 73 |
+
|
| 74 |
+
### CLI
|
| 75 |
+
|
| 76 |
+
您可以直接通过命令行界面 (CLI) 使用 `yolo` 命令来运行 Ultralytics YOLO:
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
# 使用预训练的 YOLO 模型 (例如 YOLO26n) 对图像进行预测
|
| 80 |
+
yolo predict model=yolo26n.pt source='https://ultralytics.com/images/bus.jpg'
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
`yolo` 命令支持各种任务和模式,并接受额外的参数,如 `imgsz=640`。浏览 YOLO [CLI 文档](https://docs.ultralytics.com/usage/cli)获取更多示例。
|
| 84 |
+
|
| 85 |
+
### Python
|
| 86 |
+
|
| 87 |
+
Ultralytics YOLO 也可以直接集成到您的 Python 项目中。它接受与 CLI 相同的[配置参数](https://docs.ultralytics.com/usage/cfg):
|
| 88 |
+
|
| 89 |
+
```python
|
| 90 |
+
from ultralytics import YOLO
|
| 91 |
+
|
| 92 |
+
# 加载一个预训练的 YOLO26n 模型
|
| 93 |
+
model = YOLO("yolo26n.pt")
|
| 94 |
+
|
| 95 |
+
# 在 COCO8 数据集上训练模型 100 个周期
|
| 96 |
+
train_results = model.train(
|
| 97 |
+
data="coco8.yaml", # 数据集配置文件路径
|
| 98 |
+
epochs=100, # 训练周期数
|
| 99 |
+
imgsz=640, # 训练图像尺寸
|
| 100 |
+
device="cpu", # 运行设备 (例如 'cpu', 0, [0,1,2,3])
|
| 101 |
+
)
|
| 102 |
+
|
| 103 |
+
# 评估模型在验证集上的性能
|
| 104 |
+
metrics = model.val()
|
| 105 |
+
|
| 106 |
+
# 对图像执行目标检测
|
| 107 |
+
results = model("path/to/image.jpg") # 对图像进行预测
|
| 108 |
+
results[0].show() # 显示结果
|
| 109 |
+
|
| 110 |
+
# 将模型导出为 ONNX 格式以进行部署
|
| 111 |
+
path = model.export(format="onnx") # 返回导出模型的路径
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
在 YOLO [Python 文档](https://docs.ultralytics.com/usage/python)中发现更多示例。
|
| 115 |
+
|
| 116 |
+
</details>
|
| 117 |
+
|
| 118 |
+
## ✨ 模型
|
| 119 |
+
|
| 120 |
+
Ultralytics 支持广泛的 YOLO 模型,从早期的版本如 [YOLOv3](https://docs.ultralytics.com/models/yolov3) 到最新的 [YOLO26](https://docs.ultralytics.com/models/yolo26)。下表展示了在 [COCO](https://docs.ultralytics.com/datasets/detect/coco) 上预训练的 YOLO26 模型,用于[检测](https://docs.ultralytics.com/tasks/detect)、[分割](https://docs.ultralytics.com/tasks/segment)和[姿态估计](https://docs.ultralytics.com/tasks/pose)任务。[语义分割](https://docs.ultralytics.com/tasks/semantic)模型在 [Cityscapes](https://docs.ultralytics.com/datasets/semantic/cityscapes) 上预训练,[分类](https://docs.ultralytics.com/tasks/classify)模型在 [ImageNet](https://docs.ultralytics.com/datasets/classify/imagenet) 上预训练。[跟踪](https://docs.ultralytics.com/modes/track)模式与检测、分割和姿态模型兼容。所有[模型](https://docs.ultralytics.com/models)在首次使用时都会自动从最新的 Ultralytics [发布版本](https://github.com/ultralytics/assets/releases)下载。
|
| 121 |
+
|
| 122 |
+
<a href="https://docs.ultralytics.com/tasks" target="_blank">
|
| 123 |
+
<img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/docs/ultralytics-yolov8-tasks-banner.avif" alt="Ultralytics YOLO supported tasks">
|
| 124 |
+
</a>
|
| 125 |
+
<br>
|
| 126 |
+
<br>
|
| 127 |
+
|
| 128 |
+
<details open><summary>检测 (COCO)</summary>
|
| 129 |
+
|
| 130 |
+
浏览[检测文档](https://docs.ultralytics.com/tasks/detect)获取使用示例。这些模型在 [COCO 数据集](https://cocodataset.org/)上训练,包含 80 个对象类别。
|
| 131 |
+
|
| 132 |
+
| 模型 | 尺寸<br><sup>(像素) | mAP<sup>val<br>50-95 | mAP<sup>val<br>50-95(e2e) | 速度<br><sup>CPU ONNX<br>(毫秒) | 速度<br><sup>T4 TensorRT10<br>(毫秒) | 参数<br><sup>(百万) | FLOPs<br><sup>(十亿) |
|
| 133 |
+
| ------------------------------------------------------------------------------------ | ------------------- | -------------------- | ------------------------- | ------------------------------- | ------------------------------------ | ------------------- | -------------------- |
|
| 134 |
+
| [YOLO26n](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n.pt) | 640 | 40.9 | 40.1 | 38.9 ± 0.7 | 1.7 ± 0.0 | 2.4 | 5.4 |
|
| 135 |
+
| [YOLO26s](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26s.pt) | 640 | 48.6 | 47.8 | 87.2 ± 0.9 | 2.5 ± 0.0 | 9.5 | 20.7 |
|
| 136 |
+
| [YOLO26m](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26m.pt) | 640 | 53.1 | 52.5 | 220.0 ± 1.4 | 4.7 ± 0.1 | 20.4 | 68.2 |
|
| 137 |
+
| [YOLO26l](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26l.pt) | 640 | 55.0 | 54.4 | 286.2 ± 2.0 | 6.2 ± 0.2 | 24.8 | 86.4 |
|
| 138 |
+
| [YOLO26x](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26x.pt) | 640 | 57.5 | 56.9 | 525.8 ± 4.0 | 11.8 ± 0.2 | 55.7 | 193.9 |
|
| 139 |
+
|
| 140 |
+
- **mAP<sup>val</sup>** 值指的是在 [COCO val2017](https://cocodataset.org/) 数据集上的单模型单尺度性能。详见 [YOLO 性能指标](https://docs.ultralytics.com/guides/yolo-performance-metrics)。<br>使用 `yolo val detect data=coco.yaml device=0` 复现结果。
|
| 141 |
+
- **速度** 指标是在 [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) 实例上对 COCO val 图像进行平均测量的。CPU 速度使用 [ONNX](https://onnx.ai/) 导出进行测量。GPU 速度使用 [TensorRT](https://developer.nvidia.com/tensorrt) 导出进行测量。<br>使用 `yolo val detect data=coco.yaml batch=1 device=0|cpu` 复现结果。
|
| 142 |
+
|
| 143 |
+
</details>
|
| 144 |
+
|
| 145 |
+
<details><summary>分割 (COCO)</summary>
|
| 146 |
+
|
| 147 |
+
请参阅[分割文档](https://docs.ultralytics.com/tasks/segment)获取使用示例。这些模型在 [COCO-Seg](https://docs.ultralytics.com/datasets/segment/coco) 数据集上训练,包含 80 个类别。
|
| 148 |
+
|
| 149 |
+
| 模型 | 尺寸<br><sup>(像素) | mAP<sup>box<br>50-95(e2e) | mAP<sup>mask<br>50-95(e2e) | 速度<br><sup>CPU ONNX<br>(毫秒) | 速度<br><sup>T4 TensorRT10<br>(毫秒) | 参数<br><sup>(百万) | FLOPs<br><sup>(十亿) |
|
| 150 |
+
| -------------------------------------------------------------------------------------------- | ------------------- | ------------------------- | -------------------------- | ------------------------------- | ------------------------------------ | ------------------- | -------------------- |
|
| 151 |
+
| [YOLO26n-seg](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n-seg.pt) | 640 | 39.6 | 33.9 | 53.3 ± 0.5 | 2.1 ± 0.0 | 2.7 | 9.1 |
|
| 152 |
+
| [YOLO26s-seg](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26s-seg.pt) | 640 | 47.3 | 40.0 | 118.4 ± 0.9 | 3.3 ± 0.0 | 10.4 | 34.2 |
|
| 153 |
+
| [YOLO26m-seg](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26m-seg.pt) | 640 | 52.5 | 44.1 | 328.2 ± 2.4 | 6.7 ± 0.1 | 23.6 | 121.5 |
|
| 154 |
+
| [YOLO26l-seg](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26l-seg.pt) | 640 | 54.4 | 45.5 | 387.0 ± 3.7 | 8.0 ± 0.1 | 28.0 | 139.8 |
|
| 155 |
+
| [YOLO26x-seg](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26x-seg.pt) | 640 | 56.5 | 47.0 | 787.0 ± 6.8 | 16.4 ± 0.1 | 62.8 | 313.5 |
|
| 156 |
+
|
| 157 |
+
- **mAP<sup>val</sup>** 值指的是在 [COCO val2017](https://cocodataset.org/) 数据集上的单模型单尺度性能。详见 [YOLO 性能指标](https://docs.ultralytics.com/guides/yolo-performance-metrics)。<br>使用 `yolo val segment data=coco.yaml device=0` 复现结果。
|
| 158 |
+
- **速度** 指标是在 [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) 实例上对 COCO val 图像进行平均测量的。CPU 速度使用 [ONNX](https://onnx.ai/) 导出进行测量。GPU 速度使用 [TensorRT](https://developer.nvidia.com/tensorrt) 导出进行测量。<br>使用 `yolo val segment data=coco.yaml batch=1 device=0|cpu` 复现结果。
|
| 159 |
+
|
| 160 |
+
</details>
|
| 161 |
+
|
| 162 |
+
<details><summary>语义分割 (Cityscapes)</summary>
|
| 163 |
+
|
| 164 |
+
请参阅[语义分割文档](https://docs.ultralytics.com/tasks/semantic)获取使用示例。这些模型在 [Cityscapes](https://docs.ultralytics.com/datasets/semantic/cityscapes) 数据集上训练,包含 19 个类别。
|
| 165 |
+
|
| 166 |
+
| 模型 | 尺寸<br><sup>(像素) | mIoU<sup>val | 速度<br><sup>RTX3090 PyTorch<br>(毫秒) | 参数<br><sup>(百万) | FLOPs<br><sup>(十亿) |
|
| 167 |
+
| -------------------------------------------------------------------------------------------- | ------------------- | ------------ | -------------------------------------- | ------------------- | -------------------- |
|
| 168 |
+
| [YOLO26n-sem](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n-sem.pt) | 1024 × 2048 | 78.3 | 4.4 ± 0.0 | 1.6 | 22.7 |
|
| 169 |
+
| [YOLO26s-sem](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26s-sem.pt) | 1024 × 2048 | 80.8 | 8.4 ± 0.0 | 6.5 | 88.8 |
|
| 170 |
+
| [YOLO26m-sem](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26m-sem.pt) | 1024 × 2048 | 82.0 | 19.9 ± 0.1 | 14.3 | 304.5 |
|
| 171 |
+
| [YOLO26l-sem](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26l-sem.pt) | 1024 × 2048 | 82.9 | 26.5 ± 0.1 | 17.9 | 384.7 |
|
| 172 |
+
| [YOLO26x-sem](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26x-sem.pt) | 1024 × 2048 | 83.6 | 48.9 ± 0.2 | 40.2 | 861.7 |
|
| 173 |
+
|
| 174 |
+
- **mIoU<sup>val</sup>** 值指的是在 [Cityscapes](https://www.cityscapes-dataset.com/) 验证集上的单模型单尺度性能。<br>使用 `yolo semantic val data=cityscapes.yaml device=0 imgsz=2048` 复现结果。
|
| 175 |
+
- **速度** 指标是在 RTX3090 实例上对 Cityscapes 验证集图像进行平均测量的。<br>使用 `yolo semantic val data=cityscapes.yaml batch=1 device=0|cpu imgsz=2048` 复现结果。
|
| 176 |
+
|
| 177 |
+
</details>
|
| 178 |
+
|
| 179 |
+
<details><summary>分类 (ImageNet)</summary>
|
| 180 |
+
|
| 181 |
+
请查阅[分类文档](https://docs.ultralytics.com/tasks/classify)获取使用示例。这些模型在 [ImageNet](https://docs.ultralytics.com/datasets/classify/imagenet) 数据集上训练,涵盖 1000 个类别。
|
| 182 |
+
|
| 183 |
+
| 模型 | 尺寸<br><sup>(像素) | acc<br><sup>top1 | acc<br><sup>top5 | 速度<br><sup>CPU ONNX<br>(毫秒) | 速度<br><sup>T4 TensorRT10<br>(毫秒) | 参数<br><sup>(百万) | FLOPs<br><sup>(十亿) @ 224 |
|
| 184 |
+
| -------------------------------------------------------------------------------------------- | ------------------- | ---------------- | ---------------- | ------------------------------- | ------------------------------------ | ------------------- | -------------------------- |
|
| 185 |
+
| [YOLO26n-cls](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n-cls.pt) | 224 | 71.4 | 90.1 | 5.0 ± 0.3 | 1.1 ± 0.0 | 2.8 | 0.5 |
|
| 186 |
+
| [YOLO26s-cls](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26s-cls.pt) | 224 | 76.0 | 92.9 | 7.9 ± 0.2 | 1.3 ± 0.0 | 6.7 | 1.6 |
|
| 187 |
+
| [YOLO26m-cls](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26m-cls.pt) | 224 | 78.1 | 94.2 | 17.2 ± 0.4 | 2.0 ± 0.0 | 11.6 | 4.9 |
|
| 188 |
+
| [YOLO26l-cls](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26l-cls.pt) | 224 | 79.0 | 94.6 | 23.2 ± 0.3 | 2.8 ± 0.0 | 14.1 | 6.2 |
|
| 189 |
+
| [YOLO26x-cls](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26x-cls.pt) | 224 | 79.9 | 95.0 | 41.4 ± 0.9 | 3.8 ± 0.0 | 29.6 | 13.6 |
|
| 190 |
+
|
| 191 |
+
- **acc** 值表示模型在 [ImageNet](https://www.image-net.org/) 数据集验证集上的准确率。<br>使用 `yolo val classify data=path/to/ImageNet device=0` 复现结果。
|
| 192 |
+
- **速度** 指标是在 [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) 实例上对 ImageNet val 图像进行平均测量的。CPU 速度使用 [ONNX](https://onnx.ai/) 导出进行测量。GPU 速度使用 [TensorRT](https://developer.nvidia.com/tensorrt) 导出进行测量。<br>使用 `yolo val classify data=path/to/ImageNet batch=1 device=0|cpu` 复现结果。
|
| 193 |
+
|
| 194 |
+
</details>
|
| 195 |
+
|
| 196 |
+
<details><summary>姿态估计 (COCO)</summary>
|
| 197 |
+
|
| 198 |
+
请参阅[姿态估计文档](https://docs.ultralytics.com/tasks/pose)获取使用示例。这些模型在 [COCO-Pose](https://docs.ultralytics.com/datasets/pose/coco) 数据集上训练,专注于 'person' 类别。
|
| 199 |
+
|
| 200 |
+
| 模型 | 尺寸<br><sup>(像素) | mAP<sup>pose<br>50-95(e2e) | mAP<sup>pose<br>50(e2e) | 速度<br><sup>CPU ONNX<br>(毫秒) | 速度<br><sup>T4 TensorRT10<br>(毫秒) | 参数<br><sup>(百万) | FLOPs<br><sup>(十亿) |
|
| 201 |
+
| ---------------------------------------------------------------------------------------------- | ------------------- | -------------------------- | ----------------------- | ------------------------------- | ------------------------------------ | ------------------- | -------------------- |
|
| 202 |
+
| [YOLO26n-pose](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n-pose.pt) | 640 | 57.2 | 83.3 | 40.3 ± 0.5 | 1.8 ± 0.0 | 2.9 | 7.5 |
|
| 203 |
+
| [YOLO26s-pose](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26s-pose.pt) | 640 | 63.0 | 86.6 | 85.3 ± 0.9 | 2.7 ± 0.0 | 10.4 | 23.9 |
|
| 204 |
+
| [YOLO26m-pose](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26m-pose.pt) | 640 | 68.8 | 89.6 | 218.0 ± 1.5 | 5.0 ± 0.1 | 21.5 | 73.1 |
|
| 205 |
+
| [YOLO26l-pose](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26l-pose.pt) | 640 | 70.4 | 90.5 | 275.4 ± 2.4 | 6.5 ± 0.1 | 25.9 | 91.3 |
|
| 206 |
+
| [YOLO26x-pose](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26x-pose.pt) | 640 | 71.6 | 91.6 | 565.4 ± 3.0 | 12.2 ± 0.2 | 57.6 | 201.7 |
|
| 207 |
+
|
| 208 |
+
- **mAP<sup>val</sup>** 值指的是在 [COCO Keypoints val2017](https://docs.ultralytics.com/datasets/pose/coco) 数据集上的单模型单尺度性能。详见 [YOLO 性能指标](https://docs.ultralytics.com/guides/yolo-performance-metrics)。<br>使用 `yolo val pose data=coco-pose.yaml device=0` 复现结果。
|
| 209 |
+
- **速度** 指标是在 [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) 实例上对 COCO val 图像进行平均测量的。CPU 速度使用 [ONNX](https://onnx.ai/) 导出进行测量。GPU 速度使用 [TensorRT](https://developer.nvidia.com/tensorrt) 导出进行测量。<br>使用 `yolo val pose data=coco-pose.yaml batch=1 device=0|cpu` 复现结果。
|
| 210 |
+
|
| 211 |
+
</details>
|
| 212 |
+
|
| 213 |
+
<details><summary>定向边界框 (DOTAv1)</summary>
|
| 214 |
+
|
| 215 |
+
请查阅 [OBB 文档](https://docs.ultralytics.com/tasks/obb)获取使用示例。这些模型在 [DOTAv1](https://docs.ultralytics.com/datasets/obb/dota-v2#dota-v10) 数据集上训练,包含 15 个类别。
|
| 216 |
+
|
| 217 |
+
| 模型 | 尺寸<br><sup>(像素) | mAP<sup>test<br>50-95(e2e) | mAP<sup>test<br>50(e2e) | 速度<br><sup>CPU ONNX<br>(毫秒) | 速度<br><sup>T4 TensorRT10<br>(毫秒) | 参数<br><sup>(百万) | FLOPs<br><sup>(十亿) |
|
| 218 |
+
| -------------------------------------------------------------------------------------------- | ------------------- | -------------------------- | ----------------------- | ------------------------------- | ------------------------------------ | ------------------- | -------------------- |
|
| 219 |
+
| [YOLO26n-obb](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n-obb.pt) | 1024 | 52.4 | 78.9 | 97.7 ± 0.9 | 2.8 ± 0.0 | 2.5 | 14.0 |
|
| 220 |
+
| [YOLO26s-obb](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26s-obb.pt) | 1024 | 54.8 | 80.9 | 218.0 ± 1.4 | 4.9 ± 0.1 | 9.8 | 55.1 |
|
| 221 |
+
| [YOLO26m-obb](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26m-obb.pt) | 1024 | 55.3 | 81.0 | 579.2 ± 3.8 | 10.2 ± 0.3 | 21.2 | 183.3 |
|
| 222 |
+
| [YOLO26l-obb](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26l-obb.pt) | 1024 | 56.2 | 81.6 | 735.6 ± 3.1 | 13.0 ± 0.2 | 25.6 | 230.0 |
|
| 223 |
+
| [YOLO26x-obb](https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26x-obb.pt) | 1024 | 56.7 | 81.7 | 1485.7 ± 11.5 | 30.5 ± 0.9 | 57.6 | 516.5 |
|
| 224 |
+
|
| 225 |
+
- **mAP<sup>test</sup>** 值指的是在 [DOTAv1 测试集](https://captain-whu.github.io/DOTA/dataset.html)上的单模型多尺度性能。<br>通过 `yolo val obb data=DOTAv1.yaml device=0 split=test` 复现结果,并将合并后的结果提交到 [DOTA 评估服务器](https://captain-whu.github.io/DOTA/evaluation.html)。
|
| 226 |
+
- **速度** 指标是在 [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) 实例上对 [DOTAv1 val 图像](https://docs.ultralytics.com/datasets/obb/dota-v2#dota-v10)进行平均测量的。CPU 速度使用 [ONNX](https://onnx.ai/) 导出进行测量。GPU 速度使用 [TensorRT](https://developer.nvidia.com/tensorrt) 导出进行测量。<br>通过 `yolo val obb data=DOTAv1.yaml batch=1 device=0|cpu` 复现结果。
|
| 227 |
+
|
| 228 |
+
</details>
|
| 229 |
+
|
| 230 |
+
## 🧩 集成
|
| 231 |
+
|
| 232 |
+
我们与领先 AI 平台的关键集成扩展了 Ultralytics 产品的功能,增强了数据集标注、训练、可视化和模型管理等任务。了解 Ultralytics 如何与 [Weights & Biases](https://docs.ultralytics.com/integrations/weights-biases)、[Comet ML](https://docs.ultralytics.com/integrations/comet)、[Roboflow](https://docs.ultralytics.com/integrations/roboflow) 和 [Intel OpenVINO](https://docs.ultralytics.com/integrations/openvino) 等合作伙伴协作,优化您的 AI 工作流程。在 [Ultralytics 集成](https://docs.ultralytics.com/integrations)了解更多信息。
|
| 233 |
+
|
| 234 |
+
<a href="https://platform.ultralytics.com" target="_blank">
|
| 235 |
+
<img width="100%" src="https://github.com/ultralytics/assets/raw/main/yolov8/banner-integrations.png" alt="Ultralytics active learning integrations">
|
| 236 |
+
</a>
|
| 237 |
+
|
| 238 |
+
## 🤝 贡献
|
| 239 |
+
|
| 240 |
+
我们依靠社区协作蓬勃发展!没有像您这样的开发者的贡献,Ultralytics YOLO 就不会成为如今最先进的框架。请参阅我们的[贡献指南](https://docs.ultralytics.com/help/contributing)开始贡献。我们也欢迎您的反馈——通过完成我们的[调查问卷](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey)分享您的体验。非常**感谢** 🙏 每一位贡献者!
|
| 241 |
+
|
| 242 |
+
<!-- SVG image from https://opencollective.com/ultralytics/contributors.svg?width=1280 -->
|
| 243 |
+
|
| 244 |
+
[](https://github.com/ultralytics/ultralytics/graphs/contributors)
|
| 245 |
+
|
| 246 |
+
我们期待您的贡献,帮助 Ultralytics 生态系统变得更好!
|
| 247 |
+
|
| 248 |
+
## 📜 许可证
|
| 249 |
+
|
| 250 |
+
Ultralytics 提供两种许可选项以满足不同需求:
|
| 251 |
+
|
| 252 |
+
- **AGPL-3.0 许可证**:这种经 [OSI 批准](https://opensource.org/license/agpl-3.0)的开源许可证非常适合学生、研究人员和爱好者。它鼓励开放协作和知识共享。有关完整详细信息,请参阅 [LICENSE](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) 文件。
|
| 253 |
+
- **Ultralytics 企业许可证**:适用于开发和生产用途,此许可证允许将 Ultralytics 软件和 AI 模型无缝集成到业务产品和服务中,包括内部工具、自动化工作流和生产部署,绕过 AGPL-3.0 的开源要求。如需开始使用,请通过 [Ultralytics 授权许可](https://www.ultralytics.com/license)与我们联系。
|
| 254 |
+
|
| 255 |
+
## 📞 联系方式
|
| 256 |
+
|
| 257 |
+
有关 Ultralytics 软件的错误报告和功能请求,请访问 [GitHub Issues](https://github.com/ultralytics/ultralytics/issues)。如有疑问、讨论和社区支持,请加入我们在 [Discord](https://discord.com/invite/ultralytics)、[Reddit](https://www.reddit.com/r/ultralytics/) 和 [Ultralytics 社区论坛](https://community.ultralytics.com/)上的活跃社区。我们随时为您提供有关 Ultralytics 的所有帮助!
|
| 258 |
+
|
| 259 |
+
<br>
|
| 260 |
+
<div align="center">
|
| 261 |
+
<a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="3%" alt="Ultralytics GitHub"></a>
|
| 262 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
| 263 |
+
<a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="3%" alt="Ultralytics LinkedIn"></a>
|
| 264 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
| 265 |
+
<a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="3%" alt="Ultralytics Twitter"></a>
|
| 266 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
| 267 |
+
<a href="https://www.youtube.com/ultralytics?sub_confirmation=1"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="3%" alt="Ultralytics YouTube"></a>
|
| 268 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
| 269 |
+
<a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="3%" alt="Ultralytics TikTok"></a>
|
| 270 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
| 271 |
+
<a href="https://ultralytics.com/bilibili"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-bilibili.png" width="3%" alt="Ultralytics BiliBili"></a>
|
| 272 |
+
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
| 273 |
+
<a href="https://discord.com/invite/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="3%" alt="Ultralytics Discord"></a>
|
| 274 |
+
</div>
|
models_related/ultralytics/docker/Dockerfile
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Builds ultralytics/ultralytics:latest image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
| 4 |
+
# Image is CUDA-optimized for YOLO single/multi-GPU training and inference
|
| 5 |
+
|
| 6 |
+
# Start FROM PyTorch image https://hub.docker.com/r/pytorch/pytorch or nvcr.io/nvidia/pytorch:25.02-py3
|
| 7 |
+
FROM pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime
|
| 8 |
+
|
| 9 |
+
# Set environment variables
|
| 10 |
+
# Avoid DDP error "MKL_THREADING_LAYER=INTEL is incompatible with libgomp.so.1 library"
|
| 11 |
+
# Suppress TensorFlow cuDNN, cuBLAS, and cuFFT Registration Warnings and PyTorch NNPACK warnings
|
| 12 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 13 |
+
PYTHONDONTWRITEBYTECODE=1 \
|
| 14 |
+
PIP_NO_CACHE_DIR=1 \
|
| 15 |
+
PIP_BREAK_SYSTEM_PACKAGES=1 \
|
| 16 |
+
UV_BREAK_SYSTEM_PACKAGES=1 \
|
| 17 |
+
MKL_THREADING_LAYER=GNU \
|
| 18 |
+
OMP_NUM_THREADS=1 \
|
| 19 |
+
TF_CPP_MIN_LOG_LEVEL=3 \
|
| 20 |
+
TORCH_CPP_LOG_LEVEL=ERROR
|
| 21 |
+
|
| 22 |
+
# Downloads to user config dir
|
| 23 |
+
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
| 24 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
| 25 |
+
/root/.config/Ultralytics/
|
| 26 |
+
|
| 27 |
+
# Install linux packages
|
| 28 |
+
# gnupg required for Edge TPU install
|
| 29 |
+
# libsm6 required by libqxcb to create QT-based windows for visualization; set 'QT_DEBUG_PLUGINS=1' to test in docker
|
| 30 |
+
RUN apt-get update && \
|
| 31 |
+
apt-get install -y --no-install-recommends \
|
| 32 |
+
gcc git zip unzip wget curl htop libgl1 libglib2.0-0 gnupg libsm6 && \
|
| 33 |
+
apt-get clean && \
|
| 34 |
+
rm -rf /var/lib/apt/lists/*
|
| 35 |
+
|
| 36 |
+
# Create working directory
|
| 37 |
+
WORKDIR /ultralytics
|
| 38 |
+
|
| 39 |
+
# Copy contents and configure git
|
| 40 |
+
COPY . .
|
| 41 |
+
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \
|
| 42 |
+
sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
|
| 43 |
+
ADD https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n.pt .
|
| 44 |
+
|
| 45 |
+
# Install pip packages (uv already installed in base image)
|
| 46 |
+
RUN uv pip install --system --no-cache -e "." albumentations faster-coco-eval && \
|
| 47 |
+
rm -rf tmp /root/.config/Ultralytics/persistent_cache.json
|
| 48 |
+
|
| 49 |
+
# Usage --------------------------------------------------------------------------------------------------------------
|
| 50 |
+
|
| 51 |
+
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
| 52 |
+
# Example (build): t=ultralytics/ultralytics:latest && docker build -f docker/Dockerfile -t $t .
|
| 53 |
+
# Example (push): docker push $t
|
| 54 |
+
# Example (pull): t=ultralytics/ultralytics:latest && docker pull $t
|
| 55 |
+
# Example (run-gpu): docker run -it --ipc=host --runtime=nvidia --gpus all $t
|
| 56 |
+
# Example (run-gpu-subset): docker run -it --ipc=host --runtime=nvidia --gpus "device=2,3" $t
|
| 57 |
+
# Note: device=2,3 maps to CUDA 0,1 inside the container.
|
| 58 |
+
# Example (run-with-volume): docker run -it --ipc=host --runtime=nvidia --gpus all -v "$PWD/shared/datasets:/datasets" $t
|
| 59 |
+
# Example (tag-release): t=ultralytics/ultralytics:latest tnew=ultralytics/ultralytics:vX.Y && docker tag $t $tnew && docker push $tnew
|
models_related/ultralytics/docker/Dockerfile-arm64
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Builds ultralytics/ultralytics:latest-arm64 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
| 4 |
+
# Image is aarch64-compatible for Apple M1, M2, M3, Raspberry Pi and other ARM architectures
|
| 5 |
+
|
| 6 |
+
# Start FROM Ubuntu image https://hub.docker.com/_/ubuntu with "FROM arm64v8/ubuntu:22.04" (deprecated)
|
| 7 |
+
# Start FROM Debian image for arm64v8 https://hub.docker.com/r/arm64v8/debian (deprecated)
|
| 8 |
+
# Start FROM official arm64v8 Ubuntu 24.04 image https://hub.docker.com/layers/arm64v8/ubuntu/24.04/
|
| 9 |
+
FROM arm64v8/ubuntu:24.04
|
| 10 |
+
|
| 11 |
+
# Set environment variables (suppress PyTorch NNPACK warnings)
|
| 12 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 13 |
+
PYTHONDONTWRITEBYTECODE=1 \
|
| 14 |
+
PIP_NO_CACHE_DIR=1 \
|
| 15 |
+
PIP_BREAK_SYSTEM_PACKAGES=1 \
|
| 16 |
+
UV_BREAK_SYSTEM_PACKAGES=1 \
|
| 17 |
+
TORCH_CPP_LOG_LEVEL=ERROR
|
| 18 |
+
|
| 19 |
+
# Downloads to user config dir
|
| 20 |
+
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
| 21 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
| 22 |
+
/root/.config/Ultralytics/
|
| 23 |
+
|
| 24 |
+
# Install linux packages
|
| 25 |
+
# TensorFlow on aarch64 may require pkg-config and libhdf5-dev if h5py builds from source.
|
| 26 |
+
RUN apt-get update && \
|
| 27 |
+
apt-get install -y --no-install-recommends \
|
| 28 |
+
python3-pip git zip unzip wget curl htop gcc libgl1 libglib2.0-0 gnupg && \
|
| 29 |
+
apt-get clean && \
|
| 30 |
+
rm -rf /var/lib/apt/lists/*
|
| 31 |
+
|
| 32 |
+
# Create working directory
|
| 33 |
+
WORKDIR /ultralytics
|
| 34 |
+
|
| 35 |
+
# Copy contents and configure git
|
| 36 |
+
COPY . .
|
| 37 |
+
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \
|
| 38 |
+
sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
|
| 39 |
+
ADD https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n.pt .
|
| 40 |
+
|
| 41 |
+
# Install pip packages, create python symlink, and remove build files
|
| 42 |
+
RUN python3 -m pip install uv && \
|
| 43 |
+
uv pip install --system -e ".[export]" --extra-index-url https://download.pytorch.org/whl/cpu --index-strategy unsafe-best-match && \
|
| 44 |
+
# Creates a symbolic link to make 'python' point to 'python3'
|
| 45 |
+
ln -sf /usr/bin/python3 /usr/bin/python && \
|
| 46 |
+
# Remove extra build files
|
| 47 |
+
rm -rf /root/.config/Ultralytics/persistent_cache.json
|
| 48 |
+
|
| 49 |
+
# Usage --------------------------------------------------------------------------------------------------------------
|
| 50 |
+
|
| 51 |
+
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
| 52 |
+
# Example (build): t=ultralytics/ultralytics:latest-arm64 && docker build --platform linux/arm64 -f docker/Dockerfile-arm64 -t $t .
|
| 53 |
+
# Example (push): docker push $t
|
| 54 |
+
# Example (pull): t=ultralytics/ultralytics:latest-arm64 && docker pull $t
|
| 55 |
+
# Example (run): docker run -it --ipc=host $t
|
| 56 |
+
# Example (run-with-volume): docker run -it --ipc=host -v "$PWD/shared/datasets:/datasets" $t
|
models_related/ultralytics/docker/Dockerfile-conda
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Builds ultralytics/ultralytics:latest-conda image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
| 4 |
+
# Image is optimized for Ultralytics Anaconda (https://anaconda.org/conda-forge/ultralytics) installation and usage
|
| 5 |
+
|
| 6 |
+
# Start FROM miniconda3 image https://hub.docker.com/r/continuumio/miniconda3
|
| 7 |
+
FROM continuumio/miniconda3:latest
|
| 8 |
+
|
| 9 |
+
# Set environment variables
|
| 10 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 11 |
+
PYTHONDONTWRITEBYTECODE=1 \
|
| 12 |
+
PIP_NO_CACHE_DIR=1 \
|
| 13 |
+
PIP_BREAK_SYSTEM_PACKAGES=1
|
| 14 |
+
|
| 15 |
+
# Downloads to user config dir
|
| 16 |
+
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
| 17 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
| 18 |
+
/root/.config/Ultralytics/
|
| 19 |
+
|
| 20 |
+
# Install linux packages and conda packages
|
| 21 |
+
RUN apt-get update && \
|
| 22 |
+
apt-get install -y --no-install-recommends libgl1 && \
|
| 23 |
+
apt-get clean && \
|
| 24 |
+
# Install conda packages
|
| 25 |
+
# mkl required to fix 'OSError: libmkl_intel_lp64.so.2: cannot open shared object file: No such file or directory'
|
| 26 |
+
conda config --set solver libmamba && \
|
| 27 |
+
conda install -y pytorch torchvision pytorch-cuda=12.1 -c pytorch -c nvidia && \
|
| 28 |
+
conda install -y -c conda-forge ultralytics mkl && \
|
| 29 |
+
conda clean -afy && \
|
| 30 |
+
# Remove extra build files
|
| 31 |
+
rm -rf /var/lib/apt/lists/* /root/.config/Ultralytics/persistent_cache.json
|
| 32 |
+
|
| 33 |
+
# Copy model
|
| 34 |
+
ADD https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n.pt .
|
| 35 |
+
|
| 36 |
+
# Usage --------------------------------------------------------------------------------------------------------------
|
| 37 |
+
|
| 38 |
+
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
| 39 |
+
# Example (build): t=ultralytics/ultralytics:latest-conda && docker build -f docker/Dockerfile-conda -t $t .
|
| 40 |
+
# Example (push): docker push $t
|
| 41 |
+
# Example (pull): t=ultralytics/ultralytics:latest-conda && docker pull $t
|
| 42 |
+
# Example (run): docker run -it --ipc=host $t
|
| 43 |
+
# Example (run-with-volume): docker run -it --ipc=host -v "$PWD/shared/datasets:/datasets" $t
|
models_related/ultralytics/docker/Dockerfile-cpu
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Builds ultralytics/ultralytics:latest-cpu image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
| 4 |
+
# Lightweight CPU image optimized for inference (extends latest-python)
|
| 5 |
+
|
| 6 |
+
# Build from Ultralytics Python image
|
| 7 |
+
FROM ultralytics/ultralytics:latest-python
|
| 8 |
+
|
| 9 |
+
# Set default command to bash
|
| 10 |
+
CMD ["/bin/bash"]
|
| 11 |
+
|
| 12 |
+
# Usage --------------------------------------------------------------------------------------------------------------
|
| 13 |
+
|
| 14 |
+
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
| 15 |
+
# Example (build): t=ultralytics/ultralytics:latest-cpu && docker build -f docker/Dockerfile-cpu -t $t .
|
| 16 |
+
# Example (push): docker push $t
|
| 17 |
+
# Example (pull): t=ultralytics/ultralytics:latest-cpu && docker pull $t
|
| 18 |
+
# Example (run): docker run -it --ipc=host $t
|
| 19 |
+
# Example (run-with-volume): docker run -it --ipc=host -v "$PWD/shared/datasets:/datasets" $t
|
models_related/ultralytics/docker/Dockerfile-export
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Builds ultralytics/ultralytics:latest-export image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
| 4 |
+
# Export-optimized derivative of ultralytics/ultralytics:latest for testing and benchmarks
|
| 5 |
+
# Includes all export format dependencies and pre-installed export packages
|
| 6 |
+
|
| 7 |
+
FROM ultralytics/ultralytics:latest
|
| 8 |
+
|
| 9 |
+
# Install export dependencies
|
| 10 |
+
# Numpy 1.26.4 required for TensorFlow export compatibility
|
| 11 |
+
# Note tensorrt installed on-demand as depends on runtime environment CUDA version
|
| 12 |
+
RUN uv pip install --system --no-cache -e ".[export]" numpy==1.26.4 && \
|
| 13 |
+
uv pip install --system --no-cache "onnxruntime-gpu" paddlepaddle x2paddle numpy==1.26.4 && \
|
| 14 |
+
rm -rf tmp ~/.cache /root/.config/Ultralytics/persistent_cache.json
|
| 15 |
+
|
| 16 |
+
# Usage --------------------------------------------------------------------------------------------------------------
|
| 17 |
+
|
| 18 |
+
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
| 19 |
+
# Example (build): t=ultralytics/ultralytics:latest-export && docker build -f docker/Dockerfile-export -t $t .
|
| 20 |
+
# Example (push): docker push $t
|
| 21 |
+
# Example (pull): t=ultralytics/ultralytics:latest-export && docker pull $t
|
| 22 |
+
# Example (run): docker run -it --ipc=host --runtime=nvidia --gpus all $t
|
| 23 |
+
# Example (run-with-volume): docker run -it --ipc=host --runtime=nvidia --gpus all -v "$PWD/shared/datasets:/datasets" $t
|
models_related/ultralytics/docker/Dockerfile-jetson-jetpack4
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Builds ultralytics/ultralytics:latest-jetson-jetpack4 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
| 4 |
+
# Supports JetPack4.x for YOLO on Jetson Nano, TX2, Xavier NX, AGX Xavier
|
| 5 |
+
|
| 6 |
+
# Start FROM https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-cuda
|
| 7 |
+
FROM nvcr.io/nvidia/l4t-cuda:10.2.460-runtime
|
| 8 |
+
|
| 9 |
+
# Set environment variables
|
| 10 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 11 |
+
PYTHONDONTWRITEBYTECODE=1
|
| 12 |
+
|
| 13 |
+
# Downloads to user config dir
|
| 14 |
+
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
| 15 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
| 16 |
+
/root/.config/Ultralytics/
|
| 17 |
+
|
| 18 |
+
# Add NVIDIA repositories for TensorRT dependencies
|
| 19 |
+
RUN wget -q -O - https://repo.download.nvidia.com/jetson/jetson-ota-public.asc | apt-key add - && \
|
| 20 |
+
echo "deb https://repo.download.nvidia.com/jetson/common r32.7 main" > /etc/apt/sources.list.d/nvidia-l4t-apt-source.list && \
|
| 21 |
+
echo "deb https://repo.download.nvidia.com/jetson/t194 r32.7 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list
|
| 22 |
+
|
| 23 |
+
# Install dependencies
|
| 24 |
+
# pkg-config and libhdf5-dev (not included) are needed to build 'h5py==3.11.0' aarch64 wheel required by 'tensorflow'
|
| 25 |
+
# gnupg required for Edge TPU install
|
| 26 |
+
RUN apt-get update && \
|
| 27 |
+
apt-get install -y --no-install-recommends \
|
| 28 |
+
git python3.8 python3.8-dev python3-pip python3-libnvinfer libopenmpi-dev libopenblas-base libomp-dev gcc && \
|
| 29 |
+
apt-get clean && \
|
| 30 |
+
rm -rf /var/lib/apt/lists/*
|
| 31 |
+
|
| 32 |
+
# Create symbolic links for python3.8 and pip3
|
| 33 |
+
RUN ln -sf /usr/bin/python3.8 /usr/bin/python3 && \
|
| 34 |
+
ln -sf /usr/bin/pip3 /usr/bin/pip
|
| 35 |
+
|
| 36 |
+
# Create working directory
|
| 37 |
+
WORKDIR /ultralytics
|
| 38 |
+
|
| 39 |
+
# Copy contents and configure git
|
| 40 |
+
COPY . .
|
| 41 |
+
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \
|
| 42 |
+
sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
|
| 43 |
+
ADD https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n.pt .
|
| 44 |
+
|
| 45 |
+
# Replace pyproject.toml TF.js version with 'tensorflowjs>=3.9.0' for JetPack4 compatibility
|
| 46 |
+
RUN sed -i 's/^\( *"tensorflowjs\)>=.*\(".*\)/\1>=3.9.0\2/' pyproject.toml
|
| 47 |
+
|
| 48 |
+
# Install pip packages (pip must be upgraded first before installing uv due to missing setuptools)
|
| 49 |
+
RUN python3 -m pip install --upgrade pip && \
|
| 50 |
+
python3 -m pip install uv
|
| 51 |
+
# Install pip packages and remove extra build files
|
| 52 |
+
# Onnxruntime and TensorRT from https://elinux.org/Jetson_Zoo and https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048
|
| 53 |
+
RUN uv pip install --system \
|
| 54 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/onnxruntime_gpu-1.8.0-cp38-cp38-linux_aarch64.whl \
|
| 55 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/tensorrt-8.2.0.6-cp38-none-linux_aarch64.whl \
|
| 56 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/torch-1.11.0a0+gitbc2c6ed-cp38-cp38-linux_aarch64.whl \
|
| 57 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/torchvision-0.12.0a0+9b5a3fe-cp38-cp38-linux_aarch64.whl && \
|
| 58 |
+
uv pip install --system -e ".[export]" && \
|
| 59 |
+
# Remove extra build files
|
| 60 |
+
rm -rf *.whl /root/.config/Ultralytics/persistent_cache.json
|
| 61 |
+
|
| 62 |
+
# Usage --------------------------------------------------------------------------------------------------------------
|
| 63 |
+
|
| 64 |
+
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
| 65 |
+
# Example (build): t=ultralytics/ultralytics:latest-jetson-jetpack4 && docker build --platform linux/arm64 -f docker/Dockerfile-jetson-jetpack4 -t $t .
|
| 66 |
+
# Example (push): docker push $t
|
| 67 |
+
# Example (pull): t=ultralytics/ultralytics:latest-jetson-jetpack4 && docker pull $t
|
| 68 |
+
# Example (run): docker run -it --ipc=host --runtime=nvidia $t
|
| 69 |
+
# Example (run-with-volume): docker run -it --ipc=host --runtime=nvidia -v "$PWD/shared/datasets:/datasets" $t
|
models_related/ultralytics/docker/Dockerfile-jetson-jetpack5
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Builds ultralytics/ultralytics:latest-jetson-jetpack5 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
| 4 |
+
# Supports JetPack5.1.2 for YOLO on Jetson Xavier NX, AGX Xavier, AGX Orin, Orin Nano and Orin NX
|
| 5 |
+
|
| 6 |
+
# Start FROM https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-jetpack
|
| 7 |
+
FROM nvcr.io/nvidia/l4t-jetpack:r35.4.1
|
| 8 |
+
|
| 9 |
+
# Set environment variables
|
| 10 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 11 |
+
PYTHONDONTWRITEBYTECODE=1 \
|
| 12 |
+
PIP_NO_CACHE_DIR=1 \
|
| 13 |
+
PIP_BREAK_SYSTEM_PACKAGES=1 \
|
| 14 |
+
UV_BREAK_SYSTEM_PACKAGES=1
|
| 15 |
+
|
| 16 |
+
# Downloads to user config dir
|
| 17 |
+
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
| 18 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
| 19 |
+
/root/.config/Ultralytics/
|
| 20 |
+
|
| 21 |
+
# Install dependencies
|
| 22 |
+
RUN apt-get update && \
|
| 23 |
+
apt-get install -y --no-install-recommends \
|
| 24 |
+
git python3-pip libopenmpi-dev libopenblas-base libomp-dev \
|
| 25 |
+
&& apt-get clean \
|
| 26 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 27 |
+
|
| 28 |
+
# Create working directory
|
| 29 |
+
WORKDIR /ultralytics
|
| 30 |
+
|
| 31 |
+
# Copy contents and configure git
|
| 32 |
+
COPY . .
|
| 33 |
+
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \
|
| 34 |
+
sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
|
| 35 |
+
ADD https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n.pt .
|
| 36 |
+
|
| 37 |
+
# Replace pyproject.toml TF.js version with 'tensorflowjs>=3.9.0' for JetPack5 compatibility and install packages
|
| 38 |
+
RUN sed -i 's/^\( *"tensorflowjs\)>=.*\(".*\)/\1>=3.9.0\2/' pyproject.toml && \
|
| 39 |
+
python3 -m pip install --upgrade pip uv
|
| 40 |
+
|
| 41 |
+
# Pip install onnxruntime-gpu, torch, torchvision and ultralytics, then remove build files
|
| 42 |
+
RUN uv pip install --system \
|
| 43 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/onnxruntime_gpu-1.16.3-cp38-cp38-linux_aarch64.whl \
|
| 44 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/torch-2.1.0a0+41361538.nv23.06-cp38-cp38-linux_aarch64.whl \
|
| 45 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/torchvision-0.16.2+c6f3977-cp38-cp38-linux_aarch64.whl && \
|
| 46 |
+
# Need lower version of 'numpy' for TensorRT export
|
| 47 |
+
uv pip install --system numpy==1.23.5 && \
|
| 48 |
+
uv pip install --system -e ".[export]" && \
|
| 49 |
+
# Remove extra build files
|
| 50 |
+
rm -rf *.whl /root/.config/Ultralytics/persistent_cache.json
|
| 51 |
+
|
| 52 |
+
# Usage --------------------------------------------------------------------------------------------------------------
|
| 53 |
+
|
| 54 |
+
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
| 55 |
+
# Example (build): t=ultralytics/ultralytics:latest-jetson-jetpack5 && docker build --platform linux/arm64 -f docker/Dockerfile-jetson-jetpack5 -t $t .
|
| 56 |
+
# Example (push): docker push $t
|
| 57 |
+
# Example (pull): t=ultralytics/ultralytics:latest-jetson-jetpack5 && docker pull $t
|
| 58 |
+
# Example (run): docker run -it --ipc=host --runtime=nvidia $t
|
| 59 |
+
# Example (run-with-volume): docker run -it --ipc=host --runtime=nvidia -v "$PWD/shared/datasets:/datasets" $t
|
models_related/ultralytics/docker/Dockerfile-jetson-jetpack6
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Builds ultralytics/ultralytics:latest-jetson-jetpack6 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
| 4 |
+
# Supports JetPack6.1 for YOLO on Jetson AGX Orin, Orin NX and Orin Nano Series
|
| 5 |
+
|
| 6 |
+
# Start FROM https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-jetpack
|
| 7 |
+
FROM nvcr.io/nvidia/l4t-jetpack:r36.4.0
|
| 8 |
+
|
| 9 |
+
# Set environment variables
|
| 10 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 11 |
+
PYTHONDONTWRITEBYTECODE=1 \
|
| 12 |
+
PIP_NO_CACHE_DIR=1 \
|
| 13 |
+
PIP_BREAK_SYSTEM_PACKAGES=1 \
|
| 14 |
+
UV_BREAK_SYSTEM_PACKAGES=1
|
| 15 |
+
|
| 16 |
+
# Downloads to user config dir
|
| 17 |
+
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
| 18 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
| 19 |
+
/root/.config/Ultralytics/
|
| 20 |
+
|
| 21 |
+
# Install dependencies and cleanup
|
| 22 |
+
ADD https://developer.download.nvidia.com/compute/cudss/0.7.1/local_installers/cudss-local-tegra-repo-ubuntu2204-0.7.1_0.7.1-1_arm64.deb .
|
| 23 |
+
RUN dpkg -i cudss-local-tegra-repo-ubuntu2204-0.7.1_0.7.1-1_arm64.deb && \
|
| 24 |
+
cp /var/cudss-local-tegra-repo-ubuntu2204-0.7.1/cudss-*-keyring.gpg /usr/share/keyrings/ && \
|
| 25 |
+
apt-get update && \
|
| 26 |
+
apt-get install -y --no-install-recommends \
|
| 27 |
+
git python3-pip libopenmpi-dev libopenblas-base libomp-dev cudss && \
|
| 28 |
+
apt-get clean && \
|
| 29 |
+
rm -rf /var/lib/apt/lists/*
|
| 30 |
+
|
| 31 |
+
# Upgrade TensorRT from 10.3.0 to 10.7.0 to fix INT8 + end2end build issues on JetPack 6
|
| 32 |
+
# https://github.com/ultralytics/ultralytics/issues/23841
|
| 33 |
+
ADD https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/arm64/cuda-keyring_1.1-1_all.deb .
|
| 34 |
+
RUN dpkg -i cuda-keyring_1.1-1_all.deb && \
|
| 35 |
+
apt-get update && \
|
| 36 |
+
apt-get install -y tensorrt && \
|
| 37 |
+
apt-get clean && \
|
| 38 |
+
rm -rf /var/lib/apt/lists/* cuda-keyring_1.1-1_all.deb
|
| 39 |
+
|
| 40 |
+
# Create working directory
|
| 41 |
+
WORKDIR /ultralytics
|
| 42 |
+
|
| 43 |
+
# Copy contents and configure git
|
| 44 |
+
COPY . .
|
| 45 |
+
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \
|
| 46 |
+
sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
|
| 47 |
+
ADD https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n.pt .
|
| 48 |
+
|
| 49 |
+
# Pip install onnxruntime-gpu, torch, torchvision and ultralytics, then remove build files
|
| 50 |
+
RUN python3 -m pip install --upgrade pip uv && \
|
| 51 |
+
uv pip install --system \
|
| 52 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/onnxruntime_gpu-1.23.0-cp310-cp310-linux_aarch64.whl \
|
| 53 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/torch-2.10.0-cp310-cp310-linux_aarch64.whl \
|
| 54 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/torchvision-0.25.0-cp310-cp310-linux_aarch64.whl && \
|
| 55 |
+
uv pip install --system -e ".[export]" && \
|
| 56 |
+
# Remove extra build files
|
| 57 |
+
rm -rf *.whl /root/.config/Ultralytics/persistent_cache.json
|
| 58 |
+
|
| 59 |
+
# Usage --------------------------------------------------------------------------------------------------------------
|
| 60 |
+
|
| 61 |
+
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
| 62 |
+
# Example (build): t=ultralytics/ultralytics:latest-jetson-jetpack6 && docker build --platform linux/arm64 -f docker/Dockerfile-jetson-jetpack6 -t $t .
|
| 63 |
+
# Example (push): docker push $t
|
| 64 |
+
# Example (pull): t=ultralytics/ultralytics:latest-jetson-jetpack6 && docker pull $t
|
| 65 |
+
# Example (run): docker run -it --ipc=host --runtime=nvidia $t
|
| 66 |
+
# Example (run-with-volume): docker run -it --ipc=host --runtime=nvidia -v "$PWD/shared/datasets:/datasets" $t
|
models_related/ultralytics/docker/Dockerfile-jupyter
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Builds ultralytics/ultralytics:latest-jupyter image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
| 4 |
+
# Image provides JupyterLab interface for interactive YOLO development and includes tutorial notebooks
|
| 5 |
+
|
| 6 |
+
# Start from Python-based Ultralytics image for full Python environment
|
| 7 |
+
FROM ultralytics/ultralytics:latest-python
|
| 8 |
+
|
| 9 |
+
# Install JupyterLab for interactive development
|
| 10 |
+
RUN uv pip install --system jupyterlab && \
|
| 11 |
+
# Create persistent data directory structure
|
| 12 |
+
mkdir -p /data/{datasets,weights,runs} && \
|
| 13 |
+
# Configure YOLO directories
|
| 14 |
+
yolo settings datasets_dir="/data/datasets" weights_dir="/data/weights" runs_dir="/data/runs" && \
|
| 15 |
+
rm -rf tmp /root/.config/Ultralytics/persistent_cache.json
|
| 16 |
+
|
| 17 |
+
# Start JupyterLab with tutorial notebook
|
| 18 |
+
ENTRYPOINT ["/usr/local/bin/jupyter", "lab", "--allow-root", "--ip=0.0.0.0", "/ultralytics/examples/tutorial.ipynb"]
|
| 19 |
+
|
| 20 |
+
# Usage --------------------------------------------------------------------------------------------------------------
|
| 21 |
+
|
| 22 |
+
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
| 23 |
+
# Example (build): t=ultralytics/ultralytics:latest-jupyter && docker build -f docker/Dockerfile-jupyter -t $t .
|
| 24 |
+
# Example (push): docker push $t
|
| 25 |
+
# Example (pull): t=ultralytics/ultralytics:latest-jupyter && docker pull $t
|
| 26 |
+
# Example (run): docker run -it --ipc=host -p 8888:8888 $t
|
| 27 |
+
# Example (run-with-volume): docker run -it --ipc=host -p 8888:8888 -v "$PWD/datasets:/data/datasets" $t
|
models_related/ultralytics/docker/Dockerfile-nvidia-arm64
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Builds ultralytics/ultralytics:latest-nvidia-arm64 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
| 4 |
+
# Supports JetPack 7.0 and DGX OS for YOLO on Jetson AGX Thor (T5000) and DGX Spark
|
| 5 |
+
|
| 6 |
+
# Start FROM PyTorch image nvcr.io/nvidia/pytorch:25.10-py3
|
| 7 |
+
FROM nvcr.io/nvidia/pytorch:25.10-py3
|
| 8 |
+
|
| 9 |
+
# Set environment variables
|
| 10 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 11 |
+
PYTHONDONTWRITEBYTECODE=1 \
|
| 12 |
+
PIP_NO_CACHE_DIR=1 \
|
| 13 |
+
PIP_BREAK_SYSTEM_PACKAGES=1 \
|
| 14 |
+
UV_BREAK_SYSTEM_PACKAGES=1
|
| 15 |
+
|
| 16 |
+
# Downloads to user config dir
|
| 17 |
+
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
| 18 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
| 19 |
+
/root/.config/Ultralytics/
|
| 20 |
+
|
| 21 |
+
# Install linux packages
|
| 22 |
+
RUN apt-get update && \
|
| 23 |
+
apt-get install -y --no-install-recommends libgl1 && \
|
| 24 |
+
apt-get clean && \
|
| 25 |
+
rm -rf /var/lib/apt/lists/*
|
| 26 |
+
|
| 27 |
+
# Create working directory
|
| 28 |
+
WORKDIR /ultralytics
|
| 29 |
+
|
| 30 |
+
# Copy contents and configure git
|
| 31 |
+
COPY . .
|
| 32 |
+
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \
|
| 33 |
+
sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
|
| 34 |
+
ADD https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n.pt .
|
| 35 |
+
|
| 36 |
+
# Install pip packages (uv already installed in base image)
|
| 37 |
+
RUN uv pip install --system \
|
| 38 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/onnxruntime_gpu-1.24.0-cp312-cp312-linux_aarch64.whl && \
|
| 39 |
+
# Reinstall torch and torchvision to ensure CUDA 13.0 compatibility
|
| 40 |
+
uv pip install --system --force-reinstall torch torchvision --index-url https://download.pytorch.org/whl/cu130 && \
|
| 41 |
+
uv pip install --system -e ".[export]" && \
|
| 42 |
+
# Remove extra build files
|
| 43 |
+
rm -rf *.whl /root/.config/Ultralytics/persistent_cache.json
|
| 44 |
+
|
| 45 |
+
# Usage --------------------------------------------------------------------------------------------------------------
|
| 46 |
+
|
| 47 |
+
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
| 48 |
+
# Example (build): t=ultralytics/ultralytics:latest-nvidia-arm64 && docker build --platform linux/arm64 -f docker/Dockerfile-nvidia-arm64 -t $t .
|
| 49 |
+
# Example (push): docker push $t
|
| 50 |
+
# Example (pull): t=ultralytics/ultralytics:latest-nvidia-arm64 && docker pull $t
|
| 51 |
+
# Example (run): docker run -it --ipc=host --runtime=nvidia $t
|
| 52 |
+
# Example (run-with-volume): docker run -it --ipc=host --runtime=nvidia -v "$PWD/shared/datasets:/datasets" $t
|
models_related/ultralytics/docker/Dockerfile-python
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Builds ultralytics/ultralytics:latest-python image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
| 4 |
+
# Lightweight CPU image optimized for YOLO inference
|
| 5 |
+
|
| 6 |
+
# Use official Python 3.11.10 base image for reproducibility
|
| 7 |
+
FROM python:3.11.10-slim-bookworm
|
| 8 |
+
|
| 9 |
+
# Set environment variables (suppress PyTorch NNPACK warnings)
|
| 10 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 11 |
+
PYTHONDONTWRITEBYTECODE=1 \
|
| 12 |
+
PIP_NO_CACHE_DIR=1 \
|
| 13 |
+
PIP_BREAK_SYSTEM_PACKAGES=1 \
|
| 14 |
+
UV_BREAK_SYSTEM_PACKAGES=1 \
|
| 15 |
+
TORCH_CPP_LOG_LEVEL=ERROR
|
| 16 |
+
|
| 17 |
+
# Downloads to user config dir
|
| 18 |
+
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
|
| 19 |
+
https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
|
| 20 |
+
/root/.config/Ultralytics/
|
| 21 |
+
|
| 22 |
+
# Install linux packages
|
| 23 |
+
RUN apt-get update && \
|
| 24 |
+
apt-get install -y --no-install-recommends \
|
| 25 |
+
python3-pip git zip unzip wget curl htop libgl1 libglib2.0-0 && \
|
| 26 |
+
apt-get clean && \
|
| 27 |
+
rm -rf /var/lib/apt/lists/*
|
| 28 |
+
|
| 29 |
+
# Create working directory
|
| 30 |
+
WORKDIR /ultralytics
|
| 31 |
+
|
| 32 |
+
# Copy contents and configure git
|
| 33 |
+
COPY . .
|
| 34 |
+
RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \
|
| 35 |
+
sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
|
| 36 |
+
ADD https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n.pt .
|
| 37 |
+
|
| 38 |
+
# Install pip packages
|
| 39 |
+
RUN pip install uv && \
|
| 40 |
+
uv pip install --system --no-cache -e . \
|
| 41 |
+
--extra-index-url https://download.pytorch.org/whl/cpu \
|
| 42 |
+
--index-strategy unsafe-best-match && \
|
| 43 |
+
rm -rf tmp ~/.cache /root/.config/Ultralytics/persistent_cache.json
|
| 44 |
+
|
| 45 |
+
# Usage --------------------------------------------------------------------------------------------------------------
|
| 46 |
+
|
| 47 |
+
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
| 48 |
+
# Example (build): t=ultralytics/ultralytics:latest-python && docker build -f docker/Dockerfile-python -t $t .
|
| 49 |
+
# Example (push): docker push $t
|
| 50 |
+
# Example (pull): t=ultralytics/ultralytics:latest-python && docker pull $t
|
| 51 |
+
# Example (run): docker run -it --ipc=host $t
|
| 52 |
+
# Example (run-with-volume): docker run -it --ipc=host -v "$PWD/shared/datasets:/datasets" $t
|
models_related/ultralytics/docker/Dockerfile-python-export
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Builds ultralytics/ultralytics:latest-python-export image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
| 4 |
+
# Full-featured image with export capabilities for YOLO model conversion
|
| 5 |
+
|
| 6 |
+
# Build from lightweight Ultralytics Python image
|
| 7 |
+
FROM ultralytics/ultralytics:latest-python
|
| 8 |
+
|
| 9 |
+
# Install export-specific system packages
|
| 10 |
+
# gnupg required for Edge TPU install
|
| 11 |
+
# Java runtime environment (default-jre-headless) required for Sony IMX export
|
| 12 |
+
RUN apt-get update && \
|
| 13 |
+
apt-get install -y --no-install-recommends gnupg default-jre-headless && \
|
| 14 |
+
apt-get clean && \
|
| 15 |
+
rm -rf /var/lib/apt/lists/*
|
| 16 |
+
|
| 17 |
+
# Install export dependencies
|
| 18 |
+
RUN uv pip install --system --no-cache -e ".[export]" \
|
| 19 |
+
--extra-index-url https://download.pytorch.org/whl/cpu \
|
| 20 |
+
--index-strategy unsafe-best-match && \
|
| 21 |
+
uv pip install --system --no-cache paddlepaddle x2paddle && \
|
| 22 |
+
rm -rf tmp ~/.cache /root/.config/Ultralytics/persistent_cache.json
|
| 23 |
+
|
| 24 |
+
# Usage --------------------------------------------------------------------------------------------------------------
|
| 25 |
+
|
| 26 |
+
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
| 27 |
+
# Example (build): t=ultralytics/ultralytics:latest-python-export && docker build -f docker/Dockerfile-python-export -t $t .
|
| 28 |
+
# Example (push): docker push $t
|
| 29 |
+
# Example (pull): t=ultralytics/ultralytics:latest-python-export && docker pull $t
|
| 30 |
+
# Example (run): docker run -it --ipc=host $t
|
| 31 |
+
# Example (run-with-volume): docker run -it --ipc=host -v "$PWD/shared/datasets:/datasets" $t
|
models_related/ultralytics/docker/Dockerfile-runner
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Builds GitHub actions CI runner image for deployment to DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
| 4 |
+
# Image is CUDA-optimized for YOLO single/multi-GPU training and inference tests
|
| 5 |
+
|
| 6 |
+
# Start FROM Ultralytics GPU image
|
| 7 |
+
FROM ultralytics/ultralytics:latest
|
| 8 |
+
|
| 9 |
+
# Set additional environment variables for runner (no "v" on the version)
|
| 10 |
+
ARG RUNNER_VERSION=2.334.0
|
| 11 |
+
ENV RUNNER_ALLOW_RUNASROOT=1 \
|
| 12 |
+
DEBIAN_FRONTEND=noninteractive
|
| 13 |
+
|
| 14 |
+
# Set the working directory
|
| 15 |
+
WORKDIR /actions-runner
|
| 16 |
+
|
| 17 |
+
# Download and unpack the runner from https://github.com/actions/runner and install dependencies
|
| 18 |
+
RUN FILENAME=actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz && \
|
| 19 |
+
curl -fLso "$FILENAME" "https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/${FILENAME}" && \
|
| 20 |
+
tar xzf "$FILENAME" && \
|
| 21 |
+
rm "$FILENAME" && \
|
| 22 |
+
uv pip install --system --no-cache pytest-cov "tensorrt-cu12>=7.0.0,!=10.2.0" && \
|
| 23 |
+
./bin/installdependencies.sh && \
|
| 24 |
+
apt-get update && \
|
| 25 |
+
apt-get install -y --no-install-recommends libicu-dev sudo nodejs npm && \
|
| 26 |
+
apt-get clean && \
|
| 27 |
+
rm -rf /var/lib/apt/lists/*
|
| 28 |
+
|
| 29 |
+
# JSON ENTRYPOINT command to configure and start runner with default TOKEN and NAME
|
| 30 |
+
ENTRYPOINT ["sh", "-c", "./config.sh --url https://github.com/ultralytics --token ${GITHUB_RUNNER_TOKEN:-TOKEN} --name ${GITHUB_RUNNER_NAME:-NAME} --labels gpu-latest --replace && exec ./run.sh"]
|
| 31 |
+
|
| 32 |
+
# Usage --------------------------------------------------------------------------------------------------------------
|
| 33 |
+
|
| 34 |
+
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
| 35 |
+
# Example (build): t=ultralytics/ultralytics:latest-runner && docker build -f docker/Dockerfile-runner -t $t .
|
| 36 |
+
# Example (push): docker push $t
|
| 37 |
+
# Example (pull): t=ultralytics/ultralytics:latest-runner && docker pull $t
|
| 38 |
+
# Example (run): docker run -d --restart unless-stopped -e GITHUB_RUNNER_TOKEN=TOKEN -e GITHUB_RUNNER_NAME=NAME --ipc=host --runtime=nvidia --gpus all $t
|
models_related/ultralytics/docker/Dockerfile-runner-cpu
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Builds GitHub actions CI runner image for deployment to DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
| 4 |
+
# Image is CPU-optimized for YOLO inference and CPU-only tests
|
| 5 |
+
|
| 6 |
+
# Start FROM Ultralytics CPU image
|
| 7 |
+
FROM ultralytics/ultralytics:latest-cpu
|
| 8 |
+
|
| 9 |
+
# Set additional environment variables for runner (no "v" on the version)
|
| 10 |
+
ARG RUNNER_VERSION=2.334.0
|
| 11 |
+
ENV RUNNER_ALLOW_RUNASROOT=1 \
|
| 12 |
+
DEBIAN_FRONTEND=noninteractive
|
| 13 |
+
|
| 14 |
+
# Set the working directory
|
| 15 |
+
WORKDIR /actions-runner
|
| 16 |
+
|
| 17 |
+
# Download and unpack the runner from https://github.com/actions/runner and install dependencies
|
| 18 |
+
RUN FILENAME=actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz && \
|
| 19 |
+
curl -fLso "$FILENAME" "https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/${FILENAME}" && \
|
| 20 |
+
tar xzf "$FILENAME" && \
|
| 21 |
+
rm "$FILENAME" && \
|
| 22 |
+
# Install runner dependencies \
|
| 23 |
+
uv pip install --system pytest-cov && \
|
| 24 |
+
./bin/installdependencies.sh && \
|
| 25 |
+
apt-get update && \
|
| 26 |
+
apt-get install -y --no-install-recommends libicu-dev sudo nodejs npm gpg && \
|
| 27 |
+
apt-get clean && \
|
| 28 |
+
rm -rf /var/lib/apt/lists/*
|
| 29 |
+
|
| 30 |
+
# JSON ENTRYPOINT command to configure and start runner with default TOKEN and NAME
|
| 31 |
+
ENTRYPOINT ["sh", "-c", "./config.sh --url https://github.com/ultralytics --token ${GITHUB_RUNNER_TOKEN:-TOKEN} --name ${GITHUB_RUNNER_NAME:-NAME} --labels cpu-latest --replace && exec ./run.sh"]
|
| 32 |
+
|
| 33 |
+
# Usage --------------------------------------------------------------------------------------------------------------
|
| 34 |
+
|
| 35 |
+
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
|
| 36 |
+
# Example (build): t=ultralytics/ultralytics:latest-runner-cpu && docker build -f docker/Dockerfile-runner-cpu -t $t .
|
| 37 |
+
# Example (push): docker push $t
|
| 38 |
+
# Example (pull): t=ultralytics/ultralytics:latest-runner-cpu && docker pull $t
|
| 39 |
+
# Example (run): docker run -d --restart unless-stopped -e GITHUB_RUNNER_TOKEN=TOKEN -e GITHUB_RUNNER_NAME=NAME --ipc=host $t
|
models_related/ultralytics/mkdocs.yml
ADDED
|
@@ -0,0 +1,945 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Configuration file for building the Ultralytics YOLO documentation site using MkDocs.
|
| 4 |
+
# Provides settings to control site metadata, customize the appearance using the
|
| 5 |
+
# Material theme, define the navigation structure, and enable various plugins.
|
| 6 |
+
|
| 7 |
+
# Site metadata
|
| 8 |
+
site_name: Ultralytics YOLO Docs
|
| 9 |
+
site_description: Explore Ultralytics YOLO, a cutting-edge real-time model for object detection, segmentation, semantic segmentation, classification, pose estimation, and tracking across various applications and hardware platforms.
|
| 10 |
+
site_url: https://docs.ultralytics.com
|
| 11 |
+
site_author: Ultralytics
|
| 12 |
+
repo_url: https://github.com/ultralytics/ultralytics
|
| 13 |
+
edit_uri: https://github.com/ultralytics/ultralytics/tree/main/docs/en/
|
| 14 |
+
repo_name: ultralytics/ultralytics
|
| 15 |
+
remote_name: https://github.com/ultralytics/docs
|
| 16 |
+
docs_dir: "docs/en/" # where to find the markdown files
|
| 17 |
+
site_dir: "site/" # where to publish to
|
| 18 |
+
use_directory_urls: true # use directory-style URLs instead of file-based paths
|
| 19 |
+
|
| 20 |
+
# Theme customization
|
| 21 |
+
theme:
|
| 22 |
+
name: material
|
| 23 |
+
language: en
|
| 24 |
+
custom_dir: docs/overrides/
|
| 25 |
+
logo: https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Reverse.svg
|
| 26 |
+
favicon: https://raw.githubusercontent.com/ultralytics/assets/refs/heads/main/logo/favicon-yolo.png
|
| 27 |
+
icon:
|
| 28 |
+
repo: fontawesome/brands/github
|
| 29 |
+
# font: # disabled for faster page load times
|
| 30 |
+
# text: Helvetica
|
| 31 |
+
# code: Roboto Mono
|
| 32 |
+
palette:
|
| 33 |
+
- media: "(prefers-color-scheme)"
|
| 34 |
+
toggle:
|
| 35 |
+
icon: material/brightness-auto
|
| 36 |
+
name: Switch to light mode
|
| 37 |
+
- media: "(prefers-color-scheme: dark)"
|
| 38 |
+
scheme: slate
|
| 39 |
+
primary: black
|
| 40 |
+
accent: indigo
|
| 41 |
+
toggle:
|
| 42 |
+
icon: material/brightness-4
|
| 43 |
+
name: Switch to system preference
|
| 44 |
+
- media: "(prefers-color-scheme: light)"
|
| 45 |
+
scheme: default
|
| 46 |
+
primary: indigo
|
| 47 |
+
accent: indigo
|
| 48 |
+
toggle:
|
| 49 |
+
icon: material/brightness-7
|
| 50 |
+
name: Switch to dark mode
|
| 51 |
+
features:
|
| 52 |
+
- content.action.edit
|
| 53 |
+
- content.code.annotate
|
| 54 |
+
- content.code.copy
|
| 55 |
+
- content.tooltips
|
| 56 |
+
- toc.follow
|
| 57 |
+
- navigation.top
|
| 58 |
+
- navigation.tabs
|
| 59 |
+
- navigation.tabs.sticky
|
| 60 |
+
- navigation.prune
|
| 61 |
+
- navigation.footer
|
| 62 |
+
- navigation.tracking
|
| 63 |
+
- navigation.instant
|
| 64 |
+
- navigation.instant.progress
|
| 65 |
+
- announce.dismiss
|
| 66 |
+
- navigation.indexes
|
| 67 |
+
- navigation.sections # groups top-level sections instead of expanding all
|
| 68 |
+
- content.tabs.link # all content tabs with the same label change simultaneously
|
| 69 |
+
# - search.highlight
|
| 70 |
+
# - search.share
|
| 71 |
+
# - search.suggest
|
| 72 |
+
|
| 73 |
+
# Customization
|
| 74 |
+
copyright: <a href="https://www.ultralytics.com/" target="_blank">© 2026 Ultralytics Inc.</a> All rights reserved.
|
| 75 |
+
extra: # version:
|
| 76 |
+
homepage: https://www.ultralytics.com/
|
| 77 |
+
# provider: mike # version drop-down menu
|
| 78 |
+
robots: robots.txt
|
| 79 |
+
analytics:
|
| 80 |
+
provider: google
|
| 81 |
+
property: G-2M5EHKC0BH
|
| 82 |
+
social:
|
| 83 |
+
- icon: fontawesome/brands/github
|
| 84 |
+
link: https://github.com/ultralytics
|
| 85 |
+
- icon: fontawesome/brands/linkedin
|
| 86 |
+
link: https://www.linkedin.com/company/ultralytics/
|
| 87 |
+
- icon: fontawesome/brands/x-twitter
|
| 88 |
+
link: https://x.com/ultralytics
|
| 89 |
+
- icon: fontawesome/brands/youtube
|
| 90 |
+
link: https://youtube.com/ultralytics?sub_confirmation=1
|
| 91 |
+
- icon: fontawesome/brands/docker
|
| 92 |
+
link: https://hub.docker.com/r/ultralytics/ultralytics/
|
| 93 |
+
- icon: fontawesome/brands/python
|
| 94 |
+
link: https://pypi.org/project/ultralytics/
|
| 95 |
+
- icon: fontawesome/brands/discord
|
| 96 |
+
link: https://discord.com/invite/ultralytics
|
| 97 |
+
- icon: fontawesome/brands/reddit
|
| 98 |
+
link: https://reddit.com/r/ultralytics
|
| 99 |
+
- icon: fontawesome/brands/weixin
|
| 100 |
+
link: https://weixin.qq.com/r/mp/LxckPDfEgWr_rXNf90I9
|
| 101 |
+
alternate:
|
| 102 |
+
- name: 🇬🇧 English
|
| 103 |
+
link: /
|
| 104 |
+
lang: en
|
| 105 |
+
- name: 🇨🇳 简体中文
|
| 106 |
+
link: /zh/
|
| 107 |
+
lang: zh
|
| 108 |
+
- name: 🇰🇷 한국어
|
| 109 |
+
link: /ko/
|
| 110 |
+
lang: ko
|
| 111 |
+
- name: 🇯🇵 日本語
|
| 112 |
+
link: /ja/
|
| 113 |
+
lang: ja
|
| 114 |
+
- name: 🇷🇺 Русский
|
| 115 |
+
link: /ru/
|
| 116 |
+
lang: ru
|
| 117 |
+
- name: 🇩🇪 Deutsch
|
| 118 |
+
link: /de/
|
| 119 |
+
lang: de
|
| 120 |
+
- name: 🇫🇷 Français
|
| 121 |
+
link: /fr/
|
| 122 |
+
lang: fr
|
| 123 |
+
- name: 🇪🇸 Español
|
| 124 |
+
link: /es/
|
| 125 |
+
lang: es
|
| 126 |
+
- name: 🇵🇹 Português
|
| 127 |
+
link: /pt/
|
| 128 |
+
lang: pt
|
| 129 |
+
- name: 🇮🇹 Italiano
|
| 130 |
+
link: /it/
|
| 131 |
+
lang: it
|
| 132 |
+
- name: 🇹🇷 Türkçe
|
| 133 |
+
link: /tr/
|
| 134 |
+
lang: tr
|
| 135 |
+
- name: 🇻🇳 Tiếng Việt
|
| 136 |
+
link: /vi/
|
| 137 |
+
lang: vi
|
| 138 |
+
- name: 🇸🇦 العربية
|
| 139 |
+
link: /ar/
|
| 140 |
+
lang: ar
|
| 141 |
+
|
| 142 |
+
extra_css:
|
| 143 |
+
- stylesheets/style.css
|
| 144 |
+
|
| 145 |
+
extra_javascript:
|
| 146 |
+
- https://cdn.jsdelivr.net/gh/ultralytics/llm@v0.2.8/js/chat.min.js
|
| 147 |
+
- https://unpkg.com/tablesort@5.7.0/dist/tablesort.min.js
|
| 148 |
+
- javascript/extra.js
|
| 149 |
+
- javascript/giscus.js
|
| 150 |
+
- javascript/tablesort.js
|
| 151 |
+
|
| 152 |
+
markdown_extensions:
|
| 153 |
+
- admonition
|
| 154 |
+
- md_in_html
|
| 155 |
+
- tables
|
| 156 |
+
- attr_list
|
| 157 |
+
- def_list
|
| 158 |
+
- pymdownx.critic
|
| 159 |
+
- pymdownx.caret
|
| 160 |
+
- pymdownx.keys
|
| 161 |
+
- pymdownx.mark
|
| 162 |
+
- pymdownx.tilde
|
| 163 |
+
- pymdownx.details
|
| 164 |
+
- pymdownx.inlinehilite
|
| 165 |
+
- pymdownx.superfences:
|
| 166 |
+
custom_fences:
|
| 167 |
+
- name: mermaid
|
| 168 |
+
class: mermaid
|
| 169 |
+
format: !!python/name:pymdownx.superfences.fence_code_format
|
| 170 |
+
- pymdownx.highlight:
|
| 171 |
+
anchor_linenums: true
|
| 172 |
+
- pymdownx.snippets:
|
| 173 |
+
base_path: ./
|
| 174 |
+
- pymdownx.emoji:
|
| 175 |
+
emoji_index: !!python/name:material.extensions.emoji.twemoji
|
| 176 |
+
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
| 177 |
+
- pymdownx.tabbed:
|
| 178 |
+
alternate_style: true
|
| 179 |
+
slugify: !!python/object/apply:pymdownx.slugs.slugify
|
| 180 |
+
kwds:
|
| 181 |
+
case: lower
|
| 182 |
+
|
| 183 |
+
# Validation settings https://www.mkdocs.org/user-guide/configuration/#validation
|
| 184 |
+
validation:
|
| 185 |
+
nav:
|
| 186 |
+
omitted_files: info
|
| 187 |
+
not_found: warn
|
| 188 |
+
absolute_links: info
|
| 189 |
+
links:
|
| 190 |
+
absolute_links: relative_to_docs
|
| 191 |
+
anchors: warn
|
| 192 |
+
unrecognized_links: warn
|
| 193 |
+
# Zensical treats bracketed examples like [0, 1] and [x1, y1, x2, y2] as shortcut references.
|
| 194 |
+
unresolved_references: false
|
| 195 |
+
|
| 196 |
+
# Primary navigation ---------------------------------------------------------------------------------------------------
|
| 197 |
+
not_in_nav: |
|
| 198 |
+
/macros
|
| 199 |
+
|
| 200 |
+
nav:
|
| 201 |
+
- Home:
|
| 202 |
+
- Home: index.md
|
| 203 |
+
- Quickstart: quickstart.md
|
| 204 |
+
- Usage:
|
| 205 |
+
- CLI: usage/cli.md
|
| 206 |
+
- Python: usage/python.md
|
| 207 |
+
- Callbacks: usage/callbacks.md
|
| 208 |
+
- Configuration: usage/cfg.md
|
| 209 |
+
- Simple Utilities: usage/simple-utilities.md
|
| 210 |
+
- Advanced Customization: usage/engine.md
|
| 211 |
+
- YOLO26 🚀: models/yolo26.md
|
| 212 |
+
- Languages:
|
| 213 |
+
- 🇬🇧  English: https://ultralytics.com/docs/
|
| 214 |
+
- 🇨🇳  简体中文: https://docs.ultralytics.com/zh
|
| 215 |
+
- 🇰🇷  한국어: https://docs.ultralytics.com/ko
|
| 216 |
+
- 🇯🇵  日本語: https://docs.ultralytics.com/ja
|
| 217 |
+
- 🇷🇺  Русский: https://docs.ultralytics.com/ru
|
| 218 |
+
- 🇩🇪  Deutsch: https://docs.ultralytics.com/de
|
| 219 |
+
- 🇫🇷  Français: https://docs.ultralytics.com/fr
|
| 220 |
+
- 🇪🇸  Español: https://docs.ultralytics.com/es
|
| 221 |
+
- 🇵🇹  Português: https://docs.ultralytics.com/pt
|
| 222 |
+
- 🇮🇹  Italiano: https://docs.ultralytics.com/it
|
| 223 |
+
- 🇹🇷  Türkçe: https://docs.ultralytics.com/tr
|
| 224 |
+
- 🇻🇳  Tiếng Việt: https://docs.ultralytics.com/vi
|
| 225 |
+
- 🇸🇦  العربية: https://docs.ultralytics.com/ar
|
| 226 |
+
- Modes:
|
| 227 |
+
- modes/index.md
|
| 228 |
+
- Train: modes/train.md
|
| 229 |
+
- Val: modes/val.md
|
| 230 |
+
- Predict: modes/predict.md
|
| 231 |
+
- Export: modes/export.md
|
| 232 |
+
- Track: modes/track.md
|
| 233 |
+
- Benchmark: modes/benchmark.md
|
| 234 |
+
- Tasks:
|
| 235 |
+
- tasks/index.md
|
| 236 |
+
- Detect: tasks/detect.md
|
| 237 |
+
- Segment: tasks/segment.md
|
| 238 |
+
- Semantic: tasks/semantic.md
|
| 239 |
+
- Classify: tasks/classify.md
|
| 240 |
+
- Pose: tasks/pose.md
|
| 241 |
+
- OBB: tasks/obb.md
|
| 242 |
+
- Models:
|
| 243 |
+
- models/index.md
|
| 244 |
+
- YOLOv3: models/yolov3.md
|
| 245 |
+
- YOLOv4: models/yolov4.md
|
| 246 |
+
- YOLOv5: models/yolov5.md
|
| 247 |
+
- YOLOv6: models/yolov6.md
|
| 248 |
+
- YOLOv7: models/yolov7.md
|
| 249 |
+
- YOLOv8: models/yolov8.md
|
| 250 |
+
- YOLOv9: models/yolov9.md
|
| 251 |
+
- YOLOv10: models/yolov10.md
|
| 252 |
+
- YOLO11: models/yolo11.md
|
| 253 |
+
- YOLO12: models/yolo12.md
|
| 254 |
+
- YOLO26 🚀: models/yolo26.md
|
| 255 |
+
- SAM (Segment Anything Model): models/sam.md
|
| 256 |
+
- SAM 2 (Segment Anything Model 2): models/sam-2.md
|
| 257 |
+
- SAM 3 (Segment Anything Model 3): models/sam-3.md
|
| 258 |
+
- MobileSAM (Mobile Segment Anything Model): models/mobile-sam.md
|
| 259 |
+
- FastSAM (Fast Segment Anything Model): models/fast-sam.md
|
| 260 |
+
- YOLO-NAS (Neural Architecture Search): models/yolo-nas.md
|
| 261 |
+
- RT-DETR (Realtime Detection Transformer): models/rtdetr.md
|
| 262 |
+
- YOLO-World (Real-Time Open-Vocabulary Object Detection): models/yolo-world.md
|
| 263 |
+
- YOLOE (Real-Time Seeing Anything): models/yoloe.md
|
| 264 |
+
- Compare:
|
| 265 |
+
- compare/index.md
|
| 266 |
+
- YOLO26:
|
| 267 |
+
- YOLO26 vs YOLO11: compare/yolo26-vs-yolo11.md
|
| 268 |
+
- YOLO26 vs YOLOv10: compare/yolo26-vs-yolov10.md
|
| 269 |
+
- YOLO26 vs YOLOv9: compare/yolo26-vs-yolov9.md
|
| 270 |
+
- YOLO26 vs YOLOv8: compare/yolo26-vs-yolov8.md
|
| 271 |
+
- YOLO26 vs YOLOv7: compare/yolo26-vs-yolov7.md
|
| 272 |
+
- YOLO26 vs YOLOv6: compare/yolo26-vs-yolov6.md
|
| 273 |
+
- YOLO26 vs YOLOv5: compare/yolo26-vs-yolov5.md
|
| 274 |
+
- YOLO26 vs RT-DETR: compare/yolo26-vs-rtdetr.md
|
| 275 |
+
- YOLO26 vs PP-YOLOE+: compare/yolo26-vs-pp-yoloe.md
|
| 276 |
+
- YOLO26 vs DAMO-YOLO: compare/yolo26-vs-damo-yolo.md
|
| 277 |
+
- YOLO26 vs YOLOX: compare/yolo26-vs-yolox.md
|
| 278 |
+
- YOLO26 vs EfficientDet: compare/yolo26-vs-efficientdet.md
|
| 279 |
+
- YOLO11:
|
| 280 |
+
- YOLO11 vs YOLO26: compare/yolo11-vs-yolo26.md
|
| 281 |
+
- YOLO11 vs YOLOv10: compare/yolo11-vs-yolov10.md
|
| 282 |
+
- YOLO11 vs YOLOv9: compare/yolo11-vs-yolov9.md
|
| 283 |
+
- YOLO11 vs YOLOv8: compare/yolo11-vs-yolov8.md
|
| 284 |
+
- YOLO11 vs YOLOv7: compare/yolo11-vs-yolov7.md
|
| 285 |
+
- YOLO11 vs YOLOv6: compare/yolo11-vs-yolov6.md
|
| 286 |
+
- YOLO11 vs YOLOv5: compare/yolo11-vs-yolov5.md
|
| 287 |
+
- YOLO11 vs RT-DETR: compare/yolo11-vs-rtdetr.md
|
| 288 |
+
- YOLO11 vs PP-YOLOE+: compare/yolo11-vs-pp-yoloe.md
|
| 289 |
+
- YOLO11 vs DAMO-YOLO: compare/yolo11-vs-damo-yolo.md
|
| 290 |
+
- YOLO11 vs YOLOX: compare/yolo11-vs-yolox.md
|
| 291 |
+
- YOLO11 vs EfficientDet: compare/yolo11-vs-efficientdet.md
|
| 292 |
+
- YOLOv10:
|
| 293 |
+
- YOLOv10 vs YOLO26: compare/yolov10-vs-yolo26.md
|
| 294 |
+
- YOLOv10 vs YOLO11: compare/yolov10-vs-yolo11.md
|
| 295 |
+
- YOLOv10 vs YOLOv9: compare/yolov10-vs-yolov9.md
|
| 296 |
+
- YOLOv10 vs YOLOv8: compare/yolov10-vs-yolov8.md
|
| 297 |
+
- YOLOv10 vs YOLOv7: compare/yolov10-vs-yolov7.md
|
| 298 |
+
- YOLOv10 vs YOLOv6: compare/yolov10-vs-yolov6.md
|
| 299 |
+
- YOLOv10 vs YOLOv5: compare/yolov10-vs-yolov5.md
|
| 300 |
+
- YOLOv10 vs RT-DETR: compare/yolov10-vs-rtdetr.md
|
| 301 |
+
- YOLOv10 vs PP-YOLOE+: compare/yolov10-vs-pp-yoloe.md
|
| 302 |
+
- YOLOv10 vs DAMO-YOLO: compare/yolov10-vs-damo-yolo.md
|
| 303 |
+
- YOLOv10 vs YOLOX: compare/yolov10-vs-yolox.md
|
| 304 |
+
- YOLOv10 vs EfficientDet: compare/yolov10-vs-efficientdet.md
|
| 305 |
+
- YOLOv9:
|
| 306 |
+
- YOLOv9 vs YOLO26: compare/yolov9-vs-yolo26.md
|
| 307 |
+
- YOLOv9 vs YOLO11: compare/yolov9-vs-yolo11.md
|
| 308 |
+
- YOLOv9 vs YOLOv10: compare/yolov9-vs-yolov10.md
|
| 309 |
+
- YOLOv9 vs YOLOv8: compare/yolov9-vs-yolov8.md
|
| 310 |
+
- YOLOv9 vs YOLOv7: compare/yolov9-vs-yolov7.md
|
| 311 |
+
- YOLOv9 vs YOLOv6: compare/yolov9-vs-yolov6.md
|
| 312 |
+
- YOLOv9 vs YOLOv5: compare/yolov9-vs-yolov5.md
|
| 313 |
+
- YOLOv9 vs RT-DETR: compare/yolov9-vs-rtdetr.md
|
| 314 |
+
- YOLOv9 vs PP-YOLOE+: compare/yolov9-vs-pp-yoloe.md
|
| 315 |
+
- YOLOv9 vs DAMO-YOLO: compare/yolov9-vs-damo-yolo.md
|
| 316 |
+
- YOLOv9 vs YOLOX: compare/yolov9-vs-yolox.md
|
| 317 |
+
- YOLOv9 vs EfficientDet: compare/yolov9-vs-efficientdet.md
|
| 318 |
+
- YOLOv8:
|
| 319 |
+
- YOLOv8 vs YOLO26: compare/yolov8-vs-yolo26.md
|
| 320 |
+
- YOLOv8 vs YOLO11: compare/yolov8-vs-yolo11.md
|
| 321 |
+
- YOLOv8 vs YOLOv10: compare/yolov8-vs-yolov10.md
|
| 322 |
+
- YOLOv8 vs YOLOv9: compare/yolov8-vs-yolov9.md
|
| 323 |
+
- YOLOv8 vs YOLOv7: compare/yolov8-vs-yolov7.md
|
| 324 |
+
- YOLOv8 vs YOLOv6: compare/yolov8-vs-yolov6.md
|
| 325 |
+
- YOLOv8 vs YOLOv5: compare/yolov8-vs-yolov5.md
|
| 326 |
+
- YOLOv8 vs RT-DETR: compare/yolov8-vs-rtdetr.md
|
| 327 |
+
- YOLOv8 vs PP-YOLOE+: compare/yolov8-vs-pp-yoloe.md
|
| 328 |
+
- YOLOv8 vs DAMO-YOLO: compare/yolov8-vs-damo-yolo.md
|
| 329 |
+
- YOLOv8 vs YOLOX: compare/yolov8-vs-yolox.md
|
| 330 |
+
- YOLOv8 vs EfficientDet: compare/yolov8-vs-efficientdet.md
|
| 331 |
+
- YOLOv7:
|
| 332 |
+
- YOLOv7 vs YOLO26: compare/yolov7-vs-yolo26.md
|
| 333 |
+
- YOLOv7 vs YOLO11: compare/yolov7-vs-yolo11.md
|
| 334 |
+
- YOLOv7 vs YOLOv10: compare/yolov7-vs-yolov10.md
|
| 335 |
+
- YOLOv7 vs YOLOv9: compare/yolov7-vs-yolov9.md
|
| 336 |
+
- YOLOv7 vs YOLOv8: compare/yolov7-vs-yolov8.md
|
| 337 |
+
- YOLOv7 vs YOLOv6: compare/yolov7-vs-yolov6.md
|
| 338 |
+
- YOLOv7 vs YOLOv5: compare/yolov7-vs-yolov5.md
|
| 339 |
+
- YOLOv7 vs RT-DETR: compare/yolov7-vs-rtdetr.md
|
| 340 |
+
- YOLOv7 vs PP-YOLOE+: compare/yolov7-vs-pp-yoloe.md
|
| 341 |
+
- YOLOv7 vs DAMO-YOLO: compare/yolov7-vs-damo-yolo.md
|
| 342 |
+
- YOLOv7 vs YOLOX: compare/yolov7-vs-yolox.md
|
| 343 |
+
- YOLOv7 vs EfficientDet: compare/yolov7-vs-efficientdet.md
|
| 344 |
+
- YOLOv6:
|
| 345 |
+
- YOLOv6 vs YOLO26: compare/yolov6-vs-yolo26.md
|
| 346 |
+
- YOLOv6 vs YOLO11: compare/yolov6-vs-yolo11.md
|
| 347 |
+
- YOLOv6 vs YOLOv10: compare/yolov6-vs-yolov10.md
|
| 348 |
+
- YOLOv6 vs YOLOv9: compare/yolov6-vs-yolov9.md
|
| 349 |
+
- YOLOv6 vs YOLOv8: compare/yolov6-vs-yolov8.md
|
| 350 |
+
- YOLOv6 vs YOLOv7: compare/yolov6-vs-yolov7.md
|
| 351 |
+
- YOLOv6 vs YOLOv5: compare/yolov6-vs-yolov5.md
|
| 352 |
+
- YOLOv6 vs RT-DETR: compare/yolov6-vs-rtdetr.md
|
| 353 |
+
- YOLOv6 vs PP-YOLOE+: compare/yolov6-vs-pp-yoloe.md
|
| 354 |
+
- YOLOv6 vs DAMO-YOLO: compare/yolov6-vs-damo-yolo.md
|
| 355 |
+
- YOLOv6 vs YOLOX: compare/yolov6-vs-yolox.md
|
| 356 |
+
- YOLOv6 vs EfficientDet: compare/yolov6-vs-efficientdet.md
|
| 357 |
+
- YOLOv5:
|
| 358 |
+
- YOLOv5 vs YOLO26: compare/yolov5-vs-yolo26.md
|
| 359 |
+
- YOLOv5 vs YOLO11: compare/yolov5-vs-yolo11.md
|
| 360 |
+
- YOLOv5 vs YOLOv10: compare/yolov5-vs-yolov10.md
|
| 361 |
+
- YOLOv5 vs YOLOv9: compare/yolov5-vs-yolov9.md
|
| 362 |
+
- YOLOv5 vs YOLOv8: compare/yolov5-vs-yolov8.md
|
| 363 |
+
- YOLOv5 vs YOLOv7: compare/yolov5-vs-yolov7.md
|
| 364 |
+
- YOLOv5 vs YOLOv6: compare/yolov5-vs-yolov6.md
|
| 365 |
+
- YOLOv5 vs RT-DETR: compare/yolov5-vs-rtdetr.md
|
| 366 |
+
- YOLOv5 vs PP-YOLOE+: compare/yolov5-vs-pp-yoloe.md
|
| 367 |
+
- YOLOv5 vs DAMO-YOLO: compare/yolov5-vs-damo-yolo.md
|
| 368 |
+
- YOLOv5 vs YOLOX: compare/yolov5-vs-yolox.md
|
| 369 |
+
- YOLOv5 vs EfficientDet: compare/yolov5-vs-efficientdet.md
|
| 370 |
+
- RT-DETR:
|
| 371 |
+
- RT-DETR vs YOLO26: compare/rtdetr-vs-yolo26.md
|
| 372 |
+
- RT-DETR vs YOLO11: compare/rtdetr-vs-yolo11.md
|
| 373 |
+
- RT-DETR vs YOLOv10: compare/rtdetr-vs-yolov10.md
|
| 374 |
+
- RT-DETR vs YOLOv9: compare/rtdetr-vs-yolov9.md
|
| 375 |
+
- RT-DETR vs YOLOv8: compare/rtdetr-vs-yolov8.md
|
| 376 |
+
- RT-DETR vs YOLOv7: compare/rtdetr-vs-yolov7.md
|
| 377 |
+
- RT-DETR vs YOLOv6: compare/rtdetr-vs-yolov6.md
|
| 378 |
+
- RT-DETR vs YOLOv5: compare/rtdetr-vs-yolov5.md
|
| 379 |
+
- RT-DETR vs PP-YOLOE+: compare/rtdetr-vs-pp-yoloe.md
|
| 380 |
+
- RT-DETR vs DAMO-YOLO: compare/rtdetr-vs-damo-yolo.md
|
| 381 |
+
- RT-DETR vs YOLOX: compare/rtdetr-vs-yolox.md
|
| 382 |
+
- RT-DETR vs EfficientDet: compare/rtdetr-vs-efficientdet.md
|
| 383 |
+
- PP-YOLOE+:
|
| 384 |
+
- PP-YOLOE+ vs YOLO26: compare/pp-yoloe-vs-yolo26.md
|
| 385 |
+
- PP-YOLOE+ vs YOLO11: compare/pp-yoloe-vs-yolo11.md
|
| 386 |
+
- PP-YOLOE+ vs YOLOv10: compare/pp-yoloe-vs-yolov10.md
|
| 387 |
+
- PP-YOLOE+ vs YOLOv9: compare/pp-yoloe-vs-yolov9.md
|
| 388 |
+
- PP-YOLOE+ vs YOLOv8: compare/pp-yoloe-vs-yolov8.md
|
| 389 |
+
- PP-YOLOE+ vs YOLOv7: compare/pp-yoloe-vs-yolov7.md
|
| 390 |
+
- PP-YOLOE+ vs YOLOv6: compare/pp-yoloe-vs-yolov6.md
|
| 391 |
+
- PP-YOLOE+ vs YOLOv5: compare/pp-yoloe-vs-yolov5.md
|
| 392 |
+
- PP-YOLOE+ vs RT-DETR: compare/pp-yoloe-vs-rtdetr.md
|
| 393 |
+
- PP-YOLOE+ vs DAMO-YOLO: compare/pp-yoloe-vs-damo-yolo.md
|
| 394 |
+
- PP-YOLOE+ vs YOLOX: compare/pp-yoloe-vs-yolox.md
|
| 395 |
+
- PP-YOLOE+ vs EfficientDet: compare/pp-yoloe-vs-efficientdet.md
|
| 396 |
+
- DAMO-YOLO:
|
| 397 |
+
- DAMO-YOLO vs YOLO26: compare/damo-yolo-vs-yolo26.md
|
| 398 |
+
- DAMO-YOLO vs YOLO11: compare/damo-yolo-vs-yolo11.md
|
| 399 |
+
- DAMO-YOLO vs YOLOv10: compare/damo-yolo-vs-yolov10.md
|
| 400 |
+
- DAMO-YOLO vs YOLOv9: compare/damo-yolo-vs-yolov9.md
|
| 401 |
+
- DAMO-YOLO vs YOLOv8: compare/damo-yolo-vs-yolov8.md
|
| 402 |
+
- DAMO-YOLO vs YOLOv7: compare/damo-yolo-vs-yolov7.md
|
| 403 |
+
- DAMO-YOLO vs YOLOv6: compare/damo-yolo-vs-yolov6.md
|
| 404 |
+
- DAMO-YOLO vs YOLOv5: compare/damo-yolo-vs-yolov5.md
|
| 405 |
+
- DAMO-YOLO vs RT-DETR: compare/damo-yolo-vs-rtdetr.md
|
| 406 |
+
- DAMO-YOLO vs PP-YOLOE+: compare/damo-yolo-vs-pp-yoloe.md
|
| 407 |
+
- DAMO-YOLO vs YOLOX: compare/damo-yolo-vs-yolox.md
|
| 408 |
+
- DAMO-YOLO vs EfficientDet: compare/damo-yolo-vs-efficientdet.md
|
| 409 |
+
- YOLOX:
|
| 410 |
+
- YOLOX vs YOLO26: compare/yolox-vs-yolo26.md
|
| 411 |
+
- YOLOX vs YOLO11: compare/yolox-vs-yolo11.md
|
| 412 |
+
- YOLOX vs YOLOv10: compare/yolox-vs-yolov10.md
|
| 413 |
+
- YOLOX vs YOLOv9: compare/yolox-vs-yolov9.md
|
| 414 |
+
- YOLOX vs YOLOv8: compare/yolox-vs-yolov8.md
|
| 415 |
+
- YOLOX vs YOLOv7: compare/yolox-vs-yolov7.md
|
| 416 |
+
- YOLOX vs YOLOv6: compare/yolox-vs-yolov6.md
|
| 417 |
+
- YOLOX vs YOLOv5: compare/yolox-vs-yolov5.md
|
| 418 |
+
- YOLOX vs RT-DETR: compare/yolox-vs-rtdetr.md
|
| 419 |
+
- YOLOX vs PP-YOLOE+: compare/yolox-vs-pp-yoloe.md
|
| 420 |
+
- YOLOX vs DAMO-YOLO: compare/yolox-vs-damo-yolo.md
|
| 421 |
+
- YOLOX vs EfficientDet: compare/yolox-vs-efficientdet.md
|
| 422 |
+
- EfficientDet:
|
| 423 |
+
- EfficientDet vs YOLO26: compare/efficientdet-vs-yolo26.md
|
| 424 |
+
- EfficientDet vs YOLO11: compare/efficientdet-vs-yolo11.md
|
| 425 |
+
- EfficientDet vs YOLOv10: compare/efficientdet-vs-yolov10.md
|
| 426 |
+
- EfficientDet vs YOLOv9: compare/efficientdet-vs-yolov9.md
|
| 427 |
+
- EfficientDet vs YOLOv8: compare/efficientdet-vs-yolov8.md
|
| 428 |
+
- EfficientDet vs YOLOv7: compare/efficientdet-vs-yolov7.md
|
| 429 |
+
- EfficientDet vs YOLOv6: compare/efficientdet-vs-yolov6.md
|
| 430 |
+
- EfficientDet vs YOLOv5: compare/efficientdet-vs-yolov5.md
|
| 431 |
+
- EfficientDet vs RT-DETR: compare/efficientdet-vs-rtdetr.md
|
| 432 |
+
- EfficientDet vs PP-YOLOE+: compare/efficientdet-vs-pp-yoloe.md
|
| 433 |
+
- EfficientDet vs DAMO-YOLO: compare/efficientdet-vs-damo-yolo.md
|
| 434 |
+
- EfficientDet vs YOLOX: compare/efficientdet-vs-yolox.md
|
| 435 |
+
- Datasets:
|
| 436 |
+
- Datasets: datasets/index.md
|
| 437 |
+
- Detection:
|
| 438 |
+
- datasets/detect/index.md
|
| 439 |
+
- African-wildlife: datasets/detect/african-wildlife.md
|
| 440 |
+
- Argoverse: datasets/detect/argoverse.md
|
| 441 |
+
- Brain-tumor: datasets/detect/brain-tumor.md
|
| 442 |
+
- COCO: datasets/detect/coco.md
|
| 443 |
+
- COCO8: datasets/detect/coco8.md
|
| 444 |
+
- COCO8-Grayscale: datasets/detect/coco8-grayscale.md
|
| 445 |
+
- COCO8-Multispectral: datasets/detect/coco8-multispectral.md
|
| 446 |
+
- COCO12-Formats: datasets/detect/coco12-formats.md
|
| 447 |
+
- COCO128: datasets/detect/coco128.md
|
| 448 |
+
- Construction-PPE: datasets/detect/construction-ppe.md
|
| 449 |
+
- GlobalWheat2020: datasets/detect/globalwheat2020.md
|
| 450 |
+
- HomeObjects-3K: datasets/detect/homeobjects-3k.md
|
| 451 |
+
- KITTI: datasets/detect/kitti.md
|
| 452 |
+
- LVIS: datasets/detect/lvis.md
|
| 453 |
+
- Medical-pills: datasets/detect/medical-pills.md
|
| 454 |
+
- Objects365: datasets/detect/objects365.md
|
| 455 |
+
- OpenImagesV7: datasets/detect/open-images-v7.md
|
| 456 |
+
- RF100: datasets/detect/roboflow-100.md
|
| 457 |
+
- Signature: datasets/detect/signature.md
|
| 458 |
+
- SKU-110K: datasets/detect/sku-110k.md
|
| 459 |
+
- TT100K: datasets/detect/tt100k.md
|
| 460 |
+
- VisDrone: datasets/detect/visdrone.md
|
| 461 |
+
- VOC: datasets/detect/voc.md
|
| 462 |
+
- xView: datasets/detect/xview.md
|
| 463 |
+
- Segmentation:
|
| 464 |
+
- datasets/segment/index.md
|
| 465 |
+
- Carparts-seg: datasets/segment/carparts-seg.md
|
| 466 |
+
- COCO: datasets/segment/coco.md
|
| 467 |
+
- COCO8-seg: datasets/segment/coco8-seg.md
|
| 468 |
+
- COCO128-seg: datasets/segment/coco128-seg.md
|
| 469 |
+
- Crack-seg: datasets/segment/crack-seg.md
|
| 470 |
+
- Package-seg: datasets/segment/package-seg.md
|
| 471 |
+
- Semantic Segmentation:
|
| 472 |
+
- datasets/semantic/index.md
|
| 473 |
+
- Cityscapes: datasets/semantic/cityscapes.md
|
| 474 |
+
- Cityscapes8: datasets/semantic/cityscapes8.md
|
| 475 |
+
- ADE20K: datasets/semantic/ade20k.md
|
| 476 |
+
- Pose:
|
| 477 |
+
- datasets/pose/index.md
|
| 478 |
+
- COCO: datasets/pose/coco.md
|
| 479 |
+
- COCO8-pose: datasets/pose/coco8-pose.md
|
| 480 |
+
- Dog-pose: datasets/pose/dog-pose.md
|
| 481 |
+
- Hand-keypoints: datasets/pose/hand-keypoints.md
|
| 482 |
+
- Tiger-pose: datasets/pose/tiger-pose.md
|
| 483 |
+
- Classification:
|
| 484 |
+
- datasets/classify/index.md
|
| 485 |
+
- Caltech 101: datasets/classify/caltech101.md
|
| 486 |
+
- Caltech 256: datasets/classify/caltech256.md
|
| 487 |
+
- CIFAR-10: datasets/classify/cifar10.md
|
| 488 |
+
- CIFAR-100: datasets/classify/cifar100.md
|
| 489 |
+
- Fashion-MNIST: datasets/classify/fashion-mnist.md
|
| 490 |
+
- ImageNet: datasets/classify/imagenet.md
|
| 491 |
+
- ImageNet-10: datasets/classify/imagenet10.md
|
| 492 |
+
- Imagenette: datasets/classify/imagenette.md
|
| 493 |
+
- Imagewoof: datasets/classify/imagewoof.md
|
| 494 |
+
- MNIST: datasets/classify/mnist.md
|
| 495 |
+
- Oriented Bounding Boxes (OBB):
|
| 496 |
+
- datasets/obb/index.md
|
| 497 |
+
- DOTA8: datasets/obb/dota8.md
|
| 498 |
+
- DOTA128: datasets/obb/dota128.md
|
| 499 |
+
- DOTAv2: datasets/obb/dota-v2.md
|
| 500 |
+
- Multi-Object Tracking:
|
| 501 |
+
- datasets/track/index.md
|
| 502 |
+
- Solutions:
|
| 503 |
+
- Solutions: solutions/index.md
|
| 504 |
+
- Analytics: guides/analytics.md
|
| 505 |
+
- Distance Calculation: guides/distance-calculation.md
|
| 506 |
+
- Heatmaps: guides/heatmaps.md
|
| 507 |
+
- Instance Segmentation with Object Tracking: guides/instance-segmentation-and-tracking.md
|
| 508 |
+
- Live Inference: guides/streamlit-live-inference.md
|
| 509 |
+
- Object Blurring: guides/object-blurring.md
|
| 510 |
+
- Object Counting: guides/object-counting.md
|
| 511 |
+
- Object Cropping: guides/object-cropping.md
|
| 512 |
+
- Objects Counting in Regions: guides/region-counting.md
|
| 513 |
+
- Parking Management: guides/parking-management.md
|
| 514 |
+
- Queue Management: guides/queue-management.md
|
| 515 |
+
- Security Alarm System: guides/security-alarm-system.md
|
| 516 |
+
- Similarity Search: guides/similarity-search.md
|
| 517 |
+
- Speed Estimation: guides/speed-estimation.md
|
| 518 |
+
- Track Objects in Zone: guides/trackzone.md
|
| 519 |
+
- VisionEye View Objects Mapping: guides/vision-eye.md
|
| 520 |
+
- Workouts Monitoring: guides/workouts-monitoring.md
|
| 521 |
+
- Guides:
|
| 522 |
+
- Guides: guides/index.md
|
| 523 |
+
- AzureML Quickstart: guides/azureml-quickstart.md
|
| 524 |
+
- Best Practices for Model Deployment: guides/model-deployment-practices.md
|
| 525 |
+
- COCO to YOLO Conversion: guides/coco-to-yolo.md
|
| 526 |
+
- COCO JSON Training: guides/coco-json-training.md
|
| 527 |
+
- Conda Quickstart: guides/conda-quickstart.md
|
| 528 |
+
- Customizing Trainer: guides/custom-trainer.md
|
| 529 |
+
- Data Collection and Annotation: guides/data-collection-and-annotation.md
|
| 530 |
+
- DeepStream on NVIDIA Jetson: guides/deepstream-nvidia-jetson.md
|
| 531 |
+
- Defining A Computer Vision Project's Goals: guides/defining-project-goals.md
|
| 532 |
+
- Deploying YOLO on Vertex AI in Docker container: guides/vertex-ai-deployment-with-docker.md
|
| 533 |
+
- Docker Quickstart: guides/docker-quickstart.md
|
| 534 |
+
- Edge TPU on Raspberry Pi: guides/coral-edge-tpu-on-raspberry-pi.md
|
| 535 |
+
- End-to-End Detection: guides/end2end-detection.md
|
| 536 |
+
- Export Non-YOLO Models: guides/export-non-yolo-models.md
|
| 537 |
+
- Fine-Tuning YOLO on Custom Data: guides/finetuning-guide.md
|
| 538 |
+
- Hyperparameter Tuning: guides/hyperparameter-tuning.md
|
| 539 |
+
- Insights on Model Evaluation and Fine-Tuning: guides/model-evaluation-insights.md
|
| 540 |
+
- Isolating Segmentation Objects: guides/isolating-segmentation-objects.md
|
| 541 |
+
- K-Fold Cross Validation: guides/kfold-cross-validation.md
|
| 542 |
+
- Maintaining Your Computer Vision Model: guides/model-monitoring-and-maintenance.md
|
| 543 |
+
- Modal Quickstart: guides/modal-quickstart.md
|
| 544 |
+
- Model Deployment Options: guides/model-deployment-options.md
|
| 545 |
+
- Model Testing: guides/model-testing.md
|
| 546 |
+
- Model YAML Configuration Guide: guides/model-yaml-config.md
|
| 547 |
+
- NVIDIA DALI GPU Preprocessing: guides/nvidia-dali.md
|
| 548 |
+
- NVIDIA DGX Spark: guides/nvidia-dgx-spark.md
|
| 549 |
+
- NVIDIA Jetson: guides/nvidia-jetson.md
|
| 550 |
+
- OpenVINO Latency vs Throughput modes: guides/optimizing-openvino-latency-vs-throughput-modes.md
|
| 551 |
+
- Preprocessing Annotated Data: guides/preprocessing_annotated_data.md
|
| 552 |
+
- Raspberry Pi: guides/raspberry-pi.md
|
| 553 |
+
- ROS Quickstart: guides/ros-quickstart.md
|
| 554 |
+
- SAHI Tiled Inference: guides/sahi-tiled-inference.md
|
| 555 |
+
- Steps of a Computer Vision Project: guides/steps-of-a-cv-project.md
|
| 556 |
+
- Tips for Model Training: guides/model-training-tips.md
|
| 557 |
+
- Triton Inference Server: guides/triton-inference-server.md
|
| 558 |
+
- Viewing Inference Images in a Terminal: guides/view-results-in-terminal.md
|
| 559 |
+
- YOLO26 Training Recipe: guides/yolo26-training-recipe.md
|
| 560 |
+
- YOLO Common Issues: guides/yolo-common-issues.md
|
| 561 |
+
- YOLO Data Augmentation: guides/yolo-data-augmentation.md
|
| 562 |
+
- YOLO Performance Metrics: guides/yolo-performance-metrics.md
|
| 563 |
+
- YOLO Thread-Safe Inference: guides/yolo-thread-safe-inference.md
|
| 564 |
+
- Explorer:
|
| 565 |
+
- datasets/explorer/index.md
|
| 566 |
+
- Explorer API: datasets/explorer/api.md
|
| 567 |
+
- Explorer Dashboard Demo: datasets/explorer/dashboard.md
|
| 568 |
+
- VOC Exploration Example: datasets/explorer/explorer.md
|
| 569 |
+
- YOLOv5:
|
| 570 |
+
- yolov5/index.md
|
| 571 |
+
- Quickstart: yolov5/quickstart_tutorial.md
|
| 572 |
+
- Environments:
|
| 573 |
+
- Amazon Web Services (AWS): yolov5/environments/aws_quickstart_tutorial.md
|
| 574 |
+
- Google Cloud (GCP): yolov5/environments/google_cloud_quickstart_tutorial.md
|
| 575 |
+
- AzureML: yolov5/environments/azureml_quickstart_tutorial.md
|
| 576 |
+
- Docker Image: yolov5/environments/docker_image_quickstart_tutorial.md
|
| 577 |
+
- Tutorials:
|
| 578 |
+
- Train Custom Data: yolov5/tutorials/train_custom_data.md
|
| 579 |
+
- Tips for Best Training Results: yolov5/tutorials/tips_for_best_training_results.md
|
| 580 |
+
- Multi-GPU Training: yolov5/tutorials/multi_gpu_training.md
|
| 581 |
+
- PyTorch Hub: yolov5/tutorials/pytorch_hub_model_loading.md
|
| 582 |
+
- TFLite, ONNX, CoreML, TensorRT Export: yolov5/tutorials/model_export.md
|
| 583 |
+
- Test-Time Augmentation (TTA): yolov5/tutorials/test_time_augmentation.md
|
| 584 |
+
- Model Ensembling: yolov5/tutorials/model_ensembling.md
|
| 585 |
+
- Pruning/Sparsity Tutorial: yolov5/tutorials/model_pruning_and_sparsity.md
|
| 586 |
+
- Hyperparameter evolution: yolov5/tutorials/hyperparameter_evolution.md
|
| 587 |
+
- Transfer learning with frozen layers: yolov5/tutorials/transfer_learning_with_frozen_layers.md
|
| 588 |
+
- Architecture Summary: yolov5/tutorials/architecture_description.md
|
| 589 |
+
- Neural Magic's DeepSparse: yolov5/tutorials/neural_magic_pruning_quantization.md
|
| 590 |
+
- Comet Logging: yolov5/tutorials/comet_logging_integration.md
|
| 591 |
+
- Clearml Logging: yolov5/tutorials/clearml_logging_integration.md
|
| 592 |
+
- Integrations:
|
| 593 |
+
- Integrations: integrations/index.md
|
| 594 |
+
- Albumentations: integrations/albumentations.md
|
| 595 |
+
- Amazon SageMaker: integrations/amazon-sagemaker.md
|
| 596 |
+
- Axelera: integrations/axelera.md
|
| 597 |
+
- ClearML: integrations/clearml.md
|
| 598 |
+
- Comet ML: integrations/comet.md
|
| 599 |
+
- CoreML: integrations/coreml.md
|
| 600 |
+
- DEEPX: integrations/deepx.md
|
| 601 |
+
- DVC: integrations/dvc.md
|
| 602 |
+
- ExecuTorch: integrations/executorch.md
|
| 603 |
+
- Google Colab: integrations/google-colab.md
|
| 604 |
+
- Gradio: integrations/gradio.md
|
| 605 |
+
- Hailo: integrations/hailo.md
|
| 606 |
+
- IBM Watsonx: integrations/ibm-watsonx.md
|
| 607 |
+
- JupyterLab: integrations/jupyterlab.md
|
| 608 |
+
- Kaggle: integrations/kaggle.md
|
| 609 |
+
- MLflow: integrations/mlflow.md
|
| 610 |
+
- MNN: integrations/mnn.md
|
| 611 |
+
- NCNN: integrations/ncnn.md
|
| 612 |
+
- Neptune: integrations/neptune.md
|
| 613 |
+
- Neural Magic: integrations/neural-magic.md
|
| 614 |
+
- ONNX: integrations/onnx.md
|
| 615 |
+
- OpenVINO: integrations/openvino.md
|
| 616 |
+
- PaddlePaddle: integrations/paddlepaddle.md
|
| 617 |
+
- Paperspace Gradient: integrations/paperspace.md
|
| 618 |
+
- Qualcomm QNN: integrations/qnn.md
|
| 619 |
+
- Ray Tune: integrations/ray-tune.md
|
| 620 |
+
- Roboflow: integrations/roboflow.md
|
| 621 |
+
- Rockchip RKNN: integrations/rockchip-rknn.md
|
| 622 |
+
- Seeed Studio reCamera: integrations/seeedstudio-recamera.md
|
| 623 |
+
- SONY IMX500: integrations/sony-imx500.md
|
| 624 |
+
- TensorBoard: integrations/tensorboard.md
|
| 625 |
+
- TensorRT: integrations/tensorrt.md
|
| 626 |
+
- TF GraphDef: integrations/tf-graphdef.md
|
| 627 |
+
- TF SavedModel: integrations/tf-savedmodel.md
|
| 628 |
+
- TF.js: integrations/tfjs.md
|
| 629 |
+
- TFLite: integrations/tflite.md
|
| 630 |
+
- TFLite Edge TPU: integrations/edge-tpu.md
|
| 631 |
+
- TorchScript: integrations/torchscript.md
|
| 632 |
+
- VS Code: integrations/vscode.md
|
| 633 |
+
- Weights & Biases: integrations/weights-biases.md
|
| 634 |
+
- Platform:
|
| 635 |
+
- Platform: platform/index.md
|
| 636 |
+
- Quickstart: platform/quickstart.md
|
| 637 |
+
- Data:
|
| 638 |
+
- platform/data/index.md
|
| 639 |
+
- Datasets: platform/data/datasets.md
|
| 640 |
+
- Annotation: platform/data/annotation.md
|
| 641 |
+
- Train:
|
| 642 |
+
- platform/train/index.md
|
| 643 |
+
- Projects: platform/train/projects.md
|
| 644 |
+
- Models: platform/train/models.md
|
| 645 |
+
- Cloud Training: platform/train/cloud-training.md
|
| 646 |
+
- Deploy:
|
| 647 |
+
- platform/deploy/index.md
|
| 648 |
+
- Inference: platform/deploy/inference.md
|
| 649 |
+
- Endpoints: platform/deploy/endpoints.md
|
| 650 |
+
- Monitoring: platform/deploy/monitoring.md
|
| 651 |
+
- Integrations:
|
| 652 |
+
- platform/integrations/index.md
|
| 653 |
+
- Ultralytics HUB: platform/integrations/ultralytics-hub.md
|
| 654 |
+
- Roboflow: platform/integrations/roboflow.md
|
| 655 |
+
- Account:
|
| 656 |
+
- platform/account/index.md
|
| 657 |
+
- API Keys: platform/account/api-keys.md
|
| 658 |
+
- Teams: platform/account/teams.md
|
| 659 |
+
- Billing: platform/account/billing.md
|
| 660 |
+
- Activity: platform/account/activity.md
|
| 661 |
+
- Trash: platform/account/trash.md
|
| 662 |
+
- Settings: platform/account/settings.md
|
| 663 |
+
- Explore: platform/explore.md
|
| 664 |
+
- REST API: platform/api/index.md
|
| 665 |
+
|
| 666 |
+
- Rust Inference: inference/index.md
|
| 667 |
+
|
| 668 |
+
- Reference:
|
| 669 |
+
- reference/index.md
|
| 670 |
+
- __init__: reference/__init__.md
|
| 671 |
+
- cfg:
|
| 672 |
+
- __init__: reference/cfg/__init__.md
|
| 673 |
+
- data:
|
| 674 |
+
- annotator: reference/data/annotator.md
|
| 675 |
+
- augment: reference/data/augment.md
|
| 676 |
+
- base: reference/data/base.md
|
| 677 |
+
- build: reference/data/build.md
|
| 678 |
+
- converter: reference/data/converter.md
|
| 679 |
+
- dataset: reference/data/dataset.md
|
| 680 |
+
- loaders: reference/data/loaders.md
|
| 681 |
+
- split: reference/data/split.md
|
| 682 |
+
- split_dota: reference/data/split_dota.md
|
| 683 |
+
- utils: reference/data/utils.md
|
| 684 |
+
- engine:
|
| 685 |
+
- exporter: reference/engine/exporter.md
|
| 686 |
+
- model: reference/engine/model.md
|
| 687 |
+
- predictor: reference/engine/predictor.md
|
| 688 |
+
- results: reference/engine/results.md
|
| 689 |
+
- trainer: reference/engine/trainer.md
|
| 690 |
+
- tuner: reference/engine/tuner.md
|
| 691 |
+
- validator: reference/engine/validator.md
|
| 692 |
+
- hub:
|
| 693 |
+
- __init__: reference/hub/__init__.md
|
| 694 |
+
- auth: reference/hub/auth.md
|
| 695 |
+
- google:
|
| 696 |
+
- __init__: reference/hub/google/__init__.md
|
| 697 |
+
- session: reference/hub/session.md
|
| 698 |
+
- utils: reference/hub/utils.md
|
| 699 |
+
- models:
|
| 700 |
+
- fastsam:
|
| 701 |
+
- model: reference/models/fastsam/model.md
|
| 702 |
+
- predict: reference/models/fastsam/predict.md
|
| 703 |
+
- utils: reference/models/fastsam/utils.md
|
| 704 |
+
- val: reference/models/fastsam/val.md
|
| 705 |
+
- nas:
|
| 706 |
+
- model: reference/models/nas/model.md
|
| 707 |
+
- predict: reference/models/nas/predict.md
|
| 708 |
+
- val: reference/models/nas/val.md
|
| 709 |
+
- rtdetr:
|
| 710 |
+
- model: reference/models/rtdetr/model.md
|
| 711 |
+
- predict: reference/models/rtdetr/predict.md
|
| 712 |
+
- train: reference/models/rtdetr/train.md
|
| 713 |
+
- val: reference/models/rtdetr/val.md
|
| 714 |
+
- sam:
|
| 715 |
+
- amg: reference/models/sam/amg.md
|
| 716 |
+
- build: reference/models/sam/build.md
|
| 717 |
+
- build_sam3: reference/models/sam/build_sam3.md
|
| 718 |
+
- model: reference/models/sam/model.md
|
| 719 |
+
- modules:
|
| 720 |
+
- blocks: reference/models/sam/modules/blocks.md
|
| 721 |
+
- decoders: reference/models/sam/modules/decoders.md
|
| 722 |
+
- encoders: reference/models/sam/modules/encoders.md
|
| 723 |
+
- memory_attention: reference/models/sam/modules/memory_attention.md
|
| 724 |
+
- sam: reference/models/sam/modules/sam.md
|
| 725 |
+
- tiny_encoder: reference/models/sam/modules/tiny_encoder.md
|
| 726 |
+
- transformer: reference/models/sam/modules/transformer.md
|
| 727 |
+
- utils: reference/models/sam/modules/utils.md
|
| 728 |
+
- predict: reference/models/sam/predict.md
|
| 729 |
+
- sam3:
|
| 730 |
+
- decoder: reference/models/sam/sam3/decoder.md
|
| 731 |
+
- encoder: reference/models/sam/sam3/encoder.md
|
| 732 |
+
- geometry_encoders: reference/models/sam/sam3/geometry_encoders.md
|
| 733 |
+
- maskformer_segmentation: reference/models/sam/sam3/maskformer_segmentation.md
|
| 734 |
+
- model_misc: reference/models/sam/sam3/model_misc.md
|
| 735 |
+
- necks: reference/models/sam/sam3/necks.md
|
| 736 |
+
- sam3_image: reference/models/sam/sam3/sam3_image.md
|
| 737 |
+
- text_encoder_ve: reference/models/sam/sam3/text_encoder_ve.md
|
| 738 |
+
- vitdet: reference/models/sam/sam3/vitdet.md
|
| 739 |
+
- vl_combiner: reference/models/sam/sam3/vl_combiner.md
|
| 740 |
+
- utils:
|
| 741 |
+
- loss: reference/models/utils/loss.md
|
| 742 |
+
- ops: reference/models/utils/ops.md
|
| 743 |
+
- yolo:
|
| 744 |
+
- classify:
|
| 745 |
+
- predict: reference/models/yolo/classify/predict.md
|
| 746 |
+
- train: reference/models/yolo/classify/train.md
|
| 747 |
+
- val: reference/models/yolo/classify/val.md
|
| 748 |
+
- detect:
|
| 749 |
+
- predict: reference/models/yolo/detect/predict.md
|
| 750 |
+
- train: reference/models/yolo/detect/train.md
|
| 751 |
+
- val: reference/models/yolo/detect/val.md
|
| 752 |
+
- model: reference/models/yolo/model.md
|
| 753 |
+
- obb:
|
| 754 |
+
- predict: reference/models/yolo/obb/predict.md
|
| 755 |
+
- train: reference/models/yolo/obb/train.md
|
| 756 |
+
- val: reference/models/yolo/obb/val.md
|
| 757 |
+
- pose:
|
| 758 |
+
- predict: reference/models/yolo/pose/predict.md
|
| 759 |
+
- train: reference/models/yolo/pose/train.md
|
| 760 |
+
- val: reference/models/yolo/pose/val.md
|
| 761 |
+
- segment:
|
| 762 |
+
- predict: reference/models/yolo/segment/predict.md
|
| 763 |
+
- train: reference/models/yolo/segment/train.md
|
| 764 |
+
- val: reference/models/yolo/segment/val.md
|
| 765 |
+
- semantic:
|
| 766 |
+
- predict: reference/models/yolo/semantic/predict.md
|
| 767 |
+
- train: reference/models/yolo/semantic/train.md
|
| 768 |
+
- val: reference/models/yolo/semantic/val.md
|
| 769 |
+
- world:
|
| 770 |
+
- train: reference/models/yolo/world/train.md
|
| 771 |
+
- train_world: reference/models/yolo/world/train_world.md
|
| 772 |
+
- yoloe:
|
| 773 |
+
- predict: reference/models/yolo/yoloe/predict.md
|
| 774 |
+
- train: reference/models/yolo/yoloe/train.md
|
| 775 |
+
- train_seg: reference/models/yolo/yoloe/train_seg.md
|
| 776 |
+
- val: reference/models/yolo/yoloe/val.md
|
| 777 |
+
- nn:
|
| 778 |
+
- autobackend: reference/nn/autobackend.md
|
| 779 |
+
- backends:
|
| 780 |
+
- axelera: reference/nn/backends/axelera.md
|
| 781 |
+
- base: reference/nn/backends/base.md
|
| 782 |
+
- coreml: reference/nn/backends/coreml.md
|
| 783 |
+
- deepx: reference/nn/backends/deepx.md
|
| 784 |
+
- executorch: reference/nn/backends/executorch.md
|
| 785 |
+
- mnn: reference/nn/backends/mnn.md
|
| 786 |
+
- ncnn: reference/nn/backends/ncnn.md
|
| 787 |
+
- onnx: reference/nn/backends/onnx.md
|
| 788 |
+
- openvino: reference/nn/backends/openvino.md
|
| 789 |
+
- paddle: reference/nn/backends/paddle.md
|
| 790 |
+
- pytorch: reference/nn/backends/pytorch.md
|
| 791 |
+
- qnn: reference/nn/backends/qnn.md
|
| 792 |
+
- rknn: reference/nn/backends/rknn.md
|
| 793 |
+
- tensorflow: reference/nn/backends/tensorflow.md
|
| 794 |
+
- tensorrt: reference/nn/backends/tensorrt.md
|
| 795 |
+
- triton: reference/nn/backends/triton.md
|
| 796 |
+
- modules:
|
| 797 |
+
- activation: reference/nn/modules/activation.md
|
| 798 |
+
- block: reference/nn/modules/block.md
|
| 799 |
+
- conv: reference/nn/modules/conv.md
|
| 800 |
+
- head: reference/nn/modules/head.md
|
| 801 |
+
- transformer: reference/nn/modules/transformer.md
|
| 802 |
+
- utils: reference/nn/modules/utils.md
|
| 803 |
+
- tasks: reference/nn/tasks.md
|
| 804 |
+
- text_model: reference/nn/text_model.md
|
| 805 |
+
- optim:
|
| 806 |
+
- muon: reference/optim/muon.md
|
| 807 |
+
- solutions:
|
| 808 |
+
- ai_gym: reference/solutions/ai_gym.md
|
| 809 |
+
- analytics: reference/solutions/analytics.md
|
| 810 |
+
- config: reference/solutions/config.md
|
| 811 |
+
- distance_calculation: reference/solutions/distance_calculation.md
|
| 812 |
+
- heatmap: reference/solutions/heatmap.md
|
| 813 |
+
- instance_segmentation: reference/solutions/instance_segmentation.md
|
| 814 |
+
- object_blurrer: reference/solutions/object_blurrer.md
|
| 815 |
+
- object_counter: reference/solutions/object_counter.md
|
| 816 |
+
- object_cropper: reference/solutions/object_cropper.md
|
| 817 |
+
- parking_management: reference/solutions/parking_management.md
|
| 818 |
+
- queue_management: reference/solutions/queue_management.md
|
| 819 |
+
- region_counter: reference/solutions/region_counter.md
|
| 820 |
+
- security_alarm: reference/solutions/security_alarm.md
|
| 821 |
+
- similarity_search: reference/solutions/similarity_search.md
|
| 822 |
+
- solutions: reference/solutions/solutions.md
|
| 823 |
+
- speed_estimation: reference/solutions/speed_estimation.md
|
| 824 |
+
- streamlit_inference: reference/solutions/streamlit_inference.md
|
| 825 |
+
- trackzone: reference/solutions/trackzone.md
|
| 826 |
+
- vision_eye: reference/solutions/vision_eye.md
|
| 827 |
+
- trackers:
|
| 828 |
+
- basetrack: reference/trackers/basetrack.md
|
| 829 |
+
- bot_sort: reference/trackers/bot_sort.md
|
| 830 |
+
- byte_tracker: reference/trackers/byte_tracker.md
|
| 831 |
+
- deep_oc_sort: reference/trackers/deep_oc_sort.md
|
| 832 |
+
- fast_tracker: reference/trackers/fast_tracker.md
|
| 833 |
+
- oc_sort: reference/trackers/oc_sort.md
|
| 834 |
+
- track: reference/trackers/track.md
|
| 835 |
+
- track_tracker: reference/trackers/track_tracker.md
|
| 836 |
+
- utils:
|
| 837 |
+
- gmc: reference/trackers/utils/gmc.md
|
| 838 |
+
- kalman_filter: reference/trackers/utils/kalman_filter.md
|
| 839 |
+
- matching: reference/trackers/utils/matching.md
|
| 840 |
+
- reid: reference/trackers/utils/reid.md
|
| 841 |
+
- stracks: reference/trackers/utils/stracks.md
|
| 842 |
+
- utils:
|
| 843 |
+
- __init__: reference/utils/__init__.md
|
| 844 |
+
- autobatch: reference/utils/autobatch.md
|
| 845 |
+
- autodevice: reference/utils/autodevice.md
|
| 846 |
+
- benchmarks: reference/utils/benchmarks.md
|
| 847 |
+
- callbacks:
|
| 848 |
+
- base: reference/utils/callbacks/base.md
|
| 849 |
+
- clearml: reference/utils/callbacks/clearml.md
|
| 850 |
+
- comet: reference/utils/callbacks/comet.md
|
| 851 |
+
- dvc: reference/utils/callbacks/dvc.md
|
| 852 |
+
- hub: reference/utils/callbacks/hub.md
|
| 853 |
+
- mlflow: reference/utils/callbacks/mlflow.md
|
| 854 |
+
- neptune: reference/utils/callbacks/neptune.md
|
| 855 |
+
- platform: reference/utils/callbacks/platform.md
|
| 856 |
+
- raytune: reference/utils/callbacks/raytune.md
|
| 857 |
+
- tensorboard: reference/utils/callbacks/tensorboard.md
|
| 858 |
+
- wb: reference/utils/callbacks/wb.md
|
| 859 |
+
- checks: reference/utils/checks.md
|
| 860 |
+
- cpu: reference/utils/cpu.md
|
| 861 |
+
- dist: reference/utils/dist.md
|
| 862 |
+
- downloads: reference/utils/downloads.md
|
| 863 |
+
- errors: reference/utils/errors.md
|
| 864 |
+
- events: reference/utils/events.md
|
| 865 |
+
- export:
|
| 866 |
+
- axelera: reference/utils/export/axelera.md
|
| 867 |
+
- coreml: reference/utils/export/coreml.md
|
| 868 |
+
- deepx: reference/utils/export/deepx.md
|
| 869 |
+
- engine: reference/utils/export/engine.md
|
| 870 |
+
- executorch: reference/utils/export/executorch.md
|
| 871 |
+
- imx: reference/utils/export/imx.md
|
| 872 |
+
- mnn: reference/utils/export/mnn.md
|
| 873 |
+
- ncnn: reference/utils/export/ncnn.md
|
| 874 |
+
- onnx: reference/utils/export/onnx.md
|
| 875 |
+
- openvino: reference/utils/export/openvino.md
|
| 876 |
+
- paddle: reference/utils/export/paddle.md
|
| 877 |
+
- qnn: reference/utils/export/qnn.md
|
| 878 |
+
- rknn: reference/utils/export/rknn.md
|
| 879 |
+
- tensorflow: reference/utils/export/tensorflow.md
|
| 880 |
+
- torchscript: reference/utils/export/torchscript.md
|
| 881 |
+
- files: reference/utils/files.md
|
| 882 |
+
- git: reference/utils/git.md
|
| 883 |
+
- instance: reference/utils/instance.md
|
| 884 |
+
- logger: reference/utils/logger.md
|
| 885 |
+
- loss: reference/utils/loss.md
|
| 886 |
+
- metrics: reference/utils/metrics.md
|
| 887 |
+
- nms: reference/utils/nms.md
|
| 888 |
+
- ops: reference/utils/ops.md
|
| 889 |
+
- patches: reference/utils/patches.md
|
| 890 |
+
- plotting: reference/utils/plotting.md
|
| 891 |
+
- tal: reference/utils/tal.md
|
| 892 |
+
- torch_utils: reference/utils/torch_utils.md
|
| 893 |
+
- tqdm: reference/utils/tqdm.md
|
| 894 |
+
- triton: reference/utils/triton.md
|
| 895 |
+
- tuner: reference/utils/tuner.md
|
| 896 |
+
- uploads: reference/utils/uploads.md
|
| 897 |
+
|
| 898 |
+
- Help:
|
| 899 |
+
- Help: help/index.md
|
| 900 |
+
- Frequently Asked Questions (FAQ): help/FAQ.md
|
| 901 |
+
- Contributing Guide: help/contributing.md
|
| 902 |
+
- Continuous Integration (CI) Guide: help/CI.md
|
| 903 |
+
- Contributor License Agreement (CLA): help/CLA.md
|
| 904 |
+
- Minimum Reproducible Example (MRE) Guide: help/minimum-reproducible-example.md
|
| 905 |
+
- Code of Conduct: help/code-of-conduct.md
|
| 906 |
+
- Environmental, Health and Safety (EHS) Policy: help/environmental-health-safety.md
|
| 907 |
+
- Security Policy: help/security.md
|
| 908 |
+
- Privacy Policy: help/privacy.md
|
| 909 |
+
|
| 910 |
+
# Plugins --------------------------------------------------------------------------------------------------------------
|
| 911 |
+
plugins:
|
| 912 |
+
- search:
|
| 913 |
+
enabled: false
|
| 914 |
+
# Macros are handled by minijinja in build_docs.py
|
| 915 |
+
# - macros:
|
| 916 |
+
# include_yaml:
|
| 917 |
+
# - ultralytics/cfg/default.yaml
|
| 918 |
+
# Docstrings are rendered ahead of time via docs/build_reference.py (no mkdocstrings dependency)
|
| 919 |
+
# - mkdocstrings:
|
| 920 |
+
# enabled: true
|
| 921 |
+
# default_handler: python
|
| 922 |
+
# handlers:
|
| 923 |
+
# python:
|
| 924 |
+
# options:
|
| 925 |
+
# docstring_options:
|
| 926 |
+
# ignore_init_summary: true
|
| 927 |
+
# merge_init_into_class: true
|
| 928 |
+
# docstring_style: google
|
| 929 |
+
# show_root_heading: true
|
| 930 |
+
# show_source: true
|
| 931 |
+
# separate_signature: true
|
| 932 |
+
# line_length: 80
|
| 933 |
+
# show_signature_annotations: true
|
| 934 |
+
# show_symbol_type_heading: true # insiders
|
| 935 |
+
# show_symbol_type_toc: true # insiders
|
| 936 |
+
# show_inheritance_diagram: true # insiders
|
| 937 |
+
- ultralytics:
|
| 938 |
+
add_desc: False
|
| 939 |
+
add_image: True
|
| 940 |
+
add_authors: True
|
| 941 |
+
add_json_ld: True
|
| 942 |
+
add_share_buttons: True
|
| 943 |
+
add_css: False
|
| 944 |
+
default_image: https://raw.githubusercontent.com/ultralytics/assets/main/yolov8/banner-yolov8.png
|
| 945 |
+
default_author: glenn.jocher@ultralytics.com
|
models_related/ultralytics/pyproject.toml
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Overview:
|
| 4 |
+
# This pyproject.toml file manages the build, packaging, and distribution of the Ultralytics library.
|
| 5 |
+
# It defines essential project metadata, dependencies, and settings used to develop and deploy the library.
|
| 6 |
+
|
| 7 |
+
# Key Sections:
|
| 8 |
+
# - [build-system]: Specifies the build requirements and backend (e.g., setuptools, wheel).
|
| 9 |
+
# - [project]: Includes details like name, version, description, authors, dependencies and more.
|
| 10 |
+
# - [project.optional-dependencies]: Provides additional, optional packages for extended features.
|
| 11 |
+
# - [tool.*]: Configures settings for various tools (pytest, yapf, etc.) used in the project.
|
| 12 |
+
|
| 13 |
+
# Installation:
|
| 14 |
+
# The Ultralytics library can be installed using the command: 'pip install ultralytics'
|
| 15 |
+
# For development purposes, you can install the package in editable mode with: 'pip install -e .'
|
| 16 |
+
# This approach allows for real-time code modifications without the need for re-installation.
|
| 17 |
+
|
| 18 |
+
# Documentation:
|
| 19 |
+
# For comprehensive documentation and usage instructions, visit: https://docs.ultralytics.com
|
| 20 |
+
|
| 21 |
+
[build-system]
|
| 22 |
+
requires = ["setuptools>=70.0.0,<=82.0.1", "wheel"]
|
| 23 |
+
build-backend = "setuptools.build_meta"
|
| 24 |
+
|
| 25 |
+
# Project settings -----------------------------------------------------------------------------------------------------
|
| 26 |
+
[project]
|
| 27 |
+
name = "ultralytics"
|
| 28 |
+
dynamic = ["version"]
|
| 29 |
+
description = "Ultralytics YOLO 🚀 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation, classification, and oriented object detection."
|
| 30 |
+
readme = "README.md"
|
| 31 |
+
requires-python = ">=3.8"
|
| 32 |
+
license = { "text" = "AGPL-3.0" }
|
| 33 |
+
keywords = ["machine-learning", "deep-learning", "computer-vision", "ML", "DL", "AI", "RT-DETR", "SAM3", "YOLO", "YOLOv3", "YOLOv5", "YOLOv8", "YOLO11", "YOLO26", "Platform", "Ultralytics"]
|
| 34 |
+
authors = [
|
| 35 |
+
{ name = "Glenn Jocher", email = "glenn.jocher@ultralytics.com" },
|
| 36 |
+
{ name = "Jing Qiu", email = "jing.qiu@ultralytics.com" },
|
| 37 |
+
]
|
| 38 |
+
maintainers = [
|
| 39 |
+
{ name = "Ultralytics", email = "hello@ultralytics.com" },
|
| 40 |
+
]
|
| 41 |
+
classifiers = [
|
| 42 |
+
"Development Status :: 5 - Production/Stable",
|
| 43 |
+
"Intended Audience :: Developers",
|
| 44 |
+
"Intended Audience :: Education",
|
| 45 |
+
"Intended Audience :: Science/Research",
|
| 46 |
+
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
|
| 47 |
+
"Programming Language :: Python :: 3",
|
| 48 |
+
"Programming Language :: Python :: 3.8",
|
| 49 |
+
"Programming Language :: Python :: 3.9",
|
| 50 |
+
"Programming Language :: Python :: 3.10",
|
| 51 |
+
"Programming Language :: Python :: 3.11",
|
| 52 |
+
"Programming Language :: Python :: 3.12",
|
| 53 |
+
"Programming Language :: Python :: 3.13",
|
| 54 |
+
"Topic :: Software Development",
|
| 55 |
+
"Topic :: Scientific/Engineering",
|
| 56 |
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
| 57 |
+
"Topic :: Scientific/Engineering :: Image Recognition",
|
| 58 |
+
"Operating System :: POSIX :: Linux",
|
| 59 |
+
"Operating System :: MacOS",
|
| 60 |
+
"Operating System :: Microsoft :: Windows",
|
| 61 |
+
]
|
| 62 |
+
|
| 63 |
+
# Required dependencies ------------------------------------------------------------------------------------------------
|
| 64 |
+
dependencies = [
|
| 65 |
+
"numpy>=1.23.0",
|
| 66 |
+
"matplotlib>=3.3.0",
|
| 67 |
+
"opencv-python>=4.6.0",
|
| 68 |
+
"pillow>=7.1.2",
|
| 69 |
+
"pyyaml>=5.3.1",
|
| 70 |
+
"requests>=2.23.0",
|
| 71 |
+
"scipy>=1.4.1",
|
| 72 |
+
"torch>=1.8.0",
|
| 73 |
+
"torch>=1.8.0,!=2.4.0; sys_platform == 'win32'", # Windows CPU errors w/ 2.4.0 https://github.com/ultralytics/ultralytics/issues/15049
|
| 74 |
+
"torchvision>=0.9.0",
|
| 75 |
+
"psutil>=5.8.0", # system utilization
|
| 76 |
+
"polars>=0.20.0",
|
| 77 |
+
"nvidia-ml-py>=12.0.0", # NVIDIA GPU monitoring https://pypi.org/project/nvidia-ml-py
|
| 78 |
+
"ultralytics-thop>=2.0.18", # FLOPs computation https://github.com/ultralytics/thop
|
| 79 |
+
]
|
| 80 |
+
|
| 81 |
+
# Optional dependencies ------------------------------------------------------------------------------------------------
|
| 82 |
+
[project.optional-dependencies]
|
| 83 |
+
dev = [
|
| 84 |
+
"ipython",
|
| 85 |
+
"pytest",
|
| 86 |
+
"pytest-cov",
|
| 87 |
+
"pytest-xdist>=3.0.0",
|
| 88 |
+
"coverage[toml]",
|
| 89 |
+
"zensical>=0.0.15; python_version >= '3.10'",
|
| 90 |
+
"mkdocs-ultralytics-plugin>=0.2.4", # for meta descriptions and images, dates and authors
|
| 91 |
+
"minijinja>=2.0.0", # render docs macros without mkdocs-macros-plugin
|
| 92 |
+
]
|
| 93 |
+
export-base = [
|
| 94 |
+
"onnx>=1.12.0; platform_system != 'Darwin'", # ONNX export
|
| 95 |
+
"onnx>=1.12.0,<1.18.0; platform_system == 'Darwin' and python_version < '3.13'", # TF inference hanging on MacOS (tested up to onnx==1.20.0)
|
| 96 |
+
"onnx>=1.20.0; platform_system == 'Darwin' and python_version >= '3.13'",
|
| 97 |
+
"onnxslim>=0.1.82",
|
| 98 |
+
# ONNX export validation and inference. Jetson jobs provide custom aarch64 onnxruntime-gpu wheels.
|
| 99 |
+
"onnxruntime<1.20.0; python_version < '3.11' and (platform_machine != 'aarch64' or platform_system != 'Linux')",
|
| 100 |
+
"onnxruntime>=1.20.0; python_version >= '3.11'",
|
| 101 |
+
"nncf>=2.14.0,<3.0.0; python_version >= '3.9'", # OpenVINO INT8 export
|
| 102 |
+
"openvino>=2024.0.0", # OpenVINO export
|
| 103 |
+
"packaging>=26.0; platform_machine == 'aarch64' and platform_system == 'Linux' and python_version >= '3.9'", # IMX export bug
|
| 104 |
+
]
|
| 105 |
+
export-legacy-torch = [
|
| 106 |
+
"numpy<2",
|
| 107 |
+
]
|
| 108 |
+
export-tensorflow = [
|
| 109 |
+
"numpy<2.0.0; python_version < '3.13'", # TF 2.20 compatibility
|
| 110 |
+
"tensorflow>=2.0.0,<=2.19.0; python_version < '3.13'", # TF bug https://github.com/ultralytics/ultralytics/issues/5161
|
| 111 |
+
"tensorflow>2.19.0; python_version >= '3.13'",
|
| 112 |
+
"tensorflowjs>=2.0.0", # TF.js export, automatically installs tensorflow
|
| 113 |
+
"ydf<0.13.0; platform_machine != 'aarch64' and python_version <= '3.12'", # ydf>=0.13 has protobuf gencode 6.x but tensorflow<=2.19 requires protobuf<6
|
| 114 |
+
"googleapis-common-protos<1.74.0; python_version <= '3.12'", # >=1.74.0 uses protobuf gencode 7.34.1, incompatible with tensorflow<=2.19 (protobuf<6) and breaks ray[tune] import
|
| 115 |
+
"tensorstore>=0.1.63; platform_machine == 'aarch64' and python_version >= '3.9'", # for TF Raspberry Pi exports
|
| 116 |
+
"h5py!=3.11.0; platform_machine == 'aarch64'", # fix h5py build issues due to missing aarch64 wheels in 3.11 release
|
| 117 |
+
"setuptools<=81.0.0", # pin due to >=82.0.0 breaking tensorflow.js package
|
| 118 |
+
]
|
| 119 |
+
export-coreml = [
|
| 120 |
+
"numpy<=2.3.5; python_version >= '3.13'", # pin until CoreML>9.0 new release
|
| 121 |
+
"coremltools>=9.0; platform_system != 'Windows' and python_version <= '3.13'", # CoreML supported on macOS and Linux
|
| 122 |
+
"scikit-learn>=1.3.2; platform_system != 'Windows' and python_version <= '3.13'", # CoreML k-means quantization
|
| 123 |
+
]
|
| 124 |
+
export-executorch = [
|
| 125 |
+
"executorch",
|
| 126 |
+
"numpy<=2.3.5",
|
| 127 |
+
]
|
| 128 |
+
export-deepx = [
|
| 129 |
+
"dx_com",
|
| 130 |
+
"numpy<2",
|
| 131 |
+
]
|
| 132 |
+
export = [
|
| 133 |
+
"ultralytics[export-base]",
|
| 134 |
+
"ultralytics[export-tensorflow]",
|
| 135 |
+
"ultralytics[export-coreml]",
|
| 136 |
+
]
|
| 137 |
+
solutions = [
|
| 138 |
+
"shapely>=2.0.0", # shapely for point and polygon data matching
|
| 139 |
+
"lap>=0.5.12", # for solution tracking linear assignment
|
| 140 |
+
"faiss-cpu", # for similarity search
|
| 141 |
+
"openai-clip>=1.0.1", # for similarity search text/image embeddings
|
| 142 |
+
"setuptools>=80.0.0,<81.0.0; python_version >= '3.9'", # openai-clip imports pkg_resources.packaging, removed in setuptools>=81
|
| 143 |
+
"setuptools<76.0.0; python_version < '3.9'", # provide pkg_resources for openai-clip on Python 3.8 (setuptools>=76 drops 3.8, >=81 drops pkg_resources)
|
| 144 |
+
"streamlit>=1.51.0; python_version >= '3.10'", # for live inference on web browser, i.e `yolo streamlit-predict`
|
| 145 |
+
"streamlit>=1.29.0,<1.51.0; python_version < '3.10' and (platform_machine != 'aarch64' or platform_system != 'Linux')",
|
| 146 |
+
"flask>=3.0.1", # for similarity search solution
|
| 147 |
+
]
|
| 148 |
+
logging = [
|
| 149 |
+
"wandb", # https://docs.ultralytics.com/integrations/weights-biases/
|
| 150 |
+
"tensorboard", # https://docs.ultralytics.com/integrations/tensorboard/
|
| 151 |
+
"mlflow", # https://docs.ultralytics.com/integrations/mlflow/
|
| 152 |
+
]
|
| 153 |
+
extra = [
|
| 154 |
+
"ipython", # interactive notebook
|
| 155 |
+
"albumentations>=1.4.6", # training augmentations
|
| 156 |
+
"faster-coco-eval>=1.6.7", # COCO mAP
|
| 157 |
+
]
|
| 158 |
+
typing = [
|
| 159 |
+
"scipy-stubs>=1.14.1.4; python_version >= '3.10'",
|
| 160 |
+
"types-pillow",
|
| 161 |
+
"types-psutil",
|
| 162 |
+
"types-pyyaml",
|
| 163 |
+
"types-requests",
|
| 164 |
+
"types-shapely",
|
| 165 |
+
]
|
| 166 |
+
|
| 167 |
+
[project.urls]
|
| 168 |
+
"Homepage" = "https://ultralytics.com"
|
| 169 |
+
"Source" = "https://github.com/ultralytics/ultralytics"
|
| 170 |
+
"Documentation" = "https://docs.ultralytics.com"
|
| 171 |
+
"Bug Reports" = "https://github.com/ultralytics/ultralytics/issues"
|
| 172 |
+
"Changelog" = "https://github.com/ultralytics/ultralytics/releases"
|
| 173 |
+
|
| 174 |
+
[project.scripts]
|
| 175 |
+
yolo = "ultralytics.cfg:entrypoint"
|
| 176 |
+
ultralytics = "ultralytics.cfg:entrypoint"
|
| 177 |
+
|
| 178 |
+
# Tools settings -------------------------------------------------------------------------------------------------------
|
| 179 |
+
[tool.setuptools] # configuration specific to the `setuptools` build backend.
|
| 180 |
+
packages = { find = { where = ["."], include = ["ultralytics", "ultralytics.*"] } }
|
| 181 |
+
# Tests included below for checking Conda builds in https://github.com/conda-forge/ultralytics-feedstock
|
| 182 |
+
package-data = { "ultralytics" = ["**/*.yaml", "**/*.sh", "../tests/*.py"], "ultralytics.assets" = ["*.jpg"], "ultralytics.solutions.templates" = ["*.html"]}
|
| 183 |
+
|
| 184 |
+
[tool.setuptools.dynamic]
|
| 185 |
+
version = { attr = "ultralytics.__version__" }
|
| 186 |
+
|
| 187 |
+
[tool.pytest.ini_options]
|
| 188 |
+
addopts = "--doctest-modules --durations=30 --color=yes"
|
| 189 |
+
markers = [
|
| 190 |
+
"slow: skip slow tests unless --slow is set",
|
| 191 |
+
]
|
| 192 |
+
norecursedirs = [".git", "dist", "build"]
|
| 193 |
+
|
| 194 |
+
[tool.coverage.run]
|
| 195 |
+
source = ["ultralytics/"]
|
| 196 |
+
data_file = "tests/.coverage"
|
| 197 |
+
omit = ["ultralytics/utils/callbacks/*"]
|
| 198 |
+
|
| 199 |
+
[tool.isort]
|
| 200 |
+
line_length = 120
|
| 201 |
+
multi_line_output = 0
|
| 202 |
+
|
| 203 |
+
[tool.yapf]
|
| 204 |
+
based_on_style = "pep8"
|
| 205 |
+
spaces_before_comment = 2
|
| 206 |
+
column_limit = 120
|
| 207 |
+
coalesce_brackets = true
|
| 208 |
+
spaces_around_power_operator = true
|
| 209 |
+
space_between_ending_comma_and_closing_bracket = true
|
| 210 |
+
split_before_closing_bracket = false
|
| 211 |
+
split_before_first_argument = false
|
| 212 |
+
|
| 213 |
+
[tool.ruff]
|
| 214 |
+
line-length = 120
|
| 215 |
+
|
| 216 |
+
[tool.ruff.format]
|
| 217 |
+
docstring-code-format = true
|
| 218 |
+
|
| 219 |
+
[tool.ruff.lint.pydocstyle]
|
| 220 |
+
convention = "google"
|
| 221 |
+
|
| 222 |
+
[tool.docformatter]
|
| 223 |
+
wrap-summaries = 120
|
| 224 |
+
wrap-descriptions = 120
|
| 225 |
+
pre-summary-newline = true
|
| 226 |
+
close-quotes-on-newline = true
|
| 227 |
+
in-place = true
|
| 228 |
+
|
| 229 |
+
[tool.codespell]
|
| 230 |
+
ignore-words-list = "grey,writeable,finalY,RepResNet,Idenfy,WIT,Smoot,EHR,ROUGE,ALS,iTerm,Carmel,FPR,Hach,Calle,ore,COO,MOT,crate,nd,ned,strack,dota,ane,segway,fo,gool,winn,commend,bloc,nam,afterall,skelton,goin,alls"
|
| 231 |
+
skip = "*.pt,*.pth,*.torchscript,*.onnx,*.tflite,*.pb,*.bin,*.param,*.mlmodel,*.engine,*.npy,*.data*,*.csv,*pnnx*,*venv*,*translat*,*lock*,__pycache__*,*.ico,*.jpg,*.png,*.webp,*.avif,*.mp4,*.mov,/runs,/.git,./docs/??/*.md,./docs/mkdocs_??.yml"
|
models_related/ultralytics/ultralytics/__init__.py
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
__version__ = "8.4.67"
|
| 4 |
+
|
| 5 |
+
import importlib
|
| 6 |
+
import os
|
| 7 |
+
from typing import TYPE_CHECKING
|
| 8 |
+
|
| 9 |
+
# Set ENV variables (place before imports)
|
| 10 |
+
if not os.environ.get("OMP_NUM_THREADS"):
|
| 11 |
+
os.environ["OMP_NUM_THREADS"] = "1" # default for reduced CPU utilization during training
|
| 12 |
+
|
| 13 |
+
from models_related.ultralytics.ultralytics.utils import ASSETS, SETTINGS
|
| 14 |
+
from models_related.ultralytics.ultralytics.utils.checks import check_yolo as checks
|
| 15 |
+
from models_related.ultralytics.ultralytics.utils.downloads import download
|
| 16 |
+
|
| 17 |
+
settings = SETTINGS
|
| 18 |
+
|
| 19 |
+
MODELS = ("YOLO", "YOLOWorld", "YOLOE", "NAS", "SAM", "FastSAM", "RTDETR")
|
| 20 |
+
|
| 21 |
+
__all__ = (
|
| 22 |
+
"__version__",
|
| 23 |
+
"ASSETS",
|
| 24 |
+
*MODELS,
|
| 25 |
+
"checks",
|
| 26 |
+
"download",
|
| 27 |
+
"settings",
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
+
if TYPE_CHECKING:
|
| 31 |
+
# Enable hints for type checkers
|
| 32 |
+
from models_related.ultralytics.ultralytics.models import YOLO, YOLOWorld, YOLOE, NAS, SAM, FastSAM, RTDETR # noqa
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def __getattr__(name: str):
|
| 36 |
+
"""Lazy-import model classes on first access."""
|
| 37 |
+
if name in MODELS:
|
| 38 |
+
return getattr(importlib.import_module("ultralytics.models"), name)
|
| 39 |
+
raise AttributeError(f"module {__name__} has no attribute {name}")
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def __dir__():
|
| 43 |
+
"""Extend dir() to include lazily available model names for IDE autocompletion."""
|
| 44 |
+
return sorted(set(globals()) | set(MODELS))
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
if __name__ == "__main__":
|
| 48 |
+
print(__version__)
|
models_related/ultralytics/ultralytics/assets/bus.jpg
ADDED
|
Git LFS Details
|
models_related/ultralytics/ultralytics/assets/zidane.jpg
ADDED
|
Git LFS Details
|
models_related/ultralytics/ultralytics/cfg/__init__.py
ADDED
|
@@ -0,0 +1,1060 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import ast
|
| 6 |
+
import os
|
| 7 |
+
import shutil
|
| 8 |
+
import subprocess
|
| 9 |
+
import sys
|
| 10 |
+
from pathlib import Path
|
| 11 |
+
from types import SimpleNamespace
|
| 12 |
+
from typing import Any
|
| 13 |
+
|
| 14 |
+
from models_related.ultralytics.ultralytics import __version__
|
| 15 |
+
from models_related.ultralytics.ultralytics.utils import (
|
| 16 |
+
checks,
|
| 17 |
+
)
|
| 18 |
+
from models_related.ultralytics.ultralytics.utils import ASSETS, DEFAULT_CFG, DEFAULT_CFG_DICT, DEFAULT_CFG_PATH, FLOAT_OR_INT, IS_VSCODE, LOGGER, RANK, ROOT, RUNS_DIR, SETTINGS, SETTINGS_FILE, STR_OR_PATH, TESTS_RUNNING, YAML, IterableSimpleNamespace, colorstr, deprecation_warn, vscode_msg
|
| 19 |
+
|
| 20 |
+
# Define valid solutions
|
| 21 |
+
SOLUTION_MAP = {
|
| 22 |
+
"count": "ObjectCounter",
|
| 23 |
+
"crop": "ObjectCropper",
|
| 24 |
+
"blur": "ObjectBlurrer",
|
| 25 |
+
"workout": "AIGym",
|
| 26 |
+
"heatmap": "Heatmap",
|
| 27 |
+
"isegment": "InstanceSegmentation",
|
| 28 |
+
"visioneye": "VisionEye",
|
| 29 |
+
"speed": "SpeedEstimator",
|
| 30 |
+
"queue": "QueueManager",
|
| 31 |
+
"analytics": "Analytics",
|
| 32 |
+
"inference": "Inference",
|
| 33 |
+
"trackzone": "TrackZone",
|
| 34 |
+
"region": "RegionCounter",
|
| 35 |
+
"security": "SecurityAlarm",
|
| 36 |
+
"parking": "ParkingManagement",
|
| 37 |
+
"help": None,
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
# Define valid tasks and modes
|
| 41 |
+
MODES = frozenset({"train", "val", "predict", "export", "track", "benchmark"})
|
| 42 |
+
TASKS = frozenset({"detect", "segment", "classify", "pose", "obb", "semantic"})
|
| 43 |
+
TASK2DATA = {
|
| 44 |
+
"detect": "coco8.yaml",
|
| 45 |
+
"segment": "coco8-seg.yaml",
|
| 46 |
+
"classify": "imagenet10",
|
| 47 |
+
"pose": "coco8-pose.yaml",
|
| 48 |
+
"obb": "dota8.yaml",
|
| 49 |
+
"semantic": "cityscapes8.yaml",
|
| 50 |
+
}
|
| 51 |
+
TASK2CALIBRATIONDATA = {
|
| 52 |
+
"detect": "coco128.yaml",
|
| 53 |
+
"segment": "coco128-seg.yaml",
|
| 54 |
+
"classify": "imagenet100",
|
| 55 |
+
"pose": "coco8-pose.yaml",
|
| 56 |
+
"obb": "dota128.yaml",
|
| 57 |
+
"semantic": "cityscapes8.yaml",
|
| 58 |
+
}
|
| 59 |
+
TASK2MODEL = {
|
| 60 |
+
"detect": "yolo26n.pt",
|
| 61 |
+
"segment": "yolo26n-seg.pt",
|
| 62 |
+
"classify": "yolo26n-cls.pt",
|
| 63 |
+
"pose": "yolo26n-pose.pt",
|
| 64 |
+
"obb": "yolo26n-obb.pt",
|
| 65 |
+
"semantic": "yolo26n-sem.pt",
|
| 66 |
+
}
|
| 67 |
+
TASK2METRIC = {
|
| 68 |
+
"detect": "metrics/mAP50-95(B)",
|
| 69 |
+
"segment": "metrics/mAP50-95(M)",
|
| 70 |
+
"classify": "metrics/accuracy_top1",
|
| 71 |
+
"pose": "metrics/mAP50-95(P)",
|
| 72 |
+
"obb": "metrics/mAP50-95(B)",
|
| 73 |
+
"semantic": "metrics/mIoU",
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
ARGV = sys.argv or ["", ""] # sometimes sys.argv = []
|
| 77 |
+
SOLUTIONS_HELP_MSG = f"""
|
| 78 |
+
Arguments received: {["yolo", *ARGV[1:]]!s}. Ultralytics 'yolo solutions' usage overview:
|
| 79 |
+
|
| 80 |
+
yolo solutions SOLUTION ARGS
|
| 81 |
+
|
| 82 |
+
Where SOLUTION (optional) is one of {list(SOLUTION_MAP.keys())[:-1]}
|
| 83 |
+
ARGS (optional) are any number of custom 'arg=value' pairs like 'show_in=True' that override defaults
|
| 84 |
+
at https://docs.ultralytics.com/usage/cfg
|
| 85 |
+
|
| 86 |
+
1. Call object counting solution
|
| 87 |
+
yolo solutions count source="path/to/video.mp4" region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]"
|
| 88 |
+
|
| 89 |
+
2. Call heatmap solution
|
| 90 |
+
yolo solutions heatmap colormap=cv2.COLORMAP_PARULA model=yolo26n.pt
|
| 91 |
+
|
| 92 |
+
3. Call queue management solution
|
| 93 |
+
yolo solutions queue region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]" model=yolo26n.pt
|
| 94 |
+
|
| 95 |
+
4. Call workout monitoring solution for push-ups
|
| 96 |
+
yolo solutions workout model=yolo26n-pose.pt kpts=[6, 8, 10]
|
| 97 |
+
|
| 98 |
+
5. Generate analytical graphs
|
| 99 |
+
yolo solutions analytics analytics_type="pie"
|
| 100 |
+
|
| 101 |
+
6. Track objects within specific zones
|
| 102 |
+
yolo solutions trackzone source="path/to/video.mp4" region="[(150, 150), (1130, 150), (1130, 570), (150, 570)]"
|
| 103 |
+
|
| 104 |
+
7. Count objects inside specific regions
|
| 105 |
+
yolo solutions region source="path/to/video.mp4" region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]"
|
| 106 |
+
|
| 107 |
+
8. Run security alarm monitoring (email alerts require Python API)
|
| 108 |
+
yolo solutions security source="path/to/video.mp4"
|
| 109 |
+
|
| 110 |
+
9. Monitor parking occupancy (create JSON annotations first via Python ParkingPtsSelection)
|
| 111 |
+
yolo solutions parking source="path/to/video.mp4" json_file="bounding_boxes.json"
|
| 112 |
+
|
| 113 |
+
10. Streamlit real-time webcam inference GUI
|
| 114 |
+
yolo streamlit-predict
|
| 115 |
+
"""
|
| 116 |
+
CLI_HELP_MSG = f"""
|
| 117 |
+
Arguments received: {["yolo", *ARGV[1:]]!s}. Ultralytics 'yolo' commands use the following syntax:
|
| 118 |
+
|
| 119 |
+
yolo TASK MODE ARGS
|
| 120 |
+
|
| 121 |
+
Where TASK (optional) is one of {list(TASKS)}
|
| 122 |
+
MODE (required) is one of {list(MODES)}
|
| 123 |
+
ARGS (optional) are any number of custom 'arg=value' pairs like 'imgsz=320' that override defaults.
|
| 124 |
+
See all ARGS at https://docs.ultralytics.com/usage/cfg or with 'yolo cfg'
|
| 125 |
+
|
| 126 |
+
1. Train a detection model for 10 epochs with an initial learning_rate of 0.01
|
| 127 |
+
yolo train data=coco8.yaml model=yolo26n.pt epochs=10 lr0=0.01
|
| 128 |
+
|
| 129 |
+
2. Predict a YouTube video using a pretrained segmentation model at image size 320:
|
| 130 |
+
yolo predict model=yolo26n-seg.pt source='https://youtu.be/LNwODJXcvt4' imgsz=320
|
| 131 |
+
|
| 132 |
+
3. Validate a pretrained detection model at batch-size 1 and image size 640:
|
| 133 |
+
yolo val model=yolo26n.pt data=coco8.yaml batch=1 imgsz=640
|
| 134 |
+
|
| 135 |
+
4. Export a YOLO26n classification model to ONNX format at image size 224 by 128 (no TASK required)
|
| 136 |
+
yolo export model=yolo26n-cls.pt format=onnx imgsz=224,128
|
| 137 |
+
|
| 138 |
+
5. Ultralytics solutions usage
|
| 139 |
+
yolo solutions count or any of {list(SOLUTION_MAP.keys())[1:-1]} source="path/to/video.mp4"
|
| 140 |
+
|
| 141 |
+
6. Run special commands:
|
| 142 |
+
yolo help
|
| 143 |
+
yolo checks
|
| 144 |
+
yolo version
|
| 145 |
+
yolo settings
|
| 146 |
+
yolo copy-cfg
|
| 147 |
+
yolo cfg
|
| 148 |
+
yolo solutions help
|
| 149 |
+
|
| 150 |
+
Docs: https://docs.ultralytics.com
|
| 151 |
+
Solutions: https://docs.ultralytics.com/solutions/
|
| 152 |
+
Community: https://community.ultralytics.com
|
| 153 |
+
GitHub: https://github.com/ultralytics/ultralytics
|
| 154 |
+
"""
|
| 155 |
+
|
| 156 |
+
# Define keys for arg type checks
|
| 157 |
+
CFG_FLOAT_KEYS = frozenset(
|
| 158 |
+
{ # integer or float arguments, i.e. x=2 and x=2.0
|
| 159 |
+
"warmup_epochs",
|
| 160 |
+
"box",
|
| 161 |
+
"cls",
|
| 162 |
+
"cls_pw",
|
| 163 |
+
"dfl",
|
| 164 |
+
"degrees",
|
| 165 |
+
"shear",
|
| 166 |
+
"time",
|
| 167 |
+
"workspace",
|
| 168 |
+
"batch",
|
| 169 |
+
}
|
| 170 |
+
)
|
| 171 |
+
CFG_FRACTION_KEYS = frozenset(
|
| 172 |
+
{ # fractional float arguments with 0.0<=values<=1.0
|
| 173 |
+
"dropout",
|
| 174 |
+
"lr0",
|
| 175 |
+
"lrf",
|
| 176 |
+
"momentum",
|
| 177 |
+
"weight_decay",
|
| 178 |
+
"warmup_momentum",
|
| 179 |
+
"warmup_bias_lr",
|
| 180 |
+
"hsv_h",
|
| 181 |
+
"hsv_s",
|
| 182 |
+
"hsv_v",
|
| 183 |
+
"translate",
|
| 184 |
+
"perspective",
|
| 185 |
+
"flipud",
|
| 186 |
+
"fliplr",
|
| 187 |
+
"bgr",
|
| 188 |
+
"mosaic",
|
| 189 |
+
"mixup",
|
| 190 |
+
"cutmix",
|
| 191 |
+
"copy_paste",
|
| 192 |
+
"conf",
|
| 193 |
+
"iou",
|
| 194 |
+
"fraction",
|
| 195 |
+
"multi_scale",
|
| 196 |
+
}
|
| 197 |
+
)
|
| 198 |
+
CFG_INT_KEYS = frozenset(
|
| 199 |
+
{ # integer-only arguments
|
| 200 |
+
"epochs",
|
| 201 |
+
"patience",
|
| 202 |
+
"workers",
|
| 203 |
+
"seed",
|
| 204 |
+
"close_mosaic",
|
| 205 |
+
"mask_ratio",
|
| 206 |
+
"max_det",
|
| 207 |
+
"vid_stride",
|
| 208 |
+
"line_width",
|
| 209 |
+
"nbs",
|
| 210 |
+
"save_period",
|
| 211 |
+
}
|
| 212 |
+
)
|
| 213 |
+
CFG_BOOL_KEYS = frozenset(
|
| 214 |
+
{ # boolean-only arguments
|
| 215 |
+
"save",
|
| 216 |
+
"exist_ok",
|
| 217 |
+
"verbose",
|
| 218 |
+
"deterministic",
|
| 219 |
+
"single_cls",
|
| 220 |
+
"rect",
|
| 221 |
+
"cos_lr",
|
| 222 |
+
"overlap_mask",
|
| 223 |
+
"val",
|
| 224 |
+
"save_json",
|
| 225 |
+
"half",
|
| 226 |
+
"dnn",
|
| 227 |
+
"plots",
|
| 228 |
+
"show",
|
| 229 |
+
"save_txt",
|
| 230 |
+
"save_conf",
|
| 231 |
+
"save_crop",
|
| 232 |
+
"save_frames",
|
| 233 |
+
"show_labels",
|
| 234 |
+
"show_conf",
|
| 235 |
+
"visualize",
|
| 236 |
+
"augment",
|
| 237 |
+
"agnostic_nms",
|
| 238 |
+
"retina_masks",
|
| 239 |
+
"show_boxes",
|
| 240 |
+
"keras",
|
| 241 |
+
"optimize",
|
| 242 |
+
"int8",
|
| 243 |
+
"dynamic",
|
| 244 |
+
"simplify",
|
| 245 |
+
"nms",
|
| 246 |
+
"profile",
|
| 247 |
+
"end2end",
|
| 248 |
+
}
|
| 249 |
+
)
|
| 250 |
+
|
| 251 |
+
|
| 252 |
+
def cfg2dict(cfg: str | Path | dict | SimpleNamespace) -> dict:
|
| 253 |
+
"""Convert a configuration object to a dictionary.
|
| 254 |
+
|
| 255 |
+
Args:
|
| 256 |
+
cfg (str | Path | dict | SimpleNamespace): Configuration object to be converted. Can be a file path, a string, a
|
| 257 |
+
dictionary, or a SimpleNamespace object.
|
| 258 |
+
|
| 259 |
+
Returns:
|
| 260 |
+
(dict): Configuration object in dictionary format.
|
| 261 |
+
|
| 262 |
+
Examples:
|
| 263 |
+
Convert a YAML file path to a dictionary:
|
| 264 |
+
>>> config_dict = cfg2dict("config.yaml")
|
| 265 |
+
|
| 266 |
+
Convert a SimpleNamespace to a dictionary:
|
| 267 |
+
>>> from types import SimpleNamespace
|
| 268 |
+
>>> config_sn = SimpleNamespace(param1="value1", param2="value2")
|
| 269 |
+
>>> config_dict = cfg2dict(config_sn)
|
| 270 |
+
|
| 271 |
+
Pass through an already existing dictionary:
|
| 272 |
+
>>> config_dict = cfg2dict({"param1": "value1", "param2": "value2"})
|
| 273 |
+
|
| 274 |
+
Notes:
|
| 275 |
+
- If cfg is a path or string, it's loaded as YAML and converted to a dictionary.
|
| 276 |
+
- If cfg is a SimpleNamespace object, it's converted to a dictionary using vars().
|
| 277 |
+
- If cfg is already a dictionary, it's returned unchanged.
|
| 278 |
+
"""
|
| 279 |
+
if isinstance(cfg, STR_OR_PATH):
|
| 280 |
+
cfg = YAML.load(cfg) # load dict
|
| 281 |
+
elif isinstance(cfg, SimpleNamespace):
|
| 282 |
+
cfg = vars(cfg) # convert to dict
|
| 283 |
+
return cfg
|
| 284 |
+
|
| 285 |
+
|
| 286 |
+
def get_cfg(
|
| 287 |
+
cfg: str | Path | dict | SimpleNamespace = DEFAULT_CFG_DICT, overrides: dict | None = None
|
| 288 |
+
) -> SimpleNamespace:
|
| 289 |
+
"""Load and merge configuration data from a file or dictionary, with optional overrides.
|
| 290 |
+
|
| 291 |
+
Args:
|
| 292 |
+
cfg (str | Path | dict | SimpleNamespace): Configuration data source. Can be a file path, dictionary, or
|
| 293 |
+
SimpleNamespace object.
|
| 294 |
+
overrides (dict | None): Dictionary containing key-value pairs to override the base configuration.
|
| 295 |
+
|
| 296 |
+
Returns:
|
| 297 |
+
(SimpleNamespace): Namespace containing the merged configuration arguments.
|
| 298 |
+
|
| 299 |
+
Examples:
|
| 300 |
+
>>> from ultralytics.cfg import get_cfg
|
| 301 |
+
>>> config = get_cfg() # Load default configuration
|
| 302 |
+
>>> config_with_overrides = get_cfg("path/to/config.yaml", overrides={"epochs": 50, "batch": 16})
|
| 303 |
+
|
| 304 |
+
Notes:
|
| 305 |
+
- If both `cfg` and `overrides` are provided, the values in `overrides` will take precedence.
|
| 306 |
+
- Special handling ensures alignment and correctness of the configuration, such as converting numeric
|
| 307 |
+
`project` and `name` to strings and validating configuration keys and values.
|
| 308 |
+
- The function performs type and value checks on the configuration data.
|
| 309 |
+
"""
|
| 310 |
+
cfg = cfg2dict(cfg)
|
| 311 |
+
|
| 312 |
+
# Merge overrides
|
| 313 |
+
if overrides:
|
| 314 |
+
overrides = cfg2dict(overrides)
|
| 315 |
+
check_dict_alignment(cfg, overrides)
|
| 316 |
+
cfg = {**cfg, **overrides} # merge cfg and overrides dicts (prefer overrides)
|
| 317 |
+
|
| 318 |
+
# Special handling for numeric project/name
|
| 319 |
+
for k in "project", "name":
|
| 320 |
+
if k in cfg and isinstance(cfg[k], FLOAT_OR_INT):
|
| 321 |
+
cfg[k] = str(cfg[k])
|
| 322 |
+
if cfg.get("name") == "model": # assign model to 'name' arg
|
| 323 |
+
cfg["name"] = str(cfg.get("model", "")).partition(".")[0]
|
| 324 |
+
LOGGER.warning(f"'name=model' automatically updated to 'name={cfg['name']}'.")
|
| 325 |
+
|
| 326 |
+
# Type and Value checks
|
| 327 |
+
check_cfg(cfg)
|
| 328 |
+
|
| 329 |
+
# Return instance
|
| 330 |
+
return IterableSimpleNamespace(**cfg)
|
| 331 |
+
|
| 332 |
+
|
| 333 |
+
def check_cfg(cfg: dict, hard: bool = True) -> None:
|
| 334 |
+
"""Check configuration argument types and values for the Ultralytics library.
|
| 335 |
+
|
| 336 |
+
This function validates the types and values of configuration arguments, ensuring correctness and converting them if
|
| 337 |
+
necessary. It checks for specific key types defined in global variables such as `CFG_FLOAT_KEYS`,
|
| 338 |
+
`CFG_FRACTION_KEYS`, `CFG_INT_KEYS`, and `CFG_BOOL_KEYS`.
|
| 339 |
+
|
| 340 |
+
Args:
|
| 341 |
+
cfg (dict): Configuration dictionary to validate.
|
| 342 |
+
hard (bool): If True, raises exceptions for invalid types and values; if False, attempts to convert them.
|
| 343 |
+
|
| 344 |
+
Examples:
|
| 345 |
+
>>> config = {
|
| 346 |
+
... "epochs": 50, # valid integer
|
| 347 |
+
... "lr0": 0.01, # valid float
|
| 348 |
+
... "momentum": 0.937, # valid float
|
| 349 |
+
... "save": "true", # invalid bool
|
| 350 |
+
... }
|
| 351 |
+
>>> check_cfg(config, hard=False)
|
| 352 |
+
>>> print(config)
|
| 353 |
+
{'epochs': 50, 'lr0': 0.01, 'momentum': 0.937, 'save': True}
|
| 354 |
+
|
| 355 |
+
Notes:
|
| 356 |
+
- The function modifies the input dictionary in-place.
|
| 357 |
+
- None values are ignored as they may be from optional arguments.
|
| 358 |
+
- Fraction keys are checked to be within the range [0.0, 1.0].
|
| 359 |
+
"""
|
| 360 |
+
for k, v in cfg.items():
|
| 361 |
+
if v is not None: # None values may be from optional args
|
| 362 |
+
if k in CFG_FLOAT_KEYS and not isinstance(v, FLOAT_OR_INT):
|
| 363 |
+
if hard:
|
| 364 |
+
raise TypeError(
|
| 365 |
+
f"'{k}={v}' is of invalid type {type(v).__name__}. "
|
| 366 |
+
f"Valid '{k}' types are int (i.e. '{k}=0') or float (i.e. '{k}=0.5')"
|
| 367 |
+
)
|
| 368 |
+
cfg[k] = float(v)
|
| 369 |
+
elif k == "scale":
|
| 370 |
+
if isinstance(v, (list, tuple)):
|
| 371 |
+
if len(v) != 2 or not all(isinstance(x, (int, float)) for x in v):
|
| 372 |
+
if hard:
|
| 373 |
+
raise TypeError(
|
| 374 |
+
f"'{k}={v}' is of invalid type {type(v).__name__}. "
|
| 375 |
+
f"Valid '{k}' types are int, float, or a tuple/list of two floats (i.e. '{k}=(0.5, 2.0)')"
|
| 376 |
+
)
|
| 377 |
+
continue
|
| 378 |
+
continue
|
| 379 |
+
elif not isinstance(v, FLOAT_OR_INT):
|
| 380 |
+
if hard:
|
| 381 |
+
raise TypeError(
|
| 382 |
+
f"'{k}={v}' is of invalid type {type(v).__name__}. "
|
| 383 |
+
f"Valid '{k}' types are int (i.e. '{k}=0') or float (i.e. '{k}=0.5')"
|
| 384 |
+
)
|
| 385 |
+
cfg[k] = v = float(v)
|
| 386 |
+
if not (0.0 <= v <= 1.0):
|
| 387 |
+
raise ValueError(f"'{k}={v}' is an invalid value. Valid '{k}' values are between 0.0 and 1.0.")
|
| 388 |
+
elif k in CFG_FRACTION_KEYS:
|
| 389 |
+
if not isinstance(v, FLOAT_OR_INT):
|
| 390 |
+
if hard:
|
| 391 |
+
raise TypeError(
|
| 392 |
+
f"'{k}={v}' is of invalid type {type(v).__name__}. "
|
| 393 |
+
f"Valid '{k}' types are int (i.e. '{k}=0') or float (i.e. '{k}=0.5')"
|
| 394 |
+
)
|
| 395 |
+
cfg[k] = v = float(v)
|
| 396 |
+
if not (0.0 <= v <= 1.0):
|
| 397 |
+
raise ValueError(f"'{k}={v}' is an invalid value. Valid '{k}' values are between 0.0 and 1.0.")
|
| 398 |
+
elif k in CFG_INT_KEYS and not isinstance(v, int):
|
| 399 |
+
if hard:
|
| 400 |
+
raise TypeError(
|
| 401 |
+
f"'{k}={v}' is of invalid type {type(v).__name__}. '{k}' must be an int (i.e. '{k}=8')"
|
| 402 |
+
)
|
| 403 |
+
cfg[k] = int(v)
|
| 404 |
+
elif k in CFG_BOOL_KEYS and not isinstance(v, bool):
|
| 405 |
+
if hard:
|
| 406 |
+
raise TypeError(
|
| 407 |
+
f"'{k}={v}' is of invalid type {type(v).__name__}. "
|
| 408 |
+
f"'{k}' must be a bool (i.e. '{k}=True' or '{k}=False')"
|
| 409 |
+
)
|
| 410 |
+
cfg[k] = bool(v)
|
| 411 |
+
|
| 412 |
+
|
| 413 |
+
def get_save_dir(args: SimpleNamespace, name: str | None = None) -> Path:
|
| 414 |
+
"""Return the directory path for saving outputs, derived from arguments or default settings.
|
| 415 |
+
|
| 416 |
+
Args:
|
| 417 |
+
args (SimpleNamespace): Namespace object containing configurations such as 'project', 'name', 'task', 'mode',
|
| 418 |
+
and 'save_dir'.
|
| 419 |
+
name (str | None): Optional name for the output directory. If not provided, it defaults to 'args.name' or the
|
| 420 |
+
'args.mode'.
|
| 421 |
+
|
| 422 |
+
Returns:
|
| 423 |
+
(Path): Directory path where outputs should be saved.
|
| 424 |
+
|
| 425 |
+
Examples:
|
| 426 |
+
>>> from types import SimpleNamespace
|
| 427 |
+
>>> args = SimpleNamespace(project="my_project", task="detect", mode="train", exist_ok=True)
|
| 428 |
+
>>> save_dir = get_save_dir(args)
|
| 429 |
+
>>> print(save_dir)
|
| 430 |
+
runs/detect/my_project/train
|
| 431 |
+
"""
|
| 432 |
+
if getattr(args, "save_dir", None):
|
| 433 |
+
save_dir = args.save_dir
|
| 434 |
+
else:
|
| 435 |
+
from models_related.ultralytics.ultralytics.utils.files import increment_path
|
| 436 |
+
|
| 437 |
+
project = args.project or ""
|
| 438 |
+
if not Path(project).is_absolute():
|
| 439 |
+
base = ROOT.parent / "tests/tmp/runs" if TESTS_RUNNING else RUNS_DIR
|
| 440 |
+
worker = os.environ.get("PYTEST_XDIST_WORKER")
|
| 441 |
+
if worker and TESTS_RUNNING: # isolate parallel pytest-xdist workers
|
| 442 |
+
base = base / worker
|
| 443 |
+
project = base / args.task / project
|
| 444 |
+
name = name or args.name or f"{args.mode}"
|
| 445 |
+
save_dir = increment_path(Path(project) / name, exist_ok=args.exist_ok if RANK in {-1, 0} else True)
|
| 446 |
+
|
| 447 |
+
return Path(save_dir).resolve() # resolve to display full path in console
|
| 448 |
+
|
| 449 |
+
|
| 450 |
+
def _handle_deprecation(custom: dict) -> dict:
|
| 451 |
+
"""Handle deprecated configuration keys by mapping them to current equivalents with deprecation warnings.
|
| 452 |
+
|
| 453 |
+
Args:
|
| 454 |
+
custom (dict): Configuration dictionary potentially containing deprecated keys.
|
| 455 |
+
|
| 456 |
+
Returns:
|
| 457 |
+
(dict): Updated configuration dictionary with deprecated keys replaced.
|
| 458 |
+
|
| 459 |
+
Examples:
|
| 460 |
+
>>> custom_config = {"boxes": True, "hide_labels": "False", "line_thickness": 2}
|
| 461 |
+
>>> _handle_deprecation(custom_config)
|
| 462 |
+
{'show_boxes': True, 'show_labels': False, 'line_width': 2}
|
| 463 |
+
|
| 464 |
+
Notes:
|
| 465 |
+
This function modifies the input dictionary in-place, replacing deprecated keys with their current
|
| 466 |
+
equivalents. It also handles value conversions where necessary, such as inverting boolean values for
|
| 467 |
+
'hide_labels' and 'hide_conf'.
|
| 468 |
+
"""
|
| 469 |
+
deprecated_mappings = {
|
| 470 |
+
"boxes": ("show_boxes", lambda v: v),
|
| 471 |
+
"hide_labels": ("show_labels", lambda v: not bool(v)),
|
| 472 |
+
"hide_conf": ("show_conf", lambda v: not bool(v)),
|
| 473 |
+
"line_thickness": ("line_width", lambda v: v),
|
| 474 |
+
}
|
| 475 |
+
removed_keys = {"label_smoothing", "save_hybrid", "crop_fraction"}
|
| 476 |
+
|
| 477 |
+
for old_key, (new_key, transform) in deprecated_mappings.items():
|
| 478 |
+
if old_key not in custom:
|
| 479 |
+
continue
|
| 480 |
+
deprecation_warn(old_key, new_key)
|
| 481 |
+
custom[new_key] = transform(custom.pop(old_key))
|
| 482 |
+
|
| 483 |
+
for key in removed_keys:
|
| 484 |
+
if key not in custom:
|
| 485 |
+
continue
|
| 486 |
+
deprecation_warn(key)
|
| 487 |
+
custom.pop(key)
|
| 488 |
+
|
| 489 |
+
return custom
|
| 490 |
+
|
| 491 |
+
|
| 492 |
+
def check_dict_alignment(
|
| 493 |
+
base: dict, custom: dict, e: Exception | None = None, allowed_custom_keys: set | None = None
|
| 494 |
+
) -> None:
|
| 495 |
+
"""Check alignment between custom and base configuration dictionaries, handling deprecated keys and providing error
|
| 496 |
+
messages for mismatched keys.
|
| 497 |
+
|
| 498 |
+
Args:
|
| 499 |
+
base (dict): The base configuration dictionary containing valid keys.
|
| 500 |
+
custom (dict): The custom configuration dictionary to be checked for alignment.
|
| 501 |
+
e (Exception | None): Optional error instance passed by the calling function.
|
| 502 |
+
allowed_custom_keys (set | None): Optional set of additional keys that are allowed in the custom dictionary.
|
| 503 |
+
|
| 504 |
+
Raises:
|
| 505 |
+
SyntaxError: If mismatched keys are found between the custom and base dictionaries.
|
| 506 |
+
|
| 507 |
+
Examples:
|
| 508 |
+
>>> base_cfg = {"epochs": 50, "lr0": 0.01, "batch": 16}
|
| 509 |
+
>>> custom_cfg = {"epoch": 100, "lr": 0.02, "batch": 32}
|
| 510 |
+
>>> try:
|
| 511 |
+
... check_dict_alignment(base_cfg, custom_cfg)
|
| 512 |
+
... except SyntaxError:
|
| 513 |
+
... print("Mismatched keys found")
|
| 514 |
+
|
| 515 |
+
Notes:
|
| 516 |
+
- Suggests corrections for mismatched keys based on similarity to valid keys.
|
| 517 |
+
- Automatically replaces deprecated keys in the custom configuration with updated equivalents.
|
| 518 |
+
- Prints detailed error messages for each mismatched key to help users correct their configurations.
|
| 519 |
+
"""
|
| 520 |
+
custom = _handle_deprecation(custom)
|
| 521 |
+
base_keys, custom_keys = (frozenset(x.keys()) for x in (base, custom))
|
| 522 |
+
# Allow 'augmentations' as a valid custom parameter for custom Albumentations transforms
|
| 523 |
+
if allowed_custom_keys is None:
|
| 524 |
+
allowed_custom_keys = {"augmentations", "save_dir"}
|
| 525 |
+
if mismatched := [k for k in custom_keys if k not in base_keys and k not in allowed_custom_keys]:
|
| 526 |
+
from difflib import get_close_matches
|
| 527 |
+
|
| 528 |
+
string = ""
|
| 529 |
+
for x in mismatched:
|
| 530 |
+
matches = get_close_matches(x, base_keys) # key list
|
| 531 |
+
matches = [f"{k}={base[k]}" if base.get(k) is not None else k for k in matches]
|
| 532 |
+
match_str = f"Similar arguments are i.e. {matches}." if matches else ""
|
| 533 |
+
string += f"'{colorstr('red', 'bold', x)}' is not a valid YOLO argument. {match_str}\n"
|
| 534 |
+
raise SyntaxError(string + CLI_HELP_MSG) from e
|
| 535 |
+
|
| 536 |
+
|
| 537 |
+
def merge_equals_args(args: list[str]) -> list[str]:
|
| 538 |
+
"""Merge arguments around isolated '=' in a list of strings and join fragments with brackets.
|
| 539 |
+
|
| 540 |
+
This function handles the following cases:
|
| 541 |
+
1. ['arg', '=', 'val'] becomes ['arg=val']
|
| 542 |
+
2. ['arg=', 'val'] becomes ['arg=val']
|
| 543 |
+
3. ['arg', '=val'] becomes ['arg=val']
|
| 544 |
+
4. Joins fragments with brackets, e.g., ['imgsz=[3,', '640,', '640]'] becomes ['imgsz=[3,640,640]']
|
| 545 |
+
|
| 546 |
+
Args:
|
| 547 |
+
args (list[str]): A list of strings where each element represents an argument or fragment.
|
| 548 |
+
|
| 549 |
+
Returns:
|
| 550 |
+
(list[str]): A list of strings where the arguments around isolated '=' are merged and fragments with brackets
|
| 551 |
+
are joined.
|
| 552 |
+
|
| 553 |
+
Examples:
|
| 554 |
+
>>> args = ["arg1", "=", "value", "arg2=", "value2", "arg3", "=value3", "imgsz=[3,", "640,", "640]"]
|
| 555 |
+
>>> merge_equals_args(args)
|
| 556 |
+
['arg1=value', 'arg2=value2', 'arg3=value3', 'imgsz=[3,640,640]']
|
| 557 |
+
"""
|
| 558 |
+
new_args = []
|
| 559 |
+
current = ""
|
| 560 |
+
depth = 0
|
| 561 |
+
|
| 562 |
+
i = 0
|
| 563 |
+
while i < len(args):
|
| 564 |
+
arg = args[i]
|
| 565 |
+
|
| 566 |
+
# Handle equals sign merging
|
| 567 |
+
if arg == "=" and 0 < i < len(args) - 1: # merge ['arg', '=', 'val']
|
| 568 |
+
new_args[-1] += f"={args[i + 1]}"
|
| 569 |
+
i += 2
|
| 570 |
+
continue
|
| 571 |
+
elif arg.endswith("=") and i < len(args) - 1 and "=" not in args[i + 1]: # merge ['arg=', 'val']
|
| 572 |
+
new_args.append(f"{arg}{args[i + 1]}")
|
| 573 |
+
i += 2
|
| 574 |
+
continue
|
| 575 |
+
elif arg.startswith("=") and i > 0: # merge ['arg', '=val']
|
| 576 |
+
new_args[-1] += arg
|
| 577 |
+
i += 1
|
| 578 |
+
continue
|
| 579 |
+
|
| 580 |
+
# Handle bracket joining
|
| 581 |
+
depth += arg.count("[") - arg.count("]")
|
| 582 |
+
current += arg
|
| 583 |
+
if depth == 0:
|
| 584 |
+
new_args.append(current)
|
| 585 |
+
current = ""
|
| 586 |
+
|
| 587 |
+
i += 1
|
| 588 |
+
|
| 589 |
+
# Append any remaining current string
|
| 590 |
+
if current:
|
| 591 |
+
new_args.append(current)
|
| 592 |
+
|
| 593 |
+
return new_args
|
| 594 |
+
|
| 595 |
+
|
| 596 |
+
def handle_yolo_hub(args: list[str]) -> None:
|
| 597 |
+
"""Handle Ultralytics HUB command-line interface (CLI) commands for authentication.
|
| 598 |
+
|
| 599 |
+
This function processes Ultralytics HUB CLI commands such as login and logout. It should be called when executing a
|
| 600 |
+
script with arguments related to HUB authentication.
|
| 601 |
+
|
| 602 |
+
Args:
|
| 603 |
+
args (list[str]): A list of command line arguments. The first argument should be either 'login' or 'logout'. For
|
| 604 |
+
'login', an optional second argument can be the API key.
|
| 605 |
+
|
| 606 |
+
Examples:
|
| 607 |
+
$ yolo login YOUR_API_KEY
|
| 608 |
+
|
| 609 |
+
Notes:
|
| 610 |
+
- The function imports the 'hub' module from ultralytics to perform login and logout operations.
|
| 611 |
+
- For the 'login' command, if no API key is provided, an empty string is passed to the login function.
|
| 612 |
+
- The 'logout' command does not require any additional arguments.
|
| 613 |
+
"""
|
| 614 |
+
from models_related.ultralytics.ultralytics import hub
|
| 615 |
+
|
| 616 |
+
if args[0] == "login":
|
| 617 |
+
key = args[1] if len(args) > 1 else ""
|
| 618 |
+
# Log in to Ultralytics HUB using the provided API key
|
| 619 |
+
hub.login(key)
|
| 620 |
+
elif args[0] == "logout":
|
| 621 |
+
# Log out from Ultralytics HUB
|
| 622 |
+
hub.logout()
|
| 623 |
+
|
| 624 |
+
|
| 625 |
+
def handle_yolo_settings(args: list[str]) -> None:
|
| 626 |
+
"""Handle YOLO settings command-line interface (CLI) commands.
|
| 627 |
+
|
| 628 |
+
This function processes YOLO settings CLI commands such as reset and updating individual settings. It should be
|
| 629 |
+
called when executing a script with arguments related to YOLO settings management.
|
| 630 |
+
|
| 631 |
+
Args:
|
| 632 |
+
args (list[str]): A list of command line arguments for YOLO settings management.
|
| 633 |
+
|
| 634 |
+
Examples:
|
| 635 |
+
>>> handle_yolo_settings(["reset"]) # Reset YOLO settings
|
| 636 |
+
>>> handle_yolo_settings(["runs_dir=path/to/dir"]) # Update a specific setting
|
| 637 |
+
|
| 638 |
+
Notes:
|
| 639 |
+
- If no arguments are provided, the function will display the current settings.
|
| 640 |
+
- The 'reset' command will delete the existing settings file and create new default settings.
|
| 641 |
+
- Other arguments are treated as key-value pairs to update specific settings.
|
| 642 |
+
- The function will check for alignment between the provided settings and the existing ones.
|
| 643 |
+
- After processing, the updated settings will be displayed.
|
| 644 |
+
- For more information on handling YOLO settings, visit:
|
| 645 |
+
https://docs.ultralytics.com/quickstart/#ultralytics-settings
|
| 646 |
+
"""
|
| 647 |
+
url = "https://docs.ultralytics.com/quickstart/#ultralytics-settings" # help URL
|
| 648 |
+
try:
|
| 649 |
+
if any(args):
|
| 650 |
+
if args[0] == "reset":
|
| 651 |
+
SETTINGS_FILE.unlink() # delete the settings file
|
| 652 |
+
SETTINGS.reset() # create new settings
|
| 653 |
+
LOGGER.info("Settings reset successfully") # inform the user that settings have been reset
|
| 654 |
+
else: # save a new setting
|
| 655 |
+
new = dict(parse_key_value_pair(a) for a in args)
|
| 656 |
+
check_dict_alignment(SETTINGS, new)
|
| 657 |
+
SETTINGS.update(new)
|
| 658 |
+
for k, v in new.items():
|
| 659 |
+
LOGGER.info(f"✅ Updated '{k}={v}'")
|
| 660 |
+
|
| 661 |
+
LOGGER.info(SETTINGS) # print the current settings
|
| 662 |
+
LOGGER.info(f"💡 Learn more about Ultralytics Settings at {url}")
|
| 663 |
+
except Exception as e:
|
| 664 |
+
LOGGER.warning(f"settings error: '{e}'. Please see {url} for help.")
|
| 665 |
+
|
| 666 |
+
|
| 667 |
+
def handle_yolo_solutions(args: list[str]) -> None:
|
| 668 |
+
"""Process YOLO solutions arguments and run the specified computer vision solutions pipeline.
|
| 669 |
+
|
| 670 |
+
Args:
|
| 671 |
+
args (list[str]): Command-line arguments for configuring and running the Ultralytics YOLO solutions.
|
| 672 |
+
|
| 673 |
+
Examples:
|
| 674 |
+
Run people counting solution with default settings:
|
| 675 |
+
>>> handle_yolo_solutions(["count"])
|
| 676 |
+
|
| 677 |
+
Run analytics with custom configuration:
|
| 678 |
+
>>> handle_yolo_solutions(["analytics", "conf=0.25", "source=path/to/video.mp4"])
|
| 679 |
+
|
| 680 |
+
Run inference with custom configuration, requires Streamlit version 1.29.0 or higher.
|
| 681 |
+
>>> handle_yolo_solutions(["inference", "model=yolo26n.pt"])
|
| 682 |
+
|
| 683 |
+
Notes:
|
| 684 |
+
- Arguments can be provided in the format 'key=value' or as boolean flags
|
| 685 |
+
- Available solutions are defined in SOLUTION_MAP with their respective classes and methods
|
| 686 |
+
- If an invalid solution is provided, defaults to 'count' solution
|
| 687 |
+
- Output videos are saved in 'runs/solutions/exp' directory
|
| 688 |
+
- For 'analytics' solution, frame numbers are tracked for generating analytical graphs
|
| 689 |
+
- Video processing can be interrupted by pressing 'q'
|
| 690 |
+
- Processes video frames sequentially and saves output in .avi format
|
| 691 |
+
- If no source is specified, downloads and uses a default sample video
|
| 692 |
+
- The inference solution will be launched using the 'streamlit run' command.
|
| 693 |
+
- The Streamlit app file is located in the Ultralytics package directory.
|
| 694 |
+
"""
|
| 695 |
+
from models_related.ultralytics.ultralytics.solutions.config import SolutionConfig
|
| 696 |
+
|
| 697 |
+
full_args_dict = vars(SolutionConfig()) # arguments dictionary
|
| 698 |
+
overrides = {}
|
| 699 |
+
|
| 700 |
+
# check dictionary alignment
|
| 701 |
+
for arg in merge_equals_args(args):
|
| 702 |
+
arg = arg.lstrip("-").rstrip(",")
|
| 703 |
+
if "=" in arg:
|
| 704 |
+
try:
|
| 705 |
+
k, v = parse_key_value_pair(arg)
|
| 706 |
+
overrides[k] = v
|
| 707 |
+
except (NameError, SyntaxError, ValueError, AssertionError) as e:
|
| 708 |
+
check_dict_alignment(full_args_dict, {arg: ""}, e)
|
| 709 |
+
elif arg in full_args_dict and isinstance(full_args_dict.get(arg), bool):
|
| 710 |
+
overrides[arg] = True
|
| 711 |
+
check_dict_alignment(full_args_dict, overrides) # dict alignment
|
| 712 |
+
|
| 713 |
+
# Get solution name
|
| 714 |
+
if not args:
|
| 715 |
+
LOGGER.warning("No solution name provided. i.e `yolo solutions count`. Defaulting to 'count'.")
|
| 716 |
+
args = ["count"]
|
| 717 |
+
if args[0] == "help":
|
| 718 |
+
LOGGER.info(SOLUTIONS_HELP_MSG)
|
| 719 |
+
return # Early return for 'help' case
|
| 720 |
+
elif args[0] in SOLUTION_MAP:
|
| 721 |
+
solution_name = args.pop(0) # Extract the solution name directly
|
| 722 |
+
else:
|
| 723 |
+
LOGGER.warning(
|
| 724 |
+
f"❌ '{args[0]}' is not a valid solution. 💡 Defaulting to 'count'.\n"
|
| 725 |
+
f"🚀 Available solutions: {', '.join(list(SOLUTION_MAP.keys())[:-1])}\n"
|
| 726 |
+
)
|
| 727 |
+
solution_name = "count" # Default for invalid solution
|
| 728 |
+
|
| 729 |
+
if solution_name == "inference":
|
| 730 |
+
checks.check_requirements("streamlit>=1.29.0")
|
| 731 |
+
LOGGER.info("💡 Loading Ultralytics live inference app...")
|
| 732 |
+
subprocess.run(
|
| 733 |
+
[ # Run subprocess with Streamlit custom argument
|
| 734 |
+
"streamlit",
|
| 735 |
+
"run",
|
| 736 |
+
str(ROOT / "solutions/streamlit_inference.py"),
|
| 737 |
+
"--server.headless",
|
| 738 |
+
"true",
|
| 739 |
+
overrides.pop("model", "yolo26n.pt"),
|
| 740 |
+
]
|
| 741 |
+
)
|
| 742 |
+
else:
|
| 743 |
+
import cv2 # Only needed for cap and vw functionality
|
| 744 |
+
|
| 745 |
+
from models_related.ultralytics.ultralytics import solutions
|
| 746 |
+
|
| 747 |
+
solution = getattr(solutions, SOLUTION_MAP[solution_name])(is_cli=True, **overrides) # class i.e. ObjectCounter
|
| 748 |
+
|
| 749 |
+
cap = cv2.VideoCapture(solution.CFG["source"]) # read the video file
|
| 750 |
+
if solution_name != "crop":
|
| 751 |
+
# extract width, height and fps of the video file, create save directory and initialize video writer
|
| 752 |
+
w, h, fps = (
|
| 753 |
+
int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS)
|
| 754 |
+
)
|
| 755 |
+
if solution_name == "analytics": # analytical graphs follow fixed shape for output i.e w=1280, h=720
|
| 756 |
+
w, h = 1280, 720
|
| 757 |
+
save_dir = get_save_dir(SimpleNamespace(task="solutions", name="exp", exist_ok=False, project=None))
|
| 758 |
+
save_dir.mkdir(parents=True, exist_ok=True) # create the output directory i.e. runs/solutions/exp
|
| 759 |
+
vw = cv2.VideoWriter(str(save_dir / f"{solution_name}.avi"), cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))
|
| 760 |
+
|
| 761 |
+
try: # Process video frames
|
| 762 |
+
f_n = 0 # frame number, required for analytical graphs
|
| 763 |
+
while cap.isOpened():
|
| 764 |
+
success, frame = cap.read()
|
| 765 |
+
if not success:
|
| 766 |
+
break
|
| 767 |
+
results = solution(frame, f_n := f_n + 1) if solution_name == "analytics" else solution(frame)
|
| 768 |
+
if solution_name != "crop":
|
| 769 |
+
vw.write(results.plot_im)
|
| 770 |
+
if solution.CFG["show"] and cv2.waitKey(1) & 0xFF == ord("q"):
|
| 771 |
+
break
|
| 772 |
+
finally:
|
| 773 |
+
cap.release()
|
| 774 |
+
|
| 775 |
+
|
| 776 |
+
def parse_key_value_pair(pair: str = "key=value") -> tuple:
|
| 777 |
+
"""Parse a key-value pair string into separate key and value components.
|
| 778 |
+
|
| 779 |
+
Args:
|
| 780 |
+
pair (str): A string containing a key-value pair in the format "key=value".
|
| 781 |
+
|
| 782 |
+
Returns:
|
| 783 |
+
key (str): The parsed key.
|
| 784 |
+
value (str): The parsed value.
|
| 785 |
+
|
| 786 |
+
Raises:
|
| 787 |
+
AssertionError: If the value is missing or empty.
|
| 788 |
+
|
| 789 |
+
Examples:
|
| 790 |
+
>>> key, value = parse_key_value_pair("model=yolo26n.pt")
|
| 791 |
+
>>> print(f"Key: {key}, Value: {value}")
|
| 792 |
+
Key: model, Value: yolo26n.pt
|
| 793 |
+
|
| 794 |
+
>>> key, value = parse_key_value_pair("epochs=100")
|
| 795 |
+
>>> print(f"Key: {key}, Value: {value}")
|
| 796 |
+
Key: epochs, Value: 100
|
| 797 |
+
|
| 798 |
+
Notes:
|
| 799 |
+
- The function splits the input string on the first '=' character.
|
| 800 |
+
- Leading and trailing whitespace is removed from both key and value.
|
| 801 |
+
- An assertion error is raised if the value is empty after stripping.
|
| 802 |
+
"""
|
| 803 |
+
k, v = pair.split("=", 1) # split on first '=' sign
|
| 804 |
+
k, v = k.strip(), v.strip() # remove spaces
|
| 805 |
+
assert v, f"missing '{k}' value"
|
| 806 |
+
return k, smart_value(v)
|
| 807 |
+
|
| 808 |
+
|
| 809 |
+
def smart_value(v: str) -> Any:
|
| 810 |
+
"""Convert a string representation of a value to its appropriate Python type.
|
| 811 |
+
|
| 812 |
+
This function attempts to convert a given string into a Python object of the most appropriate type. It handles
|
| 813 |
+
conversions to None, bool, int, float, and other types that can be evaluated safely.
|
| 814 |
+
|
| 815 |
+
Args:
|
| 816 |
+
v (str): The string representation of the value to be converted.
|
| 817 |
+
|
| 818 |
+
Returns:
|
| 819 |
+
(Any): The converted value. The type can be None, bool, int, float, or the original string if no conversion is
|
| 820 |
+
applicable.
|
| 821 |
+
|
| 822 |
+
Examples:
|
| 823 |
+
>>> smart_value("42")
|
| 824 |
+
42
|
| 825 |
+
>>> smart_value("3.14")
|
| 826 |
+
3.14
|
| 827 |
+
>>> smart_value("True")
|
| 828 |
+
True
|
| 829 |
+
>>> smart_value("None")
|
| 830 |
+
None
|
| 831 |
+
>>> smart_value("some_string")
|
| 832 |
+
'some_string'
|
| 833 |
+
|
| 834 |
+
Notes:
|
| 835 |
+
- The function uses a case-insensitive comparison for boolean and None values.
|
| 836 |
+
- For other types, it attempts to use Python's ast.literal_eval() function for safe evaluation.
|
| 837 |
+
- If no conversion is possible, the original string is returned.
|
| 838 |
+
"""
|
| 839 |
+
v_lower = v.lower()
|
| 840 |
+
if v_lower == "none":
|
| 841 |
+
return None
|
| 842 |
+
elif v_lower == "true":
|
| 843 |
+
return True
|
| 844 |
+
elif v_lower == "false":
|
| 845 |
+
return False
|
| 846 |
+
else:
|
| 847 |
+
try:
|
| 848 |
+
return ast.literal_eval(v)
|
| 849 |
+
except Exception:
|
| 850 |
+
name, _, attr = v.rpartition(".")
|
| 851 |
+
if (module := sys.modules.get(name)) and attr.isupper():
|
| 852 |
+
value = getattr(module, attr, None)
|
| 853 |
+
if isinstance(value, (int, float)):
|
| 854 |
+
return value
|
| 855 |
+
return v
|
| 856 |
+
|
| 857 |
+
|
| 858 |
+
def entrypoint(debug: str = "") -> None:
|
| 859 |
+
"""Ultralytics entrypoint function for parsing and executing command-line arguments.
|
| 860 |
+
|
| 861 |
+
This function serves as the main entry point for the Ultralytics CLI, parsing command-line arguments and executing
|
| 862 |
+
the corresponding tasks such as training, validation, prediction, exporting models, and more.
|
| 863 |
+
|
| 864 |
+
Args:
|
| 865 |
+
debug (str): Space-separated string of command-line arguments for debugging purposes.
|
| 866 |
+
|
| 867 |
+
Examples:
|
| 868 |
+
Train a detection model for 10 epochs with an initial learning_rate of 0.01:
|
| 869 |
+
>>> entrypoint("train data=coco8.yaml model=yolo26n.pt epochs=10 lr0=0.01")
|
| 870 |
+
|
| 871 |
+
Predict a YouTube video using a pretrained segmentation model at image size 320:
|
| 872 |
+
>>> entrypoint("predict model=yolo26n-seg.pt source='https://youtu.be/LNwODJXcvt4' imgsz=320")
|
| 873 |
+
|
| 874 |
+
Validate a pretrained detection model at batch-size 1 and image size 640:
|
| 875 |
+
>>> entrypoint("val model=yolo26n.pt data=coco8.yaml batch=1 imgsz=640")
|
| 876 |
+
|
| 877 |
+
Notes:
|
| 878 |
+
- If no arguments are passed, the function will display the usage help message.
|
| 879 |
+
- For a list of all available commands and their arguments, see the provided help messages and the
|
| 880 |
+
Ultralytics documentation at https://docs.ultralytics.com.
|
| 881 |
+
"""
|
| 882 |
+
args = (debug.split(" ") if debug else ARGV)[1:]
|
| 883 |
+
if not args: # no arguments passed
|
| 884 |
+
LOGGER.info(CLI_HELP_MSG)
|
| 885 |
+
return
|
| 886 |
+
|
| 887 |
+
special = {
|
| 888 |
+
"checks": checks.collect_system_info,
|
| 889 |
+
"version": lambda: LOGGER.info(__version__),
|
| 890 |
+
"settings": lambda: handle_yolo_settings(args[1:]),
|
| 891 |
+
"cfg": lambda: YAML.print(DEFAULT_CFG_PATH),
|
| 892 |
+
"hub": lambda: handle_yolo_hub(args[1:]),
|
| 893 |
+
"login": lambda: handle_yolo_hub(args),
|
| 894 |
+
"logout": lambda: handle_yolo_hub(args),
|
| 895 |
+
"copy-cfg": copy_default_cfg,
|
| 896 |
+
"solutions": lambda: handle_yolo_solutions(args[1:]),
|
| 897 |
+
"help": lambda: LOGGER.info(CLI_HELP_MSG), # help below hub for -h flag precedence
|
| 898 |
+
}
|
| 899 |
+
full_args_dict = {**DEFAULT_CFG_DICT, **{k: None for k in TASKS}, **{k: None for k in MODES}, **special}
|
| 900 |
+
|
| 901 |
+
# Define common misuses of special commands, i.e. -h, -help, --help
|
| 902 |
+
special.update({k[0]: v for k, v in special.items()}) # singular
|
| 903 |
+
special.update({k[:-1]: v for k, v in special.items() if len(k) > 1 and k.endswith("s")}) # singular
|
| 904 |
+
special = {**special, **{f"-{k}": v for k, v in special.items()}, **{f"--{k}": v for k, v in special.items()}}
|
| 905 |
+
|
| 906 |
+
overrides = {} # basic overrides, i.e. imgsz=320
|
| 907 |
+
for a in merge_equals_args(args): # merge spaces around '=' sign
|
| 908 |
+
if a.startswith("--"):
|
| 909 |
+
LOGGER.warning(f"argument '{a}' does not require leading dashes '--', updating to '{a[2:]}'.")
|
| 910 |
+
a = a[2:]
|
| 911 |
+
if a.endswith(","):
|
| 912 |
+
LOGGER.warning(f"argument '{a}' does not require trailing comma ',', updating to '{a[:-1]}'.")
|
| 913 |
+
a = a[:-1]
|
| 914 |
+
if "=" in a:
|
| 915 |
+
try:
|
| 916 |
+
k, v = parse_key_value_pair(a)
|
| 917 |
+
if k == "cfg" and v is not None: # custom.yaml passed
|
| 918 |
+
LOGGER.info(f"Overriding {DEFAULT_CFG_PATH} with {v}")
|
| 919 |
+
overrides = {k: val for k, val in YAML.load(checks.check_yaml(v)).items() if k != "cfg"}
|
| 920 |
+
else:
|
| 921 |
+
overrides[k] = v
|
| 922 |
+
except (NameError, SyntaxError, ValueError, AssertionError) as e:
|
| 923 |
+
check_dict_alignment(full_args_dict, {a: ""}, e)
|
| 924 |
+
|
| 925 |
+
elif a in TASKS:
|
| 926 |
+
overrides["task"] = a
|
| 927 |
+
elif a in MODES:
|
| 928 |
+
overrides["mode"] = a
|
| 929 |
+
elif a.lower() in special:
|
| 930 |
+
special[a.lower()]()
|
| 931 |
+
return
|
| 932 |
+
elif a in DEFAULT_CFG_DICT and isinstance(DEFAULT_CFG_DICT[a], bool):
|
| 933 |
+
overrides[a] = True # auto-True for default bool args, i.e. 'yolo show' sets show=True
|
| 934 |
+
elif a in DEFAULT_CFG_DICT:
|
| 935 |
+
raise SyntaxError(
|
| 936 |
+
f"'{colorstr('red', 'bold', a)}' is a valid YOLO argument but is missing an '=' sign "
|
| 937 |
+
f"to set its value, i.e. try '{a}={DEFAULT_CFG_DICT[a]}'\n{CLI_HELP_MSG}"
|
| 938 |
+
)
|
| 939 |
+
else:
|
| 940 |
+
check_dict_alignment(full_args_dict, {a: ""})
|
| 941 |
+
|
| 942 |
+
# Check keys
|
| 943 |
+
check_dict_alignment(full_args_dict, overrides)
|
| 944 |
+
|
| 945 |
+
# Mode
|
| 946 |
+
mode = overrides.get("mode")
|
| 947 |
+
if mode is None:
|
| 948 |
+
mode = DEFAULT_CFG.mode or "predict"
|
| 949 |
+
LOGGER.warning(f"'mode' argument is missing. Valid modes are {list(MODES)}. Using default 'mode={mode}'.")
|
| 950 |
+
elif mode not in MODES:
|
| 951 |
+
raise ValueError(f"Invalid 'mode={mode}'. Valid modes are {list(MODES)}.\n{CLI_HELP_MSG}")
|
| 952 |
+
|
| 953 |
+
# Task
|
| 954 |
+
task = overrides.pop("task", None)
|
| 955 |
+
if task:
|
| 956 |
+
if task not in TASKS:
|
| 957 |
+
if task == "track":
|
| 958 |
+
LOGGER.warning(
|
| 959 |
+
f"invalid 'task=track', setting 'task=detect' and 'mode=track'. Valid tasks are {list(TASKS)}.\n{CLI_HELP_MSG}."
|
| 960 |
+
)
|
| 961 |
+
task, mode = "detect", "track"
|
| 962 |
+
else:
|
| 963 |
+
raise ValueError(f"Invalid 'task={task}'. Valid tasks are {list(TASKS)}.\n{CLI_HELP_MSG}")
|
| 964 |
+
if "model" not in overrides:
|
| 965 |
+
overrides["model"] = TASK2MODEL[task]
|
| 966 |
+
|
| 967 |
+
# Model
|
| 968 |
+
model = overrides.pop("model", DEFAULT_CFG.model)
|
| 969 |
+
if model is None:
|
| 970 |
+
model = "yolo26n.pt"
|
| 971 |
+
LOGGER.warning(f"'model' argument is missing. Using default 'model={model}'.")
|
| 972 |
+
overrides["model"] = model
|
| 973 |
+
stem = Path(model).stem.lower()
|
| 974 |
+
if "rtdetr" in stem: # guess architecture
|
| 975 |
+
from models_related.ultralytics.ultralytics import RTDETR
|
| 976 |
+
|
| 977 |
+
model = RTDETR(model) # no task argument
|
| 978 |
+
elif "fastsam" in stem:
|
| 979 |
+
from models_related.ultralytics.ultralytics import FastSAM
|
| 980 |
+
|
| 981 |
+
model = FastSAM(model)
|
| 982 |
+
elif "sam_" in stem or "sam2_" in stem or "sam2.1_" in stem:
|
| 983 |
+
from models_related.ultralytics.ultralytics import SAM
|
| 984 |
+
|
| 985 |
+
model = SAM(model)
|
| 986 |
+
else:
|
| 987 |
+
from models_related.ultralytics.ultralytics import YOLO
|
| 988 |
+
|
| 989 |
+
model = YOLO(model, task=task)
|
| 990 |
+
if "yoloe" in stem or "world" in stem:
|
| 991 |
+
cls_list = overrides.pop("classes", DEFAULT_CFG.classes)
|
| 992 |
+
if cls_list is not None and isinstance(cls_list, str):
|
| 993 |
+
model.set_classes(cls_list.split(",")) # convert "person, bus" -> ['person', ' bus'].
|
| 994 |
+
# Task Update
|
| 995 |
+
if task != model.task:
|
| 996 |
+
if task:
|
| 997 |
+
LOGGER.warning(
|
| 998 |
+
f"conflicting 'task={task}' passed with 'task={model.task}' model. "
|
| 999 |
+
f"Ignoring 'task={task}' and updating to 'task={model.task}' to match model."
|
| 1000 |
+
)
|
| 1001 |
+
task = model.task
|
| 1002 |
+
|
| 1003 |
+
# Mode
|
| 1004 |
+
if mode in {"predict", "track"} and "source" not in overrides:
|
| 1005 |
+
overrides["source"] = (
|
| 1006 |
+
"https://ultralytics.com/images/boats.jpg" if task == "obb" else DEFAULT_CFG.source or ASSETS
|
| 1007 |
+
)
|
| 1008 |
+
LOGGER.warning(f"'source' argument is missing. Using default 'source={overrides['source']}'.")
|
| 1009 |
+
elif mode in {"train", "val"}:
|
| 1010 |
+
if "data" not in overrides and "resume" not in overrides:
|
| 1011 |
+
overrides["data"] = DEFAULT_CFG.data or TASK2DATA.get(task or DEFAULT_CFG.task, DEFAULT_CFG.data)
|
| 1012 |
+
LOGGER.warning(f"'data' argument is missing. Using default 'data={overrides['data']}'.")
|
| 1013 |
+
elif mode == "export":
|
| 1014 |
+
if "format" not in overrides:
|
| 1015 |
+
overrides["format"] = DEFAULT_CFG.format or "torchscript"
|
| 1016 |
+
LOGGER.warning(f"'format' argument is missing. Using default 'format={overrides['format']}'.")
|
| 1017 |
+
|
| 1018 |
+
# Run command in python
|
| 1019 |
+
getattr(model, mode)(**overrides) # default args from model
|
| 1020 |
+
|
| 1021 |
+
# Show help
|
| 1022 |
+
LOGGER.info(f"💡 Learn more at https://docs.ultralytics.com/modes/{mode}")
|
| 1023 |
+
|
| 1024 |
+
# Recommend VS Code extension
|
| 1025 |
+
if IS_VSCODE and SETTINGS.get("vscode_msg", True):
|
| 1026 |
+
LOGGER.info(vscode_msg())
|
| 1027 |
+
|
| 1028 |
+
|
| 1029 |
+
# Special modes --------------------------------------------------------------------------------------------------------
|
| 1030 |
+
def copy_default_cfg() -> None:
|
| 1031 |
+
"""Copy the default configuration file and create a new one with '_copy' appended to its name.
|
| 1032 |
+
|
| 1033 |
+
This function duplicates the existing default configuration file (DEFAULT_CFG_PATH) and saves it with '_copy'
|
| 1034 |
+
appended to its name in the current working directory. It provides a convenient way to create a custom configuration
|
| 1035 |
+
file based on the default settings.
|
| 1036 |
+
|
| 1037 |
+
Examples:
|
| 1038 |
+
>>> copy_default_cfg()
|
| 1039 |
+
# Output: default.yaml copied to /path/to/current/directory/default_copy.yaml
|
| 1040 |
+
# Example YOLO command with this new custom cfg:
|
| 1041 |
+
# yolo cfg='/path/to/current/directory/default_copy.yaml' imgsz=320 batch=8
|
| 1042 |
+
|
| 1043 |
+
Notes:
|
| 1044 |
+
- The new configuration file is created in the current working directory.
|
| 1045 |
+
- After copying, the function prints a message with the new file's location and an example
|
| 1046 |
+
YOLO command demonstrating how to use the new configuration file.
|
| 1047 |
+
- This function is useful for users who want to modify the default configuration without
|
| 1048 |
+
altering the original file.
|
| 1049 |
+
"""
|
| 1050 |
+
new_file = Path.cwd() / DEFAULT_CFG_PATH.name.replace(".yaml", "_copy.yaml")
|
| 1051 |
+
shutil.copy2(DEFAULT_CFG_PATH, new_file)
|
| 1052 |
+
LOGGER.info(
|
| 1053 |
+
f"{DEFAULT_CFG_PATH} copied to {new_file}\n"
|
| 1054 |
+
f"Example YOLO command with this new custom cfg:\n yolo cfg='{new_file}' imgsz=320 batch=8"
|
| 1055 |
+
)
|
| 1056 |
+
|
| 1057 |
+
|
| 1058 |
+
if __name__ == "__main__":
|
| 1059 |
+
# Example: entrypoint(debug='yolo predict model=yolo26n.pt')
|
| 1060 |
+
entrypoint(debug="")
|
models_related/ultralytics/ultralytics/cfg/default.yaml
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Global configuration YAML with settings and hyperparameters for YOLO training, validation, prediction and export
|
| 4 |
+
# For documentation see https://docs.ultralytics.com/usage/cfg
|
| 5 |
+
|
| 6 |
+
task: detect # (str) YOLO task, i.e. detect, segment, semantic, classify, pose, obb
|
| 7 |
+
mode: train # (str) YOLO mode, i.e. train, val, predict, export, track, benchmark
|
| 8 |
+
|
| 9 |
+
# Train settings -------------------------------------------------------------------------------------------------------
|
| 10 |
+
model: # (str, optional) path to model file, i.e. yolo26n.pt or yolo26n.yaml
|
| 11 |
+
data: # (str, optional) path to data file, i.e. coco8.yaml
|
| 12 |
+
epochs: 100 # (int) number of epochs to train for
|
| 13 |
+
time: # (float, optional) max hours to train; overrides epochs if set
|
| 14 |
+
patience: 100 # (int) early stop after N epochs without val improvement
|
| 15 |
+
batch: 16 # (int | float) batch size as int (e.g. 16), or float 0.0–1.0 for AutoBatch fraction of GPU memory
|
| 16 |
+
imgsz: 640 # (int | list) train/val use int (square); predict/export may use [h,w]
|
| 17 |
+
save: True # (bool) save train checkpoints and predict results
|
| 18 |
+
save_period: -1 # (int) save checkpoint every N epochs; disabled if < 1
|
| 19 |
+
cache: False # (bool | str) cache images in RAM (True/'ram') or on 'disk' to speed dataloading; False disables
|
| 20 |
+
device: # (int | str | list) device: 0 or [0,1,2,3] for CUDA, 'cpu'/'mps', or -1/[-1,-1] to auto-select idle GPUs
|
| 21 |
+
workers: 8 # (int) dataloader workers (per RANK if DDP)
|
| 22 |
+
project: # (str, optional) project name for results root
|
| 23 |
+
name: # (str, optional) experiment name; results in 'project/name'
|
| 24 |
+
exist_ok: False # (bool) overwrite existing 'project/name' if True
|
| 25 |
+
pretrained: True # (bool | str) use pretrained weights (bool) or load weights from path (str)
|
| 26 |
+
optimizer: auto # (str) optimizer: SGD, MuSGD, Adam, Adamax, AdamW, NAdam, RAdam, RMSProp, or auto
|
| 27 |
+
verbose: True # (bool) print verbose logs during training/val
|
| 28 |
+
seed: 0 # (int) random seed for reproducibility
|
| 29 |
+
deterministic: True # (bool) enable deterministic ops; reproducible but may be slower
|
| 30 |
+
single_cls: False # (bool) treat all classes as a single class
|
| 31 |
+
rect: False # (bool) rectangular batches for train; rectangular batching for val when mode='val'
|
| 32 |
+
cos_lr: False # (bool) cosine learning rate scheduler
|
| 33 |
+
close_mosaic: 10 # (int) disable mosaic augmentation for final N epochs (0 to keep enabled)
|
| 34 |
+
resume: False # (bool) resume training from last checkpoint in the run dir
|
| 35 |
+
amp: True # (bool) Automatic Mixed Precision (AMP) training; True runs AMP capability check
|
| 36 |
+
fraction: 1.0 # (float) fraction of training dataset to use (1.0 = all)
|
| 37 |
+
profile: False # (bool) profile ONNX/TensorRT speeds during training for loggers
|
| 38 |
+
freeze: # (int | list, optional) freeze first N layers (int) or specific layer indices (list)
|
| 39 |
+
multi_scale: 0.0 # (float) multi-scale range as a fraction of imgsz; sizes are rounded to stride multiples
|
| 40 |
+
compile: False # (bool | str) enable torch.compile() backend='inductor'; True="default", False=off, or "default|reduce-overhead|max-autotune-no-cudagraphs"
|
| 41 |
+
|
| 42 |
+
# Segmentation
|
| 43 |
+
overlap_mask: True # (bool) merge instance masks into one mask during training (segment only)
|
| 44 |
+
mask_ratio: 4 # (int) mask downsample ratio (segment only)
|
| 45 |
+
|
| 46 |
+
# Classification
|
| 47 |
+
dropout: 0.0 # (float) dropout for classification head (classify only)
|
| 48 |
+
|
| 49 |
+
# Val/Test settings ----------------------------------------------------------------------------------------------------
|
| 50 |
+
val: True # (bool) run validation/testing during training
|
| 51 |
+
split: val # (str) dataset split to evaluate: 'val', 'test' or 'train'
|
| 52 |
+
save_json: False # (bool) save results to COCO JSON (detect/segment/pose) or PNG masks (semantic) for external evaluation
|
| 53 |
+
conf: # (float, optional) confidence threshold; defaults: predict=0.25, val=0.001
|
| 54 |
+
iou: 0.7 # (float) IoU threshold used for NMS
|
| 55 |
+
max_det: 300 # (int) maximum number of detections per image
|
| 56 |
+
half: False # (bool) use half precision (FP16) if supported
|
| 57 |
+
dnn: False # (bool) use OpenCV DNN for ONNX inference
|
| 58 |
+
plots: True # (bool) save plots and images during train/val
|
| 59 |
+
end2end: # (bool, optional) whether to use end2end head (YOLO26, YOLOv10) for predict/val/export
|
| 60 |
+
|
| 61 |
+
# Predict settings -----------------------------------------------------------------------------------------------------
|
| 62 |
+
source: # (str, optional) path/dir/URL/stream for images or videos; e.g. 'ultralytics/assets' or '0' for webcam
|
| 63 |
+
vid_stride: 1 # (int) read every Nth frame for video sources
|
| 64 |
+
stream_buffer: False # (bool) True buffers all frames; False keeps the most recent frame for low-latency streams
|
| 65 |
+
visualize: False # (bool) visualize model features (predict) or TP/FP/FN confusion (val)
|
| 66 |
+
augment: False # (bool) apply test-time augmentation during prediction
|
| 67 |
+
agnostic_nms: False # (bool) class-agnostic NMS
|
| 68 |
+
classes: # (int | list[int], optional) filter by class id(s), e.g. 0 or [0,2,3]
|
| 69 |
+
retina_masks: False # (bool) use high-resolution segmentation masks (segment)
|
| 70 |
+
embed: # (list[int], optional) return feature embeddings from given layer indices
|
| 71 |
+
|
| 72 |
+
# Visualize settings ---------------------------------------------------------------------------------------------------
|
| 73 |
+
show: False # (bool) show images/videos in a window if supported
|
| 74 |
+
save_frames: False # (bool) save individual frames from video predictions
|
| 75 |
+
save_txt: False # (bool) save results as .txt files (xywh format)
|
| 76 |
+
save_conf: False # (bool) save confidence scores with results
|
| 77 |
+
save_crop: False # (bool) save cropped prediction regions to files
|
| 78 |
+
show_labels: True # (bool) draw class labels on images, e.g. 'person'
|
| 79 |
+
show_conf: True # (bool) draw confidence values on images, e.g. '0.99'
|
| 80 |
+
show_boxes: True # (bool) draw bounding boxes on images
|
| 81 |
+
line_width: # (int, optional) line width of boxes; auto-scales with image size if not set
|
| 82 |
+
|
| 83 |
+
# Export settings ------------------------------------------------------------------------------------------------------
|
| 84 |
+
format: torchscript # (str) target format, e.g. torchscript|onnx|openvino|engine|coreml|saved_model|pb|tflite|edgetpu|tfjs|paddle|mnn|ncnn|imx|rknn|executorch|axelera|deepx|qnn
|
| 85 |
+
keras: False # (bool) TF SavedModel only (format=saved_model); enable Keras layers during export
|
| 86 |
+
optimize: False # (bool) TorchScript: mobile optimizations; DEEPX: higher compiler optimization (slower compile, faster inference)
|
| 87 |
+
int8: False # (bool) INT8/PTQ where supported (openvino, engine, coreml, tflite, tfjs, mnn, imx, rknn, axelera, deepx); needs calibration data/fraction
|
| 88 |
+
dynamic: False # (bool) dynamic shapes for torchscript, onnx, openvino, engine, coreml; enable variable image sizes
|
| 89 |
+
simplify: True # (bool) ONNX/engine only; run graph simplifier for cleaner ONNX before runtime conversion
|
| 90 |
+
opset: # (int, optional) ONNX/engine only; opset version for export; leave unset to use a tested default
|
| 91 |
+
workspace: # (float, optional) engine (TensorRT) only; workspace size in GiB, e.g. 4
|
| 92 |
+
nms: False # (bool) fuse NMS into exported model when backend supports; if True, conf/iou apply (agnostic_nms except coreml)
|
| 93 |
+
|
| 94 |
+
# Hyperparameters ------------------------------------------------------------------------------------------------------
|
| 95 |
+
lr0: 0.01 # (float) initial learning rate (SGD=1e-2, Adam/AdamW=1e-3)
|
| 96 |
+
lrf: 0.01 # (float) final LR fraction; final LR = lr0 * lrf
|
| 97 |
+
momentum: 0.937 # (float) SGD momentum or Adam beta1
|
| 98 |
+
weight_decay: 0.0005 # (float) weight decay (L2 regularization)
|
| 99 |
+
warmup_epochs: 3.0 # (float) warmup epochs (fractions allowed)
|
| 100 |
+
warmup_momentum: 0.8 # (float) initial momentum during warmup
|
| 101 |
+
warmup_bias_lr: 0.1 # (float) bias learning rate during warmup
|
| 102 |
+
box: 7.5 # (float) box loss gain
|
| 103 |
+
cls: 0.5 # (float) classification loss gain
|
| 104 |
+
cls_pw: 0.0 # (float) class weights power for handling class imbalance (0.0=disable, 1.0=full inverse frequency)
|
| 105 |
+
dfl: 1.5 # (float) distribution focal loss gain
|
| 106 |
+
pose: 12.0 # (float) pose loss gain (pose tasks)
|
| 107 |
+
kobj: 1.0 # (float) keypoint objectness loss gain (pose tasks)
|
| 108 |
+
rle: 1.0 # (float) rle loss gain (pose tasks)
|
| 109 |
+
angle: 1.0 # (float) oriented angle loss gain (obb tasks)
|
| 110 |
+
nbs: 64 # (int) nominal batch size used for loss normalization
|
| 111 |
+
hsv_h: 0.015 # (float) HSV hue augmentation fraction
|
| 112 |
+
hsv_s: 0.7 # (float) HSV saturation augmentation fraction
|
| 113 |
+
hsv_v: 0.4 # (float) HSV value (brightness) augmentation fraction
|
| 114 |
+
degrees: 0.0 # (float) rotation degrees (+/-)
|
| 115 |
+
translate: 0.1 # (float) translation fraction (+/-)
|
| 116 |
+
scale: 0.5 # (float | tuple) scale gain (+/-) as float, or explicit (min, max) tuple
|
| 117 |
+
shear: 0.0 # (float) shear degrees (+/-)
|
| 118 |
+
perspective: 0.0 # (float) perspective fraction (0–0.001 typical)
|
| 119 |
+
flipud: 0.0 # (float) vertical flip probability
|
| 120 |
+
fliplr: 0.5 # (float) horizontal flip probability
|
| 121 |
+
bgr: 0.0 # (float) RGB↔BGR channel swap probability
|
| 122 |
+
mosaic: 1.0 # (float) mosaic augmentation probability
|
| 123 |
+
mixup: 0.0 # (float) MixUp augmentation probability
|
| 124 |
+
cutmix: 0.0 # (float) CutMix augmentation probability
|
| 125 |
+
copy_paste: 0.0 # (float) segmentation copy-paste probability
|
| 126 |
+
copy_paste_mode: flip # (str) copy-paste strategy for segmentation: flip or mixup
|
| 127 |
+
auto_augment: randaugment # (str) classification auto augmentation policy: randaugment, autoaugment, augmix
|
| 128 |
+
erasing: 0.4 # (float) random erasing probability for classification (0.0–1.0)
|
| 129 |
+
|
| 130 |
+
# Custom config.yaml ---------------------------------------------------------------------------------------------------
|
| 131 |
+
cfg: # (str, optional) path to a config.yaml that overrides defaults
|
| 132 |
+
|
| 133 |
+
# Tracker settings ------------------------------------------------------------------------------------------------------
|
| 134 |
+
tracker: botsort.yaml # (str) tracker config: botsort.yaml, bytetrack.yaml, ocsort.yaml, deepocsort.yaml, fasttrack.yaml, tracktrack.yaml
|
models_related/ultralytics/ultralytics/cfg/models/11/yolo11-cls-resnet18.yaml
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Ultralytics YOLO11-cls image classification model with ResNet18 backbone
|
| 4 |
+
# Model docs: https://docs.ultralytics.com/models/yolo11
|
| 5 |
+
# Task docs: https://docs.ultralytics.com/tasks/classify
|
| 6 |
+
|
| 7 |
+
# Parameters
|
| 8 |
+
nc: 1000 # number of classes
|
| 9 |
+
|
| 10 |
+
# ResNet18 backbone
|
| 11 |
+
backbone:
|
| 12 |
+
# [from, repeats, module, args]
|
| 13 |
+
- [-1, 1, TorchVision, [512, resnet18, DEFAULT, True, 2]] # truncate two layers from the end
|
| 14 |
+
|
| 15 |
+
# YOLO11n head
|
| 16 |
+
head:
|
| 17 |
+
- [-1, 1, Classify, [nc]] # Classify
|
models_related/ultralytics/ultralytics/cfg/models/11/yolo11-cls.yaml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Ultralytics YOLO11-cls image classification model
|
| 4 |
+
# Model docs: https://docs.ultralytics.com/models/yolo11
|
| 5 |
+
# Task docs: https://docs.ultralytics.com/tasks/classify
|
| 6 |
+
|
| 7 |
+
# Parameters
|
| 8 |
+
nc: 1000 # number of classes
|
| 9 |
+
scales: # model compound scaling constants, i.e. 'model=yolo11n-cls.yaml' will call yolo11-cls.yaml with scale 'n'
|
| 10 |
+
# [depth, width, max_channels]
|
| 11 |
+
n: [0.50, 0.25, 1024] # summary: 86 layers, 1633584 parameters, 1633584 gradients, 0.5 GFLOPs
|
| 12 |
+
s: [0.50, 0.50, 1024] # summary: 86 layers, 5545488 parameters, 5545488 gradients, 1.6 GFLOPs
|
| 13 |
+
m: [0.50, 1.00, 512] # summary: 106 layers, 10455696 parameters, 10455696 gradients, 5.0 GFLOPs
|
| 14 |
+
l: [1.00, 1.00, 512] # summary: 176 layers, 12937104 parameters, 12937104 gradients, 6.2 GFLOPs
|
| 15 |
+
x: [1.00, 1.50, 512] # summary: 176 layers, 28458544 parameters, 28458544 gradients, 13.7 GFLOPs
|
| 16 |
+
|
| 17 |
+
# YOLO11n backbone
|
| 18 |
+
backbone:
|
| 19 |
+
# [from, repeats, module, args]
|
| 20 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
| 21 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
| 22 |
+
- [-1, 2, C3k2, [256, False, 0.25]]
|
| 23 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
| 24 |
+
- [-1, 2, C3k2, [512, False, 0.25]]
|
| 25 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
| 26 |
+
- [-1, 2, C3k2, [512, True]]
|
| 27 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
| 28 |
+
- [-1, 2, C3k2, [1024, True]]
|
| 29 |
+
- [-1, 2, C2PSA, [1024]] # 9
|
| 30 |
+
|
| 31 |
+
# YOLO11n head
|
| 32 |
+
head:
|
| 33 |
+
- [-1, 1, Classify, [nc]] # Classify
|
models_related/ultralytics/ultralytics/cfg/models/11/yolo11-obb.yaml
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Ultralytics YOLO11-obb Oriented Bounding Boxes (OBB) model with P3/8 - P5/32 outputs
|
| 4 |
+
# Model docs: https://docs.ultralytics.com/models/yolo11
|
| 5 |
+
# Task docs: https://docs.ultralytics.com/tasks/obb
|
| 6 |
+
|
| 7 |
+
# Parameters
|
| 8 |
+
nc: 80 # number of classes
|
| 9 |
+
scales: # model compound scaling constants, i.e. 'model=yolo11n-obb.yaml' will call yolo11-obb.yaml with scale 'n'
|
| 10 |
+
# [depth, width, max_channels]
|
| 11 |
+
n: [0.50, 0.25, 1024] # summary: 196 layers, 2695747 parameters, 2695731 gradients, 6.9 GFLOPs
|
| 12 |
+
s: [0.50, 0.50, 1024] # summary: 196 layers, 9744931 parameters, 9744915 gradients, 22.7 GFLOPs
|
| 13 |
+
m: [0.50, 1.00, 512] # summary: 246 layers, 20963523 parameters, 20963507 gradients, 72.2 GFLOPs
|
| 14 |
+
l: [1.00, 1.00, 512] # summary: 372 layers, 26220995 parameters, 26220979 gradients, 91.3 GFLOPs
|
| 15 |
+
x: [1.00, 1.50, 512] # summary: 372 layers, 58875331 parameters, 58875315 gradients, 204.3 GFLOPs
|
| 16 |
+
|
| 17 |
+
# YOLO11n backbone
|
| 18 |
+
backbone:
|
| 19 |
+
# [from, repeats, module, args]
|
| 20 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
| 21 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
| 22 |
+
- [-1, 2, C3k2, [256, False, 0.25]]
|
| 23 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
| 24 |
+
- [-1, 2, C3k2, [512, False, 0.25]]
|
| 25 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
| 26 |
+
- [-1, 2, C3k2, [512, True]]
|
| 27 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
| 28 |
+
- [-1, 2, C3k2, [1024, True]]
|
| 29 |
+
- [-1, 1, SPPF, [1024, 5]] # 9
|
| 30 |
+
- [-1, 2, C2PSA, [1024]] # 10
|
| 31 |
+
|
| 32 |
+
# YOLO11n head
|
| 33 |
+
head:
|
| 34 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
| 35 |
+
- [[-1, 6], 1, Concat, [1]] # cat backbone P4
|
| 36 |
+
- [-1, 2, C3k2, [512, False]] # 13
|
| 37 |
+
|
| 38 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
| 39 |
+
- [[-1, 4], 1, Concat, [1]] # cat backbone P3
|
| 40 |
+
- [-1, 2, C3k2, [256, False]] # 16 (P3/8-small)
|
| 41 |
+
|
| 42 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 43 |
+
- [[-1, 13], 1, Concat, [1]] # cat head P4
|
| 44 |
+
- [-1, 2, C3k2, [512, False]] # 19 (P4/16-medium)
|
| 45 |
+
|
| 46 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 47 |
+
- [[-1, 10], 1, Concat, [1]] # cat head P5
|
| 48 |
+
- [-1, 2, C3k2, [1024, True]] # 22 (P5/32-large)
|
| 49 |
+
|
| 50 |
+
- [[16, 19, 22], 1, OBB, [nc, 1]] # OBB(P3, P4, P5)
|
models_related/ultralytics/ultralytics/cfg/models/11/yolo11-pose.yaml
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
| 2 |
+
|
| 3 |
+
# Ultralytics YOLO11-pose keypoints/pose estimation model with P3/8 - P5/32 outputs
|
| 4 |
+
# Model docs: https://docs.ultralytics.com/models/yolo11
|
| 5 |
+
# Task docs: https://docs.ultralytics.com/tasks/pose
|
| 6 |
+
|
| 7 |
+
# Parameters
|
| 8 |
+
nc: 80 # number of classes
|
| 9 |
+
kpt_shape: [17, 3] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible)
|
| 10 |
+
scales: # model compound scaling constants, i.e. 'model=yolo11n-pose.yaml' will call yolo11-pose.yaml with scale 'n'
|
| 11 |
+
# [depth, width, max_channels]
|
| 12 |
+
n: [0.50, 0.25, 1024] # summary: 196 layers, 2908507 parameters, 2908491 gradients, 7.7 GFLOPs
|
| 13 |
+
s: [0.50, 0.50, 1024] # summary: 196 layers, 9948811 parameters, 9948795 gradients, 23.5 GFLOPs
|
| 14 |
+
m: [0.50, 1.00, 512] # summary: 246 layers, 20973273 parameters, 20973257 gradients, 72.3 GFLOPs
|
| 15 |
+
l: [1.00, 1.00, 512] # summary: 372 layers, 26230745 parameters, 26230729 gradients, 91.4 GFLOPs
|
| 16 |
+
x: [1.00, 1.50, 512] # summary: 372 layers, 58889881 parameters, 58889865 gradients, 204.3 GFLOPs
|
| 17 |
+
|
| 18 |
+
# YOLO11n backbone
|
| 19 |
+
backbone:
|
| 20 |
+
# [from, repeats, module, args]
|
| 21 |
+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
| 22 |
+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
| 23 |
+
- [-1, 2, C3k2, [256, False, 0.25]]
|
| 24 |
+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
|
| 25 |
+
- [-1, 2, C3k2, [512, False, 0.25]]
|
| 26 |
+
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
|
| 27 |
+
- [-1, 2, C3k2, [512, True]]
|
| 28 |
+
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
|
| 29 |
+
- [-1, 2, C3k2, [1024, True]]
|
| 30 |
+
- [-1, 1, SPPF, [1024, 5]] # 9
|
| 31 |
+
- [-1, 2, C2PSA, [1024]] # 10
|
| 32 |
+
|
| 33 |
+
# YOLO11n head
|
| 34 |
+
head:
|
| 35 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
| 36 |
+
- [[-1, 6], 1, Concat, [1]] # cat backbone P4
|
| 37 |
+
- [-1, 2, C3k2, [512, False]] # 13
|
| 38 |
+
|
| 39 |
+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
|
| 40 |
+
- [[-1, 4], 1, Concat, [1]] # cat backbone P3
|
| 41 |
+
- [-1, 2, C3k2, [256, False]] # 16 (P3/8-small)
|
| 42 |
+
|
| 43 |
+
- [-1, 1, Conv, [256, 3, 2]]
|
| 44 |
+
- [[-1, 13], 1, Concat, [1]] # cat head P4
|
| 45 |
+
- [-1, 2, C3k2, [512, False]] # 19 (P4/16-medium)
|
| 46 |
+
|
| 47 |
+
- [-1, 1, Conv, [512, 3, 2]]
|
| 48 |
+
- [[-1, 10], 1, Concat, [1]] # cat head P5
|
| 49 |
+
- [-1, 2, C3k2, [1024, True]] # 22 (P5/32-large)
|
| 50 |
+
|
| 51 |
+
- [[16, 19, 22], 1, Pose, [nc, kpt_shape]] # Pose(P3, P4, P5)
|