Skip to main content

Face Changing in Real Time

Project description

Face Changing


Inspired by neural style and face detection, I combined these two together for face changing just for fun. neural style transfer adopted from fast-neural-style-keras only for inference, the original pretrained models are h5 format and I remove the loss net, convert weights to pb format.

weight file size
hdf5 66.4M
pb 7.4M


several arguments:

  • input type: should be image, video or camera(default)
  • style: neural style you want to use, choose from des, la, wave, mirror(default)
  • image path: if input type is image, then image path shoud be specified
  • video path: if input type is video, then video path should be specified
  • save path: where to save transferred image or video, not required.

note: video or camera, please press q to exit.

1. From Code

clone this repo, and cd to facechanging.

python facechanging/ -i image -img ./facechanging/images/Carlos_Moya.jpg -style wave -save ./facechanging/outputs/wave.png

python facechanging/ -i camera -style mirror -save ./facechanging/outputs/camera.mp4

python facechanging/ -i video -video ./facechanging/images/a.webm -style mirror -save ./facechanging/outputs/a_mirror.mp4

2. Install

pp install facechanging and open command line, just same as above, e.g.

facechanging -i image -img ./facechanging/images/a.jpg -style la -save ./facechanging/outputs/a_la.png



  • python >= 3.5
  • tensorflow >= 1.5.0
  • keras
  • opencv-python >= 4.0.0


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for facechanging, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size facechanging-1.1.0-py3-none-any.whl (31.7 MB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page