PyTorch code for our paper "Attention in Attention Network for Image Super-Resolution"

Related tags

Deep Learning A2N
Overview

Under construction...

Attention in Attention Network for Image Super-Resolution (A2N)

This repository is an PyTorch implementation of the paper

"Attention in Attention Network for Image Super-Resolution" [arXiv]

Visual results in the paper are availble at Google Drive or Baidu Netdisk (password: 7t74).

Unofficial TensorFlow implementation: https://github.com/Anuj040/superres

Test

Dependecies: torch==0.4.1

You can download the test sets from Google Drive. Put the test data in ../Data/benchmark/.

python main.py  --scale 4 --data_test Set5 --pre_train ./experiment/model/aan_x4.pt --chop --test_only

If you use CPU, please add "--cpu".

Train

Training data preparation

  1. Download DIV2K training data from DIV2K dataset or SNU_CVLab.
  2. Specify '--dir_data' in option.py based on the data path.

For more informaiton, please refer to EDSR(PyTorch).

Training

python main.py --scale 2 --patch_size 128 --reset --chop

python main.py --scale 3 --patch_size 192 --reset --chop

python main.py --scale 4 --patch_size 256 --reset --chop

Citation

If you have any question or suggestion, welcome to email me at here.

If you find our work helpful in your resarch or work, please cite the following papers.

