mirror of
https://github.com/huggingface/candle.git
synced 2025-06-16 18:48:51 +00:00
20 lines
516 B
Rust
20 lines
516 B
Rust
use candle_transformers::models::segment_anything::sam;
|
|
use wasm_bindgen::prelude::*;
|
|
|
|
pub use sam::{Sam, IMAGE_SIZE};
|
|
|
|
#[wasm_bindgen]
|
|
extern "C" {
|
|
// Use `js_namespace` here to bind `console.log(..)` instead of just
|
|
// `log(..)`
|
|
#[wasm_bindgen(js_namespace = console)]
|
|
pub fn log(s: &str);
|
|
}
|
|
|
|
#[macro_export]
|
|
macro_rules! console_log {
|
|
// Note that this is using the `log` function imported above during
|
|
// `bare_bones`
|
|
($($t:tt)*) => ($crate::log(&format_args!($($t)*).to_string()))
|
|
}
|