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
24 lines
626 B
Rust
24 lines
626 B
Rust
use usls::{models::MODNet, Annotator, DataLoader, Options};
|
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
// build model
|
|
let options = Options::default()
|
|
.with_model("modnet/dyn-f32.onnx")?
|
|
.with_i00((1, 1, 4).into())
|
|
.with_i02((416, 512, 800).into())
|
|
.with_i03((416, 512, 800).into());
|
|
let mut model = MODNet::new(options)?;
|
|
|
|
// load image
|
|
let x = [DataLoader::try_read("images/liuyifei.png")?];
|
|
|
|
// run
|
|
let y = model.run(&x)?;
|
|
|
|
// annotate
|
|
let annotator = Annotator::default().with_saveout("MODNet");
|
|
annotator.annotate(&x, &y);
|
|
|
|
Ok(())
|
|
}
|