yolov5s

Created on 20 Aug 2020  ·  4Comments  ·  Source: ultralytics/yolov5

❔Question

yolov5s is still have too many parameters for me. How should I change yolov5s.yaml to decrease parameters?(FPS is one of my evaluation.)

Additional context

Stale question

Most helpful comment

@linhaoqi027 maybe yolov5nano (yolov5n) can meet your requirements.

All 4 comments

@linhaoqi027 maybe yolov5nano (yolov5n) can meet your requirements.

where can i find it

@jinfagang I like it. @linhaoqi027 YOLOv5n does not exist, but you can modify the base YOLOv5 scaling constants to produce a smaller model here:
https://github.com/ultralytics/yolov5/blob/5e0b90de8f7782b3803fa2886bb824c2336358d0/models/yolov5s.yaml#L1-L5

If you reduce width_multiple by half for example, from 0.5 to 0.25, then your model will have about 1/4 the parameters, or 1.9M vs 7.5M for YOLOv5s.
python from n params module arguments 0 -1 1 1760 models.common.Focus [3, 16, 3] 1 -1 1 4672 models.common.Conv [16, 32, 3, 2] 2 -1 1 5088 models.common.BottleneckCSP [32, 32, 1] 3 -1 1 18560 models.common.Conv [32, 64, 3, 2] 4 -1 1 40640 models.common.BottleneckCSP [64, 64, 3] 5 -1 1 73984 models.common.Conv [64, 128, 3, 2] 6 -1 1 161152 models.common.BottleneckCSP [128, 128, 3] 7 -1 1 295424 models.common.Conv [128, 256, 3, 2] 8 -1 1 164608 models.common.SPP [256, 256, [5, 9, 13]] 9 -1 1 313088 models.common.BottleneckCSP [256, 256, 1, False] 10 -1 1 33024 models.common.Conv [256, 128, 1, 1] 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] 12 [-1, 6] 1 0 models.common.Concat [1] 13 -1 1 95104 models.common.BottleneckCSP [256, 128, 1, False] 14 -1 1 8320 models.common.Conv [128, 64, 1, 1] 15 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] 16 [-1, 4] 1 0 models.common.Concat [1] 17 -1 1 24000 models.common.BottleneckCSP [128, 64, 1, False] 18 -1 1 36992 models.common.Conv [64, 64, 3, 2] 19 [-1, 14] 1 0 models.common.Concat [1] 20 -1 1 78720 models.common.BottleneckCSP [128, 128, 1, False] 21 -1 1 147712 models.common.Conv [128, 128, 3, 2] 22 [-1, 10] 1 0 models.common.Concat [1] 23 -1 1 313088 models.common.BottleneckCSP [256, 256, 1, False] 24 [17, 20, 23] 1 115005 Detect [80, [[10, 13, 16, 30, 33, 23], [30, 61, 62, 45, 59, 119], [116, 90, 156, 198, 373, 326]], [64, 128, 256]] Model Summary: 191 layers, 1.93094e+06 parameters, 1.93094e+06 gradients, 4.8 GFLOPS

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings