Skip to content

Commit

Permalink
Fix missing namespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelmenges committed Feb 4, 2025
1 parent dd2fe85 commit 7219807
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/wasm-emscripten/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub extern "C" fn detect_objects(ptr: *const u8, width: u32, height: u32) {
.commit_from_memory(&model)
.expect("Cannot commit model.");

let image_data = unsafe { slice::from_raw_parts(ptr, (width * height * 4) as usize).to_vec() }; // Copy via .to_vec might be not necessary as memory lives long enough.
let image_data = unsafe { std::slice::from_raw_parts(ptr, (width * height * 4) as usize).to_vec() }; // Copy via .to_vec might be not necessary as memory lives long enough.
let image = image::ImageBuffer::<image::Rgba<u8>, Vec<u8>>::from_raw(width, height, image_data).expect("Cannot parse input image.");
let image640 = image::imageops::resize(&image, 640, 640, image::imageops::FilterType::CatmullRom);
let tensor =
Expand Down

0 comments on commit 7219807

Please sign in to comment.