Alphamoon
Alphamoon
Sep 5, 2018 · 1 min read

We modified CycleGAN loss function by adding two additional penalty terms, which prevent the model from modifying the face in the image. To construct these terms we first detected faces in all training examples using OpenCV, and, based on the output, prepared binary masks that indicate the location of the face. The first penalty term is basically the mean absolute difference between Input_A and Generated_B multiplied by the binary mask, and the second term is analogical, but Input_B and Generated_A are taken.

    Alphamoon

    Written by

    Alphamoon

    Custom-tailored AI solutions