Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "usls"
edition = "2021"
version = "0.2.0-alpha.3"
version = "0.2.0-alpha.4"
rust-version = "1.88"
description = "A Rust library integrated with ONNXRuntime, providing a collection of ML models."
repository = "https://github.com/jamjamjon/usls"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ cargo run -r -F openvino -F ort-load-dynamic --example yolo -- --device openvino

- <a href="https://jamjamjon.github.io/usls/">📖 <strong>Online Documentation</strong></a>
- <a href="https://docs.rs/usls/latest/usls/">📚 <strong>API Reference</strong></a>
- <a href="https://jamjamjon.github.io/usls/model-zoo/overview/">📦 <strong>Model Zoo</strong></a>
- <a href="./examples/README.md">🚀 <strong>Examples</strong></a>


Expand Down
2 changes: 1 addition & 1 deletion examples/background-removal/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn main() -> anyhow::Result<()> {
}
}?;

usls::perf(false);
usls::perf_chart();

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion examples/birefnet/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn main() -> Result<()> {
let config = args::config(&cli.args)?.commit()?;
run::<BiRefNet>(config, &cli.source, &annotator)?;

usls::perf(false);
usls::perf_chart();
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion examples/bytetrack/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ fn main() -> Result<()> {
}
}?;

usls::perf(false);
usls::perf_chart();
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion examples/depth-estimation/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn main() -> Result<()> {
}
}?;

usls::perf(false);
usls::perf_chart();

Ok(())
}
2 changes: 1 addition & 1 deletion examples/embedding/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn main() -> Result<()> {
}
}?;

usls::perf(false);
usls::perf_chart();
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion examples/gaze-estimation/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn main() -> Result<()> {
run::<YOLO, MobileGaze>(yolo_config, mobile_gaze_config, &cli, &annotator)
}
}?;
usls::perf(false);
usls::perf_chart();

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion examples/image-classification/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fn main() -> anyhow::Result<()> {
}
}?;

usls::perf(false);
usls::perf_chart();

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion examples/image-matting/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn main() -> Result<()> {
}
}?;

usls::perf(false);
usls::perf_chart();
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion examples/image-segmentation/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fn main() -> Result<()> {
run_sam3_tracker(config, &cli.source, args)
}
}?;
usls::perf(false);
usls::perf_chart();

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion examples/object-detection/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fn main() -> Result<()> {
run::<DFINE>(config, &cli.source, &annotator)
}
}?;
usls::perf(false);
usls::perf_chart();

Ok(())
}
2 changes: 1 addition & 1 deletion examples/ocr/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ fn main() -> Result<()> {
}
}?;

usls::perf(false);
usls::perf_chart();
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion examples/open-set-detection/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn main() -> Result<()> {
run::<OWLv2>(config, &cli.source, &annotator)
}
}?;
usls::perf(false);
usls::perf_chart();

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion examples/open-set-segmentation/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn main() -> Result<()> {
}
}

usls::perf(false);
usls::perf_chart();

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion examples/pose-estimation/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ fn main() -> Result<()> {
}
}?;

usls::perf(false);
usls::perf_chart();
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion examples/sapiens/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn main() -> Result<()> {
.display(),
))?;
}
usls::perf(false);
usls::perf_chart();

Ok(())
}
2 changes: 1 addition & 1 deletion examples/super-resolution/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn main() -> Result<()> {
}
}?;

usls::perf(false);
usls::perf_chart();

Ok(())
}
Expand Down
2 changes: 2 additions & 0 deletions examples/viewer/imshow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ fn main() -> anyhow::Result<()> {
viewer.write_video_frame(&images[0])?;
}
}
usls::perf_chart();
usls::perf_dashboard();

Ok(())
}
2 changes: 1 addition & 1 deletion examples/vlm/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn main() -> Result<()> {
}
}?;

usls::perf(false);
usls::perf_chart();
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion examples/yolo/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fn main() -> Result<()> {
}
}

usls::perf(false);
usls::perf_chart();

Ok(())
}
12 changes: 5 additions & 7 deletions src/annotator/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,20 +174,18 @@ impl Annotator {
/// # }
/// ```
pub fn annotate<T: Drawable>(&self, image: &Image, drawable: &T) -> anyhow::Result<Image> {
crate::elapsed_annotator!("annotate_total", {
let mut rgba8 = crate::elapsed_annotator!("RgbImage->RgbaImage", image.to_rgba8());
self.draw_inplace(&mut rgba8, drawable)?;
Ok(rgba8.into())
})
let mut rgba8 = crate::perf!("Annotator::rgb -> rgba", image.to_rgba8());
self.draw_inplace(&mut rgba8, drawable)?;
Ok(rgba8.into())
}

pub fn draw_inplace<T: Drawable>(
&self,
rgba8: &mut image::RgbaImage,
drawable: &T,
) -> anyhow::Result<()> {
let ctx = crate::elapsed_annotator!("context_creation", self.create_context());
crate::elapsed_annotator!("drawable_render", drawable.draw(&ctx, rgba8)?);
let ctx = crate::perf!("Annotator::create-ctx", self.create_context());
crate::perf!("Annotator::render", drawable.draw(&ctx, rgba8)?);
Ok(())
}

Expand Down
Loading