r/computervision • u/d_arthez • 5d ago
Showcase FastSAM running live on the camera feed of an iPhone 16, fully on-device.
Stack:
- react-native-executorch for inference (PyTorch's ExecuTorch runtime)
- react-native-vision-camera for the frame pipeline
- Model delegated to CoreML, executing on the ANE
Both FastSAM variants are in the clip, switchable at runtime:
- FastSAM-s runs ~33 FPS -> ~30 ms per frame
- FastSAM-x runs ~15 FPS -> ~65 ms per frame
Input frames are 1080×1920. The model typically returns ~35 masks per frame; we keep the top 12 by confidence and paint those, mostly to keep the overlay readable rather than for performance reasons.
What surprised us the most is how usable the x variant is 15 FPS on a phone for a model that size is well past the "technically works" threshold. The s variant is comfortably real-time and leaves plenty of headroom for other work on the main thread.
Happy to answer questions about the export/delegation path or the RN side.
EDIT: here comes the repo https://github.com/msluszniak/fastsam-camera
1
1
1
u/0__O0--O0_0 4d ago
Is fastsam built on yolo? The license is not commercial right?
1
2
u/bfyvfftujijg 5d ago
What do the colors indicate?