Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jamjamjon authored Jun 6, 2024
1 parent 4fa1ed5 commit 1db1dfa
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,48 @@ let y = model.run(&x)?;
let annotator = Annotator::default().with_saveout("YOLOv8");
annotator.annotate(&x, &y);
```

#### 5. Get results
The inference outputs of provided models will be saved to `Vec<Y>`.

```Rust
pub struct Y {
probs: Option<Prob>,
bboxes: Option<Vec<Bbox>>,
keypoints: Option<Vec<Vec<Keypoint>>>,
mbrs: Option<Vec<Mbr>>,
polygons: Option<Vec<Polygon>>,
texts: Option<Vec<String>>,
masks: Option<Vec<Mask>>,
embedding: Option<Embedding>,
}
```


- You can get detection bboxes with `y.bboxes()`:
```Rust
let ys = model.run(&xs)?;
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(),
)
}
}
}
```
More `Bbox` methods here: `src/ys/bbox.rs`

- Other tasks results can be found at: `src/ys/y.rs`



</details>

0 comments on commit 1db1dfa

Please sign in to comment.