Open okanduzyel opened 1 year ago
Hi,
I have got that prompt issue below:
Traceback (most recent call last): File "/Users/okanduzyel/Downloads/segment-anything/testWithPrompt.py", line 23, in <module> masks, _, _ = predictor.predict("brain tumor") File "/Users/okanduzyel/Downloads/segment-anything/segment_anything/predictor.py", line 139, in predict assert ( AssertionError: point_labels must be supplied if point_coords is supplied.
My code:
import cv2 import matplotlib.pyplot as plt import numpy as np import os import argparse from segment_anything import SamPredictor, sam_model_registry sam = sam_model_registry["vit_h"](checkpoint="/Users/okanduzyel/Downloads/segment-anything/sam_vit_h_4b8939.pth") predictor = SamPredictor(sam) image_path = '/Users/okanduzyel/Downloads/archive-2/Testing/glioma_tumor/image.jpg' #args.input img = cv2.imread(image_path) img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) predictor.set_image(img) masks, _, _ = predictor.predict("brain tumor")
Any idea?
It seems you use text as prompt "brain tumor" while the open-source SAM only support point or box now. The SAM support text is not available now.
Will the ability to use text for segmentation be open source?
Hi,
I have got that prompt issue below:
My code:
Any idea?