ultralytics 8.1.42 add YOLOv9 Segment models (#9296)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
1e547e60a0
commit
3208eb72ef
25 changed files with 236 additions and 93 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
|
||||
__version__ = "8.1.41"
|
||||
__version__ = "8.1.42"
|
||||
|
||||
from ultralytics.data.explorer.explorer import Explorer
|
||||
from ultralytics.models import RTDETR, SAM, YOLO, YOLOWorld
|
||||
|
|
|
|||
38
ultralytics/cfg/models/v9/yolov9c-seg.yaml
Normal file
38
ultralytics/cfg/models/v9/yolov9c-seg.yaml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# YOLOv9c-seg
|
||||
# 654 layers, 27897120 parameters, 159.4 GFLOPs
|
||||
|
||||
# parameters
|
||||
nc: 80 # number of classes
|
||||
|
||||
# gelan backbone
|
||||
backbone:
|
||||
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
|
||||
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
|
||||
- [-1, 1, RepNCSPELAN4, [256, 128, 64, 1]] # 2
|
||||
- [-1, 1, ADown, [256]] # 3-P3/8
|
||||
- [-1, 1, RepNCSPELAN4, [512, 256, 128, 1]] # 4
|
||||
- [-1, 1, ADown, [512]] # 5-P4/16
|
||||
- [-1, 1, RepNCSPELAN4, [512, 512, 256, 1]] # 6
|
||||
- [-1, 1, ADown, [512]] # 7-P5/32
|
||||
- [-1, 1, RepNCSPELAN4, [512, 512, 256, 1]] # 8
|
||||
- [-1, 1, SPPELAN, [512, 256]] # 9
|
||||
|
||||
head:
|
||||
- [-1, 1, nn.Upsample, [None, 2, 'nearest']]
|
||||
- [[-1, 6], 1, Concat, [1]] # cat backbone P4
|
||||
- [-1, 1, RepNCSPELAN4, [512, 512, 256, 1]] # 12
|
||||
|
||||
- [-1, 1, nn.Upsample, [None, 2, 'nearest']]
|
||||
- [[-1, 4], 1, Concat, [1]] # cat backbone P3
|
||||
- [-1, 1, RepNCSPELAN4, [256, 256, 128, 1]] # 15 (P3/8-small)
|
||||
|
||||
- [-1, 1, ADown, [256]]
|
||||
- [[-1, 12], 1, Concat, [1]] # cat head P4
|
||||
- [-1, 1, RepNCSPELAN4, [512, 512, 256, 1]] # 18 (P4/16-medium)
|
||||
|
||||
- [-1, 1, ADown, [512]]
|
||||
- [[-1, 9], 1, Concat, [1]] # cat head P5
|
||||
- [-1, 1, RepNCSPELAN4, [512, 512, 256, 1]] # 21 (P5/32-large)
|
||||
|
||||
- [[15, 18, 21], 1, Segment, [nc, 32, 256]] # Segment(P3, P4, P5)
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
# YOLOv9
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# YOLOv9c
|
||||
# 618 layers, 25590912 parameters, 104.0 GFLOPs
|
||||
|
||||
# parameters
|
||||
nc: 80 # number of classes
|
||||
|
|
|
|||
62
ultralytics/cfg/models/v9/yolov9e-seg.yaml
Normal file
62
ultralytics/cfg/models/v9/yolov9e-seg.yaml
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# YOLOv9c-seg
|
||||
# 1261 layers, 60512800 parameters, 248.4 GFLOPs
|
||||
|
||||
# parameters
|
||||
nc: 80 # number of classes
|
||||
|
||||
# gelan backbone
|
||||
backbone:
|
||||
- [-1, 1, Silence, []]
|
||||
- [-1, 1, Conv, [64, 3, 2]] # 1-P1/2
|
||||
- [-1, 1, Conv, [128, 3, 2]] # 2-P2/4
|
||||
- [-1, 1, RepNCSPELAN4, [256, 128, 64, 2]] # 3
|
||||
- [-1, 1, ADown, [256]] # 4-P3/8
|
||||
- [-1, 1, RepNCSPELAN4, [512, 256, 128, 2]] # 5
|
||||
- [-1, 1, ADown, [512]] # 6-P4/16
|
||||
- [-1, 1, RepNCSPELAN4, [1024, 512, 256, 2]] # 7
|
||||
- [-1, 1, ADown, [1024]] # 8-P5/32
|
||||
- [-1, 1, RepNCSPELAN4, [1024, 512, 256, 2]] # 9
|
||||
|
||||
- [1, 1, CBLinear, [[64]]] # 10
|
||||
- [3, 1, CBLinear, [[64, 128]]] # 11
|
||||
- [5, 1, CBLinear, [[64, 128, 256]]] # 12
|
||||
- [7, 1, CBLinear, [[64, 128, 256, 512]]] # 13
|
||||
- [9, 1, CBLinear, [[64, 128, 256, 512, 1024]]] # 14
|
||||
|
||||
- [0, 1, Conv, [64, 3, 2]] # 15-P1/2
|
||||
- [[10, 11, 12, 13, 14, -1], 1, CBFuse, [[0, 0, 0, 0, 0]]] # 16
|
||||
- [-1, 1, Conv, [128, 3, 2]] # 17-P2/4
|
||||
- [[11, 12, 13, 14, -1], 1, CBFuse, [[1, 1, 1, 1]]] # 18
|
||||
- [-1, 1, RepNCSPELAN4, [256, 128, 64, 2]] # 19
|
||||
- [-1, 1, ADown, [256]] # 20-P3/8
|
||||
- [[12, 13, 14, -1], 1, CBFuse, [[2, 2, 2]]] # 21
|
||||
- [-1, 1, RepNCSPELAN4, [512, 256, 128, 2]] # 22
|
||||
- [-1, 1, ADown, [512]] # 23-P4/16
|
||||
- [[13, 14, -1], 1, CBFuse, [[3, 3]]] # 24
|
||||
- [-1, 1, RepNCSPELAN4, [1024, 512, 256, 2]] # 25
|
||||
- [-1, 1, ADown, [1024]] # 26-P5/32
|
||||
- [[14, -1], 1, CBFuse, [[4]]] # 27
|
||||
- [-1, 1, RepNCSPELAN4, [1024, 512, 256, 2]] # 28
|
||||
- [-1, 1, SPPELAN, [512, 256]] # 29
|
||||
|
||||
# gelan head
|
||||
head:
|
||||
- [-1, 1, nn.Upsample, [None, 2, 'nearest']]
|
||||
- [[-1, 25], 1, Concat, [1]] # cat backbone P4
|
||||
- [-1, 1, RepNCSPELAN4, [512, 512, 256, 2]] # 32
|
||||
|
||||
- [-1, 1, nn.Upsample, [None, 2, 'nearest']]
|
||||
- [[-1, 22], 1, Concat, [1]] # cat backbone P3
|
||||
- [-1, 1, RepNCSPELAN4, [256, 256, 128, 2]] # 35 (P3/8-small)
|
||||
|
||||
- [-1, 1, ADown, [256]]
|
||||
- [[-1, 32], 1, Concat, [1]] # cat head P4
|
||||
- [-1, 1, RepNCSPELAN4, [512, 512, 256, 2]] # 38 (P4/16-medium)
|
||||
|
||||
- [-1, 1, ADown, [512]]
|
||||
- [[-1, 29], 1, Concat, [1]] # cat head P5
|
||||
- [-1, 1, RepNCSPELAN4, [512, 1024, 512, 2]] # 41 (P5/32-large)
|
||||
|
||||
# segment
|
||||
- [[35, 38, 41], 1, Segment, [nc, 32, 256]] # Segment (P3, P4, P5)
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
# YOLOv9
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# YOLOv9e
|
||||
# 1225 layers, 58206592 parameters, 193.0 GFLOPs
|
||||
|
||||
# parameters
|
||||
nc: 80 # number of classes
|
||||
|
|
|
|||
|
|
@ -364,6 +364,7 @@ class Annotator:
|
|||
cv2.circle(self.im, (int(track[-1][0]), int(track[-1][1])), track_thickness * 2, color, -1)
|
||||
|
||||
def queue_counts_display(self, label, points=None, region_color=(255, 255, 255), txt_color=(0, 0, 0), fontsize=0.7):
|
||||
"""Displays queue counts on an image centered at the points with customizable font size and colors."""
|
||||
x_values = [point[0] for point in points]
|
||||
y_values = [point[1] for point in points]
|
||||
center_x = sum(x_values) // len(points)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue