| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Project Page | Paper (Arxiv) | Video | Poster
Depth estimation is a long-lasting yet important task in computer vision. Most of the previous works try to estimate depth from input images and assume images are all-in-focus (AiF), which is less common in real-world applications. On the other hand, a few works take defocus blur into account and consider it as another cue for depth estimation. In this paper, we propose a method to estimate not only a depth map but an AiF image from a set of images with different focus positions (known as a focal stack). We design a shared architecture to exploit the relationship between depth and AiF estimation. As a result, the proposed method can be trained either supervisedly with ground truth depth, or unsupervisedly with AiF images as supervisory signals. We show in various experiments that our method outperforms the state-of-the-art methods both quantitatively and qualitatively, and also has higher efficiency in inference time.
This is the official PyTorch implementation of
"Bridging Unsupervised and Supervised Depth from Focus via All-in-Focus Supervision",
Ning-Hsu Wang, Ren Wang, Yu-Lun Liu, Yu-Hao Huang, Yu-Lin Chang, Chia-Ping Chen, Kevin Jou (National Tsing Hua University, MediaTek Inc.) in International Comference on Computer Vision (ICCV) 2021 conference. If you find this code useful for your research, please consider citing the following paper and star this repo.
DDFF-12-Scene Dataset
DefocusNet Dataset
Download zip file to ./data/DefocusNet_Gen
Run the following command under ./data/DefocusNet_Gen
unzip fs_6.zip
python DefocusNet_gen_txt.py
cd ../../4D-Light-Field Dataset
unzip full_data.zip
python LF2hdf5.py --base_dir ./full_data --output_dir ./LF
python FS_gen.py --LF_path ./LF/HCI_LF_trainval.h5 --output_dir ./FS FlyingThings3D Dataset
Middlebury Dataset
Mobile Depth Dataset
mkdir Photos_Calibration_Results
mv depth_from_focus_data2.zip Photos_Calibration_Results
cd Photos_Calibration_Results
unzip ./depth_from_focus_data2.zip
mv calibration/metal calibration/metals
mv calibration/GT calibration/zeromotion
mv calibration/GTSmall calibration/smallmotion
mv calibration/GTLarge calibration/largemotion
cd ..
unzip depth_from_focus_data3.zip
python gen_txt_mobile.py
cd ../../Install packages from requirements.txt in your conda environment.
conda create --name AiFDepthNet --file requirements.txt -c pytorch
conda activate AiFDepthNetCUDA_VISIBLE_DEVICES=[GPU_ID] python test.py --txt(optional) [path to the txt file of the dataset] --h5py(optional) [path to the h5py file of the dataset] --pth [path to your pretrained model] --outdir(optional) [path to your output results storage] --dataset [dataset name] --disp_depth [pretrained model is trained with disparity or depth] --test(optional) [Run DDFF-12-Scene Dataset on testing data]Please cite our paper if you find the code or dataset useful for your research.
@inproceedings{Wang-ICCV-2021,
author = {Wang, Ning-Hsu and Wang, Ren and Liu, Yu-Lun and Huang, Yu-Hao and Chang, Yu-Lin and Chen, Chia-Ping and Jou, Kevin},
title = {Bridging Unsupervised and Supervised Depth from Focus via All-in-Focus Supervision},
booktitle = {International Conference on Computer Vision},
year = {2021}
}| Back | FazBrowse Home | New Git URL |