diff --git a/tests/test_python.py b/tests/test_python.py index e7963be..61b59d1 100644 --- a/tests/test_python.py +++ b/tests/test_python.py @@ -96,5 +96,5 @@ def test_export_paddle(): def test_all_model_yamls(): - for m in list((ROOT / 'yolo/v8/models').rglob('*.yaml')): + for m in list((ROOT / 'models').rglob('*.yaml')): YOLO(m.name) diff --git a/ultralytics/models/README.md b/ultralytics/models/README.md new file mode 100644 index 0000000..f81008e --- /dev/null +++ b/ultralytics/models/README.md @@ -0,0 +1,24 @@ +## Models HUB + +Here are the models that are supported out-of-the-box with Ultralytics. For a detailed view and navigation, visit [model hub](<>) section of the docs. + +### Usage + +You can simply set the `model` parameter to any available yaml config or pretained weights + +```bash +yolo task=... mode=... model=yolov5n.yaml +``` + +| Model | Version/ | size (pixels) | mAPval 50-95 | Speed CPU b1 (ms) | params (M) | FLOPs @640 (B) | model file | Pretrained Weights | +| ------------------ | -------- | ------------- | ------------ | ----------------- | ---------- | -------------- | ------------- | ------------------ | +| YOLOv5n | v6.3 | 640 | 28.0 | 45 | 1.9 | 4.5 | yolov5n.yaml | - | +| YOLOv5s | - | 640 | 37.4 | 98 | 7.2 | 16.5 | yolov5s.yaml | - | +| YOLOv5m | - | 640 | 45.4 | 224 | 21.2 | 49.0 | yolov5m.yaml | - | +| YOLOv5l | - | 640 | 49.0 | 430 | 46.5 | 109.1 | yolov5l.yaml | - | +| YOLOv5x | - | 640 | 50.7 | 766 | 86.7 | 205.7 | yolov5x.yaml | - | +| YOLOv5n6 | - | 1280 | 36.0 | 153 | 3.2 | 4.6 | yolov5n6.yaml | - | +| YOLOv5s6 | - | 1280 | 44.8 | 385 | 12.6 | 16.8 | yolov5s6.yaml | - | +| YOLOv5m6 | - | 1280 | 51.3 | 887 | 35.7 | 50.0 | yolov5m6.yaml | - | +| YOLOv5l6 | - | 1280 | 53.7 | 1784 | 76.8 | 111.4 | yolov5l6.yaml | - | +| YOLOv5x6 + \[TTA\] | - | 1280 1536 | 55.0 55.8 | 3136 - | 140.7 - | 209.8 - | yolov5x6.yaml | - | diff --git a/ultralytics/models/v3/yolov3-spp.yaml b/ultralytics/models/v3/yolov3-spp.yaml new file mode 100644 index 0000000..5d6794f --- /dev/null +++ b/ultralytics/models/v3/yolov3-spp.yaml @@ -0,0 +1,47 @@ +# Ultralytics YOLO 🚀, GPL-3.0 license + +# Parameters +nc: 80 # number of classes +depth_multiple: 1.0 # model depth multiple +width_multiple: 1.0 # layer channel multiple + +# darknet53 backbone +backbone: + # [from, number, module, args] + [[-1, 1, Conv, [32, 3, 1]], # 0 + [-1, 1, Conv, [64, 3, 2]], # 1-P1/2 + [-1, 1, Bottleneck, [64]], + [-1, 1, Conv, [128, 3, 2]], # 3-P2/4 + [-1, 2, Bottleneck, [128]], + [-1, 1, Conv, [256, 3, 2]], # 5-P3/8 + [-1, 8, Bottleneck, [256]], + [-1, 1, Conv, [512, 3, 2]], # 7-P4/16 + [-1, 8, Bottleneck, [512]], + [-1, 1, Conv, [1024, 3, 2]], # 9-P5/32 + [-1, 4, Bottleneck, [1024]], # 10 + ] + +# YOLOv3-SPP head +head: + [[-1, 1, Bottleneck, [1024, False]], + [-1, 1, SPP, [512, [5, 9, 13]]], + [-1, 1, Conv, [1024, 3, 1]], + [-1, 1, Conv, [512, 1, 1]], + [-1, 1, Conv, [1024, 3, 1]], # 15 (P5/32-large) + + [-2, 1, Conv, [256, 1, 1]], + [-1, 1, nn.Upsample, [None, 2, 'nearest']], + [[-1, 8], 1, Concat, [1]], # cat backbone P4 + [-1, 1, Bottleneck, [512, False]], + [-1, 1, Bottleneck, [512, False]], + [-1, 1, Conv, [256, 1, 1]], + [-1, 1, Conv, [512, 3, 1]], # 22 (P4/16-medium) + + [-2, 1, Conv, [128, 1, 1]], + [-1, 1, nn.Upsample, [None, 2, 'nearest']], + [[-1, 6], 1, Concat, [1]], # cat backbone P3 + [-1, 1, Bottleneck, [256, False]], + [-1, 2, Bottleneck, [256, False]], # 27 (P3/8-small) + + [[27, 22, 15], 1, Detect, [nc]], # Detect(P3, P4, P5) + ] diff --git a/ultralytics/models/v3/yolov3-tiny.yaml b/ultralytics/models/v3/yolov3-tiny.yaml new file mode 100644 index 0000000..d7921d3 --- /dev/null +++ b/ultralytics/models/v3/yolov3-tiny.yaml @@ -0,0 +1,38 @@ +# Ultralytics YOLO 🚀, GPL-3.0 license + +# Parameters +nc: 80 # number of classes +depth_multiple: 1.0 # model depth multiple +width_multiple: 1.0 # layer channel multiple + +# YOLOv3-tiny backbone +backbone: + # [from, number, module, args] + [[-1, 1, Conv, [16, 3, 1]], # 0 + [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 1-P1/2 + [-1, 1, Conv, [32, 3, 1]], + [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 3-P2/4 + [-1, 1, Conv, [64, 3, 1]], + [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 5-P3/8 + [-1, 1, Conv, [128, 3, 1]], + [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 7-P4/16 + [-1, 1, Conv, [256, 3, 1]], + [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 9-P5/32 + [-1, 1, Conv, [512, 3, 1]], + [-1, 1, nn.ZeroPad2d, [[0, 1, 0, 1]]], # 11 + [-1, 1, nn.MaxPool2d, [2, 1, 0]], # 12 + ] + +# YOLOv3-tiny head +head: + [[-1, 1, Conv, [1024, 3, 1]], + [-1, 1, Conv, [256, 1, 1]], + [-1, 1, Conv, [512, 3, 1]], # 15 (P5/32-large) + + [-2, 1, Conv, [128, 1, 1]], + [-1, 1, nn.Upsample, [None, 2, 'nearest']], + [[-1, 8], 1, Concat, [1]], # cat backbone P4 + [-1, 1, Conv, [256, 3, 1]], # 19 (P4/16-medium) + + [[19, 15], 1, Detect, [nc]], # Detect(P4, P5) + ] diff --git a/ultralytics/models/v3/yolov3.yaml b/ultralytics/models/v3/yolov3.yaml new file mode 100644 index 0000000..3ecb642 --- /dev/null +++ b/ultralytics/models/v3/yolov3.yaml @@ -0,0 +1,47 @@ +# Ultralytics YOLO 🚀, GPL-3.0 license + +# Parameters +nc: 80 # number of classes +depth_multiple: 1.0 # model depth multiple +width_multiple: 1.0 # layer channel multiple + +# darknet53 backbone +backbone: + # [from, number, module, args] + [[-1, 1, Conv, [32, 3, 1]], # 0 + [-1, 1, Conv, [64, 3, 2]], # 1-P1/2 + [-1, 1, Bottleneck, [64]], + [-1, 1, Conv, [128, 3, 2]], # 3-P2/4 + [-1, 2, Bottleneck, [128]], + [-1, 1, Conv, [256, 3, 2]], # 5-P3/8 + [-1, 8, Bottleneck, [256]], + [-1, 1, Conv, [512, 3, 2]], # 7-P4/16 + [-1, 8, Bottleneck, [512]], + [-1, 1, Conv, [1024, 3, 2]], # 9-P5/32 + [-1, 4, Bottleneck, [1024]], # 10 + ] + +# YOLOv3 head +head: + [[-1, 1, Bottleneck, [1024, False]], + [-1, 1, Conv, [512, 1, 1]], + [-1, 1, Conv, [1024, 3, 1]], + [-1, 1, Conv, [512, 1, 1]], + [-1, 1, Conv, [1024, 3, 1]], # 15 (P5/32-large) + + [-2, 1, Conv, [256, 1, 1]], + [-1, 1, nn.Upsample, [None, 2, 'nearest']], + [[-1, 8], 1, Concat, [1]], # cat backbone P4 + [-1, 1, Bottleneck, [512, False]], + [-1, 1, Bottleneck, [512, False]], + [-1, 1, Conv, [256, 1, 1]], + [-1, 1, Conv, [512, 3, 1]], # 22 (P4/16-medium) + + [-2, 1, Conv, [128, 1, 1]], + [-1, 1, nn.Upsample, [None, 2, 'nearest']], + [[-1, 6], 1, Concat, [1]], # cat backbone P3 + [-1, 1, Bottleneck, [256, False]], + [-1, 2, Bottleneck, [256, False]], # 27 (P3/8-small) + + [[27, 22, 15], 1, Detect, [nc]], # Detect(P3, P4, P5) + ] diff --git a/ultralytics/models/v5/yolov5l.yaml b/ultralytics/models/v5/yolov5l.yaml new file mode 100644 index 0000000..ca3a85d --- /dev/null +++ b/ultralytics/models/v5/yolov5l.yaml @@ -0,0 +1,44 @@ +# Ultralytics YOLO 🚀, GPL-3.0 license + +# Parameters +nc: 80 # number of classes +depth_multiple: 1.0 # model depth multiple +width_multiple: 1.0 # layer channel multiple + +# YOLOv5 v6.0 backbone +backbone: + # [from, number, module, args] + [[-1, 1, Conv, [64, 6, 2, 2]], # 0-P1/2 + [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 + [-1, 3, C3, [128]], + [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 + [-1, 6, C3, [256]], + [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 + [-1, 9, C3, [512]], + [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 + [-1, 3, C3, [1024]], + [-1, 1, SPPF, [1024, 5]], # 9 + ] + +# YOLOv5 v6.0 head +head: + [[-1, 1, Conv, [512, 1, 1]], + [-1, 1, nn.Upsample, [None, 2, 'nearest']], + [[-1, 6], 1, Concat, [1]], # cat backbone P4 + [-1, 3, C3, [512, False]], # 13 + + [-1, 1, Conv, [256, 1, 1]], + [-1, 1, nn.Upsample, [None, 2, 'nearest']], + [[-1, 4], 1, Concat, [1]], # cat backbone P3 + [-1, 3, C3, [256, False]], # 17 (P3/8-small) + + [-1, 1, Conv, [256, 3, 2]], + [[-1, 14], 1, Concat, [1]], # cat head P4 + [-1, 3, C3, [512, False]], # 20 (P4/16-medium) + + [-1, 1, Conv, [512, 3, 2]], + [[-1, 10], 1, Concat, [1]], # cat head P5 + [-1, 3, C3, [1024, False]], # 23 (P5/32-large) + + [[17, 20, 23], 1, Detect, [nc]], # Detect(P3, P4, P5) + ] \ No newline at end of file diff --git a/ultralytics/models/v5/yolov5m.yaml b/ultralytics/models/v5/yolov5m.yaml new file mode 100644 index 0000000..fddcc63 --- /dev/null +++ b/ultralytics/models/v5/yolov5m.yaml @@ -0,0 +1,44 @@ +# Ultralytics YOLO 🚀, GPL-3.0 license + +# Parameters +nc: 80 # number of classes +depth_multiple: 0.67 # model depth multiple +width_multiple: 0.75 # layer channel multiple + +# YOLOv5 v6.0 backbone +backbone: + # [from, number, module, args] + [[-1, 1, Conv, [64, 6, 2, 2]], # 0-P1/2 + [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 + [-1, 3, C3, [128]], + [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 + [-1, 6, C3, [256]], + [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 + [-1, 9, C3, [512]], + [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 + [-1, 3, C3, [1024]], + [-1, 1, SPPF, [1024, 5]], # 9 + ] + +# YOLOv5 v6.0 head +head: + [[-1, 1, Conv, [512, 1, 1]], + [-1, 1, nn.Upsample, [None, 2, 'nearest']], + [[-1, 6], 1, Concat, [1]], # cat backbone P4 + [-1, 3, C3, [512, False]], # 13 + + [-1, 1, Conv, [256, 1, 1]], + [-1, 1, nn.Upsample, [None, 2, 'nearest']], + [[-1, 4], 1, Concat, [1]], # cat backbone P3 + [-1, 3, C3, [256, False]], # 17 (P3/8-small) + + [-1, 1, Conv, [256, 3, 2]], + [[-1, 14], 1, Concat, [1]], # cat head P4 + [-1, 3, C3, [512, False]], # 20 (P4/16-medium) + + [-1, 1, Conv, [512, 3, 2]], + [[-1, 10], 1, Concat, [1]], # cat head P5 + [-1, 3, C3, [1024, False]], # 23 (P5/32-large) + + [[17, 20, 23], 1, Detect, [nc]], # Detect(P3, P4, P5) + ] \ No newline at end of file diff --git a/ultralytics/models/v5/yolov5n.yaml b/ultralytics/models/v5/yolov5n.yaml new file mode 100644 index 0000000..259e1cf --- /dev/null +++ b/ultralytics/models/v5/yolov5n.yaml @@ -0,0 +1,44 @@ +# Ultralytics YOLO 🚀, GPL-3.0 license + +# Parameters +nc: 80 # number of classes +depth_multiple: 0.33 # model depth multiple +width_multiple: 0.25 # layer channel multiple + +# YOLOv5 v6.0 backbone +backbone: + # [from, number, module, args] + [[-1, 1, Conv, [64, 6, 2, 2]], # 0-P1/2 + [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 + [-1, 3, C3, [128]], + [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 + [-1, 6, C3, [256]], + [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 + [-1, 9, C3, [512]], + [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 + [-1, 3, C3, [1024]], + [-1, 1, SPPF, [1024, 5]], # 9 + ] + +# YOLOv5 v6.0 head +head: + [[-1, 1, Conv, [512, 1, 1]], + [-1, 1, nn.Upsample, [None, 2, 'nearest']], + [[-1, 6], 1, Concat, [1]], # cat backbone P4 + [-1, 3, C3, [512, False]], # 13 + + [-1, 1, Conv, [256, 1, 1]], + [-1, 1, nn.Upsample, [None, 2, 'nearest']], + [[-1, 4], 1, Concat, [1]], # cat backbone P3 + [-1, 3, C3, [256, False]], # 17 (P3/8-small) + + [-1, 1, Conv, [256, 3, 2]], + [[-1, 14], 1, Concat, [1]], # cat head P4 + [-1, 3, C3, [512, False]], # 20 (P4/16-medium) + + [-1, 1, Conv, [512, 3, 2]], + [[-1, 10], 1, Concat, [1]], # cat head P5 + [-1, 3, C3, [1024, False]], # 23 (P5/32-large) + + [[17, 20, 23], 1, Detect, [nc]], # Detect(P3, P4, P5) + ] \ No newline at end of file diff --git a/ultralytics/models/v5/yolov5s.yaml b/ultralytics/models/v5/yolov5s.yaml new file mode 100644 index 0000000..9e63349 --- /dev/null +++ b/ultralytics/models/v5/yolov5s.yaml @@ -0,0 +1,45 @@ +# Ultralytics YOLO 🚀, GPL-3.0 license + +# Parameters +nc: 80 # number of classes +depth_multiple: 0.33 # model depth multiple +width_multiple: 0.50 # layer channel multiple + + +# YOLOv5 v6.0 backbone +backbone: + # [from, number, module, args] + [[-1, 1, Conv, [64, 6, 2, 2]], # 0-P1/2 + [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 + [-1, 3, C3, [128]], + [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 + [-1, 6, C3, [256]], + [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 + [-1, 9, C3, [512]], + [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 + [-1, 3, C3, [1024]], + [-1, 1, SPPF, [1024, 5]], # 9 + ] + +# YOLOv5 v6.0 head +head: + [[-1, 1, Conv, [512, 1, 1]], + [-1, 1, nn.Upsample, [None, 2, 'nearest']], + [[-1, 6], 1, Concat, [1]], # cat backbone P4 + [-1, 3, C3, [512, False]], # 13 + + [-1, 1, Conv, [256, 1, 1]], + [-1, 1, nn.Upsample, [None, 2, 'nearest']], + [[-1, 4], 1, Concat, [1]], # cat backbone P3 + [-1, 3, C3, [256, False]], # 17 (P3/8-small) + + [-1, 1, Conv, [256, 3, 2]], + [[-1, 14], 1, Concat, [1]], # cat head P4 + [-1, 3, C3, [512, False]], # 20 (P4/16-medium) + + [-1, 1, Conv, [512, 3, 2]], + [[-1, 10], 1, Concat, [1]], # cat head P5 + [-1, 3, C3, [1024, False]], # 23 (P5/32-large) + + [[17, 20, 23], 1, Detect, [nc]], # Detect(P3, P4, P5) + ] \ No newline at end of file diff --git a/ultralytics/models/v5/yolov5x.yaml b/ultralytics/models/v5/yolov5x.yaml new file mode 100644 index 0000000..8217aff --- /dev/null +++ b/ultralytics/models/v5/yolov5x.yaml @@ -0,0 +1,44 @@ +# Ultralytics YOLO 🚀, GPL-3.0 license + +# Parameters +nc: 80 # number of classes +depth_multiple: 1.33 # model depth multiple +width_multiple: 1.25 # layer channel multiple + +# YOLOv5 v6.0 backbone +backbone: + # [from, number, module, args] + [[-1, 1, Conv, [64, 6, 2, 2]], # 0-P1/2 + [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 + [-1, 3, C3, [128]], + [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 + [-1, 6, C3, [256]], + [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 + [-1, 9, C3, [512]], + [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 + [-1, 3, C3, [1024]], + [-1, 1, SPPF, [1024, 5]], # 9 + ] + +# YOLOv5 v6.0 head +head: + [[-1, 1, Conv, [512, 1, 1]], + [-1, 1, nn.Upsample, [None, 2, 'nearest']], + [[-1, 6], 1, Concat, [1]], # cat backbone P4 + [-1, 3, C3, [512, False]], # 13 + + [-1, 1, Conv, [256, 1, 1]], + [-1, 1, nn.Upsample, [None, 2, 'nearest']], + [[-1, 4], 1, Concat, [1]], # cat backbone P3 + [-1, 3, C3, [256, False]], # 17 (P3/8-small) + + [-1, 1, Conv, [256, 3, 2]], + [[-1, 14], 1, Concat, [1]], # cat head P4 + [-1, 3, C3, [512, False]], # 20 (P4/16-medium) + + [-1, 1, Conv, [512, 3, 2]], + [[-1, 10], 1, Concat, [1]], # cat head P5 + [-1, 3, C3, [1024, False]], # 23 (P5/32-large) + + [[17, 20, 23], 1, Detect, [nc]], # Detect(P3, P4, P5) + ] \ No newline at end of file diff --git a/ultralytics/yolo/v8/models/cls/yolov8l-cls.yaml b/ultralytics/models/v8/cls/yolov8l-cls.yaml similarity index 100% rename from ultralytics/yolo/v8/models/cls/yolov8l-cls.yaml rename to ultralytics/models/v8/cls/yolov8l-cls.yaml diff --git a/ultralytics/yolo/v8/models/cls/yolov8m-cls.yaml b/ultralytics/models/v8/cls/yolov8m-cls.yaml similarity index 100% rename from ultralytics/yolo/v8/models/cls/yolov8m-cls.yaml rename to ultralytics/models/v8/cls/yolov8m-cls.yaml diff --git a/ultralytics/yolo/v8/models/cls/yolov8n-cls.yaml b/ultralytics/models/v8/cls/yolov8n-cls.yaml similarity index 100% rename from ultralytics/yolo/v8/models/cls/yolov8n-cls.yaml rename to ultralytics/models/v8/cls/yolov8n-cls.yaml diff --git a/ultralytics/yolo/v8/models/cls/yolov8s-cls.yaml b/ultralytics/models/v8/cls/yolov8s-cls.yaml similarity index 100% rename from ultralytics/yolo/v8/models/cls/yolov8s-cls.yaml rename to ultralytics/models/v8/cls/yolov8s-cls.yaml diff --git a/ultralytics/yolo/v8/models/cls/yolov8x-cls.yaml b/ultralytics/models/v8/cls/yolov8x-cls.yaml similarity index 100% rename from ultralytics/yolo/v8/models/cls/yolov8x-cls.yaml rename to ultralytics/models/v8/cls/yolov8x-cls.yaml diff --git a/ultralytics/yolo/v8/models/seg/yolov8l-seg.yaml b/ultralytics/models/v8/seg/yolov8l-seg.yaml similarity index 100% rename from ultralytics/yolo/v8/models/seg/yolov8l-seg.yaml rename to ultralytics/models/v8/seg/yolov8l-seg.yaml diff --git a/ultralytics/yolo/v8/models/seg/yolov8m-seg.yaml b/ultralytics/models/v8/seg/yolov8m-seg.yaml similarity index 100% rename from ultralytics/yolo/v8/models/seg/yolov8m-seg.yaml rename to ultralytics/models/v8/seg/yolov8m-seg.yaml diff --git a/ultralytics/yolo/v8/models/seg/yolov8n-seg.yaml b/ultralytics/models/v8/seg/yolov8n-seg.yaml similarity index 100% rename from ultralytics/yolo/v8/models/seg/yolov8n-seg.yaml rename to ultralytics/models/v8/seg/yolov8n-seg.yaml diff --git a/ultralytics/yolo/v8/models/seg/yolov8s-seg.yaml b/ultralytics/models/v8/seg/yolov8s-seg.yaml similarity index 100% rename from ultralytics/yolo/v8/models/seg/yolov8s-seg.yaml rename to ultralytics/models/v8/seg/yolov8s-seg.yaml diff --git a/ultralytics/yolo/v8/models/seg/yolov8x-seg.yaml b/ultralytics/models/v8/seg/yolov8x-seg.yaml similarity index 100% rename from ultralytics/yolo/v8/models/seg/yolov8x-seg.yaml rename to ultralytics/models/v8/seg/yolov8x-seg.yaml diff --git a/ultralytics/yolo/v8/models/yolov8l.yaml b/ultralytics/models/v8/yolov8l.yaml similarity index 100% rename from ultralytics/yolo/v8/models/yolov8l.yaml rename to ultralytics/models/v8/yolov8l.yaml diff --git a/ultralytics/yolo/v8/models/yolov8m.yaml b/ultralytics/models/v8/yolov8m.yaml similarity index 100% rename from ultralytics/yolo/v8/models/yolov8m.yaml rename to ultralytics/models/v8/yolov8m.yaml diff --git a/ultralytics/yolo/v8/models/yolov8n.yaml b/ultralytics/models/v8/yolov8n.yaml similarity index 100% rename from ultralytics/yolo/v8/models/yolov8n.yaml rename to ultralytics/models/v8/yolov8n.yaml diff --git a/ultralytics/yolo/v8/models/yolov8s.yaml b/ultralytics/models/v8/yolov8s.yaml similarity index 100% rename from ultralytics/yolo/v8/models/yolov8s.yaml rename to ultralytics/models/v8/yolov8s.yaml diff --git a/ultralytics/yolo/v8/models/yolov8x.yaml b/ultralytics/models/v8/yolov8x.yaml similarity index 100% rename from ultralytics/yolo/v8/models/yolov8x.yaml rename to ultralytics/models/v8/yolov8x.yaml diff --git a/ultralytics/yolo/v8/models/yolov8x6.yaml b/ultralytics/models/v8/yolov8x6.yaml similarity index 100% rename from ultralytics/yolo/v8/models/yolov8x6.yaml rename to ultralytics/models/v8/yolov8x6.yaml diff --git a/ultralytics/yolo/engine/predictor.py b/ultralytics/yolo/engine/predictor.py index 15e683c..15c2ff1 100644 --- a/ultralytics/yolo/engine/predictor.py +++ b/ultralytics/yolo/engine/predictor.py @@ -57,7 +57,7 @@ class BasePredictor: dataset (Dataset): Dataset used for prediction. vid_path (str): Path to video file. vid_writer (cv2.VideoWriter): Video writer for saving video output. - view_img (bool): Whether to view image output. + show (bool): Whether to view image output. annotator (Annotator): Annotator used for prediction. data_path (str): Path to data. """ @@ -88,7 +88,7 @@ class BasePredictor: self.device = None self.dataset = None self.vid_path, self.vid_writer = None, None - self.view_img = None + self.show = None self.annotator = None self.data_path = None self.callbacks = defaultdict(list, {k: [v] for k, v in callbacks.default_callbacks.items()}) # add callbacks @@ -127,7 +127,7 @@ class BasePredictor: # Dataloader bs = 1 # batch_size if webcam: - self.view_img = check_imshow(warn=True) + self.show = check_imshow(warn=True) self.dataset = LoadStreams(source, imgsz=imgsz, stride=stride, auto=pt, vid_stride=self.args.vid_stride) bs = len(self.dataset) elif screenshot: diff --git a/ultralytics/yolo/utils/checks.py b/ultralytics/yolo/utils/checks.py index fc1da26..4c5ad23 100644 --- a/ultralytics/yolo/utils/checks.py +++ b/ultralytics/yolo/utils/checks.py @@ -217,8 +217,8 @@ def check_file(file, suffix=''): return file else: # search files = [] - for d in 'data', 'v8', 'utils': # search directories - files.extend(glob.glob(str(ROOT / "yolo" / d / '**' / file), recursive=True)) # find file + for d in 'models', 'yolo/data': # search directories + files.extend(glob.glob(str(ROOT / d / '**' / file), recursive=True)) # find file assert len(files), f'File not found: {file}' # assert file was found assert len(files) == 1, f"Multiple files match '{file}', specify exact path: {files}" # assert unique return files[0] # return file