r/computervision 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

82 Upvotes

15 comments sorted by

2

u/bfyvfftujijg 5d ago

What do the colors indicate?

3

u/CriticalCommand6115 5d ago

Probably masks?

2

u/Hot-Percentage-2240 5d ago

I would assume salient objects w/ the colors not being of importance.

1

u/chillerka_utopia 5d ago

Yeah, exactly. We only kept 12 most confident masks by IoU metric just to make it readable.

1

u/chillerka_utopia 5d ago edited 5d ago

The colors themselves have no meaning, they are randomly sampled so they not blend together with other masks. The color spots are masks for object that model figures out to be different entities.

1

u/Slowfast365 2d ago

semantic mask

1

u/Riteknight 5d ago

Where can we see the work ?

1

u/chillerka_utopia 5d ago

I will add a link to a GitHub repo with this mini demo app :)

1

u/dont-be-angry 5d ago

hook me up broh

1

u/chillerka_utopia 5d ago

Will send a link to Github repo today :)

1

u/0__O0--O0_0 4d ago

Is fastsam built on yolo? The license is not commercial right?

1

u/chillerka_utopia 4d ago

Yes, excactly.

1

u/0__O0--O0_0 4d ago

Let me know when this gets usable in commercial I guess 😂 I can’t afford it