Page 1 of 1

Training from multiple sources - how to combine alignments?

Posted: Mon Jun 21, 2021 6:45 pm
by Replicon

So far, I've been combining source videos using Kdenlive, and then the "multiple alignment files" problem just goes away.

But now, I'm faced with a situation where I want to incorporate a new source into the pool of sources for an identity.

I'm not about to recombine the videos and redo the alignment work, so I figure there should be a way to just have it read multiple alignment files when training.

In the old guide screenshots, I can see there's a "merge" job on the alignments tool, but that doesn't seem to exist anymore.

I had assumed the right way was to just extract everything into the same directory and pass a list of alignment files to the training, but I was reminded the "alignments" option is deprecated.

So, this leads me to two questions:

1) What's the workflow for training from multiple sources (separate videos, for which I've meticulously adjusted separate alignment files)?

2) In general, how come 'train' doesn't actually need an alignment file input? I mean, it MUST need to know the landmarks/alignments for the frames, which it can't just infer from the extracted photos. Does it just infer the alignment file name from the name of the input directory? If so, how do we do multiple alignment files, if the "merge" tool doesn't exist anymore?


Re: Training from multiple sources - how to combine alignments?

Posted: Thu Jun 24, 2021 2:41 am
by sp13
  1. Put all the extracted face .png files (for one particular person) into one directory and use it as the training source

  2. Alignments are stored in header of the .png files

The alignment files are not used for training at all, so there is no way to read multiple files (or even one) and no need to merge them.


Re: Training from multiple sources - how to combine alignments?

Posted: Thu Jun 24, 2021 10:38 pm
by Replicon

Ahaaaaaaa, that was the missing piece! I didn't realize the alignments were actually stored in the png headers. Ok, the world makes sense again, thank you!


Re: Training from multiple sources - how to combine alignments?

Posted: Fri Jun 25, 2021 9:52 pm
by Replicon

Oh BTW, I just updated my script to support extracting from multiple sources to the same output directory, but it fails on the second iteration (second source), with:

ERROR: Output faces folder should be empty

Is this by design? Seems we should be able to use the tool to generate a faces folder for one person from multiple sources/alignments. I'll update my script to output them to a temporary location and move the contents to the real location to work around this.


Re: Training from multiple sources - how to combine alignments?

Posted: Sat Jun 26, 2021 9:24 am
by torzdf

Yeah, there are arguments for and against being able to extract to the same folder. The current system is a hangover from how Faceswap was originally built. However, from my point of view at least, the inconvenience of having to manually move faces into the same folder is outweighed by the risk of accidentally overwriting faces in an existing folder (if that makes sense).