Size of faces in B-side video source

Discussions about research, Faceswapping and things that don't fit in the other categories here.


Post Reply
User avatar
fssf
Posts: 3
Joined: Mon Nov 06, 2023 2:55 pm
Has thanked: 2 times

Size of faces in B-side video source

Post by fssf »

I have a question about the size of faces when extracting from B-side video source.
I found a similar answer from Mr. torzdf from a past question, but my English is not good enough to understand it.

But (for example) a 256px model takes faces at 256px regardless if they come from a low/high res source. Downsizing a 4K image to 256px will not retain any Downsizing a 4K image to 256px will not retain any more detail than using an image that was 256px to start with.

viewtopic.php?t=2824

Assuming the image is 1920x1080, the red box is 256x256 and the blue box is 128x128.
Don't worry about the quality. This is only a question about the size of the face. And I am sorry if I am fundamentally wrong.

Image

Image

Image

Image

1 is almost the ideal face size in that I think.
2 and 3 are fine with the face sticking out far from the box?
I think 4 is not good.

If I am right and I really need to use 4 (or 2 and 3), should I convert the video to 1080x720 or something else?

Thank you for reading my question.

Last edited by torzdf on Tue Nov 07, 2023 11:55 am, edited 1 time in total.
User avatar
torzdf
Posts: 2687
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 135 times
Been thanked: 628 times

Re: Size of faces in B-side video source

Post by torzdf »

If I understand correctly, I think you are talking about applying a 256px face on high resolution close-ups?

You are correct that close ups like these won't work as well as the face needs to be enlarged to fit into the frame. However, it is hard to say how much this will matter to you, and how bad it will look in the final swap.

Lowering the resolution of the final swap will definitely help, but again, this depends on your particular use case, and what is acceptable to you.

Really, all you can do is generate the swap at normal size and see if you are happy with the results. If you are not, then you can do one of 2 things:

  • Use something like FFMPEG / Handbrake to resize the video to a smaller size
  • Use the Output Scale in Faceswap when running convert to downsize the output there.

My word is final

User avatar
fssf
Posts: 3
Joined: Mon Nov 06, 2023 2:55 pm
Has thanked: 2 times

Re: Size of faces in B-side video source

Post by fssf »

Mr. torzdf, thanks for your answer. However, I may not have communicated my question well. (sorry for my bad english)

I think the answer you gave me is [ I don't know if I will be satisfied if I swap B's face with A's because it will magnify B's face and make it blurry ].

I know you have answered the same question a million times and I think I have read most of them.

My question is about the size of the face in the video file that is input to [Extract Setup>Data>Input Dir] during the first step, the extraction of B's face. And the image was representing the size of B face, not the size of A face.

You are correct that close ups like these won't work as well as the face needs to be enlarged to fit into the frame.

<- This means enlarging B's face, right?

However, it is hard to say how much this will matter to you, and how bad it will look in the final swap.
Lowering the resolution of the final swap will definitely help, but again, this depends on your particular use case, and what is acceptable to you.

<- I assume this answer also refers to the last [Convert>Frame Processing>Output Scale] ?

What I wanted to ask is, if the B face size is 4 (or 2 and 3), should I use a third party software to convert the video to 720p, etc. and make the face smaller in the previous step of [Extract Setup>Data>Input Dir] (before starting the faceswap software)? This is the question.

I would be happy to answer again if this question makes sense.

Last edited by torzdf on Wed Nov 08, 2023 11:21 pm, edited 2 times in total.
User avatar
torzdf
Posts: 2687
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 135 times
Been thanked: 628 times

Re: Size of faces in B-side video source

Post by torzdf »

fssf wrote: Tue Nov 07, 2023 3:11 pm

<- This means enlarging B's face, right?

You don't need to enlarge it, no. But you are correct that the face will be enlarged (or shrunk) to the correct size to fit in the final frame. The size of the model output is uniform (be that 128px, 256px, 512px etc.) The size of any face in a frame could be any size.

<- I assume this answer also refers to the last [Convert>Frame Processing>Output Scale] ?

Yes

fssf wrote: Tue Nov 07, 2023 3:11 pm

What I wanted to ask is, if the B face size is 4 (or 2 and 3), should I use a third party software to convert the video to 720p, etc. and make the face smaller in the previous step of [Extract Setup>Data>Input Dir] (before starting the faceswap software)? This is the question.

No, this is not necessary at all. Just feed the video you have into Faceswap and let the process take care of everything. There is no need to resize videos prior to the extraction (or convert) process.

My word is final

User avatar
fssf
Posts: 3
Joined: Mon Nov 06, 2023 2:55 pm
Has thanked: 2 times

Re: Size of faces in B-side video source

Post by fssf »

I was thinking that if B's face is larger than A's face, converting B's video smaller beforehand would speed up the process, but it looks like that's not necessary.

I'm glad I learned that. Thank you for your thoughtful answer.

Post Reply