You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -678,6 +684,15 @@ cargo run --example video_inference \
678
684
--threshold "5.min_score=0.6" \
679
685
--threshold "4.min_anomaly_score=0.35"
680
686
687
+
# With custom overlay settings
688
+
cargo run --example video_inference \
689
+
--width 224 \
690
+
--height 224 \
691
+
--font-size-percentage 0.12 \
692
+
--stroke-width 3 \
693
+
--text-color 0x00FF00 \
694
+
--background-color 0x000000
695
+
681
696
# EIM mode (legacy)
682
697
cargo run --example video_inference -- --model path/to/your/model.eim
683
698
```
@@ -755,6 +770,58 @@ Grid cells:
755
770
756
771
The element will automatically detect the model type and emit appropriate messages. Thresholds can be set for both object detection (`min_score`) and anomaly detection (`min_anomaly_score`) blocks. See [Public API](#public-api-inference-output) for output details.
757
772
773
+
### Image Inference
774
+
Run the image inference example to process a single image file:
775
+
```bash
776
+
# Basic usage (FFI mode - default)
777
+
cargo run --example image_inference -- --image <path-to-image>
778
+
779
+
# With custom dimensions and overlay settings
780
+
cargo run --example image_inference \
781
+
--image input.jpg \
782
+
--width 224 \
783
+
--height 224 \
784
+
--font-size-percentage 0.12 \
785
+
--stroke-width 3 \
786
+
--text-color 0x00FF00 \
787
+
--background-color 0x000000
788
+
789
+
# Save output with overlay
790
+
cargo run --example image_inference \
791
+
--image input.jpg \
792
+
--output output_with_overlay.png \
793
+
--font-size-percentage 0.10
794
+
795
+
# EIM mode (legacy)
796
+
cargo run --example image_inference \
797
+
--model path/to/your/model.eim \
798
+
--image input.jpg
799
+
```
800
+
801
+
This will process a single image and display inference results. The example supports:
802
+
-**Input formats**: JPEG, PNG, and other formats supported by GStreamer
803
+
-**Output options**: Display with overlay or save to file with overlay
804
+
-**Overlay customization**: Font size percentage, stroke width, and text color
805
+
-**Model thresholds**: Same threshold support as video inference
0 commit comments