Skip to content

kjzju/specular-removal

Repository files navigation

M2-Net

This repository is the official implementation of M2-Net: Multi-stages Specular Highlight Detection and Removal in Multi-scenes.

Introduction

M2-Net (the name Multi-stages Specular Highlight Detection and Removal in Multi-scenes) achieves strong performance in multi-scenes single image specular highlight removal (natural scenes, facial scenes, text scenes etc.), surpassing previous models by a large margin.

image-20220810153228038

Requirements

To install requirements:

pip install -r requirements.txt

Training

To train the model(s) in the paper, run this command:

python train.py --runs_name <> --dataroot <> --train_dir <> --test_dir <>

Example:

python train.py --runs_name './myruns' --dataroot './data/shiq' --train_dir 'train' --test_dir 'test'

Evaluation

To evaluate my model on your datasets, run:

python infer.py --input_dir <> --output_dir <> -- infer_model <>

Example:

python infer.py --input_dir './test/inp/' --output_dir './test/out/' --infer_model './savedmodel/nature.mdl'

Pre-trained Models

You can download pretrained models here M2Net. It contains two models( text_face and nature), and you can use either one according to your needs.

Final Note

This code is not allowed for any commercial purpose without written concent from the authors.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages