参考:
https://github.com/mindspore-lab/mindyolo
使用案例:
https://github.com/mindspore-lab/mindyolo/blob/master/GETTING_STARTED.md
安装:
pip install mindyolo
特别注意opencv-python、opencv-python-headless版本问题,不然会遇到ImportError: libGL.so.1: cannot open shared object file: No such file or directory等问题
代码
1)下载项目
git clone https://github.com/mindspore-lab/mindyolo
2)运行测试
模型权重下载:https://github.com/mindspore-lab/mindyolo/blob/master/MODEL_ZOO.md
测试这种命令形式用华为昇腾npu推理速度不算快
cd mindyolo
# Run with Ascend (By default)华为昇腾npu推理
python demo/predict.py --config ./configs/yolov7/yolov7.yaml --weight=/path_to_ckpt/WEIGHT.ckpt --image_path /path_to_image/IMAGE.jpg
# Run with GPU
python demo/predict.py --config ./configs/yolov7/yolov7.yaml --weight=/path_to_ckpt/WEIGHT.ckpt --image_path /path_to_image/IMAGE.jpg --device_target=GPU
## 我这里用的yolov7-tiny测试
python demo/predict.py --config ./configs/yolov7/yolov7-tiny.yaml --weight=../yolov7-tiny_300e_mAP375-d8972c94.ckpt --image_path ../17people.jpg --device_target=CPU
推理图片结果保存在runs_infer下