GithubHelp home page GithubHelp logo

fu123456 / shiq Goto Github PK

View Code? Open in Web Editor NEW
85.0 5.0 16.0 1.03 MB

Project for CVPR21 paper: "A Multi-Task Network for Joint Specular Highlight Detection and Removal".

MATLAB 32.80% Python 0.85% Shell 66.35%
highlight detection removal

shiq's Introduction

This is the project about our JSHDR (CVPR2021). Our paper is here A Multi-Task Network for Joint Specular Highlight Detection and Removal.

@InProceedings{fu-2021-multi-task,
author = {Fu, Gang and Zhang, Qing and Zhu, Lei and Li, Ping and Xiao, Chunxia},
title = {A Multi-Task Network for Joint Specular Highlight Detection and Removal},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
year = {2021},
pages = {7752-7761},
month = {June},
tags = {CVPR},
}

Overview

./images/highlight_removal.png

Figure 1: Visual comparison of highlight detection and removal on an example image from our dataset. We compare our method with the state-of-the-art removal method Shi et al. [7], Guo et al. [6], and Yang et al [3], and with the state-of-the-art detection methods including Zhang et al. [2], Li et al [1], and Fu et al [8]. Please zoom in to view fine details.

Specular highlight detection and removal are fundamental and challenging tasks. Although recent methods have achieved promising results on the two tasks by training on synthetic training data in a supervised manner, they are typically solely designed for highlight detection or removal, and their performance usually deteriorates significantly on real-world images. In this paper, we present a novel network that aims to detect and remove highlights from natural images. To remove the domain gap between synthetic training samples and real test images, and support the investigation of learning-based approaches, we first introduce a dataset with about 16K real images, each of which has the corresponding ground truths of highlight detection and removal. Using the presented dataset, we develop a multi-task network for joint highlight detection and removal, based on a new specular highlight image formation model. Experiments on the benchmark datasets and our new dataset show that our approach clearly outperforms state-of-the-art methods for both highlight detection and removal.

Specular highlight image quadruples (SHIQ)

To enable effective training and comprehensive evaluation for highlight detection and removal, we in this work introduce a large-scale real dataset for highlight detection and removal. It covers a wide range of scenes, subjects, and lighting conditions. Each image in the dataset has the corresponding highlight detection, removal, and highlight intensity images. Several examples in our dataset are shown in Figure 2.

./images/data_teaser.png

Figure 2: An illustration of several highlight (1st row), highlight-free (2nd row), highlight intensity (3rd row) and highlight mask (4th row) image quadruples in our dataset.

Some notes about the data generation as follows:

  • The original multi-illumination dataset can be downloaded from Lukas Murmann’s homepage.
  • The original multi-image specular reflection removal method RPCA can also be available from xjguo.
  • We provide the useful source code which can produce the data including image cropping, data augmentation, mask generation and white balance operation etc.
  • You can download our data from Google Drive. The link is: https://drive.google.com/file/d/1RFiNpziz8X5qYPVJPl8Y3nRbfbWVoDCC/view?usp=sharing (~1G).
  • Statement. SHIQ dataset is intended only for research purposes and thus cannot be used commercially. Moreover, reference must be made to the following publication when the dataset is used in any academic and research reports.
    @InProceedings{fu-2021-multi-task,
    author = {Fu, Gang and Zhang, Qing and Zhu, Lei and Li, Ping and Xiao, Chunxia},
    title = {A Multi-Task Network for Joint Specular Highlight Detection and Removal},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    year = {2021},
    pages = {7752-7761},
    month = {June},
    tags = {CVPR},
    }
        

Network

Requirements

  • Python3.7 Python3.6
  • PyTorch 1.5
  • pillow

Notes: The versions Python and PyTorch must be v3.6 and v1.5. If you use Python3.7+, some module can not be correctly loaded; if you use PyTorch with other versions, some errors may be caused.

Test

Download model file from here, unzip jshdr.zip in the dir checkpoints, and run the script file test.sh.

References

  • [1] Ranyang Li, Junjun Pan, Yaqing Si, Bin Yan, Yong Hu, and Hong Qin. Specular reflections removal for endoscopic image sequences with adaptive-rpca decomposition. IEEE Transactions on Medical Imaging, 39(2):328–340, 2019.
  • [2] Wuming Zhang, Xi Zhao, Jean-Marie Morvan, and Liming Chen. Improving shadow suppression for illumination robust face recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 41(3):611–624, 2018.
  • [3] Qingxiong Yang, Jinhui Tang, and Narendra Ahuja. Efficient and robust specular highlight removal. IEEE Transactions on Pattern Analysis and Machine Intelligence, 37(6):1304– 1311, 2015.
  • [4] Jie Guo, Zuojian Zhou, and Limin Wang. Single image high- light removal with a sparse and low-rank reflection model. In ECCV, pages 268–283, 2018.
  • [5] Lukas Murmann, Michael Gharbi, Miika Aittala, and Fredo Durand. A dataset of multi-illumination images in the wild. In ICCV, pages 4080–4089, 2019.
  • [6] Xiaojie Guo, Xiaochun Cao, and Yi Ma. Robust separation of reflection from multiple images. In CVPR, pages 2187– 2194, 2014.
  • [7] Jian Shi, Yue Dong, Hao Su, and Stella X. Yu. Learning non-lambertian object intrinsics across shapenet categories. In CVPR, pages 1685–1694, 2017.
  • [8] Gang Fu, Qing Zhang, Qifeng Lin, Lei Zhu, and Chunxia Xiao. Learning to detect specular highlights from real-world images. In ACM MM, pages 1873–1881, 2020.

