Giter VIP home page Giter VIP logo

tcs-net's Introduction

TCS-Net

This repository is the pytorch code for paper "From Patch to Pixel: A Transformer-based Hierarchical Framework for Compressive Image Sensing".

1. Introduction

1) Datasets

Training set: BSDS500, testing sets: McM18, LIVE29, General100 and OST300.

2)Project structure

(TCS-Net)
|-dataset
|    |-train  
|        |-BSDS500 (.jpg)  
|    |-test  
|        |-McM18  
|        |-LIVE29  
|        |-General100  
|        |-OST300  
|-reconstructed_images
|    |-McM18
|        |-grey
|            |-... (Testing results .png)
|        |-rgb
|            |-... (Testing results .png)
|    |-... (Testing sets)
|    |-Res_(...).txt
|-models
|    |-__init__.py  
|    |-net.py  
|    |-modules.py  
|-trained_models  
|    |-1  
|    |-4  
|    |-... (Sampling rates)
|-config 
|    |-__init__.py  
|    |-config.py  
|    |-loader.py  
|-test.py  
|-train.py
|-train.sh

3) Competting methods

Methods Sources Year
ReconNet Conf. Comput. Vis. Pattern Recog. 2016
LDIT Proc. Adv. Neural Inf. Process. Syst. 2017
LDAMP Proc. Adv. Neural Inf. Process. Syst. 2017
ISTA-Net (plus) Conf. Comput. Vis. Pattern Recog. 2018
CSGAN Proc. Int. Conf. Mach. Learn. 2019
CSNet (plus) Trans. Image Process. 2020
AMP-Net Trans. Image Process. 2021
CSformer arXiv 2022

4) Performance demonstrates

Visual comparisons of reconstruction images (original images are drawn from dataset LIVE29):

2. Useage

1) Re-training TCS-Net.

  • Put the BSDS500 and VOC2012 images into ./dataset/train/.
  • e.g., If you want to train TCS-Net at sampling rate τ = 0.1 with GPU No.0, please run the following command. The train set will be automatically packaged and our model will be trained with its default parameters (please make sure you have enough GPU RAM):
python train.py --rate 0.1 --GPU 0
  • You can also run our shell script directly as well, it will automatically train the model under all sampling rates, i.e., τ ∈ {0.01, 0.04, 0.1, 0.25}:
sh train.sh
  • The trained models (.pth) will save in the trained_models folder.

2) Testing TCS-Net.

  • We provide the trained models so that you can put them under TCS-Net/trained_models/ and use them for testing directly; all trained TCS-Net models can be found in this GoogleDrive link; Please note that the folder's names are the 100 times of sampling rates, e.g., the folder named 10 includes trained models at sampling rate = 0.1.

  • Put the testing folders into ./dataset/test/.

  • e.g., if you want to test TCS-Net at sampling rate τ = 0.1 with GPU No.0, please run:

python test.py --rate 0.1 --GPU 0
  • After that, the reconstructed images, PSNR and SSIM results will be saved to ./reconstructed_images/.

End

We appreciate your reading and attention. For more details about TCS-Net, please refer to our paper.

tcs-net's People

Contributors

icsresearch avatar

Stargazers

 avatar  avatar Shivam avatar Xiao Wang avatar  avatar  avatar  avatar

Watchers

 avatar

tcs-net's Issues

Code does not run

Hi there!

I have run into the following types of errors trying to run python train.py --rate 0.1 --GPU 0.
Examples:

  • --GPU not being an argument
  • (After removing the GPU argument) In config/__init__.py, from .loader import TrainDatasetFromFolder needs to be TrainDataPackage instead
  • Now I am seeing errors regarding missing folders:
    • `from .modules import TransformerEncoder, TransformerDecoder
       ModuleNotFoundError: No module named 'models.modules'`
      

I would appreciate if you could upload the proper code to replicate your published work.
Thanks!

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.