OneTrainer icon indicating copy to clipboard operation
OneTrainer copied to clipboard

[Feat]: Add the ability to invert batch generated masks.

Open crapthings opened this issue 1 year ago • 3 comments

Describe your use-case.

  • a toggle button that invert mask

learn background or learn foreground

i don't know if Unmasked probability, Unmasked Weight can do invert learning

What would you like to see as a solution?

image
ImageOps.Invert(input_image)

Have you considered alternatives? List them here.

No response

crapthings avatar Apr 09 '24 02:04 crapthings

I ran into needing this too as I'm trying to train the background. I'm going to try batch inverting via gimp or whatever to see if that'll work. I assume so.

pinballelectronica avatar Sep 17 '24 15:09 pinballelectronica

Please keep in mind masking likely does not work like either of you think it does, there are many many misconceptions about it, its not a replacement for cropping. To quote one of the former devs: "I find masked training is best when you've got a piece that trains harder than everything else in the image and you're trying to balance it. Does that apply to you? T"

O-J1 avatar Oct 13 '24 16:10 O-J1

I would still be interested in having this. Say you captioned image "backgrounds" (not the people behavior and appearance in it, but the setting they are in, landscape etc). Then it would make sense to generate an "inverted" mask with rembg to make it pick up on those parts of the image much faster. I guess one could work out a batch-workflow using imagemagick -negate or something similar to get the same effect, but it would be so much easier and less error prone this way.

gilga2024 avatar Nov 16 '24 21:11 gilga2024