personalrobotics / ada_feeding

Robot-assisted feeding demos and projects for the ADA robot
4 stars 4 forks source link

SegmentFromPoint: Speed Up (EfficientSAM) & Return Feedback #163

Closed amalnanavati closed 8 months ago

amalnanavati commented 8 months ago

Description

This PR makes two changes to SegmentFromPoint:

  1. Speeds it up: As documented in #134 , due to GPU throttling, SegmentAnything runs unreasonably slow on wheelchair power. This PR improves that by implementing EfficientSAM, which has a ~3x speedup relative to SAM.
  2. Returns feedback: When nothing changes on the web app, it is hard for users to know if something has crashed or is working but just thinking. Thus, this PR returns feedback from SegmentFromPoint (elapsed time), which is already supported in the web app.

With this combination, I feel bite selection is usable on wheelchair power (although of course further speedups would be welcome).

Note that I also tried FastSAM on the images in ada_feeding_perception/text/food_img, but got very inaccurate results. This might be because FastSAM segments the entire image, and then filters through returned masks using the seed point; it doesn't account for the seed point in segmentation. I also tried FastSAM's text prompting with prompts like "the bite of watermelon," "the apple," etc. on the test images and also got inaccurate results.

Testing procedure

On the real robot:

Before opening a pull request

Before Merging