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:
10
examples/picodet-layout/README.md
Normal file
10
examples/picodet-layout/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
## Quick Start
|
||||
|
||||
```shell
|
||||
cargo run -r --example picodet-layout
|
||||
```
|
||||
|
||||
|
||||
## Results
|
||||
|
||||

|
31
examples/picodet-layout/main.rs
Normal file
31
examples/picodet-layout/main.rs
Normal file
@ -0,0 +1,31 @@
|
||||
use anyhow::Result;
|
||||
use usls::{models::PicoDet, Annotator, DataLoader, Options};
|
||||
|
||||
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();
|
||||
|
||||
// options
|
||||
let options = Options::picodet_layout_1x()
|
||||
// picodet_l_layout_3cls()
|
||||
// picodet_l_layout_17cls()
|
||||
.commit()?;
|
||||
let mut model = PicoDet::new(options)?;
|
||||
|
||||
// load
|
||||
let xs = [DataLoader::try_read("images/academic.jpg")?];
|
||||
|
||||
// annotator
|
||||
let annotator = Annotator::default()
|
||||
.with_bboxes_thickness(3)
|
||||
.with_saveout(model.spec());
|
||||
|
||||
// run
|
||||
let ys = model.forward(&xs)?;
|
||||
println!("{:?}", ys);
|
||||
annotator.annotate(&xs, &ys);
|
||||
|
||||
Ok(())
|
||||
}
|
Reference in New Issue
Block a user