手机拍摄的图片像素是3072×4096,使用Yolov8训练,能不能修改imgsz这个超参数使输入的图片不压缩成640尺寸呢
然后通过detect.py对图像进行目标检测:
python detect.py --source ./data/image/bus.jpg
detect.py默认使用同目录下的yolov5s.pt 模型,如果想用其他的,可以用–weights 进行指定。
然后可以在yolov5/runs/detect目录下找到模型输出结果的文件夹 :
这是源码自带的bus.jpg识别效果:
在网上随便找了一张图片,下载试了效果也不错,同时Yolov5处理该图片时间只用了0.3s
python detect.py --source ./data/image/people.jpg