Color

class plugins.convert.color.avg_color.Color(config_file=None, config=None)

Bases: Adjustment

Adjust the mean of the color channels to be the same for the swap and old frame

Methods Summary

process(old_face, new_face, raw_mask)

Adjust the mean of the original face and the new face to be the same

run(old_face, new_face, raw_mask)

Perform selected adjustment on face

Methods Documentation

process(old_face: ndarray, new_face: ndarray, raw_mask: ndarray) ndarray

Adjust the mean of the original face and the new face to be the same

Parameters:
  • old_face (numpy.ndarray) – The original face

  • new_face (numpy.ndarray) – The Faceswap generated face

  • raw_mask (numpy.ndarray) – A raw mask for including the face area only

Returns:

The adjusted face patch

Return type:

numpy.ndarray

run(old_face, new_face, raw_mask)

Perform selected adjustment on face

process(old_face: ndarray, new_face: ndarray, raw_mask: ndarray) ndarray

Adjust the mean of the original face and the new face to be the same

Parameters:
  • old_face (numpy.ndarray) – The original face

  • new_face (numpy.ndarray) – The Faceswap generated face

  • raw_mask (numpy.ndarray) – A raw mask for including the face area only

Returns:

The adjusted face patch

Return type:

numpy.ndarray