zoukankan      html  css  js  c++  java
  • GAN网络中采用导向滤波的论文

    1、<Inductive Guided Filter: Real-time Deep Image Matting with Weakly Annotated Masks on Mobile Devices>

    CVPR2019

     下载地址:https://arxiv.org/pdf/1905.06747.pdf

    2、<Fast End-to-End Trainable Guided Filter>

    CVPR2018

      下载地址:https://arxiv.org/pdf/1803.05619.pdf

      代码路径:https://github.com/farmingyard/DeepGuidedFilter

     3、<Learning to Cartoonize Using White-box Cartoon Representations>

    CVPR2020

     导向滤波用于调整图像的细节锐度,基于tensorflow实现,代码如下:

    '''
    CVPR 2020 submission, Paper ID 6791
    Source code for 'Learning to Cartoonize Using White-Box Cartoon Representations'
    '''
    
    
    import tensorflow as tf
    import numpy as np
    
    
    def tf_box_filter(x, r):
        ch = x.get_shape().as_list()[-1]
        weight = 1/((2*r+1)**2)
        box_kernel = weight*np.ones((2*r+1, 2*r+1, ch, 1))
        box_kernel = np.array(box_kernel).astype(np.float32)
        output = tf.nn.depthwise_conv2d(x, box_kernel, [1, 1, 1, 1], 'SAME')
        return output
    
    
    
    def guided_filter(x, y, r, eps=1e-2):
        
        x_shape = tf.shape(x)
        #y_shape = tf.shape(y)
    
        N = tf_box_filter(tf.ones((1, x_shape[1], x_shape[2], 1), dtype=x.dtype), r)
    
        mean_x = tf_box_filter(x, r) / N
        mean_y = tf_box_filter(y, r) / N
        cov_xy = tf_box_filter(x * y, r) / N - mean_x * mean_y
        var_x  = tf_box_filter(x * x, r) / N - mean_x * mean_x
    
        A = cov_xy / (var_x + eps)
        b = mean_y - A * mean_x
    
        mean_A = tf_box_filter(A, r) / N
        mean_b = tf_box_filter(b, r) / N
    
        output = mean_A * x + mean_b
    
        return output
    
    
    if __name__ == '__main__':
        pass
    

    paper:https://link.zhihu.com/?target=https%3A//systemerrorwang.github.io/White-box-Cartoonization/paper/06791.pdf

    code:https://github.com/SystemErrorWang/White-box-Cartoonization

  • 相关阅读:
    Spring
    sikuli常用方法学习
    运行测试Caused by: java.lang.UnsatisfiedLinkError: no attach in java.library.path错误解决
    sikuli+java实例
    sikuli运行出现问题:Win32Util.dll: Can't load 32-bit .dll on a AMD 64 bit platform
    官网下载jdk
    java:jdk环境变量配置+tomcat环境变量配置
    Redis能干啥?细看11种Web应用场景
    计数场景的优化
    国内外三个领域巨头告诉你Redis怎么用
  • 原文地址:https://www.cnblogs.com/wjjcjj/p/14430806.html
Copyright © 2011-2022 走看看