【源码】基于卷积神经网络的语义颜色一致性设计
请注意,将使用对角线校正的颜色恒定性应用于线性原始图像。
Note that color constancy using diagonal correction should be applied to the linear RAW image.
在这里,我们并没有使用这一方法,因为没有原始图像的语义分割模型(只是概念上的证明)。
Here, we did not use that because of the absence of semantic segmentation models for RAW images (just a proof of concept).
要生成语义掩码,可以从以下链接下载Refinenet
To generate semantic masks, you can download Refinenet from the following link:
https://github.com/guosheng/refinenet
记住:您必须使用在MIT ADE20K数据集(ResNet-152)上训练的模型来理解实验场景。
Remember: you have to use the model trained on MIT ADE20K dataset (ResNet-152) for scene understanding
由于采用的是4-D图像,运行MATLAB将发现以下错误信息:Error using imageInputLayer>iParseInputArguments (line 59) The value of 'InputSize' is invalid. Expected input image size to be a 2 or 3 element vector. For a 3-element vector, the third element must be 3 or 1.
Because of the 4-D images, you are going to get an error states the following: Error using imageInputLayer>iParseInputArguments (line 59) The value of 'InputSize' is invalid. Expected input image size to be a 2 or 3 element vector. For a 3-element vector, the third element must be 3 or 1.
要修复这个错误,请执行以下操作:
-打开matlab(以管理员身份运行)
-修改:编辑imageInputLayer.m代码
To fix it, do the following: -Open Matlab (run as administrator) -Write: edit imageInputLayer.m
-修改以下代码:
-replace the following code:
将
function tf = iIsValidRGBImageSize(sz)
tf = numel(sz) == 3 && sz(end) == 3;
end
修改为
with the modified function:
function tf = iIsValidRGBImageSize(sz)
tf = numel(sz) == 3 && (sz(end) == 3 || sz(end) == 4);
end
-save
参考文献:
Mahmoud Afifi. "Semantic White Balance: Semantic Color Constancy Using Convolutional Neural Network." arXiv preprint arXiv:1802.00153 (2018).
完整源码下载请点击“阅读原文”