developmentseed / segment-anything-services

Running segment-anything image embedding, prompting, and mask generation as torchserve services
Apache License 2.0
93 stars 10 forks source link

decode payloads for multi point and example foreground background points #25

Closed rbavery closed 11 months ago

rbavery commented 1 year ago

This adds prompting options for handling for multiple input points per one object (foreground only) and multiple points with one point per each object.

It also updates tests that show the expected return shapes and expected payloads for each type of prompt that is supported, see conftest.py

@Rub21 thanks a bunch for picking this back up! I moved much of the functionality to sam_serve/decode.py and updated the handlers accordingly. Can you give this a look and see if the new structure looks good?

still TODO

rbavery commented 11 months ago

hey @Rub21, is it ok if I factor your multi point work here into the python module in #32 after #32 is merged? Do you have any more commits to push here? I could start a new smaller PR to complete that work.

I think it will be a cleaner way to handle the logic than I initially started with all the functionality in the handlers.py files. Then we can more easily test this locally.

Rub21 commented 11 months ago

hey @rbavery ,Sure , you can refactor the code 🚀 !!

Rub21 commented 11 months ago

Good to merge this PR!!