facebookresearch / segment-anything

The repository provides code for running inference with the SegmentAnything Model (SAM), links for downloading the trained model checkpoints, and example notebooks that show how to use the model.
Apache License 2.0
46.97k stars 5.56k forks source link

how to encode image same as like sam demo? #370

Open TapendraBaduwal opened 1 year ago

TapendraBaduwal commented 1 year ago

i am doing like this..but not getting mask

image = cv2.imread(file_location) predictor.set_image(image) image_embedding = predictor.get_image_embedding().cpu().numpy().tobytes() encoded=[base64.b64encode(image_embedding).decode('ascii')]

AlessandroMondin00 commented 1 year ago

Any news here?

qq846511277 commented 11 months ago

You can use np. load()