developmentseed / segment-anything-services

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

GPU enabled encoder torchserver #4

Closed rbavery closed 1 year ago

rbavery commented 1 year ago

This adds a Dockerfile for GPU image encoding. The README also covers instructions for CPU decoding and building a container for that, but this is still a WIP.

To test the image encoder on a GPU enabled system after building the container:

bash start_serve_encode_gpu.sh

and the you can run the test_endpoint.ipynb or curl http://127.0.0.1:8080/predictions/sam_vit_h_encode -T ./data/sample-img-fox.jpg

This GPU container can also be run on the cpu by removing the --gpu arg in start_serve_encode.sh