0.1.0-beta.1 (#82)

This commit is contained in:
Jamjamjon
2025-04-27 13:01:51 +08:00
committed by GitHub
parent aa25854f7f
commit 80468d9c83
174 changed files with 8413 additions and 6188 deletions

View File

@@ -12,17 +12,23 @@ fn main() -> Result<()> {
let mut model = RTDETR::new(options)?;
// load
let x = [DataLoader::try_read("./assets/bus.jpg")?];
let xs = DataLoader::try_read_n(&["./assets/bus.jpg"])?;
// run
let y = model.forward(&x)?;
println!("{:?}", y);
let ys = model.forward(&xs)?;
println!("{:?}", ys);
// annotate
let annotator = Annotator::default()
.with_bboxes_thickness(3)
.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(())
}