DeepGuidedFilter
Official Implementation of Fast End-to-End Trainable Guided Filter, CVPR 2018
Install / Use
/learn @wuhuikai/DeepGuidedFilterREADME
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 (huikaiwu@icloud.com)
Get Started
Prepare Environment [Python>=3.6]
- Download source code from GitHub.
git clone https://github.com/wuhuikai/DeepGuidedFilter cd DeepGuidedFilter && git checkout release - 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 - (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
- Enter the directory.
cd ComputerVision/Deeplab-Resnet - Download the pretrained model [Google Drive|BaiduYunPan].
- Run it now !
python predict_dgf.py --img_path ../../images/segmentation.jpg --snapshots [MODEL_PATH]
Note:
- Result is in
../../images. - Run
python predict_dgf.py -hfor more details.
Saliency Detection with DSS
- Enter the directory.
cd ComputerVision/Saliency_DSS - Download the pretrained model [Google Drive|BaiduYunPan].
- Try it now !
python predict.py --im_path ../../images/saliency.jpg \ --netG [MODEL_PATH] \ --thres 161 \ --dgf --nn_dgf \ --post_sigmoid --cuda
Note:
- Result is in
../../images. - See Here or
python predict.py -hfor more details.
Monocular Depth Estimation
- Enter the directory.
cd ComputerVision/MonoDepth - Download and Unzip Pretrained Model [Google Drive|BaiduYunPan]
- Run on an Image
python monodepth_simple.py --image_path ../../images/depth.jpg --checkpoint_path [MODEL_PATH] --guided_filter
Note:
- Result is in
../../images. - See Here or
python monodepth_simple.py -hfor 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
- Image Processing
- Semantic Segmentation with Deeplab-Resnet
- Saliency Detection with DSS
- Monocular Depth Estimation
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}
}
Related Skills
node-connect
349.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
