IOPaint icon indicating copy to clipboard operation
IOPaint copied to clipboard

Do you support custom MASK?

Open Shi-Guang-0901 opened this issue 2 years ago • 5 comments

Hi,

Shi-Guang-0901 avatar Nov 05 '22 07:11 Shi-Guang-0901

You mean upload a mask image?

Sanster avatar Nov 05 '22 07:11 Sanster

yes, smearing with a brush is not accurate enough.

Shi-Guang-0901 avatar Nov 05 '22 08:11 Shi-Guang-0901

Agreed, manual mask image upload would be useful

strandborg avatar Nov 05 '22 11:11 strandborg

Yes, it is useful

Edwardpillwin avatar Nov 12 '22 05:11 Edwardpillwin

https://github.com/Sanster/lama-cleaner/releases/tag/0.26.0

Sanster avatar Nov 16 '22 04:11 Sanster

https://github.com/Sanster/lama-cleaner/releases/tag/0.26.0

Test use assets/dog.jpg, by "background". Hi, Is there anything I need to pay attention about mask images? I use the mask image from : segment-anything 1

it remove dog success , but it filled with other object there.

i find the mask image from [segment-anything] is a grayscale image, so i convert it to RGB, but it still works wrong. dog_cleanup (1) dog_cleanup

And if i use mak image from [lama-cleaner] download, it works very well.

SunSoul avatar May 10 '23 07:05 SunSoul

https://github.com/Sanster/lama-cleaner/releases/tag/0.26.0

Test use assets/dog.jpg, by "background". Hi, Is there anything I need to pay attention about mask images? I use the mask image from : segment-anything

it works wrong, remove dog success , but it filled with other object there. i find the mask image from [segment-anything] is a grayscale image, so i convert it to RGB, but it still works wrong.

maybe you can show some results to compare

Edwardpillwin avatar May 10 '23 08:05 Edwardpillwin

@SunSoul Can you share a picture of your results? If you directly use the results of segment-anything, the LaMa model's performance is indeed not good(The mask should be slightly larger than the target area to be inpainted.). To achieve better results, you need to perform a dilation operation on the mask result of segment-anything. https://github.com/Sanster/lama-cleaner/blob/37e9137ac70ef9021224a7c3037b21d35b835a01/lama_cleaner/plugins/interactive_seg.py#L68

By the way, segment-anything is already supported in lama-cleaner 1.1.1, here is a demo video. You can start server with following command line args:

--enable-interactive-seg --interactive-seg-model=vit_l  --interactive-seg-device=cpu

Sanster avatar May 10 '23 08:05 Sanster

@SunSoul Can you share a picture of your results? If you directly use the results of segment-anything, the LaMa model's performance is indeed not good(The mask should be slightly larger than the target area to be inpainted.). To achieve better results, you need to perform a dilation operation on the mask result of segment-anything.

https://github.com/Sanster/lama-cleaner/blob/37e9137ac70ef9021224a7c3037b21d35b835a01/lama_cleaner/plugins/interactive_seg.py#L68

By the way, segment-anything is already supported in lama-cleaner 1.1.1, here is a demo video. You can start server with following command line args:

--enable-interactive-seg --interactive-seg-model=vit_l  --interactive-seg-device=cpu

Just now I was re-editing the issue! I'll test it, thanks!

SunSoul avatar May 10 '23 08:05 SunSoul

https://github.com/Sanster/lama-cleaner/releases/tag/0.26.0

Test use assets/dog.jpg, by "background". Hi, Is there anything I need to pay attention about mask images? I use the mask image from : segment-anything it works wrong, remove dog success , but it filled with other object there. i find the mask image from [segment-anything] is a grayscale image, so i convert it to RGB, but it still works wrong.

maybe you can show some results to compare

Just now I was re-editing the issue, thanks!

SunSoul avatar May 10 '23 08:05 SunSoul

@Sanster works very well, thank you !

SunSoul avatar May 10 '23 09:05 SunSoul