jhj0517 / sam2-playground

Playground Web UI using segment-anything-2 models from the Meta.
Apache License 2.0
13 stars 1 forks source link

How to flip mask for solid color? #4

Closed Askejm closed 2 weeks ago

Askejm commented 2 weeks ago

I would like to use this tool for quick green screens. I see there already is the solid color option, however this is only the object itself and not the background.

jhj0517 commented 2 weeks ago

Hi. You want the object to have a green background, right? Adding "Invert mask" option is a good idea. I'll work on that.

jhj0517 commented 2 weeks ago

@Askejm I've added "invert mask" option in #6,

image

it works fine on my test, can you check the latest version?

https://github.com/user-attachments/assets/1ff11c57-04a7-4dbb-b1cd-422beb89839c

Askejm commented 2 weeks ago

@jhj0517 Works great. Thank you so much! This is very useful, I use it for my video editing. While I'm at it, you could also consider borrowing some functionality from this tool, based on SAM1. I've used it a lot and the multi mask feature and inpainting is super useful. I'm hoping a tool of similar functionality can make it, but with SAM2!