← 开源
Ha0Tang

AttentionGAN

AttentionGAN for Unpaired Image-to-Image Translation & Multi-Domain Image-to-Image Translation

Model DevelopmentArchitecturePython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
687
Star
100
Fork
+0
本周
2
贡献者
创建于 2019-07-09 · 更新于 2026-09-24 · 今日第 14991 名
主要开发者
Ha0Tangazusakou

Ha0Tang/AttentionGAN 排名第 14,991,有 687 个星标。

同类别比较

Ha0Tang/AttentionGAN 排名第 14,991,此处有 8 个同类条目;twjiang/graphSAGE-pytorch 排名第 14,987。

同类别比较
名称排名指标
wichtounet/dll14,977
语言:
C++
星标数:
689
分叉数:
157
简介:
Fast Deep Learning Library (DLL) for C++ (ANNs, CNNs, RBMs, DBNs...)
atcbosselut/comet-commonsense14,982
语言:
Python
星标数:
688
分叉数:
124
简介:
Code for ACL 2019 Paper: "COMET: Commonsense Transformers for Automatic Knowledge Graph Construction" https://arxiv.org/abs/1906.05317
facebookresearch/WavAugment14,984
语言:
Python
星标数:
688
分叉数:
60
简介:
A library for speech data augmentation in time-domain
twjiang/graphSAGE-pytorch14,987
语言:
Python
星标数:
688
分叉数:
150
简介:
A PyTorch implementation of GraphSAGE. This package contains a PyTorch implementation of GraphSAGE.
wenbowen123/BundleTrack14,999
语言:
C++
星标数:
687
分叉数:
72
简介:
[IROS 2021] BundleTrack: 6D Pose Tracking for Novel Objects without Instance or Category-Level 3D Models
inspirehep/magpie15,009
语言:
Python
星标数:
686
分叉数:
188
简介:
Deep neural network framework for multi-label text classification
mokemokechicken/reversi-alpha-zero15,011
语言:
Python
星标数:
686
分叉数:
167
简介:
Reversi reinforcement learning by AlphaGo Zero methods.
QUVA-Lab/e2cnn15,016
语言:
Python
星标数:
685
分叉数:
84
简介:
E(2)-Equivariant CNNs Library for Pytorch
关键参数与规格
关键参数与规格
参数值
语言Python
类别Model Development
子类别Architecture
关键词Computer vision, Image production
星标数687
分叉数100
贡献者2
创建日期2019-07-09
更新日期2026-09-24
1 天星标数0
7 天星标数0
排名14,991
上次排名14,820
排名变化-171
7 天星标排名14,754
上次 7 天星标排名14,766
7 天星标排名变化12
总星标排名15,095
上次总星标排名15,066
总星标排名变化-29
国家Switzerland
README 摘录

AttentionGAN-v2 for Unpaired Image-to-Image Translation AttentionGAN-v2 Framework The proposed generator learns both foreground and background attentions. It uses the foreground attention to select from the generated output for the foreground regions, while uses the background attention to maintain the background information from the input image. Please refer to our papers for more details. Comparsion with State-of-the-Art Methods Selfie To Anime Translation Horse to Zebra Translation Zebra to Horse Translation Apple to Orange Translation

Orange to Apple Translation Map to Aerial Photo Translation Aerial Photo to Map Translation Style Transfer Visualization of Learned Attention Masks Selfie to Anime Translation Horse to Zebra Translation Zebra to Horse Translation Apple to Orange Translation Orange to Apple Translation Map to Aerial Photo Translation Aerial Photo to Map Translation Extended Paper | Conference Paper AttentionGAN: Unpaired Image-to-Image Translation using Attention-Guided Generative Adversarial Networks. Hao Tang 1 , Hong Liu 2 , Dan Xu 3 , Philip H. 1 University

of Trento, Italy, 2 Peking University, China, 3 University of Oxford, UK. The repository offers the official implementation of our paper in PyTorch. Are you looking for AttentionGAN-v1 for Unpaired Image-to-Image Translation? Paper | Code Are you looking for AttentionGAN-v1 for Multi-Domain Image-to-Image Translation? Paper | Code Facial Expression-to-Expression Translation Order: The Learned Attention Masks, The Learned Content Masks, Final Results Facial Attribute Transfer Order: The Learned Attention Masks, The Learned Content Masks

