[Guide] Extraction - A Workflow

Want to know about the Faceswap's Face Extraction process? Got tips, ideas or just want to learn about how it all works? Then this is the place for you


Forum rules

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

This forum is for discussing tips and understanding the process involved for Extracting and preparing face sets for training a model in Faceswap.

If you have found a bug are having issues with the Extraction process not working, then you should post in the Extract Support forum.

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

User avatar
torzdf
Posts: 1844
Joined: Fri Jul 12, 2019 12:53 am
Answers: 136
Has thanked: 79 times
Been thanked: 371 times

Re: [Guide] Extraction - A Workflow

Post by torzdf »

manintan wrote: Tue Dec 01, 2020 11:30 am

Deleted my alignments file but still have the extracted faces. How do I make a new alignments file?

Not possible, I'm afraid.

Alignments files need to be generated from the source video.

My word is final


Tags:

User avatar
ipnesterov
Posts: 1
Joined: Fri Feb 26, 2021 11:33 pm
Has thanked: 2 times

Re: [Guide] Extraction - A Workflow

Post by ipnesterov »

kilroythethird wrote: Sat Aug 24, 2019 7:35 pm

@Vaca: If you see opencl and CPU options in sort you are using a old faceswap version. Update via "tools" -> "check for updates. Should also be a good bit faster after the update,

Нет. Я тоже не вижу этого!! Я обновил и даже переустановил.
Not. I don't see that either !! I updated and even reinstalled.Image


User avatar
torzdf
Posts: 1844
Joined: Fri Jul 12, 2019 12:53 am
Answers: 136
Has thanked: 79 times
Been thanked: 371 times

Re: [Guide] Extraction - A Workflow

Post by torzdf »

That option is no longer in the sort tool, as it is no longer required.

If you need to force sorting on CPU, then check all of the GPUs under the "Exclude GPU" option

My word is final


User avatar
Logry
Posts: 5
Joined: Tue Apr 20, 2021 9:45 am

Re: [Guide] Extraction - A Workflow

Post by Logry »

Hi, when I try to use the console mode for the extraction I use this command line :

Code: Select all

python faceswap.py extract -i ~/faceswap/src/old.webm -o ~/faceswap/faces/old

And I receive the following error message :

Code: Select all

Traceback (most recent call last):
  File "faceswap.py", line 5, in <module>
    from lib.cli import args
  File "/home/maxime/faceswap-2.0.0/lib/cli/args.py", line 11, in <module>
    from lib.utils import get_backend
  File "/home/maxime/faceswap-2.0.0/lib/utils.py", line 13, in <module>
    from pathlib import Path
ImportError: No module named pathlib

I want to do it console mode beacause the interface presented below doesn't show up when I start faceswap.


User avatar
torzdf
Posts: 1844
Joined: Fri Jul 12, 2019 12:53 am
Answers: 136
Has thanked: 79 times
Been thanked: 371 times

Re: [Guide] Extraction - A Workflow

Post by torzdf »

Are you definitely inside the faceswap environment? Pathlib is an explicit pre-requisite

My word is final


User avatar
Logry
Posts: 5
Joined: Tue Apr 20, 2021 9:45 am

Re: [Guide] Extraction - A Workflow

Post by Logry »

torzdf wrote: Sun Aug 01, 2021 10:01 am

Are you definitely inside the faceswap environment? Pathlib is an explicit pre-requisite

I opened the shell in the /home/ME/faceswap/ indeed.


User avatar
torzdf
Posts: 1844
Joined: Fri Jul 12, 2019 12:53 am
Answers: 136
Has thanked: 79 times
Been thanked: 371 times

Re: [Guide] Extraction - A Workflow

Post by torzdf »

Yeah, that's not being in the environment.

conda activate faceswap

My word is final


User avatar
cedenburn
Posts: 8
Joined: Sun Jan 02, 2022 3:11 am
Has thanked: 9 times

Re: [Guide] Extraction - A Workflow

Post by cedenburn »

Hello,

I have question about the sorting process. If there is another face in the frame with the face you are altering do you remove the frame SO NOT to confuse the computer. If so is the frame then not altered by the tool?

Thank you,
Chris


User avatar
torzdf
Posts: 1844
Joined: Fri Jul 12, 2019 12:53 am
Answers: 136
Has thanked: 79 times
Been thanked: 371 times

Re: [Guide] Extraction - A Workflow

Post by torzdf »

Not sure I entirely understand the question.

If you have an extracted face (512px extracted image) and your target face is front and center, but there is also another face in the same image, but they aren't front and center then that is fine, keep it. The other face will be masked out anyway.

My word is final


User avatar
robm19
Posts: 2
Joined: Thu Jan 27, 2022 10:45 pm
Been thanked: 1 time

Alignment landmarks - head turns from camera

Post by robm19 »

Hello
What do I do with alignment landmarks when head/facial features are not in camera view?

Example ... head turns right, right eye and eyebrow are no longer visible to the camera, but I still have the right eye and eyebrow landmark points.

Better detail: landmark points 17 through to 21 inclusive and landmark points 36 to 41 inclusive are present in the alignment even though those facial features are not visible to the camera.

Is it safe to delete them? Do I ignore them and let them "do whatever"? Do I stack them to the edge of the face?

Thank you very much in advance
ps I did search through the forum and did not find what I was looking for - if I missed it, please be kind enough to point me to it.

Image

Image


User avatar
bryanlyon
Site Admin
Posts: 695
Joined: Fri Jul 12, 2019 12:49 am
Answers: 42
Location: San Francisco
Has thanked: 3 times
Been thanked: 169 times
Contact:

Re: Alignment landmarks - head turns from camera

Post by bryanlyon »

robm19 wrote: Thu Jan 27, 2022 11:16 pm

Hello
What do I do with alignment landmarks when head/facial features are not in camera view?

Example ... head turns right, right eye and eyebrow are no longer visible to the camera, but I still have the right eye and eyebrow landmark points.

Specific landmark points really don't matter. We only use the overall alignment. If the face is properly centered and placed in the image (matching other images in the set) then you're fine to ignore it. If it isn't, you can try to put the landmarks approximately where they belong to correct the alignment or if you're just working on a training set, delete the misaaligned faces.


User avatar
robm19
Posts: 2
Joined: Thu Jan 27, 2022 10:45 pm
Been thanked: 1 time

Re: [Guide] Extraction - A Workflow

Post by robm19 »

Thank you! Makes sense 8-)


User avatar
what
Posts: 1
Joined: Sat Mar 12, 2022 7:44 pm

Re: [Guide] Extraction - A Workflow

Post by what »

Tutorial claims that the swapping process uses lots of memory but I'm finding odd behavior. It really doesn't use much system memory, pegs the CPU @ 50% and only uses the first GPU is finds. Is this expected normal behavior?


User avatar
torzdf
Posts: 1844
Joined: Fri Jul 12, 2019 12:53 am
Answers: 136
Has thanked: 79 times
Been thanked: 371 times

Re: [Guide] Extraction - A Workflow

Post by torzdf »

Inference is a single GPU task, so that is normal. It will use the amount of CPU it requires to process the data. Memory use is exponential. Lots of images = lots of memory use.

My word is final


Post Reply