赞
踩
- git clone https://github.com/ultralytics/yolov5
- cd yolov5
- pip install -r requirements.txt
- import torch
-
- # Model
- model = torch.hub.load('ultralytics/yolov5', 'yolov5s') # or yolov5m, yolov5x, custom
-
- # Images
- img = 'https://ultralytics.com/images/zidane.jpg' # or file, PIL, OpenCV, numpy, multiple
-
- # Inference
- results = model(img)
-
- # Results
- results.print() # or .show(), .save(), .crop(), .pandas(), etc.
- $ python detect.py --source 0 # webcam
- file.jpg # image
- file.mp4 # video
- path/ # directory
- path/*.jpg # glob
- 'https://youtu.be/NUsoVlDFqZg' # YouTube video
- 'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。