Mask display during training / verify mask after extraction

If training is failing to start, and you are not receiving an error message telling you what to do, tell us about it here


Forum rules

Read the FAQs and search the forum before posting a new topic.

This forum is for reporting errors with the Training process. If you want to get tips, or better understand the Training process, then you should look in the Training Discussion forum.

Please mark any answers that fixed your problems so others can find the solutions.

Locked
User avatar
Fed
Posts: 16
Joined: Sat Jun 18, 2022 3:31 pm
Been thanked: 1 time

Mask display during training / verify mask after extraction

Post by Fed »

The preview I see during training makes me think some parts of the mask were not exported properly.
Or maybe my eyes deceive me due to bright vibrant colors of the parts where I expect to see the mask. Maybe the mask is just too transparent and neutral.

I checked the mask with Tools -> Manual and extracted again with Alignments -> Extract to make sure I'm not just using some old images from the time I didn't modify the mask.
And I still see the same problem in the preview during training - certain parts of the image don't have the mask. The image itself does have the mask, I see it. But not everywhere where it should.
Or maybe my eyes deceive me.

I use Bisenet-Fp mask everywhere - in the extract and training settings and when I check the mask manually (tools -> manual).
And in most preview images I have no problems spotting the mask. Including the other parts of the same images where I see the problem.
So I don't think I modified or exported the wrong mask.

Is there a way to change how mask is shown in the preview during training? Some config that's not in the gui settings? To make it more extreme like so I can make sure.

User avatar
torzdf
Posts: 2672
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 131 times
Been thanked: 625 times

Re: Mask display during training / verify mask after extraction

Post by torzdf »

No, but I could look to add this,

Can you share a screengrab illustrating what you mean?

My word is final

User avatar
Fed
Posts: 16
Joined: Sat Jun 18, 2022 3:31 pm
Been thanked: 1 time

Re: Mask display during training / verify mask after extraction

Post by Fed »

Sure, I'll roll the previews to get one that would illustrate.
Before I go do that I have to explain - it's not my proudest deepfake, but it's not as bad as it probably looks like. :D
(I can explain though the explanation isn't that interesting I think)

I attached two images.

First one (01.png) is the zoomed in preview during training. The green paint, the yellow paint and the violet paint should be masked out just like the hair, the background etc.
But I don't exactly see in on the Original (A) (which is the left part of the first image). I do see some parts of the mask on the A>A (the right part of the first image) - where where the yellow paint goes under the eye and on the nose.
I should be able to see some reddish remnants of the mask where the purple paint was, I think. But I don't.

The second image (02b.png) is what I see when I manually edit the mask. Not the exact frame - just to illustrate how I edited the mask in this case. I didn't find any frame that I missed and since I modified all of them the same way, I think it's relevant.

P.S. I never encountered this problem. Which could be related to the vibrant colors as I mentioned before. But also I just recently updated (less than a month ago?) and until recently I only used one version (from something like 9 month ago). Maybe that's relevant too.

Attachments
During manual mask editing (not exact frame match, but enough to demonstrate, I think)
During manual mask editing (not exact frame match, but enough to demonstrate, I think)
02b.png (240.66 KiB) Viewed 1898 times
Zoomed in preview during training
Zoomed in preview during training
01.png (71.19 KiB) Viewed 1898 times
User avatar
torzdf
Posts: 2672
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 131 times
Been thanked: 625 times

Re: Mask display during training / verify mask after extraction

Post by torzdf »

Ok, yes. I see the issue....

So a number of possibilities. It is very possible that you just can't see the mask because of the color contrast (as you said). Some kind of control would be useful for this kind of thing, I agree.

Some other possibilities that you may want to rule out.

  1. Are you definitely using the same mask type in training as the one you are editing in the manual tool? I have seen people get this mixed up before, so it is entirely possible.
  2. Did you re-extract your face images after updating the masks and saving them to the alignments file? This would need to be done following any mask edits, for the new masks to be placed in the alignments file (see here for when someone had a similar issue recently and I demonstrated the process was working as intended: viewtopic.php?p=8391#p8391)
Last edited by torzdf on Sun Feb 12, 2023 12:05 am, edited 2 times in total.

My word is final

User avatar
Fed
Posts: 16
Joined: Sat Jun 18, 2022 3:31 pm
Been thanked: 1 time

Re: Mask display during training / verify mask after extraction

Post by Fed »

Did you re-extract your face images after updating the masks and saving them to the alignments file?

Yeah, I did that. My workflow was a bit different (I extract with the masker checked for example).
But when I encountered the problem, after checking the masks with the manual tool I did extract the images again using the alignments and overwritten the images in the folder I use for training images.
And I did re-check - the training uses Bisenet-Fp Face and that's the same mask I edited manually.

I can also try to mess up the mask for testing purposes, to make extra-sure I did the process right. I'll try that.

User avatar
Fed
Posts: 16
Joined: Sat Jun 18, 2022 3:31 pm
Been thanked: 1 time

Re: Mask display during training / verify mask after extraction

Post by Fed »

So I did try to mess up the mask (one eye and a half of the mouth).
Looks like the process itself is fine - I see some of the results of messing up the masks.

On the 03 image of preview during training you can definitely see one eye masked out.
If you know what to expect - you can see a part of the mouth masked out. Although I'm really not sure if I would see that without the prior knowledge of what I did to the mask.
And I still can't see the the mask over yellow and violet paint.
So it's either the colors and brightness or some very weird bug during the extraction. The former is way more plausible than the latter. It would be easier to check if I could just change how the mask is shown in the preview, though. But then then again - it's a rare case , when you need something like this if I am to judge.

Attachments
manual mask messing up
manual mask messing up
04a.png (187.94 KiB) Viewed 1868 times
preview during training
preview during training
03.png (75.61 KiB) Viewed 1868 times
User avatar
torzdf
Posts: 2672
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 131 times
Been thanked: 625 times

Re: Mask display during training / verify mask after extraction

Post by torzdf »

Because I was feeling particularly generous (and I do see a use case for having this configurable), I have added config options to change the mask colour and opacity.

I appreciate that this would be more useful directly accessible from the preview window, but that is quite a bit more complex, so they have been placed in training configuration options:

mask_opts.jpg
mask_opts.jpg (124.68 KiB) Viewed 1837 times
preview_2023-02-13_14.27.30.jpg
preview_2023-02-13_14.27.30.jpg (159.61 KiB) Viewed 1837 times

My word is final

User avatar
Fed
Posts: 16
Joined: Sat Jun 18, 2022 3:31 pm
Been thanked: 1 time

Re: Mask display during training / verify mask after extraction

Post by Fed »

Cool.

And I totally agree - it would be an overkill to fit it into the preview window.

Locked