rembg icon indicating copy to clipboard operation
rembg copied to clipboard

SAM model returns inversed

Open francois-dibulo opened this issue 1 year ago • 0 comments

Describe the bug

I tried using the SAM model to remove the background and normally I get this result (using e.g. u2netp)

Screenshot 2024-06-30 at 14 48 43

With SAM I am getting the opposite: Screenshot 2024-06-30 at 14 44 18

To Reproduce Code:

  session = new_session("sam")
  sam_prompt = [{"type": "rectangle", "data": [0, 0, width, height], "label": 1}]
  res = remove(cvImage, session=session, sam_prompt=sam_prompt)

Input image

Screenshot 2024-06-30 at 14 52 20

Expected behavior

  • Any idea why SAM returns the opposite?
  • Where can I find more information on e.g. what the label property is doing?
  • For those kind of images, which model is the best?

Thank you!

Rembg version: v2.0.57

francois-dibulo avatar Jun 30 '24 12:06 francois-dibulo