-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用detect.py 和 hub 推理。 #15
Comments
👋 你好 @hshs0123, 如有任何问题,请首先检查你的运行指令有没有问题,如果指令没有问题,请尝试更新作者仓库的最新代码: # 如果没下载官方代码
$ git clone https://github.com/ultralytics/yolov5.git
$ cd yolov5
$ pip install -r requirements.txt # 如果已下载官方代码
$ cd yolov5
$ git reset --hard
$ git pull
$ pip install -r requirements.txt 更多请参考⭐️英文官方教程 依赖Python版本3.6或更高,python依赖库都在requirements.txt 里面,直接 环境下面是已经配置好环境的免费GPU训练环境:
|
python上我还没见过0ms的前后处理,只在C++上见过,你应该改过 |
重新下载了一下。 但结果似乎还是一样。肯定是最新的了。
上面全是直接照搬sample的。 ##############################
|
###################
|
|
|
E:\anaconda3\envs\pytorch\python.exe C:/yolov5-master/detect.py
detect: weights=C:/Users/10980/PycharmProjects/best.pt, source=runs/detect/exp25/zidane.jpg, imgsz=[640, 640], conf_thres=0.25, iou_thres=0.45, max_det=1000, device=0, view_img=True, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=runs/detect, name=exp, exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, half=False
YOLOv5 2021-9-21 torch 1.9.1 CUDA:0 (NVIDIA GeForce RTX 2080 Ti, 11264.0MB)
Fusing layers...
Model Summary: 224 layers, 7056607 parameters, 0 gradients, 16.3 GFLOPs
image 1/1 C:\yolov5-master\runs\detect\exp25\zidane.jpg: 384x640 2 person_heads, 2 person_vboxs, Done. (0.016s)
Speed: 0.0ms pre-process, 15.6ms inference, 0.0ms NMS per image at shape (1, 3, 640, 640)
Results saved to runs\detect\exp26
#############################################
E:\anaconda3\envs\pytorch\python.exe C:/Users/10980/PycharmProjects/msstestcapture.py
Using cache found in C:\Users\10980/.cache\torch\hub\ultralytics_yolov5_master
YOLOv5 2021-9-24 torch 1.9.1 CUDA:0 (NVIDIA GeForce RTX 2080 Ti, 11264.0MB)
Fusing layers...
Model Summary: 224 layers, 7266973 parameters, 0 gradients
Adding AutoShape...
image 1/1: 720x1280 2 persons, 2 ties
Speed: 15.6ms pre-process, 15.6ms inference, 0.0ms NMS per image at shape (1, 3, 384, 640)
Process finished with exit code 0
Run detect.py 为什么速度更快?同一张图片。看时间是跳过了pre-process.
Speed: 0.0ms pre-process, 15.6ms inference, 0.0ms NMS per image at shape (1, 3, 640, 640)
但是为什么hub 不是这样呢? 或者怎么提升这个速度呢?
谢谢!
E:\anaconda3\envs\pytorch\python.exe C:/Users/10980/PycharmProjects/msstestcapture.py
Using cache found in C:\Users\10980/.cache\torch\hub\ultralytics_yolov5_master
YOLOv5 2021-9-24 torch 1.9.1 CUDA:0 (NVIDIA GeForce RTX 2080 Ti, 11264.0MB)
Fusing layers...
Model Summary: 224 layers, 7266973 parameters, 0 gradients
Adding AutoShape...
image 1/1: 720x1280 2 persons, 2 ties
Speed: 15.6ms pre-process, 15.6ms inference, 0.0ms NMS per image at shape (1, 3, 384, 640)
The text was updated successfully, but these errors were encountered: