pull/13542/head
UltralyticsAssistant 2025-03-23 10:27:10 +00:00
parent 12317f704a
commit 5b12436818
1 changed files with 10 additions and 10 deletions

View File

@ -106,16 +106,16 @@ results.print() # or .show(), .save(), .crop(), .pandas(), etc.
`detect.py` runs inference on a variety of sources, downloading [models](https://github.com/ultralytics/yolov5/tree/master/models) automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases) and saving results to `runs/detect`.
```bash
python detect.py --weights yolov5s.pt --source 0 # webcam
python detect.py --weights yolov5s.pt --source img.jpg # image
python detect.py --weights yolov5s.pt --source vid.mp4 # video
python detect.py --weights yolov5s.pt --source screen # screenshot
python detect.py --weights yolov5s.pt --source path/ # directory
python detect.py --weights yolov5s.pt --source list.txt # list of images
python detect.py --weights yolov5s.pt --source list.streams # list of streams
python detect.py --weights yolov5s.pt --source 'path/*.jpg' # glob
python detect.py --weights yolov5s.pt --source 'https://youtu.be/LNwODJXcvt4' # YouTube
python detect.py --weights yolov5s.pt --source 'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream
python detect.py --weights yolov5s.pt --source 0 # webcam
python detect.py --weights yolov5s.pt --source img.jpg # image
python detect.py --weights yolov5s.pt --source vid.mp4 # video
python detect.py --weights yolov5s.pt --source screen # screenshot
python detect.py --weights yolov5s.pt --source path/ # directory
python detect.py --weights yolov5s.pt --source list.txt # list of images
python detect.py --weights yolov5s.pt --source list.streams # list of streams
python detect.py --weights yolov5s.pt --source 'path/*.jpg' # glob
python detect.py --weights yolov5s.pt --source 'https://youtu.be/LNwODJXcvt4' # YouTube
python detect.py --weights yolov5s.pt --source 'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream
```
</details>