Skip to content

Commit 3bbc91c

Browse files
committed
docs: 📝 Clarify default source behavior and add source options table in README.
Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com>
1 parent 3d10e01 commit 3bbc91c

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ model.export(format="onnx")
5151
### Run Inference
5252

5353
```bash
54-
# With defaults (auto-detects yolo11n.onnx and assets/ folder)
54+
# With defaults (auto-downloads model and sample images)
5555
cargo run --release -- predict
5656

5757
# With explicit arguments
@@ -70,12 +70,12 @@ cargo run --release -- predict --model yolo11n.onnx --source video.mp4 --show --
7070
### Example Output
7171

7272
```
73-
WARNING ⚠️ 'source' argument is missing. Using default 'source=assets'.
73+
WARNING ⚠️ 'source' argument is missing. Using default images: https://ultralytics.com/images/bus.jpg, https://ultralytics.com/images/zidane.jpg
7474
Ultralytics 0.0.4 🚀 Rust ONNX CPU
7575
YOLO11 summary: 80 classes, imgsz=(640, 640)
7676
77-
image 1/2 assets/bus.jpg: 810x1080 4 persons, 1 bus, 27.3ms
78-
image 2/2 assets/zidane.jpg: 1280x720 2 persons, 1 tie, 24.9ms
77+
image 1/2 bus.jpg: 810x1080 4 persons, 1 bus, 27.3ms
78+
image 2/2 zidane.jpg: 1280x720 2 persons, 1 tie, 24.9ms
7979
Speed: 9.4ms preprocess, 26.1ms inference, 0.8ms postprocess per image at shape (1, 3, 720, 1280)
8080
💡 Learn more at https://docs.ultralytics.com/modes/predict
8181
```
@@ -100,14 +100,25 @@ cargo run --release -- predict --model <model.onnx> --source <source>
100100
| Option | Short | Description | Default |
101101
| ---------- | ----- | ------------------------------------------------ | -------------- |
102102
| `--model` | `-m` | Path to ONNX model file | `yolo11n.onnx` |
103-
| `--source` | `-s` | Input source (image, video, webcam index, or URL)| `assets` |
103+
| `--source` | `-s` | Input source (image, video, webcam index, or URL)| `Task dependent Ultralytics URL assets`|
104104
| `--conf` | | Confidence threshold | `0.25` |
105105
| `--iou` | | IoU threshold for NMS | `0.45` |
106106
| `--imgsz` | | Inference image size | `640` |
107107
| `--half` | | Use FP16 half-precision inference | `false` |
108108
| `--save` | | Save annotated images to runs/detect/predict | `false` |
109109
| `--show` | | Display results in a window | `false` |
110110

111+
**Source Options:**
112+
113+
| Source Type | Example Input | Description |
114+
| ----------- | ------------------------------- | ------------------------------------ |
115+
| Image | `image.jpg` | Single image file |
116+
| Directory | `images/` | Directory of images |
117+
| Glob | `images/*.jpg` | Glob pattern for images |
118+
| Video | `video.mp4` | Video file |
119+
| Webcam | `0`,`1` | Webcam index (0 = default webcam) |
120+
| URL | `https://example.com/image.jpg` | Remote image URL |
121+
111122
### As a Rust Library
112123

113124
Add to your `Cargo.toml`:

0 commit comments

Comments
 (0)