@misc{chen2021attention,
      title={Attention in Attention Network for Image Super-Resolution}, 
      author={Haoyu Chen and Jinjin Gu and Zhi Zhang},
      year={2021},
      eprint={2104.09497},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

Acknowledgements

This code is built on EDSR (PyTorch) and PAN. We thank the authors for sharing their codes.

Comments
  • About pre-trained model

    About pre-trained model

    Thank you for your amazing work! I would like to know if the pre-trained model is provided? I can't find it , sry. And I notice that the methods of reconstruction module and Upsample module are nearest-neighbor interpolation and bilinear interpolation, respectively.Have you tried using sub-pixel related methods? And how is the result? Thanks again.

    opened by jjlinghu 2
  • Mismatch in the model architecture implementation and the one given in the paper

    Mismatch in the model architecture implementation and the one given in the paper

    Thanks a lot for an interesting work on super-resolution and an easy to understand repository. I am working to implement this repo in tensorflow (link). I noticed that the following skip connection is not shown in the Figure 3. of https://arxiv.org/abs/2104.09497. Just wanted to confirm that. https://github.com/haoyuc/A2N/blob/a04e78a3f3735553c4514521dd5b6937eee40aae/code/model/aan.py#L152

    Thanks a lot for your time. PS: If you feel my implementation worthy of reference, please consider that. Would be immensely grateful.

    opened by Anuj040 2
  • Suggestion

    Suggestion

    Hi, @haoyuc Thanks for your work For the convenience of comparison, can you share the pre-trained model or benchmark results. Looking for you work and good luck!

    opened by Senwang98 2
  • 关于注意力分支的问题

    关于注意力分支的问题

    您好,在看完您的文章后,我有一些不清楚的地方想向您请教一下,Attention Branch中使用的是通道-空间注意嘛?为什么我只能看到的是空间注意力机制。还有就是我不清楚,注意力机制的最后一步,为什么又加了一个卷积,K4的作用是什么呢?我的问题可能比较基础,希望您有空的话,可以解决一下我的疑惑。谢谢您的指教。 image image

    opened by zyaqin 2
  • 对于注意力分支的选择

    对于注意力分支的选择

    对您的工作很感兴趣,请问一下看您论文里写的 非注意和通道-空间注意的组合具有最好的表现,您代码中用的是通道-空间注意吗?还有就是请问一下 单纯采用通道注意力和非注意力的组合,加上您的dropout模块,效果会变得不好吗?dropout模块只能在非注意和通道-空间注意或空间注意的组合才有正面效果吗? 谢谢您的指教

    opened by Lewis0427 1
  • Problem with loading data

    Problem with loading data

    Thank you for sharing codes to us. While reproducing the code, I came across some minor issues that I would like to ask you for advice on, as follows: KE0_L@XDKXGJW@(6P4X1AP1 I carefully checked the code and found that the output of the data loader had only three parts, namely hr, lr and filename, and I was puzzled as to why there were four parts (lr,hr,_,idx_scale) of output in the code. Looking forward to your reply, thanks!

    opened by zyaqin 4
Owner
Haoyu Chen
Haoyu Chen
PyTorch code for our paper "Image Super-Resolution with Non-Local Sparse Attention" (CVPR2021).

Image Super-Resolution with Non-Local Sparse Attention This repository is for NLSN introduced in the following paper "Image Super-Resolution with Non-

null 143 Dec 28, 2022
PyTorch code for our ECCV 2020 paper "Single Image Super-Resolution via a Holistic Attention Network"

HAN PyTorch code for our ECCV 2020 paper "Single Image Super-Resolution via a Holistic Attention Network" This repository is for HAN introduced in the

五维空间 140 Nov 23, 2022
PyTorch code for our ECCV 2018 paper "Image Super-Resolution Using Very Deep Residual Channel Attention Networks"

PyTorch code for our ECCV 2018 paper "Image Super-Resolution Using Very Deep Residual Channel Attention Networks"

Yulun Zhang 1.2k Dec 26, 2022
PyTorch code accompanying our paper on Maximum Entropy Generators for Energy-Based Models

Maximum Entropy Generators for Energy-Based Models All experiments have tensorboard visualizations for samples / density / train curves etc. To run th

Rithesh Kumar 135 Oct 27, 2022
Convolutional neural network web app trained to track our infant’s sleep schedule using our Google Nest camera.

Machine Learning Sleep Schedule Tracker What is it? Convolutional neural network web app trained to track our infant’s sleep schedule using our Google

g-parki 7 Jul 15, 2022
Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

CoProtector Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

Zhensu Sun 1 Oct 26, 2021
Official implementation of our paper "LLA: Loss-aware Label Assignment for Dense Pedestrian Detection" in Pytorch.

LLA: Loss-aware Label Assignment for Dense Pedestrian Detection This project provides an implementation for "LLA: Loss-aware Label Assignment for Dens

null 35 Dec 6, 2022
Official implementation of our CVPR2021 paper "OTA: Optimal Transport Assignment for Object Detection" in Pytorch.

OTA: Optimal Transport Assignment for Object Detection This project provides an implementation for our CVPR2021 paper "OTA: Optimal Transport Assignme

null 217 Jan 3, 2023
PyTorch implementation of the Deep SLDA method from our CVPRW-2020 paper "Lifelong Machine Learning with Deep Streaming Linear Discriminant Analysis"

Lifelong Machine Learning with Deep Streaming Linear Discriminant Analysis This is a PyTorch implementation of the Deep Streaming Linear Discriminant

Tyler Hayes 41 Dec 25, 2022
The official pytorch implementation of our paper "Is Space-Time Attention All You Need for Video Understanding?"

TimeSformer This is an official pytorch implementation of Is Space-Time Attention All You Need for Video Understanding?. In this repository, we provid

Facebook Research 1k Dec 31, 2022
Pytorch implementation of our paper under review — Lottery Jackpots Exist in Pre-trained Models

Lottery Jackpots Exist in Pre-trained Models (Paper Link) Requirements Python >= 3.7.4 Pytorch >= 1.6.1 Torchvision >= 0.4.1 Reproduce the Experiment

Yuxin Zhang 27 Jun 28, 2022
The repository offers the official implementation of our paper in PyTorch.

Cloth Interactive Transformer (CIT) Cloth Interactive Transformer for Virtual Try-On Bin Ren1, Hao Tang1, Fanyang Meng2, Runwei Ding3, Ling Shao4, Phi

Bingoren 49 Dec 1, 2022
PyTorch implementations for our SIGGRAPH 2021 paper: Editable Free-viewpoint Video Using a Layered Neural Representation.

st-nerf We provide PyTorch implementations for our paper: Editable Free-viewpoint Video Using a Layered Neural Representation SIGGRAPH 2021 Jiakai Zha

Diplodocus 258 Jan 2, 2023
PyTorch implementation of our ICCV2021 paper: StructDepth: Leveraging the structural regularities for self-supervised indoor depth estimation

StructDepth PyTorch implementation of our ICCV2021 paper: StructDepth: Leveraging the structural regularities for self-supervised indoor depth estimat

SJTU-ViSYS 112 Nov 28, 2022
Pytorch implementation for our ICCV 2021 paper "TRAR: Routing the Attention Spans in Transformers for Visual Question Answering".

TRAnsformer Routing Networks (TRAR) This is an official implementation for ICCV 2021 paper "TRAR: Routing the Attention Spans in Transformers for Visu

Ren Tianhe 49 Nov 10, 2022
This is the official pytorch implementation for our ICCV 2021 paper "TRAR: Routing the Attention Spans in Transformers for Visual Question Answering" on VQA Task

?? ERASOR (RA-L'21 with ICRA Option) Official page of "ERASOR: Egocentric Ratio of Pseudo Occupancy-based Dynamic Object Removal for Static 3D Point C

Hyungtae Lim 225 Dec 29, 2022
PyTorch implementation of our ICCV 2021 paper, Interpretation of Emergent Communication in Heterogeneous Collaborative Embodied Agents.

PyTorch implementation of our ICCV 2021 paper, Interpretation of Emergent Communication in Heterogeneous Collaborative Embodied Agents.

Saim Wani 4 May 8, 2022
PyTorch implementation for our NeurIPS 2021 Spotlight paper "Long Short-Term Transformer for Online Action Detection".

Long Short-Term Transformer for Online Action Detection Introduction This is a PyTorch implementation for our NeurIPS 2021 Spotlight paper "Long Short

null 77 Dec 16, 2022
Official PyTorch implemention of our paper "Learning to Rectify for Robust Learning with Noisy Labels".

WarPI The official PyTorch implemention of our paper "Learning to Rectify for Robust Learning with Noisy Labels". Run python main.py --corruption_type

Haoliang Sun 3 Sep 3, 2022