MobileStyleGAN.pytorch
initial public release
公式のPytorchの実装

付随するビデオはYouTubeで見つけることができます。詳細については、論文を参照してください。
pip install -r requirements.txt
python train.py --cfg configs/mobile_stylegan_ffhq.json --gpus < n_gpus > フレームワークは、Rosinality/StyleGan2-PytorchのStyleGan2チェックポイント形式をサポートしています。 ckptのstylegan2のチェックポイントをフレームワークに変換するには:
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 >チェックポイントが正しく変換されていることを確認するには、デモの視覚化を実行するだけです。
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 > FIDスコアを評価するには、Pytorch-FIDライブラリの変更されたバージョンを使用します。
python evaluate_fid.py < path_to_ref_dataset > < path_to_generated_imgs > MobileStyleganを使用してデモの視覚化を実行します:
python demo.py --cfg configs/mobile_stylegan_ffhq.json --ckpt < path_to_ckpt >StyleGan2とMobileStyleganを使用して視覚比較を実行します。
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 > OpenVinoフレームワークを使用して、Edgeデバイスにモデルを展開する例として、外部ライブラリRandom_faceを提供します。
| 名前 | fid |
|---|---|
| mobilestylegan_ffhq.ckpt | 7.75 |
(*)当社のフレームワークは、自動ダウンロード前--ckpt <pretrined_model_name>モデルをサポートしています。
| コード | ソース | ライセンス |
|---|---|---|
| カスタムキューダカーネル | https://github.com/nvlabs/stylegan2 | nvidiaライセンス |
| stylegan2ブロック | https://github.com/rosinality/stylegan2-pytorch | mit |
私たちは、私たちのプロジェクトに作品が貢献した人々に感謝したいと思います::
この作業の結果とコードを使用している場合は、次のように引用してください。
@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},
}