Improved Usage example docstrings (#9075)

* Updated Usage examples

* Update detect.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update predict.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Glenn Jocher authored and GitHub committed 2022-08-22 01:06:29 +02:00
1 parent 0abae780b3
commit 06831aa9e9
10 files changed
+94 -61

No files matched your search

+18 -3
View File
@@ -1,9 +1,24 @@
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Run classification inference on file/dir/URL/glob
Run YOLOv5 classification inference on images, videos, directories, and globs.
Usage:
$ python classify/predict.py --weights yolov5s-cls.pt --source data/images/bus.jpg
Usage - sources:
$ python classify/predict.py --weights yolov5s.pt --source img.jpg # image
vid.mp4 # video
path/ # directory
'path/*.jpg' # glob
Usage - formats:
$ python classify/predict.py --weights yolov5s-cls.pt # PyTorch
yolov5s-cls.torchscript # TorchScript
yolov5s-cls.onnx # ONNX Runtime or OpenCV DNN with --dnn
yolov5s-cls.xml # OpenVINO
yolov5s-cls.engine # TensorRT
yolov5s-cls.mlmodel # CoreML (macOS-only)
yolov5s-cls_saved_model # TensorFlow SavedModel
yolov5s-cls.pb # TensorFlow GraphDef
yolov5s-cls.tflite # TensorFlow Lite
yolov5s-cls_edgetpu.tflite # TensorFlow Edge TPU
"""
import argparse