danielgatis / rembg

Rembg is a tool to remove images background
MIT License
16.46k stars 1.84k forks source link

SAM model returns inversed #647

Closed francois-dibulo closed 1 month ago

francois-dibulo commented 3 months ago

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

Thank you!

Rembg version: v2.0.57

github-actions[bot] commented 2 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 month ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

StokedOnIt commented 1 month ago

Was this issue solved as I am experiencing the same problem?

francois-dibulo commented 1 month ago

Sadly never found a solution