Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jamjamjon authored Sep 15, 2024
1 parent 49c60e5 commit ae60775
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,13 @@ cargo run -r --example yolo # blip, clip, yolop, svtr, db, ...
- #### Follow the pipeline
- Build model with the provided `models` and `Options`
- Load Images, Video and Stream with `DataLoader`
- Load images, video and stream with `DataLoader`
- Do inference
- Annotate Inference Results with `Annotator`
- Annotate inference results with `Annotator`
- Retrieve inference results from `Vec<Y>`
```rust
use usls::{models::YOLO, Annotator, DataLoader, Options, Vision, YOLOTask, YOLOVersion};
use usls::{models::YOLO, Annotator, DataLoader, Nms, Options, Vision, YOLOTask, YOLOVersion};
fn main() -> anyhow::Result<()> {
// Build model with Options
Expand Down Expand Up @@ -160,6 +161,24 @@ cargo run -r --example yolo # blip, clip, yolop, svtr, db, ...
for (xs, _) in dl {
let ys = model.forward(&xs, false)?;
annotator.annotate(&xs, &ys);
// Retrieve inference results
for y in ys {
// bboxes
if let Some(bboxes) = y.bboxes() {
for bbox in bboxes {
println!(
"Bbox: {}, {}, {}, {}, {}, {}",
bbox.xmin(),
bbox.ymin(),
bbox.xmax(),
bbox.ymax(),
bbox.confidence(),
bbox.id(),
);
}
}
}
}
Ok(())
Expand Down

0 comments on commit ae60775

Please sign in to comment.