[Example] YOLO-Series(v5-11) ONNXRuntime Rust (#17311)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Jamjamjon 2024-11-02 20:06:07 +08:00 committed by GitHub
parent d28caa9a58
commit f95dc37311
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 362 additions and 29 deletions

View file

@ -8,7 +8,7 @@ use rand::{thread_rng, Rng};
use std::path::PathBuf;
use crate::{
load_font, gen_time_string, non_max_suppression, Args, Batch, Bbox, Embedding, OrtBackend,
gen_time_string, load_font, non_max_suppression, Args, Batch, Bbox, Embedding, OrtBackend,
OrtConfig, OrtEP, Point2, YOLOResult, YOLOTask, SKELETON,
};
@ -40,7 +40,7 @@ impl YOLOv8 {
OrtEP::CUDA(config.device_id)
} else {
OrtEP::CPU
};
};
// batch
let batch = Batch {
@ -463,7 +463,7 @@ impl YOLOv8 {
image::Rgb(self.color_palette[bbox.id()].into()),
bbox.xmin() as i32,
(bbox.ymin() - legend_size as f32) as i32,
legend_size as f32,
legend_size as f32,
&font,
&legend,
);