I've recently redone my entire folder structure because it made more sense to keep all the files organised that way. I was wondering how other people have set up their workspace directories to work with Faceswap efficiently. This is my what my workspace and workflow look like:
Workspace
Code: Select all
C:\
├── code
│ ├── faceswap
│ └── <my other GitHub repositories>
└── faceswap
├── actors
│ ├── jay_pharoah
│ │ ├── trainset
│ │ │ ├── interview_jimmy_010810_0.png
│ │ │ ├── interview_larry_004230_0.png
│ │ │ ├── interview_steve_005040_0.png
│ │ │ └── <all the aligned faces are here>
│ │ ├── trainset.json
│ │ ├── interview_jimmy.mp4
│ │ ├── interview_jimmy_alignments.json
│ │ ├── interview_larry.mp4
│ │ ├── interview_larry_alignments.json
│ │ ├── interview_steve.mp4
│ │ └── interview_steve_alignments.json
│ ├── chris_rock
│ ├── eddie_murphy
│ ├── kevin_hart
│ └── <other personalities>
├── conversions
│ ├── chris_rock__jay_pharoah
│ │ ├── fit_model
│ │ ├── trainset
│ │ │ ├── scene_1_000009_0.png
│ │ │ └── <all the aligned faces are here>
│ │ ├── trainset.json
│ │ ├── fit_training.fsw
│ │ ├── scene_1.mp4
│ │ ├── scene_1_converted.mp4
│ │ ├── scene_2.mp4
│ │ └── scene_2_converted.mp4
│ ├── eddie_murphy__jay_pharoah
│ ├── kevin_hart__jay_pharoah
│ └── <other swaps, written as B__A>
├── models
│ ├── _cai_dfl_sae
│ ├── chris_rock__jay_pharoah
│ │ ├── dfl_sae
│ │ ├── dfl_sae_snapshot_125001_iters
│ │ └── dfl_sae.fsw
│ ├── eddie_murphy__jay_pharoah
│ ├── kevin_hart__jay_pharoah
│ └── <other swaps, written as B__A>
├── projects
│ └── jay_pharoah_on_stevetv
│ ├── Jay_Pharoah_on_SteveTV.prproj
│ └── Jay_Pharoah_on_SteveTV.mp4
├── every.bat
├── flatten.bat
└── jobs.bat
Sourcing & Extraction
I download source material and rename them appropriately short, and move them into the correct actors subdirectory.
I run Extract on each source material, extracting roughly every 7 frames (my sources are usually 25fps or 30fps). I save the aligned faces to a trainset directory in the actor's directory.
I sort my faces and clean up each alignments file individually before I merge them together. I keep all alignment files, because sometimes I add more source material later and then I'll want to re-merge all my clean alignments.
I name this merged file trainset.json.
Training
I create a directory in models using naming convention face_b__face_A. I do this because I consider face_b to be the face donor, and face_a to be the host body. I put the donor face onto the host body, hence this naming convention (rather than the A>B convention Faceswap uses).
Inside that directory I create a subdirectory for the actual model. I use this nested approach because Faceswap clones the directories when it's making snapshots and I don't want to pollute my models directory.
I also save my training config here so I can start up training quickly after a reboot.
Conversion
I use the same naming convention as with my models.
Inside a swap's directory under conversions, I will save and extract a video I want to convert on. I extract all the frames from this video and save the aligned faces in a trainset subdirectory.
I clean up the alignments file.
I run the Manual Alignments tool on the convert video. This is really important for good quality swaps.
I delete all my aligned faces from the trainset directory.
I re-extract using the Extract Alignments tool. Now I have the aligned faces that match the manually edited alignments file.
I have a cloned directory of my trained model as well, on which I do fit training.
Finally, I use the aligned faces in trainset and the model in fit_model to do the conversion, creating the <filename>_converted.mp4 video.
Everything under projects can be considered post-processing. I stitch my converted videos together and perform some masking tasks to enhance the swap quality.
Scripts
I have a couple of scripts in the workspace root, mainly to move files around or create subsets. The jobs.bat file is to edit as needed, pasting in commands from Faceswap's Generate button to perform multiple jobs while I'm away from the computer.
What does your workspace look like?
Does it influence your workflow?