Skip to content

Commit

Permalink
update pre-trained model and flops
Browse files Browse the repository at this point in the history
  • Loading branch information
vinthony committed Aug 19, 2021
1 parent c715ca5 commit f963028
Show file tree
Hide file tree
Showing 2 changed files with 675 additions and 32 deletions.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Paper: https://arxiv.org/abs/2106.03106

### Update:

* 2021.07.29 add a script for testing the pre-trained model on the arbitrary-resolution images.
* 2021.08.19 Release a pre-trained model(Uformer32)! Add a script for FLOP/GMAC calculation.
* 2021.07.29 Add a script for testing the pre-trained model on the arbitrary-resolution images.

<hr>
<i>In this paper, we present Uformer, an effective and efficient Transformer-based architecture, in which we build a hierarchical encoder-decoder network using the Transformer block for image restoration. Uformer has two core designs to make it suitable for this task. The first key element is a local-enhanced window Transformer block, where we use non-overlapping window-based self-attention to reduce the computational requirement and employ the depth-wise convolution in the feed-forward network to further improve its potential for capturing local context. The second key element is that we explore three skip-connection schemes to effectively deliver information from the encoder to the decoder. Powered by these two designs, Uformer enjoys a high capability for capturing useful dependencies for image restoration. Extensive experiments on several image restoration tasks demonstrate the superiority of Uformer, including image denoising, deraining, deblurring and demoireing. We expect that our work will encourage further research to explore Transformer-based architectures for low-level vision tasks.</i>
Expand All @@ -23,6 +24,11 @@ The project is built with PyTorch 1.7.1, Python3.7, CUDA10.1. For package depend
pip3 install -r requirements.txt
```

## Pretrained model

- uformer32_denoising_sidd.pth [[Google Drive]](https://drive.google.com/file/d/1dS7Lh46SMbncnwRW9zM5AW3cXrvYkjQU/view?usp=sharing): PSNR 39.77 dB.


## Data preparation
### Denoising
For training data of SIDD, you can download the SIDD-Medium dataset from the [official url](https://www.eecs.yorku.ca/~kamel/sidd/dataset.php).
Expand Down Expand Up @@ -57,6 +63,17 @@ python3 ./test.py --arch Uformer --batch_size 1 --gpu '0' \
```


## Computational Cost

We provide a simple script to calculate the flops by ourselves, a simple script has been added in `model.py`. You can change the configuration and run it via:

```python
python3 model.py
```

> The manual calculation of GMacs in this repo differs slightly from the main paper, but they do not influence the conclusion. We will correct the paper later.

## Citation
If you find this project useful in your research, please consider citing:

Expand Down
Loading

0 comments on commit f963028

Please sign in to comment.