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

GPU Encoder service, CPU decoder service to predict masks, notebook example to tie the two together #6

Closed rbavery closed 1 year ago

rbavery commented 1 year ago

sam_service

To test it out, follow the steps in the README, then run the test_endpoint.ipynb.

This addresses: https://github.com/developmentseed/segment-anything-geo/issues/1

The image encoder and decoder might be making assumptions about image resizing that we don't want for all image sizes, but we can change these optimizations later.

With this, the image encoder runs at about 10x speed of the CPU encoder in https://github.com/developmentseed/sam-service/pull/1, with 1 second per image on an average GPU (my 1080 Ti). There's further gains to be made I think by compiling with ONNX (lower lift) or TensorRT (higher lift).

cc @geohacker @srmsoumya @batpad

geohacker commented 1 year ago

@rbavery is there a specific reason to have encoder and decode run on separate services?