What does your workspace look like?

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


Locked
User avatar
Surrogator
Posts: 13
Joined: Sun Jul 14, 2019 11:39 pm
Has thanked: 2 times
Been thanked: 2 times

What does your workspace look like?

Post by Surrogator »

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

  1. I download source material and rename them appropriately short, and move them into the correct actors subdirectory.

  2. 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.

  3. 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.

  4. I name this merged file trainset.json.

Training

  1. 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).

  2. 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.

  3. I also save my training config here so I can start up training quickly after a reboot.

Conversion

  1. I use the same naming convention as with my models.

  2. 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.

  3. I clean up the alignments file.

  4. I run the Manual Alignments tool on the convert video. This is really important for good quality swaps.

  5. I delete all my aligned faces from the trainset directory.

  6. I re-extract using the Extract Alignments tool. Now I have the aligned faces that match the manually edited alignments file.

  7. I have a cloned directory of my trained model as well, on which I do fit training.

  8. Finally, I use the aligned faces in trainset and the model in fit_model to do the conversion, creating the <filename>_converted.mp4 video.

  9. 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?

User avatar
Kahubu
Posts: 2
Joined: Wed Jul 17, 2019 9:25 am
Has thanked: 1 time

Re: What does your workspace look like?

Post by Kahubu »

My Workflow is pretty simple, I think.

Find my source material, for each actor, I put them into Premiere Pro and line the scenes up, one after the other(I keep the full scene in, Including other actors that I don't want, so I can just plop the converted files on after, without cutting too much). Export them x2, extract in FS x2 (per actor). I extract every frame, I end up with about 10k-20k faces (not sure if this is too many? but I try to get a variety of interview, film/tv work, and high res pictures, which I also put into PP after the scenes)(need to learn how to extract from video and pictures and put into the same folder)

I'll then sort and delete all the faces of actors I don't want, which usually leaves me with about 5k-15k faces. Then I manually align. Takes me a while this part, as I've tried to get the alignments spot on as I've learned more about FS.

Then I'll extract every frame again from the aligned faces and then I'll start my training.

Every 100k iterations or so I'll convert to ffmpeg and see my results and carry on training, I save a config file of my train for ease. After I'm happy I'll then use the pillow writer to convert to png files and then take it into After Effects, fill in missing faces, add grain and sharpen etc. Export after that, roughly, of a 2-minute file, takes up to 30-40 minutes due to the grain and sharpen effects. (Unsharp mask can help with hard cuts on the edge of the faces if you haven't adjusted the mask in FS)

File Structure:
Actor Name

  • Source> Includes exported faces ready to be extraced. And will hold alignment files.

  • Sort> NameSource1> Includes the faces from the extract which I will sort and then delete from.

  • Extract> Extraced1> Hold all the extracted face

  • Models> Model1> Holds the model files.

  • Convert> 001i[/i]> Holds my finished ffmpeg for previews or my png faces.

  • Exports> Hold the finished files after being exported from editing softwares

Locked