Offizielle Pytorch -Implementierung

Die dazugehörigen Videos finden Sie auf YouTube. Weitere Informationen finden Sie in der Zeitung.
pip install -r requirements.txt
python train.py --cfg configs/mobile_stylegan_ffhq.json --gpus < n_gpus > Unser Framework unterstützt Stylegan2-Checkpoints-Format aus Rosinalität/Stylegan2-Pytorch. Um CKPT Ihren eigenen Checkpoint von Stylegan2 in unser Rahmen umzuwandeln:
python convert_rosinality_ckpt.py --ckpt < path_to_rosinality_stylegan2_ckpt > --ckpt-mnet < path_to_output_mapping_network_ckpt > --ckpt-snet < path_to_output_synthesis_network_ckpt > --cfg-path < path_to_output_config_json >Um zu überprüfen, ob Ihr Checkpoint korrekt konvertiert wird, führen Sie einfach die Demo -Visualisierung aus:
python demo.py --cfg < path_to_output_config_json > --ckpt " " --generator teacherpython generate.py --cfg configs/mobile_stylegan_ffhq.json --device cuda --ckpt < path_to_ckpt > --output-path < path_to_store_imgs > --batch-size < batch_size > --n-batches < n_batches > Um den FID-Score zu bewerten, verwenden wir eine modifizierte Version der Pytorch-Fid-Bibliothek:
python evaluate_fid.py < path_to_ref_dataset > < path_to_generated_imgs > Führen Sie die Demo -Visualisierung mit Mobilestylegan aus:
python demo.py --cfg configs/mobile_stylegan_ffhq.json --ckpt < path_to_ckpt >Führen Sie einen visuellen Vergleich mit Stylegan2 vs. Mobilestylegan aus:
python compare.py --cfg configs/mobile_stylegan_ffhq.json --ckpt < path_to_ckpt > python train.py --cfg configs/mobile_stylegan_ffhq.json --ckpt < path_to_ckpt > --export-model onnx --export-dir < output_dir > python train.py --cfg configs/mobile_stylegan_ffhq.json --ckpt < path_to_ckpt > --export-model coreml --export-dir < output_dir > Wir bieten eine externe Bibliothek random_face als Beispiel für die Bereitstellung unseres Modells an den Edge -Geräten mithilfe des OpenVino -Frameworks.
| Name | Fid |
|---|---|
| MOBILESTYLEGAN_FFHQ.CKPT | 7.75 |
--ckpt <pretrined_model_name>
| Code | Quelle | Lizenz |
|---|---|---|
| Benutzerdefinierte Cuda -Kerne | https://github.com/nvlabs/stylegan2 | NVIDIA -Lizenz |
| Stylegan2 -Blöcke | https://github.com/rosinality/stylegan2-pytorch | MIT |
Wir möchten den Menschen danken, deren Werke zu unserem Projekt beigetragen haben ::
Wenn Sie die Ergebnisse und den Code dieser Arbeit verwenden, zitieren Sie sie bitte als:
@misc{belousov2021mobilestylegan,
title={MobileStyleGAN: A Lightweight Convolutional Neural Network for High-Fidelity Image Synthesis},
author={Sergei Belousov},
year={2021},
eprint={2104.04767},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
@article{BELOUSOV2021100115,
title = {MobileStyleGAN.pytorch: PyTorch-based toolkit to compress StyleGAN2 model},
journal = {Software Impacts},
year = {2021},
issn = {2665-9638},
doi = {https://doi.org/10.1016/j.simpa.2021.100115},
url = {https://www.sciencedirect.com/science/article/pii/S2665963821000452},
author = {Sergei Belousov},
}