Home

Awesome

StyleMatte: Adversarially-Guided Portrait Matting

[arXiv] [BibTeX] [Gitlab] [Demo]

PWC

<p align="left"> <img src="assets/swap.gif" width="70%" height="60%" /> </p><br/>

Model Zoo and Baselines

State fileSizeWhere to placeDownload
stylematte_pure.pth133.6 MBstylematte/checkpoints/(https://github.com/chroneus/stylematte/releases/download/weights/stylematte_pure.pth)
stylematte_synth.pth133.6 MBstylematte/checkpoints/(https://github.com/chroneus/stylematte/releases/download/weights/stylematte_synth.pth)
animals.pkl300.5 MBstylegan3(https://github.com/chroneus/stylematte/releases/download/weights/animals.pkl)
humans.pkl281.1 MBstylegan3(https://github.com/chroneus/stylematte/releases/download/weights/humans.pkl)

How to run StyleMatteGAN

To synthesize synthetic dataset of RGBA images, move to stylegan3 and run synthesize.py. You should create conda environment from stylegan3/environment.yml. You can also generate images with different truncation and seed values using gen_images.py .

conda activate stylegan3
cd stylegan3
python synthesize.py

To change image background on synthetic dataset, run

python visualizer.py

In the GUI you can choose model weights, background picture, truncation value and other visualization parameters.

StyleMatteGAN results

<p align="left"> <img src="assets/back.gif" width="60%" height="60%" /> </p><br/>

How to run StyleMatte

To test our model, change directory to stylematte and run test.py. You can modify test.yaml file for your datasets and models.

cd stylematte
python test.py

The report directory is stylematte/report/. See report examples there.

StyleMatte results

<p align="left"> <img src="assets/merged.gif" width="100%" height="50%" /> </p><br/>

License

<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work is licensed under a variant of <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.

Please see the specific license.