TinySAM icon indicating copy to clipboard operation
TinySAM copied to clipboard

TinySAM multimask_output parameter

Open Riley-livingston opened this issue 1 year ago • 0 comments

Hello, I'm trying to use TinySAM with the output of RTMDet as bounding box prompts.

I came across the issue of the 'multimask_output' parameter in the 'predict' method of mask_predictor not being recognized. Is the name of this parameter different, or does it not need to be specified? I believe that it's by default set to True in the foundation model.

TypeError                              Traceback (most recent call last)
[<ipython-input-28-1a43b775f4cb>](https://localhost:8080/#) in <cell line: 50>()
     48 logging.basicConfig(level=logging.INFO)
     49 image_path = "/content/drive/MyDrive/YOLOv5_Images/4lqw42gnjq1c1.webp"  # Replace with your image path
---> 50 segment_and_display_objects(image_path, rtmdet_model, mask_predictor, threshold=0.5, mask_threshold=0.3)

[<ipython-input-28-1a43b775f4cb>](https://localhost:8080/#) in segment_and_display_objects(image_path, rtmdet_model, mask_predictor, threshold, mask_threshold)
     24         if score > threshold:
     25             mask_predictor.set_image(original_img_bgr)
---> 26             masks, _, _ = mask_predictor.predict(box=bbox, multimask_output=True)
     27 
     28             if len(masks) >= 3:

TypeError: SamPredictor.predict() got an unexpected keyword argument 'multimask_output'

Riley-livingston avatar Dec 28 '23 18:12 Riley-livingston

Hi, the 'multimask_output' is True by default, there is no need to be specified. You can just remove 'multimask_output=True' in Line 26.

shuh15 avatar Dec 29 '23 02:12 shuh15