mirror of
https://github.com/mii443/usls.git
synced 2025-12-03 02:58:22 +00:00
0.1.0-beta.1 (#82)
This commit is contained in:
@@ -23,17 +23,22 @@ fn main() -> Result<()> {
|
||||
let mut model = Sapiens::new(options)?;
|
||||
|
||||
// load
|
||||
let x = [DataLoader::try_read("images/paul-george.jpg")?];
|
||||
let xs = DataLoader::try_read_n(&["images/paul-george.jpg"])?;
|
||||
|
||||
// run
|
||||
let y = model.forward(&x)?;
|
||||
let ys = model.forward(&xs)?;
|
||||
|
||||
// annotate
|
||||
let annotator = Annotator::default()
|
||||
.without_masks(true)
|
||||
.with_polygons_name(true)
|
||||
.with_saveout(model.spec());
|
||||
annotator.annotate(&x, &y);
|
||||
let annotator = Annotator::default();
|
||||
for (x, y) in xs.iter().zip(ys.iter()) {
|
||||
annotator.annotate(x, y)?.save(format!(
|
||||
"{}.jpg",
|
||||
usls::Dir::Current
|
||||
.base_dir_with_subs(&["runs", model.spec()])?
|
||||
.join(usls::timestamp(None))
|
||||
.display(),
|
||||
))?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user