百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

stargan

> 编程语言
开源

StarGAN - 官方 PyTorch 实现 (CVPR 2018)

5.3K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

StarGAN - 官方 PyTorch 实现 (CVPR 2018)

## StarGAN - Official PyTorch Implementation **\*\*\*\*\* New: StarGAN v2 is available at https://github.com/clovaai/stargan-v2 \*\*\*\*\***

This repository provides the official PyTorch implementation of the following paper: > **StarGAN: Unified Generative Adversarial Networks for Multi-Domain Image-to-Image Translation**
> [Yunjey Choi](https://github.com/yunjey)1,2, [Minje Choi](https://github.com/mjc92)1,2, [Munyoung Kim](https://www.facebook.com/munyoung.kim.1291)2,3, [Jung-Woo Ha](https://www.facebook.com/jungwoo.ha.921)2, [Sung Kim](https://www.cse.ust.hk/~hunkim/)2,4, [Jaegul Choo](https://sites.google.com/site/jaegulchoo/)1,2    
> 1Korea University, 2Clova AI Research, NAVER Corp.
> 3The College of New Jersey, 4Hong Kong University of Science and Technology
> https://arxiv.org/abs/1711.09020
> > **Abstract:** *Recent studies have shown remarkable success in image-to-image translation for two domains. However, existing approaches have limited scalability and robustness in handling more than two domains, since different models should be built independently for every pair of image domains. To address this limitation, we propose StarGAN, a novel and scalable approach that can perform image-to-image translations for multiple domains using only a single model. Such a unified model architecture of StarGAN allows simultaneous training of multiple datasets with different domains within a single network. This leads to StarGAN's superior quality of translated images compared to existing models as well as the novel capability of flexibly translating an input image to any desired target domain. We empirically demonstrate the effectiveness of our approach on a facial attribute transfer and a facial expression synthesis tasks.* ## Dependencies * [Python 3.5+](https://www.continuum.io/downloads) * [PyTorch 0.4.0+](http://pytorch.org/) * [TensorFlow 1.3+](https://www.tensorflow.org/) (optional for tensorboard) ## Downloading datasets To download the CelebA dataset: ```bash git clone https://github.com/yunjey/StarGAN.git cd StarGAN/ bash download.sh celeba ``` To download the RaFD dataset, you must request access to the dataset from [the Radboud Faces Database website](http://www.socsci.ru.nl:8180/RaFD2/RaFD?p=main). Then, you need to create a folder structure as described [here](https://github.com/yunjey/StarGAN/blob/master/jpg/RaFD.md). ## Training networks To train StarGAN on CelebA, run the training script below. See [here](https://github.com/yunjey/StarGAN/blob/master/jpg/CelebA.md) for a list of selectable attributes in the CelebA dataset. If you change the `selected_attrs` argument, you should also change the `c_dim` argument accordingly. ``` … ``` To train StarGAN on RaFD: ``` … ``` To train StarGAN on both CelebA and RafD: ``` … ``` To train StarGAN on your own dataset, create a folder structure in the same format as [RaFD](https://github.com/yunjey/StarGAN/blob/master/jpg/RaFD.md) and run the command: ``` … ``` ## Using pre-trained networks To download a pre-trained model checkpoint, run the script below. The pre-trained model checkpoint will be downloaded and saved into `./stargan_celeba_128/models` directory. ```bash $ bash download.sh pretrained-celeba-128x128 ``` To translate images using the pre-trained model, run the evaluation script below. The translated images will be saved into `./stargan_celeba_128/results` directory. ```bash $ python main.py --mode test --dataset CelebA --image_size 128 --c_dim 5 \ --selected_attrs Black_Hair Blond_Hair Brown_Hair Male Young \ --model_save_dir='stargan_celeba_128/models' \ --result_dir='stargan_celeba_128/results' ``` ## Citation If you find this work useful for your research, please cite our [paper](https://arxiv.org/abs/1711.09020): ``` @inproceedings{choi2018stargan, author={Yunjey Choi and Minje Choi and Munyoung Kim and Jung-Woo Ha and Sunghun Kim and Jaegul Choo}, title={StarGAN: Unified Generative Adversarial Networks for Multi-Domain Image-to-Image Translation}, booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition}, year={2018} } ``` ## Acknowledgements This work was mainly done while the first author did a research internship at [Clova AI Research, NAVER](https://clova.ai/en/research/research-area-detail.html?id=0). We thank all the researchers at NAVER, especially Donghyun Kwak, for insightful discussions.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythoncvpr2018generative-modelsimage-to-image-translationpytorch

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言