Add yolo v8 as an example (#541)

* Sketching yolo-v8.

* Get the model to load.

* yolo-v8 forward pass.

* Complete(?) the forward pass.

* Fix some shape issues.

* Add the missing padding.

* Process the predictions.
This commit is contained in:
Laurent Mazare
2023-08-21 18:40:09 +01:00
committed by GitHub
parent cc2d6cf2e0
commit de50e66af1
3 changed files with 862 additions and 0 deletions

View File

@ -199,6 +199,7 @@ pub fn main() -> Result<()> {
};
let image = (image.unsqueeze(0)?.to_dtype(DType::F32)? * (1. / 255.))?;
let predictions = model.forward(&image)?.squeeze(0)?;
println!("generated predictions {predictions:?}");
let image = report(&predictions, original_image, net_width, net_height)?;
image_name.set_extension("pp.jpg");
println!("writing {image_name:?}");