mirror of
https://github.com/huggingface/candle.git
synced 2025-06-15 02:16:37 +00:00
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:
@ -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:?}");
|
||||
|
Reference in New Issue
Block a user