ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.76k stars 16.35k forks source link

Why yolov3 and Yolov5s detection speed is not much different? #6052

Closed liang-jingyi closed 2 years ago

liang-jingyi commented 2 years ago

Search before asking

Question

It is well known that yolov3 and Yolov5s model parameters differ greatly.Why is there no significant difference in detection speed? My computer used yolov3 to detect each image in an average of 17.6ms. But yolov5s took an average of 13.8ms for each image. The input size is 640*640.

One more problem, I noticed that the current version completes yolov5-bifpn.yaml, but I don't see a bifpn function in common.py. Class Concat is no different from the previous version. I want to know where bifPN is set.

Please help me.Thank you.

Additional

No response

glenn-jocher commented 2 years ago

@liang-jingyi speeds depend on a variety of factors. See https://github.com/ultralytics/yolov5#pretrained-checkpoints for profiling results.

liang-jingyi commented 2 years ago

@glenn-jocher One more problem, I noticed that the current version completes yolov5-bifpn.yaml. But I don't see a bifpn function in common.py. Class Concat is no different from the previous version. I want to know where bifPN is set.

glenn-jocher commented 2 years ago

@liang-jingyi bifpn architecture is defined in the yaml itself.

liang-jingyi commented 2 years ago

@glenn-jocher Thanks for noticing. Actually,I want to know how bifPN can be realized in code

glenn-jocher commented 2 years ago

@liang-jingyi you can train a YOLOv5l BiFPN model simply with:

python train.py --weights yolov5l.pt --cfg yolov5-bifpn.yaml

You can adjust the scaling constants if you want smaller or larger models, i.e. n, s, m, l, x etc. https://github.com/ultralytics/yolov5/blob/dc54ed5763720ced4f6784552c47534af5413d45/models/hub/yolov5-bifpn.yaml#L5-L6

liang-jingyi commented 2 years ago

@glenn-jocher I know how to train this model. I want to know the bifPN underlying code, such as SPP, Bottleneck code in common.py Can you tell me where I can find bifpn.

glenn-jocher commented 2 years ago

@liang-jingyi I've already told you, the yaml contains the BiFPN head: https://github.com/ultralytics/yolov5/blob/dc54ed5763720ced4f6784552c47534af5413d45/models/hub/yolov5-bifpn.yaml#L27-L48

Zengyf-CVer commented 2 years ago

@liang-jingyi BiFPN does not exist as a specific function in YOLOv5. Its essence is an architectural form. You can find biFPN papers or blogs on the Internet and study it carefully.

github-actions[bot] commented 2 years ago

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!