在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):bes-dev/MobileStyleGAN.pytorch开源软件地址(OpenSource Url):https://github.com/bes-dev/MobileStyleGAN.pytorch开源编程语言(OpenSource Language):Python 85.3%开源软件介绍(OpenSource Introduction):MobileStyleGAN: A Lightweight Convolutional Neural Network for High-Fidelity Image SynthesisOfficial PyTorch Implementation The accompanying videos can be found on YouTube. For more details, please refer to the paper. Requirements
Trainingpip install -r requirements.txt
python train.py --cfg configs/mobile_stylegan_ffhq.json --gpus <n_gpus> Convert checkpoint from rosinality/stylegan2-pytorchOur framework supports StyleGAN2 checkpoints format from rosinality/stylegan2-pytorch. To convert ckpt your own checkpoint of StyleGAN2 to our framework: 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> Check converted checkpointTo check that your checkpoint is converted correctly, just run demo visualization: python demo.py --cfg <path_to_output_config_json> --ckpt "" --generator teacher Generate images using MobileStyleGANpython 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> Evaluate FID scoreTo evaluate the FID score we use a modified version of pytorch-fid library: python evaluate_fid.py <path_to_ref_dataset> <path_to_generated_imgs> DemoRun demo visualization using MobileStyleGAN: python demo.py --cfg configs/mobile_stylegan_ffhq.json --ckpt <path_to_ckpt> Run visual comparison using StyleGAN2 vs. MobileStyleGAN: python compare.py --cfg configs/mobile_stylegan_ffhq.json --ckpt <path_to_ckpt> Convert to ONNXpython train.py --cfg configs/mobile_stylegan_ffhq.json --ckpt <path_to_ckpt> --export-model onnx --export-dir <output_dir> Convert to CoreMLpython train.py --cfg configs/mobile_stylegan_ffhq.json --ckpt <path_to_ckpt> --export-model coreml --export-dir <output_dir> Deployment using OpenVINOWe provide external library random_face as an example of deploying our model at the edge devices using the OpenVINO framework. Pretrained models
(*) Our framework supports automatic download pretrained models, just use Legacy license
AcknowledgementsWe want to thank the people whose works contributed to our project::
CitationIf you are using the results and code of this work, please cite it as:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论