Coder Social home page Coder Social logo

cvmeta / uhdm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cvmi-lab/uhdm

0.0 0.0 0.0 16.5 MB

(ECCV2022) This is the official PyTorch implementation of ECCV2022 paper: Towards Efficient and Scale-Robust Ultra-High-Definition Image Demoireing

License: MIT License

Shell 1.58% Python 98.42%

uhdm's Introduction

Towards Efficient and Scale-Robust Ultra-High-Definition Image Demoiréing

PWC PWC

Towards Efficient and Scale-Robust Ultra-High-Definition Image Demoireing (ECCV 2022)
Xin Yu, Peng Dai, Wenbo Li, Lan Ma, Jiajun Shen, Jia Li, Xiaojuan Qi

Example 1 Gif 1

⏳ To Do

  • Release training code
  • Release testing code
  • Release dataset
  • Release pre-trained models
  • Release an improved model trained on combined datasets
  • Add an online demo 🤗

🚀 🚀 🚀 News:

  • Jul. 31, 2022: Add an online demo in HuggingFace Space 🤗, which allows testing via an interactive window. Note the demo runs on CPU, so the inference may cost 80s per 4K image. The demo model was trained on combined datasets for more robust qualitative performance.

Introduction

When photographing the contents displayed on the digital screen, an inevitable frequency aliasing between the camera’s color filter array (CFA) and the screen’s LCD subpixel widely exists. The captured images are thus mixed with colorful stripes, named moire patterns, which severely degrade images’ perceptual qualities. Although a plethora of dedicated demoiré methods have been proposed in the research community recently, yet is still far from achieving promising results in the real-world scenes. The key limitation of these methods is that they all only conduct research on low-resolution or synthetic images. However, with the rapid development of mobile devices, modern widely-used mobile phones typically allow users to capture 4K resolution (i.e.,ultra-high-definition) images, and thus the effectiveness of these methods on this practical scenes is not promised. In this work, we explore moire pattern removal for ultra-high-definition images. First, we propose the first ultra-high-definition demoiréing dataset (UHDM), which contains 5,000 real-world 4K resolution image pair, and conduct a benchmark study on the current state of the art. Then, we analyze limitations of the state of the art and summarize the key issue of them, i.e., not scale-robust. To address their deficiencies, we deliver a plug-and-play semantic-aligned scale-aware module which helps us to build a frustratingly simple baseline model for tackling 4K moire images. Our framework is easy to implement and fast for inference, achieving state-of-the-art results on four demoiréing datasets while being much more lightweight. We hope our investigation could inspire more future research in this more practical setting in image demoiréing.

Environments

First you have to make sure that you have installed all dependencies. To do so, you can create an anaconda environment called esdnet using

conda env create -f environment.yaml
conda activate esdnet

Our implementation has been tested on one NVIDIA 3090 GPU with cuda 11.2.

Quick Test

Once you have installed all dependencies, you can try a quick test without downloading training dataset:

1. Download our pre-trained models:

We provide pre-trained models on four datasets, which can be downloaded through the following links:

Model Name Training Dataset Download Link
ESDNet UHDM uhdm_checkpoint.pth
ESDNet-L UHDM uhdm_large_checkpoint.pth
ESDNet FHDMi fhdmi_checkpoint.pth
ESDNet-L FHDMi fhdmi_large_checkpoint.pth
ESDNet TIP2018 tip_checkpoint.pth
ESDNet-L TIP2018 tip_large_checkpoint.pth
ESDNet LCDMoire aim_checkpoint.pth
ESDNet-L LCDMoire aim_large_checkpoint.pth

Or you can simply run the following command for automatic downloading:

bash scripts/download_model.sh

Then the checkpoints will be included in the folder pretrain_model/.

2. Test with your own images:

Change the configuration file ./demo_config/demo.yaml to fit your own setting, and then simply run:

python demo_test.py --config ./demo_config/demo.yaml

the output images will be included in the path depending on the flags SAVE_PREFIX and EXP_NAME in your configuration file.

Dataset

Data We provide the 4K dataset UHDM for you to evaluate a pretrained model or train a new model. To this end, you can download them here, or you can simply run the following command for automatic data downloading:

bash scripts/download_data.sh

Then the dataset will be available in the folder uhdm_data/.

Train

To train a model from scratch, simply run:

python train.py --config CONFIG.yaml

where you replace CONFIG.yaml with the name of the configuration file you want to use. We have included configuration files for each dataset under the folder config/.

For example, if you want to train our lightweight model ESDNet on UHDM dataset, run:

python train.py --config ./config/uhdm_config.yaml

Test

To test a model, you can also simply run:

python test.py --config CONFIG.yaml

where you need to specify the value of TEST_EPOCH in the CONFIG.yaml to evaluate a model trained after specific epochs, or you can also specify the value of LOAD_PATH to directly load a pre-trained checkpoint.

Results

Quantitative Results:

Extended link:

If you want to remove moire patterns in your video, you can try our CVPR 2022 work: VDMoire vdmoire

Citation

Please consider 😬 staring this repository and citing the following papers if you feel this repository useful.

@inproceedings{Yu2022TowardsEA,
  title={Towards Efficient and Scale-Robust Ultra-High-Definition Image Demoireing},
  author={Xin Yu and Peng Dai and Wenbo Li and Lan Ma and Jiajun Shen and Jia Li and Xiaojuan Qi},
  booktitle={European Conference on Computer Vision (ECCV)},
  year={2022}
}

@inproceedings{dai2022video,
  title={Video Demoireing with Relation-Based Temporal Consistency},
  author={Dai, Peng and Yu, Xin and Ma, Lan and Zhang, Baoheng and Li, Jia and Li, Wenbo and Shen, Jiajun and Qi, Xiaojuan},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year={2022}
}

Contact

If you have any questions, you can email me ([email protected]).

uhdm's People

Contributors

xinyu-andy avatar daipengwa 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.