, Final Results Order: The Learned Attention Masks, AttentionGAN, StarGAN License Copyright (C) 2019 University of Trento, Italy. 0 (**Attribution-NonCommercial-ShareAlike 4. 0 International**) The code is released for academic research use only. For commercial use, please contact bjdxtanghao@gmail. Please install dependencies by or To reproduce the results reported in the paper, you would need an NVIDIA Tesla V100 with 16G memory. Dataset Preparation Download the datasets using the following script. Please cite their paper if you use the

data. The selfie2anime dataset can be download here. AttentionGAN Training/Testing Download a dataset using the previous script (e. To view training results and loss plots, run and click the URL Train a model: To see more intermediate results, check out . Test the model: The test results will be saved to a html file here: . Generating Images Using Pretrained Model You need download a pretrained model (e. , horse2zebra) with the following script: The pretrained model is saved at . Then generate

the result using The results will be saved at . Note that if you want to save the intermediate results and have enough disk space, remove on the command line. Image Translation with Geometric Changes Between Source and Target Domains For instance, if you want to run experiments of Selfie to Anime Translation. Usage: replace and with the ones in the folder. Test the Pretrained Model Download data and pretrained model according above instructions. Train a New Model Test the Trained

Model Evaluation Code FID: Official Implementation KID or Here: Suggested by UGATIT. If you encounter the issue , please do . Citation

常见问题

记录了多少星标和分叉?

Ha0Tang/AttentionGAN 有 687 个星标和 100 个分叉。

仓库排名是多少?

Ha0Tang/AttentionGAN 排名第 14,991。

记录的语言和类别是什么?

Ha0Tang/AttentionGAN 有 687 个星标,语言为 Python,类别为 Model Development。

哪个仓库排名最接近?

Ha0Tang/AttentionGAN 与 twjiang/graphSAGE-pytorch 比较,后者排名第 14,987,有 688 个星标。

README

AttentionGAN-v2 for Unpaired Image-to-Image Translation

AttentionGAN-v2 Framework

The proposed generator learns both foreground and background attentions. It uses the foreground attention to select from the generated output for the foreground regions, while uses the background attention to maintain the background information from the input image. Please refer to our papers for more details.

Comparsion with State-of-the-Art Methods

Selfie To Anime Translation

Horse to Zebra Translation

Zebra to Horse Translation

Apple to Orange Translation

Orange to Apple Translation

Map to Aerial Photo Translation

Aerial Photo to Map Translation

Style Transfer

Visualization of Learned Attention Masks

Selfie to Anime Translation

Horse to Zebra Translation

Zebra to Horse Translation

Apple to Orange Translation

Orange to Apple Translation

Map to Aerial Photo Translation

Aerial Photo to Map Translation

Extended Paper | Conference Paper

AttentionGAN: Unpaired Image-to-Image Translation using Attention-Guided Generative Adversarial Networks.

Hao Tang1, Hong Liu2, Dan Xu3, Philip H.S. Torr3 and Nicu Sebe1.

1University of Trento, Italy, 2Peking University, China, 3University of Oxford, UK.

In TNNLS 2021 & IJCNN 2019 Oral.

The repository offers the official implementation of our paper in PyTorch.

Are you looking for AttentionGAN-v1 for Unpaired Image-to-Image Translation?

Paper | Code

Are you looking for AttentionGAN-v1 for Multi-Domain Image-to-Image Translation?

Paper | Code

Facial Expression-to-Expression Translation

Order: The Learned Attention Masks, The Learned Content Masks, Final Results

Facial Attribute Transfer

Order: The Learned Attention Masks, The Learned Content Masks, Final Results

Order: The Learned Attention Masks, AttentionGAN, StarGAN

License

Copyright (C) 2019 University of Trento, Italy.

All rights reserved. Licensed under the CC BY-NC-SA 4.0 (Attribution-NonCommercial-ShareAlike 4.0 International)

The code is released for academic research use only. For commercial use, please contact bjdxtanghao@gmail.com.

Installation

Clone this repo.

git clone https://github.com/Ha0Tang/AttentionGAN
cd AttentionGAN/

This code requires PyTorch 0.4.1+ and python 3.6.9+. Please install dependencies by

pip install -r requirements.txt (for pip users)

or

./scripts/conda_deps.sh (for Conda users)

To reproduce the results reported in the paper, you would need an NVIDIA Tesla V100 with 16G memory.

Dataset Preparation

Download the datasets using the following script. Please cite their paper if you use the data. Try twice if it fails the first time!

sh ./datasets/download_cyclegan_dataset.sh dataset_name

The selfie2anime dataset can be download here.

AttentionGAN Training/Testing

  • Download a dataset using the previous script (e.g., horse2zebra).
  • To view training results and loss plots, run python -m visdom.server and click the URL http://localhost:8097.
  • Train a model:
sh ./scripts/train_attentiongan.sh
  • To see more intermediate results, check out ./checkpoints/horse2zebra_attentiongan/web/index.html.
  • How to continue train? Append --continue_train --epoch_count xxx on the command line.
  • Test the model:
sh ./scripts/test_attentiongan.sh
  • The test results will be saved to a html file here: ./results/horse2zebra_attentiongan/latest_test/index.html.

Generating Images Using Pretrained Model

  • You need download a pretrained model (e.g., horse2zebra) with the following script:
sh ./scripts/download_attentiongan_model.sh horse2zebra
  • The pretrained model is saved at ./checkpoints/{name}_pretrained/latest_net_G.pth.
  • Then generate the result using
python test.py --dataroot ./datasets/horse2zebra --name horse2zebra_pretrained --model attention_gan --dataset_mode unaligned --norm instance --phase test --no_dropout --load_size 256 --crop_size 256 --batch_size 1 --gpu_ids 0 --num_test 5000 --epoch latest --saveDisk

The results will be saved at ./results/. Use --results_dir {directory_path_to_save_result} to specify the results directory. Note that if you want to save the intermediate results and have enough disk space, remove --saveDisk on the command line.

  • For your own experiments, you might want to specify --netG, --norm, --no_dropout to match the generator architecture of the trained model.

Image Translation with Geometric Changes Between Source and Target Domains

For instance, if you want to run experiments of Selfie to Anime Translation. Usage: replace attention_gan_model.py and networks with the ones in the AttentionGAN-geo folder.

Test the Pretrained Model

Download data and pretrained model according above instructions.

python test.py --dataroot ./datasets/selfie2anime/ --name selfie2anime_pretrained --model attention_gan --dataset_mode unaligned --norm instance --phase test --no_dropout --load_size 256 --crop_size 256 --batch_size 1 --gpu_ids 0 --num_test 5000 --epoch latest

Train a New Model

python train.py --dataroot ./datasets/selfie2anime/ --name selfie2anime_attentiongan --model attention_gan --dataset_mode unaligned --pool_size 50 --no_dropout --norm instance --lambda_A 10 --lambda_B 10 --lambda_identity 0.5 --load_size 286 --crop_size 256 --batch_size 4 --niter 100 --niter_decay 100 --gpu_ids 0 --display_id 0 --display_freq 100 --print_freq 100

Test the Trained Model

python test.py --dataroot ./datasets/selfie2anime/ --name selfie2anime_attentiongan --model attention_gan --dataset_mode unaligned --norm instance --phase test --no_dropout --load_size 256 --crop_size 256 --batch_size 1 --gpu_ids 0 --num_test 5000 --epoch latest

Evaluation Code

  • FID: Official Implementation
  • KID or Here: Suggested by UGATIT. Install Steps: conda create -n python36 pyhton=3.6 anaconda and pip install --ignore-installed --upgrade tensorflow==1.13.1. If you encounter the issue AttributeError: module 'scipy.misc' has no attribute 'imread', please do pip install scipy==1.1.0.

Citation

If you use this code for your research, please cite our papers.

@article{tang2021attentiongan,
  title={AttentionGAN: Unpaired Image-to-Image Translation using Attention-Guided Generative Adversarial Networks},
  author={Tang, Hao and Liu, Hong and Xu, Dan and Torr, Philip HS and Sebe, Nicu},
  journal={IEEE Transactions on Neural Networks and Learning Systems (TNNLS)},
  year={2021} 
}

@inproceedings{tang2019attention,
  title={Attention-Guided Generative Adversarial Networks for Unsupervised Image-to-Image Translation},
  author={Tang, Hao and Xu, Dan and Sebe, Nicu and Yan, Yan},
  booktitle={International Joint Conference on Neural Networks (IJCNN)},
  year={2019}
}

Acknowledgments

This source code is inspired by CycleGAN, GestureGAN, and SelectionGAN.

Contributions

If you have any questions/comments/bug reports, feel free to open a github issue or pull a request or e-mail to the author Hao Tang (bjdxtanghao@gmail.com).

Collaborations

I'm always interested in meeting new people and hearing about potential collaborations. If you'd like to work together or get in contact with me, please email bjdxtanghao@gmail.com. Some of our projects are listed here.


Figure out what you like. Try to become the best in the world of it.

排名相邻
同类项目