add calculation for flops

This commit is contained in:
wa22 2024-06-03 11:21:49 +08:00
parent 587981fc27
commit 1539b5a678
2 changed files with 9 additions and 1 deletions

8
flops.py Normal file
View File

@ -0,0 +1,8 @@
from ultralytics import YOLOv10
model = YOLOv10('yolov10n.yaml')
model.model.model[-1].export = True
model.model.model[-1].format = 'onnx'
del model.model.model[-1].cv2
del model.model.model[-1].cv3
model.fuse()

View File

@ -496,7 +496,7 @@ class RTDETRDecoder(nn.Module):
class v10Detect(Detect): class v10Detect(Detect):
max_det = -1 max_det = 300
def __init__(self, nc=80, ch=()): def __init__(self, nc=80, ch=()):
super().__init__(nc, ch) super().__init__(nc, ch)