We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
burn_dino/crates/bevy_burn_dino/src/main.rs
Line 348 in 0a59eb7
} #[cfg(feature = "web")] mod web { use std::cell::RefCell; use image::{ DynamicImage, RgbImage, RgbaImage, }; use wasm_bindgen::prelude::*; thread_local! { pub static SAMPLE_RECEIVER: RefCell<Option<RgbImage>> = RefCell::new(None); } #[wasm_bindgen] pub fn frame_input(pixel_data: &[u8], width: u32, height: u32) { let rgba_image = RgbaImage::from_raw(width, height, pixel_data.to_vec()) .expect("failed to create RgbImage"); // TODO: perform video element -> burn's webgpu texture conversion directly // TODO: perform this conversion from tensors let dynamic_image = DynamicImage::ImageRgba8(rgba_image); let rgb_image: RgbImage = dynamic_image.to_rgb8(); SAMPLE_RECEIVER.with(|receiver| { *receiver.borrow_mut() = Some(rgb_image); }); } } #[derive(Resource)] struct DinoModel<B: Backend> { config: DinoVisionTransformerConfig, device: B::Device, model: Arc<Mutex<DinoVisionTransformer<B>>>, } #[derive(Resource)]
The text was updated successfully, but these errors were encountered:
mosure
No branches or pull requests
burn_dino/crates/bevy_burn_dino/src/main.rs
Line 348 in 0a59eb7
The text was updated successfully, but these errors were encountered: