Giter VIP home page Giter VIP logo

passrnet's Introduction

PASSRnet: Parallax Attention Stereo Super-Resolution Network

Pytorch implementation of "Learning Parallax Attention for Stereo Image Super-Resolution", CVPR 2019

[arXiv] [CVF] [Supp]

Overview

overview

Figure 1. Overview of our PASSRnet network.

Figure 2. Illustration of our parallax-attention mechanism.

Figure 3. A toy example illustration of the parallax-attention and cycle-attention maps generated by our PAM. The attention maps (30×30) correspond to the regions (1×30) marked by a yellow stroke. In (a) and (b), the first row represents left/right stereo images, the second row stands for parallax-attention maps, and the last row represents cycle-attention maps.

Figure 4. The Flickr1024 dataset.

Requirements

  • pytorch (0.4), torchvision (0.2) (Note: The code is tested with python=3.6, cuda=9.0)
  • Matlab (For training/test data generation)

Train

Prepare training data

  1. Download the Flickr1024 dataset and put the images in data/train/Flickr1024 (Note: In our paper, we also use 60 images in the Middlebury dataset as the training set.)
  2. Cd to data/train and run generate_trainset.m to generate training data.

Begin to train

python train.py --scale_factor 4 --device cuda:0 --batch_size 32 --n_epochs 80 --n_steps 30

Test

Prepare test data

  1. Download the KITTI2012 dataset and put folders testing/colored_0 and testing/colored_1 in data/test/KITTI2012/original
  2. Cd to data/test and run generate_testset.m to generate test data.
  3. (optional) You can also download KITTI2015, Middlebury or other stereo datasets and prepare test data in data/test as below:
  data
  └── test
      ├── dataset_1
            ├── hr
                ├── scene_1
                      ├── hr0.png
                      └── hr1.png
                ├── ...
                └── scene_M
            └── lr_x4
                ├── scene_1
                      ├── lr0.png
                      └── lr1.png
                ├── ...
                └── scene_M
      ├── ...
      └── dataset_N

Demo

python demo_test.py --scale_factor 4 --device cuda:0 --dataset KITTI2012

Results

2x

Figure 5. Visual comparison for 2× SR. These results are achieved on “test_image_013” of the KITTI 2012 dataset and “test_image_019” of the KITTI 2015 dataset.

4x

Figure 6. Visual comparison for 4× SR. These results are achieved on “test_image_004” of the KITTI 2015 dataset.

2x

Figure 7. Visual comparison for 2× SR. These results are achieved on a stereo image pair acquired in our laboratory.

Citation

@InProceedings{Wang2019Learning,
  author    = {Longguang Wang and Yingqian Wang and Zhengfa Liang and Zaiping Lin and Jungang Yang and Wei An and Yulan Guo},
  title     = {Learning Parallax Attention for Stereo Image Super-Resolution},
  booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  year      = {2019},
}

Contact

For questions, please send an email to [email protected]

passrnet's People

Contributors

longguangwang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

passrnet's Issues

About Supplemental Material

Hi, Longguang, you have metion about the supplemental material many times in your paper. Where could I get it ?

Comparison to Bicubic in another dataset

Thank you for your great repo.

I am trying to test your method on another dataset for stereo video SR and compare it with you.

I did not train your model on my dataset, and just used your pre-trained model to create super resolved frames.
The problem is that PSNR of your method is lower than the Bicubic base method. When Bicubic gives about 31, your method gives 28.5 of PSNR.

Why do you think this happens?
Thank you so much

confusion about models generated by training

Hi, thanks for your repo and it helps a lot.
I am trying to reproduce your repo recently and hit some bugs when testing my pre-trained model.
image
I would appreciate it if you could give me some advice.

SSIM 偏小

我在demo_test.py 中测试了SSIM,( SSIM = measure.compare_ssim(HR_left_np,SR_left_np,multichannel=True,data_range=1))skimage用了0.13.0版本,但是跑出的middlebury数据集下的SSIM结果比论文中偏小。跑出结果middlebury: 0.822,论文结果middlebury: 0.871
请问有没有哪位正确测试出论文中middlebury数据集下的SSIM值?skimage用了那个版本?

训练集问题

您好!请问训练集是由Flickr1024中的800对训练图片和Middlebury中的60对训练图片构成的吗?

test Help

Hello, how do you test with your own trained model? The model file you regenerate is in .tar format, for example: PassRnet_x4_epoch80.pth.tar. Is it necessary to change the model generated by myself to the model folder with the same name of the existing model file PASSRnet_x4.pth, and then test it?
Another problem is that you can only test a single test. When you put all the tests into the same dataset, can you test them at the same time?

train.py 问题

我按照README中的操作步骤运行
python train.py --scale_factor 4 --device cuda:0 --batch_size 32 --n_epochs 80 --n_steps 30
系统给出如下错误:

Traceback (most recent call last):
File "train.py", line 107, in <module>
main(cfg)
File "train.py", line 103, in main
train(train_loader, cfg)
File "train.py", line 80, in train
psnr_epoch.append(cal_psnr(HR_left[:,:,:,64:].data.cpu(), SR_left[:,:,:,64:].data.cpu()))
File "/home/xujialang/PASSRnet/utils.py", line 84, in cal_psnr
return measure.compare_psnr(img1_np, img2_np)
File "/home/xujialang/anaconda3/envs/passrnet/lib/python3.6/site-packages/skimage/measure/simple_metrics.py", line 65, in compare_psnr
return peak_signal_noise_ratio(im_true, im_test, data_range=data_range)
File "/home/xujialang/anaconda3/envs/passrnet/lib/python3.6/site-packages/skimage/metrics/simple_metrics.py", line 149, in peak_signal_noise_ratio
"im_true has intensity values outside the range expected for "
ValueError: im_true has intensity values outside the range expected for its data type.  Please manually specify the data_range

我将'cuda:0' 切换为 'cuda:1' 或者其他GPU,错误就消失了,请问这是什么原因呢?

Confusion about weight sharing

Hi,thanks for your great repo. I'm a little confused about why the left and right branches share weights during training. How can the same network extract different features from two different views? Looking forward to your reply. Thank you very much!

Test help,Thank you

Hello, how can I test without using the image on the right? How to set up the different test modes in Table 2?

Some problem about calcu_PSNR?

Hello,
In the project, the formula for calculating PSNR is as follows:
cal_psnr(HR_left[:,:,:,64:], SR_left[:,:,:,64:])

What does 64 represent?

Thank you.

code

When will you release the code?

supplemental material

Hello,in the paper yousaid if the groundtruth disparities are available, we can generate the groundtruth attention maps accordingly(see the supplemental material for more details).
But the paper i downed didn't have the supplemental material,could you send me the material?
Thank you for your kindness!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.