This repository is the official implementation of M2-Net: Multi-stages Specular Highlight Detection and Removal in Multi-scenes.
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.
To install requirements:
pip install -r requirements.txt
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'
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'
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.
This code is not allowed for any commercial purpose without written concent from the authors.