GithubHelp home page GithubHelp logo

chu246 / msprl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from feiyuli-cs/msprl

0.0 0.0 0.0 34.42 MB

Rethinking PRL: A Multiscale Progressively Residual Learning Network for Inverse Halftoning

License: MIT License

Python 100.00%

msprl's Introduction

MS-PRL

Rethinking PRL: A Multiscale Progressively Residual Learning Network for Inverse Halftoning.

Abstract

Network architecture

Contents

  1. Environment
  2. Demo
  3. Train
  4. Test and Valid
  5. Dataset
  6. Model
  7. Citation
  8. Other

Environment

python=3.8 numpy=1.21.2 opencv-python=4.5.5.64
pillow=8.4.0 numba=0.55.1 scikit-image=0.18.3
pytorch=1.10.0 torchvision=0.11.1 cudatoolkit=11.3

Demo

demo images in demo/halftone/ folder, and the output images in demo/output/ folder.

python demo.py

Train

To train MS-PRL , run the command below:

python main.py --mode train --model_name=MSPRL

if you want to train other model, pleace change --model_name="your model name". The model weights will be saved in ./checkpoint/model_name/model_name_iterations.pth folder.

Test and Valid

  1. run test mode, images will be saved in ./resutls/model_name/test_name/ and the log will be saved in ./logs/model_name/test/test_name/log.txt.
  2. run valid mode, just the log will be saved in ./logs/model_name/test/test_name/log.txt

To test MS-PRL , run the command below:

python main.py --mode test --model_name=MS-PRL

To valid MS-PRL , run the command below:

python main.py --mode valid --model_name=MS-PRL

Please pay attention to the dataset path, refer to the details of the dataset.

Dataset

  1. Download VOC2012, Kodak25, Place365 dataset and five standard benchmark datasets. You can also download our dataset in here.

  2. To generate halftone image using Floyd Steinberg error diffusion, run the command below:

cd utils
python halftone.py

The data folder should be like the format below:

dataset
├─ train
│ ├─ data     % 13841 halftone images
│ │ ├─ xxxx.png
│ │ ├─ ......
│ │
│ ├─ target   % 13841 gray images
│ │ ├─ xxxx.png
│ │ ├─ ......
│
├─ valid
│ ├─ data     % 3000 halftone images
│ │ ├─ xxxx.png
│ │ ├─ ......
│ │
│ ├─ target   % 3000 gray images
│ │ ├─ xxxx.png
│ │ ├─ ......
|
├─ test
│ ├─ Class
| │ ├─ data     % halftone images
| │ │ ├─ xxxx.png
│ | │ ├─ ......
│ │
│ | ├─ target   % gray image
│ │ | ├─ xxxx.png
│ │ | ├─ ......
|
│ ├─ Kodak
| | ├─ ......

Model

We provide our all pre-trained models.

  • MS-PRL, PRL-dt and other model in here. The data folder should be like the format below:
checkpoint
├─ MSPRL
│ ├─ MSPRL_iteration.pth
│ │
├─ DnCNN
│ ├─ DnCNN_iteration.pth
│ │

Citation

Other

Reference Code:

  1. https://github.com/chosj95/MIMO-UNet
  2. https://github.com/swz30/MIRNetv2
  3. https://github.com/csbhr/CNLRN
  4. DnCNN: https://github.com/cszn/KAIR

msprl's People

Contributors

feiyuli-cs 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.