shiq's People

Contributors

fu123456 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

shiq's Issues

About LIME dataset in your article

Can you tell me how to use LIME dataset to train and test a model?
On the one hand, which one is the highlighted folder, and which one is the unhighlighted folder.
On the other hand, LIME only has training data, which pictures to use for testing.
Looking forward to your reply! Thanks!

No evaluation code

The standard evaluation code is of extraordinary significance to the community. Can you provide evaluation codes for the following indicators? Looking forward to your reply.
image

请问可以提供高光反射检测到的MASK输出接口吗

to 大神
作者的工作非常棒~
我想将它应用到下游任务中,但是由于原始图像本身分辨率太高,直接应用权重的移除效果并不好,但是它检测的结果很不错。
不知道作者什么时候可以提供一个MASK输出的接口。非常感谢。

参数量

您好,请问可以告诉一下参数量吗?谢谢您。

Please provide source

Hello,
Could you provide the source code for your model ?
The .so is useful for testing as-is but I'd like to mess with the parameters myself.
Thanks in advance

谷歌网盘下载模型没有权限

你好,我想下载您的训练模型进行测试,
但是谷歌网盘下载需要权限。
能麻烦您给一个能下载的模型吗?
感谢

想要中间F图结果的学生

你好,我是在校研三学生,正参考您的文章实现高光去除,但由于高光去除结果没有那么理想,想了解一下中间提取特征F结果,可以吗?或者告诉我是哪个地方出现问题(F图或者M图或者S图),请您指点。谢谢!
1)这是我预测的图片
14002_D_626_31 438dB_46 695loss_0 878267
14003_D_626_34 377dB_23 734loss_0 968986

2)这是我的中间F图
14002_F_626
14003_F_626
3)这是预测M图
14002_M_626_36 461dB_14 688loss
14003_M_626_48 979dB_0 823loss
4)这是预测S图
14002_S_626_32 389dB_37 511loss
14003_S_626_38 489dB_9 207loss

开源代码是否缺少文件,谢谢

您好,我下载模型后用infer.py代码测试,
代码内:
from utils.detectionRemoval import test_single_highlight_image
工程内未找到detectionRemoval 文件,只有detectionRemoval.cpython-36m-x86_64-linux-gnu.so文件,
是工程缺少文件,还是本人使用错误。
感谢指导

Can you provide test results?

We noticed that you posted a test model. Before deciding whether to go further, the researcher seems to want to see the test image directly. Can you provide test results? For example, a zip file containing test images (.png) available for download. Looking forward to your reply.

question about RPCA

how to run the matlab code? where is the dataface metioned by load('./data/dataFace.mat') in sidDemo

关于评价指标的计算

您好,在论文中您提到的在SHIQ数据集上的去高光结果是PSNR=34.13,SSIM=0.86,请问计算的时候是只在的高光区域上进行计算,还是在整张图片上计算的?

测试卡在load model

我在测试时,程序似乎卡在load the model ,对于该问题,你知道是什么情况导致的吗?
image

About DSCFA module

Hello,

I'm trying to reimplement your network but having problem on the DSCFA module. In the paper you wrote "Our DSCFA block learns dilated spatial features to extract and aggregate dilated contextual features from four directions" and the figure showed in Figure 7.
I'm wondering:

  1. how to take the convolution from different directions? Or they are just the output for the normal convolution with different given meanings?
  2. what are the shapes of the kernels you use to get the DSCNN_U/D/R/L?

Thanks!

复现时遇到问题

image
你好,在复现代码的时候,我对图中的红圈部分产生了问题,文中的意思是将input图片通过三个卷积层和两个relu就可以得到attention map,然后再和四个不同dilation rate的输出做点积吗?

复现时的一些detail问题,想请教一下

你好同学,最近在复现您的这篇工作,有一些细节的地方图不是很清楚想请教一下
一共有两个问题
第一个问题,输入图片到第一个DSCFA时,中间是否要加入一些cnns 来改变通道数(3 ->k)
第二个问题,F经过convs得到M时,这里的M是指的一个特征图还是一个展示出来的detect_mask?(S同理?)因为mask的通道应该是1吧,而M后续还有两步的使用,感觉应该M是一个k通道的特征图而不是最后的mask,mask应该是在M的基础上再加上了一个卷积得到的?
第三个问题, 如果第二问题M和S都是k个通道的特征图的话,那I-MS计算的时候,I是不是要先经过卷积通道也做到k?

RuntimeError: CUDA error: no kernel image is available for execution on the device

按照要求安装环境,我的显卡cuda是11.6,但是安装pytorch1.5.0只有cuda10.2的版本,运行代码后出现如下错误:RuntimeError: CUDA error: no kernel image is available for execution on the device。

用其它版本的pytorch跑又会出现其它的错误。

请问作者怎么解决?还有是否可以提供源码?

希望得到您的回复

关于数据集的制作

您好。我想制作自己的数据集,目前只有两种类型的图片(_A.png 和 _D.png),您提供的开源代码中有生成_T.png的工具,但是需要用到_S.png,那么请问这个_S.png是怎样获得的 ?我在您的文章里没有看到有提到(或者是我没有理解)。

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.