Converter for Faceswap
Converter(output_size, coverage_ratio, centering, draw_transparent, pre_encode, arguments, configfile=None)¶
The converter is responsible for swapping the original face(s) in a frame with the output of a trained Faceswap model.
- output_size (int) – The size of the face, in pixels, that is output from the Faceswap model
- coverage_ratio (float) – The ratio of the training image that was used for training the Faceswap model
- centering (str) – The extracted face centering that the model was trained on (“face” or “legacy”)
- draw_transparent (bool) – Whether the final output should be drawn onto a transparent layer rather than the original frame. Only available with certain writer plugins.
- pre_encode (python function) – Some writer plugins support the pre-encoding of images prior to saving out. As patching is done in multiple threads, but writing is done in a single thread, it can speed up the process to do any pre-encoding as part of the converter process.
- arguments (
argparse.Namespace) – The arguments that were passed to the convert process as generated from Faceswap’s command line arguments
- configfile (str, optional) – Optional location of custom configuration
Nonethen use the default config location. Default:
The command line arguments passed to the convert process
Main convert process.
Takes items from the in queue, runs the relevant adjustments, patches faces to final frame and outputs patched frame to the out queue.
- in_queue (
queue.Queue) – The output from
scripts.convert.Predictor. Contains detected faces from the Faceswap model as well as the frame to be patched.
- out_queue (
queue.Queue) – The queue to place patched frames into for writing by one of Faceswap’s
- in_queue (