mirror of
https://github.com/mii443/usls.git
synced 2025-08-22 15:45:41 +00:00
🐍 v0.1.0 (#53)
This commit is contained in:
@ -1,25 +1,26 @@
|
||||
use anyhow::Result;
|
||||
use usls::{models::RTMO, Annotator, DataLoader, Options, COCO_SKELETONS_16};
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
fn main() -> Result<()> {
|
||||
tracing_subscriber::fmt()
|
||||
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
|
||||
.with_timer(tracing_subscriber::fmt::time::ChronoLocal::rfc_3339())
|
||||
.init();
|
||||
|
||||
// build model
|
||||
let options = Options::default()
|
||||
.with_model("rtmo/s-dyn.onnx")?
|
||||
.with_nk(17)
|
||||
.with_confs(&[0.3])
|
||||
.with_kconfs(&[0.5]);
|
||||
let mut model = RTMO::new(options)?;
|
||||
let mut model = RTMO::new(Options::rtmo_s().commit()?)?;
|
||||
|
||||
// load image
|
||||
let x = [DataLoader::try_read("images/bus.jpg")?];
|
||||
let xs = [DataLoader::try_read("images/bus.jpg")?];
|
||||
|
||||
// run
|
||||
let y = model.run(&x)?;
|
||||
let ys = model.forward(&xs)?;
|
||||
|
||||
// annotate
|
||||
let annotator = Annotator::default()
|
||||
.with_saveout("RTMO")
|
||||
.with_saveout(model.spec())
|
||||
.with_skeletons(&COCO_SKELETONS_16);
|
||||
annotator.annotate(&x, &y);
|
||||
annotator.annotate(&xs, &ys);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user