v853 YOLO v5 量化安装yoloV5
在量化yolov5 模型时,需要用onnx-simplifier转换模型,转换后的模型不一定可以用,需要验证一下。这里就使用 YOLOv5 源码提供的 detect.py 测试转换后的 onnx 模型;
3.1 安装yolo V5
git clone https://github.com/ultralytics/yolov5
cd yolov5
- 安装依赖
pip3 install -r requirements.txt
3.2 使用yolo v5源码中的detect.py测试onnxsim处理过的模型
cd yolov5
python3 detect.py --weights ../yolov5s-sim.onnx --source data/images/bus.jpg --conf-thres 0.5
- 处理结果如下
- 执行完后执行结果保存到
runs/detect/exp
- 可以看到输出结果还是非常精确的,模型确认没有问题
3.2.1如果执行上面操作过程中出现ImportError: cannot import name 'ParserError' from 'dateutil.parser'
错误的解决方案
pip3 install python-dateutil
pip3 install --upgrade python-dateutil