Coder Social home page Coder Social logo

specular-removal's Introduction

Specular Removal

Single image specular removal based on deep learning.

Quick start

  1. Create virtual environment:

    conda create -n Specular_Removal python=3.8
    conda activate Specular_Removal
    pip install -r requirements.txt
  2. Install PyTorch,refer to the blog for details;

  3. Test environment:

    conda activate Specular_Removal
    python remove_specular.py
  4. Download dataset and unzip it to ./data folder

Train model

conda activate Specular_Removal
python train.py

Examples

漏勺 橙子 亚马逊包装袋

References

License

MIT License

Copyright (c) 2021 Huang Zhengzhi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

specular-removal's People

Contributors

zhiyiyo avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

season-chan

specular-removal's Issues

训练时出错

您好,我在Windows训练时一切正常,但为什么会在Linux上训练时遇到错误说tensor的size不一样?
两者的环境和训练代码都是一样的,请问这可能是哪里出了错呢?

github

您好,请问这部分的代码是在做什么工作

1

def forward(self, x, M):
    """
    Parameters
    ----------
    x: Tensor of shape `(N, C, H, W)`
        特征图

    M: Tensor of shape `(N, 1, H, W)`
        图像蒙版,高光区域的像素值为 `0`
    """
    M = self.conv_M(M)
    index = M == 0
    M[index] = 1
    x = self.conv_I(M*x)
    x = F.relu(self.bn(x/M))
    M = M.masked_fill(index, 0)
    return x, M

文章

你好,请问这是哪篇文章的代码实现呢?是《A Multi-Task Network for Joint Specular Highlight Detection and Removal》?还是《CDFF-Net: Cumulative Dense Feature Fusion for Single Image Specular Highlight Removal》呢?

test environment时出错

你好!我在Test environment 时,触发了错误“图像太大啦,请缩小图像大小后再尝试~~”,我没有修改remove_specular.py中的任何代码,这是为什么呢?resource/images目录下的文件图片大小为200x200,我将图像尺寸缩小一半后(即100x100),还是触发同样的错误。这个网络能处理图片的尺寸是固定大小的吗?如果是的话,大小应该为多小?

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.