GithubHelp home page GithubHelp logo

hydrogensulfate / lfssr-sas-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jingjin25/lfssr-sas-pytorch

0.0 0.0 0.0 14.92 MB

Repository for "Light Field Spatial Super-resolution Using Deep Efficient Spatial-Angular Separable Convolution" , TIP 2018

MATLAB 25.84% Python 72.94% Shell 1.22%

lfssr-sas-pytorch's Introduction

LFSSR-SAS-PyTorch

PyTorch implementation of TIP 2018 paper: "Light Field Spatial Super-resolution Using Deep Efficient Spatial-Angular Separable Convolution". You can find the original MATLAB code from here.

Usage

Dependencies

  • Python 3.6
  • PyTorch 1.0

Dataset

We provide MATLAB code for preparing the training and testing data. Please first download light field datasets, and put them into corresponding folders in LFData.

Demo

usage: demo.py [-h] [--model_path MODEL_PATH] [--scale SCALE]
               [--test_dataset TEST_DATASET] [--angular_num ANGULAR_NUM]
               [--layer_num LAYER_NUM] [--save_img SAVE_IMG] 
             
optional arguments:  
  -h, --help          Show this help message and exit  
  --model_path        Model path. Default=pretrained_models/model_2x.pth  
  --scale             SR factor  
  --test_dataset      Dataset for test  
  --angular_num       Size of one angular dim. Default=7.  
  --layer_num         Number of SAS layers. Default=6.  
  --save_img          Save image or not  

An example of usage is shown as follows:

python demo.py --model_path pretrained_models/model_2x.pth --test_dataset HCI --scale 2  --save_img 1

Note: We provide 2 pre-trained models for 2x and 4x SR, respectively. There are some differences from the original MATLAB pre-trained models:

  • new models were trained on a hybrid dataset containing both synthetic and real-world light field images, while the original ones were trained only on real-world images captured by a Lytro Illum camera. The lists of datasets used to train the new models can be found in LFData/dataset_train/trainList_datasetname.txt;
  • new models were trained for light fields with the angular resolution of 7x7, while the original ones were trained for 8x8 light fields;
  • and new models used 6 layers of spatial-angular convolutions, while the original ones used 10 layers.

Training

An example of training your own model is shown as follows:

python train.py --dataset all --scale 2 --layer_num 6 --angular_num 7 --lr 1e-4

Testing

An example of testing one epoch of your trained model is shown as follows:

python test.py --train_dataset all --test_dataset HCI --scale 2 --layer_num 6 --angular_num 7 --lr 1e-4 --epoch 500 --save_img 1

lfssr-sas-pytorch's People

Contributors

jingjin25 avatar

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.