تنفيذ Pytorch الرسمي

يمكن العثور على مقاطع الفيديو المصاحبة على YouTube. لمزيد من التفاصيل ، يرجى الرجوع إلى الورقة.
pip install -r requirements.txt
python train.py --cfg configs/mobile_stylegan_ffhq.json --gpus < n_gpus > يدعم Framework تنسيق نقاط التفتيش Stylegan2 من Rosinality/Stylegan2-Pytorch. لتحويل 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 > نحن نقدم مكتبة خارجية عشوائية _ face كمثال على نشر نموذجنا في أجهزة الحافة باستخدام إطار OpenVino.
| اسم | fid |
|---|---|
| mobilestylegan_ffhq.ckpt | 7.75 |
(*) يدعم إطار عملنا النماذج التلقائية للتنزيل ، فقط استخدم --ckpt <pretrined_model_name> .
| شفرة | مصدر | رخصة |
|---|---|---|
| مخصصة CUDA النواة | https://github.com/nvlabs/stylegan2 | ترخيص Nvidia |
| stylegan2 كتل | https://github.com/rosinality/stylegan2-pytorch | معهد ماساتشوستس للتكنولوجيا |
نريد أن نشكر الأشخاص الذين ساهمت أعمالهم في مشروعنا ::
إذا كنت تستخدم نتائج ورمز هذا العمل ، فيرجى الاستشهاد به على النحو التالي:
@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},
}