• Stars
    star
    823
  • Rank 55,417 (Top 2 %)
  • Language
    Python
  • Created over 6 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Official Implementation of Fast End-to-End Trainable Guided Filter, CVPR 2018

Fast End-to-End Trainable Guided Filter

[Project] [Paper] [arXiv] [Demo] [Home]

Official implementation of Fast End-to-End Trainable Guided Filter.
Faster, Better and Lighter for pixel-wise image prediction.

Overview

DeepGuidedFilter is the author's implementation of:

Fast End-to-End Trainable Guided Filter
Huikai Wu, Shuai Zheng, Junge Zhang, Kaiqi Huang
CVPR 2018

With our method, FCNs can run 10-100 times faster w/o performance drop.

Contact: Hui-Kai Wu ([email protected])

Get Started

Prepare Environment [Python>=3.6]

  1. Download source code from GitHub.
    git clone https://github.com/wuhuikai/DeepGuidedFilter
    
    cd DeepGuidedFilter && git checkout release
  2. Install dependencies.
    conda install opencv=3.4
    conda install pytorch=1.1 torchvision=0.2 cudatoolkit=9.0 -c pytorch
    
    pip install -r requirements.txt 
  3. (Optional) Install dependencies for MonoDepth.
    cd ComputerVision/MonoDepth
    
    pip install -r requirements.txt

Ready to GO !

Image Processing

cd ImageProcessing/DeepGuidedFilteringNetwork

python predict.py  --task auto_ps \
                   --img_path ../../images/auto_ps.jpg \
                   --save_folder . \
                   --model deep_guided_filter_advanced \
                   --low_size 64 \
                   --gpu 0

See Here or python predict.py -h for more details.

Semantic Segmentation with Deeplab-Resnet

  1. Enter the directory.
    cd ComputerVision/Deeplab-Resnet
  2. Download the pretrained model [Google Drive|BaiduYunPan].
  3. Run it now !
    python predict_dgf.py --img_path ../../images/segmentation.jpg --snapshots [MODEL_PATH]

Note:

  1. Result is in ../../images.
  2. Run python predict_dgf.py -h for more details.

Saliency Detection with DSS

  1. Enter the directory.
    cd ComputerVision/Saliency_DSS
  2. Download the pretrained model [Google Drive|BaiduYunPan].
  3. Try it now !
    python predict.py --im_path ../../images/saliency.jpg \
                      --netG [MODEL_PATH] \
                      --thres 161 \
                      --dgf --nn_dgf \
                      --post_sigmoid --cuda

Note:

  1. Result is in ../../images.
  2. See Here or python predict.py -h for more details.

Monocular Depth Estimation

  1. Enter the directory.
    cd ComputerVision/MonoDepth
  2. Download and Unzip Pretrained Model [Google Drive|BaiduYunPan]
  3. Run on an Image
    python monodepth_simple.py --image_path ../../images/depth.jpg --checkpoint_path [MODEL_PATH] --guided_filter

Note:

  1. Result is in ../../images.
  2. See Here or python monodepth_simple.py -h for more details.

Guided Filtering Layer

Install Released Version

  • PyTorch Version
    pip install guided-filter-pytorch
  • Tensorflow Version
    pip install guided-filter-tf

Usage

  • PyTorch Version
    from guided_filter_pytorch.guided_filter import FastGuidedFilter
    
    hr_y = FastGuidedFilter(r, eps)(lr_x, lr_y, hr_x)
    from guided_filter_pytorch.guided_filter import GuidedFilter
    
    hr_y = GuidedFilter(r, eps)(hr_x, init_hr_y)
    from guided_filter_pytorch.guided_filter import ConvGuidedFilter
    
    hr_y = ConvGuidedFilter(r, norm)(lr_x, lr_y, hr_x)
    
  • Tensorflow Version
    from guided_filter_tf.guided_filter import fast_guided_filter
    
    hr_y = fast_guided_filter(lr_x, lr_y, hr_x, r, eps, nhwc)
    from guided_filter_tf.guided_filter import guided_filter
    
    hr_y = guided_filter(hr_x, init_hr_y, r, eps, nhwc)

Training from scratch

Prepare Training Environment

git checkout master

conda install opencv=3.4
conda install pytorch=1.1 torchvision=0.2 cudatoolkit=9.0 -c pytorch

pip uninstall Pillow
pip install -r requirements.txt

# (Optional) For MonoDepth
pip install -r ComputerVision/MonoDepth/requirements.txt 

Start to Train

Citation

@inproceedings{wu2017fast,
  title     = {Fast End-to-End Trainable Guided Filter},
  author    = {Wu, Huikai and Zheng, Shuai and Zhang, Junge and Huang, Kaiqi},
  booktitle = {CVPR},
  year = {2018}
}

More Repositories

1

FastFCN

FastFCN: Rethinking Dilated Convolution in the Backbone for Semantic Segmentation.
Python
835
star
2

FaceSwap

Swap face between two photos.
Python
691
star
3

GP-GAN

Official Chainer implementation of GP-GAN: Towards Realistic High-Resolution Image Blending (ACMMM 2019, oral)
Python
448
star
4

TF-A2RL

The official implementation for A2-RL: Aesthetics Aware Rinforcement Learning for Automatic Image Cropping
Python
189
star
5

MSC

MSC: A Dataset for Macro-Management in StarCraft II
Python
138
star
6

PointCloudSuperResolution

Point Cloud Super Resolution with Adversarial Residual Graph Networks
Python
56
star
7

SparseMask

SparseMask: Differentiable Connectivity Learning for Dense Image Prediction.
Python
51
star
8

chainer-pix2pix

Chainer implementation for Image-to-Image Translation Using Conditional Adversarial Networks
Python
39
star
9

DeepCV

A set of RESTful APIs for computer vision and image processing with PyTorch and Flask.
HTML
8
star
10

chainer-neural-style

Chainer implementation for Neural Style Transfer & Fast Neural Style Transfer
Python
6
star
11

chainer-realism-cnn

Chainer implementation for realismCNN.
Python
6
star
12

a3c-deepmind-pytorch

Python
6
star
13

pytorch-a3c

Python
3
star
14

SIFT

SIFT in C++
C++
3
star
15

pytorch-dqn-universe

Deep Reinforcement learning with pytorch on universe platform
Python
2
star
16

GP-GAN-Project

Project Website for GP-GAN: Towards Realistic High-Resolution Image Blending
HTML
2
star
17

wuhuikai

2
star
18

CNN_CUT

Using CNN to boot up GrabCut
C++
2
star
19

FastFCNProject

HTML
1
star
20

ProximalGradientOptimization

Python source code & example for use proximal gradient optimization
Python
1
star
21

DeepDrone

A python library for running image (video) processing, computer vision, and deep learning algorithms on Tello (DJI drone).
Python
1
star
22

DeepJS

HTML
1
star
23

DeepGuidedFilterProject

HTML
1
star