Tuesday, March 10, 2020

Do you want a custom deepfake?

Sorting - After erasing our faces, we need to delete data and synchronize files. The extractor does a good job of getting a face, but it's not perfect. He will have some false alarms, he won't even be able to see some faces and will also extract people who don't want to trade with us. If you enter a folder with your face, chances are that you have most of the exits that look like this (image on https://deepfake-porn.com/howto-custom-deepfake/).

Cleaning doesn't look fun! Luckily, we can make it easier. The fastest and easiest way to clean up our dataset is to sort faces in a meaningful order and then delete all the faces we don't want. The best sorting method for some distance is "face sorting".

NB: RAM-intensive facial sorting. He has to do a lot of calculations. I successfully tested the ordering of 22,000 faces on 8 GB RAM. If you need to sort more areas than can be stored in RAM, the process will automatically run to a much slower method. So, if you have limited RAM, you might want to divide the notes into smaller subsets.

Theoretically, the required RAM size is (n2 * 24) / 1.8, where n is the number of images. You also need to use another RAM to read (eg another program is running, the image is loaded into RAM), but theoretically this means that 30,000 images (300002 * 24) / 1.8 = 12,000,000,000 bytes or about 11 GB

In the GUI, navigate to the Tools tab and then the Sort tab.

Data - Here we select the veneer that we extracted in the previous sorting step.
Input: Enter the folder that contains your face extracted from the previous step.
Sort Settings - how we want to sort faces.
Sort by: put this in advance
You can ignore all other options in this section.

Results - How to display our sorted faces.
Last step: Make sure this is set to "Change name".
Note: Make sure this is not activated.

You can leave all other options untouched because it does not affect changing the task name.
Settings - Special sorting settings.
Backend: Optionally set to GPU. Do this only if you have a GPU and don't currently use your GPU for other machine training tasks (e.g. Training). This makes sorting much faster.
You can leave all other options unaffected.

Run - leave all other default options. We are now ready to review our options and release sorting.
You should get a screen similar to the one below.
Press Sort to begin the sorting process.
The process begins to read the person who built the identity. He will then group faces in the same way. The actual grouping process can take a long time because a lot of data must be calculated. Unfortunately, there is no visual feedback about progress. Be patient, please.

After finishing, you have to find 99% of people together. Now all you have to do is scroll through the face folder and delete faces that you don't want to save.

Clean File Alignment - Now we have removed all the faces we don't want and only have one set to do. We need to clean the alignment file. Why Because all the information about unwanted people is still contained in the file, this might cause problems in the future.

Cleaning the alignment file with built-in tools also has the added benefit that our faces are renamed to their original file names. So this is a profitable advantage.

Go to the Tools tab and then the Align tab.
Jobs - This is a list of all the targeting jobs available in the tool.
Select "Remove face".

Data - the location of the resource that we want to process.
Alignment file: Select the alignment file that is generated during the extraction process. It's in the same folder as the video where you extracted it, or in the image folder where you extracted it.

Face folder: Select the folder where you can extract faces as part of the extraction process (the same folder that you used to sort them).

Run - leave all other default options. We are now ready to review our options and clean up the alignment file.
You should get a screen similar to the one below.
Press Align and let the process finish.
After this is done, your face will be renamed back to its default name and unwanted faces will be deleted from your leveling file.

This process archives your old targeting file and places it next to the file you just created in its original location. It has the same name as your clean sync file, but "backup_ <timestamp>" was added at the end. If you are satisfied that your new targeting file is correct, you can safely delete this backup file.

At this point, if you take for conversions (or sets used for conversions and training), you can completely delete your face folder. None of these people is needed anymore. If you need to remake your surface, you can do it using the alignment tool (assignment instructions).