Real-time Meta SAM 3 in native Rust on NVIDIA GPUs (CUDA) and Apple silicon (Metal): text, box and click segmentation and video tracking, up to 93x faster than PyTorch
//! NVTX ranges, so nsys timelines split by pipeline stage. Without the `nvtx` feature
//! they compile to nothing
usestd::ffi::CStr;#[cfg(feature ="nvtx")]unsafeextern"C"{fnsam3rs_nvtx_push(name:*conststd::ffi::c_char);fnsam3rs_nvtx_pop();}/// Open range; it closes when dropped
pubstructRange(());/// Opens a range named `name` on the calling thread
pubfnrange(name:&CStr)-> Range{#[cfg(feature ="nvtx")]unsafe{sam3rs_nvtx_push(name.as_ptr())};#[cfg(not(feature ="nvtx"))]let_= name;
Range(())}#[cfg(feature ="nvtx")]implDrop forRange{fndrop(&mutself){unsafe{sam3rs_nvtx_pop()};}}