mirror of
https://github.com/mii443/usls.git
synced 2025-08-22 15:45:41 +00:00
- Added `Hub` for resource management - Updated `DataLoader` to support video and streaming - Updated `CI` - Replaced `println!` with `tracing` for logging
31 lines
766 B
Rust
31 lines
766 B
Rust
use usls::{
|
|
models::{Sapiens, SapiensTask},
|
|
Annotator, DataLoader, Options, BODY_PARTS_28,
|
|
};
|
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
// build
|
|
let options = Options::default()
|
|
.with_model("sapiens/seg-0.3b-dyn.onnx")?
|
|
.with_sapiens_task(SapiensTask::Seg)
|
|
.with_names(&BODY_PARTS_28)
|
|
.with_profile(false)
|
|
.with_i00((1, 1, 8).into());
|
|
let mut model = Sapiens::new(options)?;
|
|
|
|
// load
|
|
let x = [DataLoader::try_read("images/paul-george.jpg")?];
|
|
|
|
// run
|
|
let y = model.run(&x)?;
|
|
|
|
// annotate
|
|
let annotator = Annotator::default()
|
|
.without_masks(true)
|
|
.with_polygons_name(false)
|
|
.with_saveout("Sapiens");
|
|
annotator.annotate(&x, &y);
|
|
|
|
Ok(())
|
|
}
|