如何推理一张图片
todesti2 opened this issue · comments
Prerequisite
- I have searched the existing and past issues but cannot get the expected help.
- I have read the FAQ documentation but cannot get the expected help.
- The bug has not been fixed in the latest version.
💬 Describe the reimplementation questions
我想推理一张测试图片,但是找不到相关文件来执行
Environment
pytorch
Expected results
No response
Additional information
No response
类似
python tools/test.py configs/yolov8/yolov8_s_syncbn_fast_8xb16-500e_psvoc.py work_dirs/yolov8_s_syncbn_fast_8xb16-500e_psvoc/best_pascal_voc_mAP_epoch_110.pth --show-dir show_results
见 https://mmyolo.readthedocs.io/zh-cn/latest/get_started/15_minutes_object_detection.html
有推理验证集的方法和deploy模型的方法。
类似 python tools/test.py configs/yolov8/yolov8_s_syncbn_fast_8xb16-500e_psvoc.py work_dirs/yolov8_s_syncbn_fast_8xb16-500e_psvoc/best_pascal_voc_mAP_epoch_110.pth --show-dir show_results
见 https://mmyolo.readthedocs.io/zh-cn/latest/get_started/15_minutes_object_detection.html 有推理验证集的方法和deploy模型的方法。
好嘞!!感谢您帮助我!!我马上去尝试一下
类似 python tools/test.py configs/yolov8/yolov8_s_syncbn_fast_8xb16-500e_psvoc.py work_dirs/yolov8_s_syncbn_fast_8xb16-500e_psvoc/best_pascal_voc_mAP_epoch_110.pth --show-dir show_results
见 https://mmyolo.readthedocs.io/zh-cn/latest/get_started/15_minutes_object_detection.html 有推理验证集的方法和deploy模型的方法。
您好!它这个不能指定单张图片进行推理的吗
可以啊,链接内容最下面就是啊
python projects/easydeploy/tools/image-demo.py \
data/cat/images/IMG_20210728_205117.jpg \
configs/yolov5/yolov5_s-v61_fast_1xb12-40e_cat.py \
work_dirs/yolov5_s-v61_fast_1xb12-40e_cat/end2end.onnx \
--device cpu
--device cpu
噢噢,这个是得转换成onnx模型才能用来推理一张非验证集的图片嘛
指点谈不上,我没用Python推理过,我一般转TensorRT然后用C++。
如果你使用的是我提到那个方法,
在image-demo.py
里有一个函数
cv2.putText(
bgr,
name, (bbox[0], bbox[1] - 2),
cv2.FONT_HERSHEY_SIMPLEX,
2.0, [225, 255, 255],
thickness=3)
你可以搜一下形参代表含义,应该有颜色,字体,字号,粗细等,尝试修改一下
您好!我调小了puttext,但是它变得非常模糊,我该怎么办呢
这不是模糊了,粗细没调,太粗了导致看起来是一大坨
您好!我调小了puttext,但是它变得非常模糊,我该怎么办呢
这不是模糊了,粗细没调,太粗了导致看起来是一大坨
原来如此!谢谢您的指点!!~~我马上去了解❤
为什么速度这么慢,比用yolov5慢好多好多