positive666 / yolo_research

based on yolo-high-level project (detect\pose\classify\segment\):include yolov5\yolov7\yolov8\ core ,improvement research ,SwintransformV2 and Attention Series. training skills, business customization, engineering deployment C
GNU General Public License v3.0
758 stars 146 forks source link

在YOLOv5中如何得到模型的推理时间(或者说FPS)? #91

Closed xingguang12 closed 1 year ago

xingguang12 commented 1 year ago

❔Question

通过执行如下命令得到模型推理时间吗? python val.py --data coco.yaml --img 640 --weight runs/train/exp1/weights/best.pt --task speed --batch-size 1 为什么不能通过执行detect.py在val数据集上得到模型的推理时间? 在我的实验下:通过detect.py得到的推理时间比通过val.py得到的推理时间要快很多(在我的数据集下要快30ms),这是什么原因呢? 我通过执行如下命令python val.py --data coco.yaml --img 640 --weight runs/train/exp1/weights/best.pt --task speed --batch-size 1所得到的mAP比通过训练得到的最好一轮的(best.pt)mAP要小? 非常抱歉耽误您的时间,万分感谢

Additional context

positive666 commented 1 year ago

1.你运行的验证代码的是计算时间需要和检测的计算方式是一样的,再者可以自行在验证推理上加入

  1. 验证数据集和你训练的best差一些也没关系,如果差很多就是你过拟合了 ,你要正则化系数调整,或者丰富你的数据集种类的数量
hukaick commented 1 year ago

佬 博客V8啥时候更新

positive666 commented 1 year ago

佬 博客V8啥时候更新

在开始更新了 不过比较慢

github-actions[bot] commented 1 year ago

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.