From 9e0c13610fe0545a5b6a6fb8d0aff9a501adb243 Mon Sep 17 00:00:00 2001 From: Ultralytics Assistant <135830346+UltralyticsAssistant@users.noreply.github.com> Date: Thu, 2 May 2024 03:08:58 +0200 Subject: [PATCH] Fix Adobe DNG and ONNX Rust links (#11169) --- docs/en/modes/predict.md | 2 +- examples/YOLOv8-ONNXRuntime-Rust/README.md | 41 +++++++++------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/docs/en/modes/predict.md b/docs/en/modes/predict.md index c8ad07d4..96df24fd 100644 --- a/docs/en/modes/predict.md +++ b/docs/en/modes/predict.md @@ -406,7 +406,7 @@ The below table contains valid Ultralytics image formats. | Image Suffixes | Example Predict Command | Reference | |----------------|----------------------------------|-------------------------------------------------------------------------------| | `.bmp` | `yolo predict source=image.bmp` | [Microsoft BMP File Format](https://en.wikipedia.org/wiki/BMP_file_format) | -| `.dng` | `yolo predict source=image.dng` | [Adobe DNG](https://www.adobe.com/products/photoshop/extend.displayTab2.html) | +| `.dng` | `yolo predict source=image.dng` | [Adobe DNG](https://helpx.adobe.com/camera-raw/digital-negative.html) | | `.jpeg` | `yolo predict source=image.jpeg` | [JPEG](https://en.wikipedia.org/wiki/JPEG) | | `.jpg` | `yolo predict source=image.jpg` | [JPEG](https://en.wikipedia.org/wiki/JPEG) | | `.mpo` | `yolo predict source=image.mpo` | [Multi Picture Object](https://fileinfo.com/extension/mpo) | diff --git a/examples/YOLOv8-ONNXRuntime-Rust/README.md b/examples/YOLOv8-ONNXRuntime-Rust/README.md index 8961d9ce..9594700b 100644 --- a/examples/YOLOv8-ONNXRuntime-Rust/README.md +++ b/examples/YOLOv8-ONNXRuntime-Rust/README.md @@ -26,7 +26,7 @@ You can follow the instruction with `ort` doc or simply do this: On ubuntu, You can do like this: -``` +```bash vim ~/.bashrc # Add the path of ONNXRUntime lib @@ -65,25 +65,25 @@ yolo export model=yolov8m-seg.pt format=onnx simplify It will perform inference with the ONNX model on the source image. -``` +```bash cargo run --release -- --model --source ``` Set `--cuda` to use CUDA execution provider to speed up inference. -``` +```bash cargo run --release -- --cuda --model --source ``` Set `--trt` to use TensorRT execution provider, and you can set `--fp16` at the same time to use TensorRT FP16 engine. -``` +```bash cargo run --release -- --trt --fp16 --model --source ``` Set `--device_id` to select which device to run. When you have only one GPU, and you set `device_id` to 1 will not cause program panic, the `ort` would automatically fall back to `CPU` EP. -``` +```bash cargo run --release -- --cuda --device_id 0 --model --source ``` @@ -91,25 +91,25 @@ Set `--batch` to do multi-batch-size inference. If you're using `--trt`, you can also set `--batch-min` and `--batch-max` to explicitly specify min/max/opt batch for dynamic batch input.(https://onnxruntime.ai/docs/execution-providers/TensorRT-ExecutionProvider.html#explicit-shape-range-for-dynamic-shape-input).(Note that the ONNX model should exported with dynamic shapes) -``` +```bash cargo run --release -- --cuda --batch 2 --model --source ``` Set `--height` and `--width` to do dynamic image size inference. (Note that the ONNX model should exported with dynamic shapes) -``` +```bash cargo run --release -- --cuda --width 480 --height 640 --model --source ``` Set `--profile` to check time consumed in each stage.(Note that the model usually needs to take 1~3 times dry run to warmup. Make sure to run enough times to evaluate the result.) -``` +```bash cargo run --release -- --trt --fp16 --profile --model --source ``` Results: (yolov8m.onnx, batch=1, 3 times, trt, fp16, RTX 3060Ti) -``` +```bash ==> 0 [Model Preprocess]: 12.75788ms [ORT H2D]: 237.118µs @@ -145,7 +145,7 @@ And also: you can check out all CLI arguments by: -``` +```bash git clone https://github.com/ultralytics/ultralytics cd ultralytics/examples/YOLOv8-ONNXRuntime-Rust cargo run --release -- --help @@ -153,17 +153,19 @@ cargo run --release -- --help ## Examples +![Ultralytics YOLO Tasks](https://raw.githubusercontent.com/ultralytics/assets/main/im/banner-tasks.png) + ### Classification Running dynamic shape ONNX model on `CPU` with image size `--height 224 --width 224`. Saving plotted image in `runs` directory. -``` +```bash cargo run --release -- --model ../assets/weights/yolov8m-cls-dyn.onnx --source ../assets/images/dog.jpg --height 224 --width 224 --plot --profile ``` You will see result like: -``` +```bash Summary: > Task: Classify (Ultralytics 8.0.217) > EP: Cpu @@ -185,37 +187,28 @@ Summary: Masks: None, }, ] - ``` -![2023-11-25-22-02-02-156623351](https://github.com/jamjamjon/ultralytics/assets/51357717/ef75c2ae-c5ab-44cc-9d9e-e60b51e39662) - ### Object Detection Using `CUDA` EP and dynamic image size `--height 640 --width 480` -``` +```bash cargo run --release -- --cuda --model ../assets/weights/yolov8m-dynamic.onnx --source ../assets/images/bus.jpg --plot --height 640 --width 480 ``` -![det](https://github.com/jamjamjon/ultralytics/assets/51357717/5d89a19d-0c96-4a59-875c-defab6887a2c) - ### Pose Detection using `TensorRT` EP -``` +```bash cargo run --release -- --trt --model ../assets/weights/yolov8m-pose.onnx --source ../assets/images/bus.jpg --plot ``` -![2023-11-25-22-31-45-127054025](https://github.com/jamjamjon/ultralytics/assets/51357717/157b5ba7-bfcf-47cf-bee7-68b62e0de1c4) - ### Instance Segmentation using `TensorRT` EP and FP16 model `--fp16` -``` +```bash cargo run --release -- --trt --fp16 --model ../assets/weights/yolov8m-seg.onnx --source ../assets/images/0172.jpg --plot ``` - -![seg](https://github.com/jamjamjon/ultralytics/assets/51357717/cf046f4f-9533-478a-adc7-4de22443a641)