The official repository for BaMBNet

Overview

BaMBNet-Pytorch

Paper: https://arxiv.org/abs/2105.14766 (arXiv)

The code is for the work:

@article{liang2021BaMBNet,
  title={BaMBNet: A Blur-aware Multi-branch Network for Defocus Deblurring},
  author={Pengwei Liang, Junjun Jiang, Xianming Liu, and Jiayi Ma},
  journal={submitted to IEEE Transactions on Computational Imaging},
  volume={},
  number={},
  pages={},
  year={2021},
}

Requirements

pytorch == 1.7.1
kornia == 0.4.1
opencv == 4.4.0

Dataset

Please refer to the official repo at Defocus deblurring using dual-pixel data.

Train

  • Step 1: train COC network to estimate the blur amounts of DP data.

    python blur_train.py -opt option/train/COC_Dataset_Train.yaml
  • Step 2: prepare the COC maps for deblurring training.

    python blur_test.py -opt option/test/COC_Dataset_Test.yaml
  • Step 3: train the deblurred network.

    python train.py -opt option/train/Deblur_Dataset_Trained.yaml

Test

python test.py -opt option/test/Deblur_Dataset_Test.yaml

License

This project is under the CC-BY-NC 4.0 license. See LICENSE for details.

Comments
  • About first step COCMap training?

    About first step COCMap training?

    Thanks for projects again! I used the config you given to train 20 epochs Cocmap on dataset of Canon by the preprocessing code 'image_to_patch_filter.py' , and the inference results are shown in the figure below Figure 1, all pixels is black with the value >1000.There are several questions: 1.The pixel value of the image is uint16, and the effect of the sub-area described in the paper cannot be seen. I would like to know whether my training is wrong or yours is the same. 2.Why three channel and not a single channel, and what's the meaning of the pixel value on each result graph? In addition, I modified the config "niter: 500000 epoch: 300 #20" , trained it at about 45 epoch(70 000 iter), and the phenomenon of unsupervised loss=0 would appear. Then, the test results were shown in Figure 2, is that normal? image

    opened by pingjun18-li 14
  • How to update the thresholds r2, r3, r4 in your code?

    How to update the thresholds r2, r3, r4 in your code?

    In Section III C of your paper, the thresholds r2-4 are updated by adaptively learning from a small amountof meta-data. However, I don't find this part in your code. I only find you give four static_kernel_size . ”Combined with the model training process, generatingthe defocus mask is a nested optimization“ Where is the nested optimization?

    opened by FlyFish-space 5
  • The input of model  in train.py and test.py

    The input of model in train.py and test.py

    1. In your code train.py, the model input is (l_img, r_img, b_img). Is b_img COC map of train dataset? But b_img is not obtained in your blur_train.py. So do I need to change your code blur_test.py to obtain b_img?
    2. In your code test.py, the model input is (l_img, r_img, r_img).If there’s been a mistake?Why do you concatnate two r_img?
    opened by FlyFish-space 3
  • Cannot open the arxiv paper

    Cannot open the arxiv paper

    Hi Guys,

    Want to read your paper but seems the arXiv link cannot be opened by me. Could you check it or send it to me offline ([email protected]) ? Thanks.

    opened by xytmhy 1
  • Input for model in test.py

    Input for model in test.py

    Many thanks for your work. I am confused about the input for model in test.py. It seems that the COC maps are not used as input for model in test.py. While the COC maps ARE used as input for model in train.py. Is it used for ablation study or a wrong setting. Many thanks.

    opened by yarqian 1
  • About pretrained model ?

    About pretrained model ?

    Thanks for providing the code for the BaMBNet, I think it’s a very interesting method! However , it only can be train by single GPU, it will take a lot of time to reproduce the performance. I just want to see the results generated by the model, can you provide your pretrained model ? Thanks again for your help!

    opened by pingjun18-li 1
Owner
Junjun Jiang
He is a Professor at HIT, Harbin, China.
Junjun Jiang
Official repository for Few-shot Image Generation via Cross-domain Correspondence (CVPR '21)

Few-shot Image Generation via Cross-domain Correspondence Utkarsh Ojha, Yijun Li, Jingwan Lu, Alexei A. Efros, Yong Jae Lee, Eli Shechtman, Richard Zh

Utkarsh Ojha 251 Dec 11, 2022
Official repository for Jia, Raghunathan, Göksel, and Liang, "Certified Robustness to Adversarial Word Substitutions" (EMNLP 2019)

Certified Robustness to Adversarial Word Substitutions This is the official GitHub repository for the following paper: Certified Robustness to Adversa

Robin Jia 38 Oct 16, 2022
Official repository for the ICLR 2021 paper Evaluating the Disentanglement of Deep Generative Models with Manifold Topology

Official repository for the ICLR 2021 paper Evaluating the Disentanglement of Deep Generative Models with Manifold Topology Sharon Zhou, Eric Zelikman

Stanford Machine Learning Group 34 Nov 16, 2022
The repository offers the official implementation of our paper in PyTorch.

Cloth Interactive Transformer (CIT) Cloth Interactive Transformer for Virtual Try-On Bin Ren1, Hao Tang1, Fanyang Meng2, Runwei Ding3, Ling Shao4, Phi

Bingoren 49 Dec 1, 2022
Official code repository of the paper Learning Associative Inference Using Fast Weight Memory by Schlag et al.

Learning Associative Inference Using Fast Weight Memory This repository contains the offical code for the paper Learning Associative Inference Using F

Imanol Schlag 18 Oct 12, 2022
Official repository for "Action-Based Conversations Dataset: A Corpus for Building More In-Depth Task-Oriented Dialogue Systems"

Action-Based Conversations Dataset (ABCD) This respository contains the code and data for ABCD (Chen et al., 2021) Introduction Whereas existing goal-

ASAPP Research 49 Oct 9, 2022
Official repository for HOTR: End-to-End Human-Object Interaction Detection with Transformers (CVPR'21, Oral Presentation)

Official PyTorch Implementation for HOTR: End-to-End Human-Object Interaction Detection with Transformers (CVPR'2021, Oral Presentation) HOTR: End-to-

Kakao Brain 114 Nov 28, 2022
Official repository for "Intriguing Properties of Vision Transformers" (2021)

Intriguing Properties of Vision Transformers Muzammal Naseer, Kanchana Ranasinghe, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, & Ming-Hsuan Yang P

Muzammal Naseer 155 Dec 27, 2022
Competitive Programming Club, Clinify's Official repository for CP problems hosting by club members.

Clinify-CPC_Programs This repository holds the record of the competitive programming club where the competitive coding aspirants are thriving hard and

Clinify Open Sauce 4 Aug 22, 2022
Official repository for "On Improving Adversarial Transferability of Vision Transformers" (2021)

Improving-Adversarial-Transferability-of-Vision-Transformers Muzammal Naseer, Kanchana Ranasinghe, Salman Khan, Fahad Khan, Fatih Porikli arxiv link A

Muzammal Naseer 47 Dec 2, 2022
This is the official repository of XVFI (eXtreme Video Frame Interpolation)

XVFI This is the official repository of XVFI (eXtreme Video Frame Interpolation), https://arxiv.org/abs/2103.16206 Last Update: 20210607 We provide th

Jihyong Oh 195 Dec 29, 2022
CVPR 2021 - Official code repository for the paper: On Self-Contact and Human Pose.

selfcontact This repo is part of our project: On Self-Contact and Human Pose. [Project Page] [Paper] [MPI Project Page] It includes the main function

Lea Müller 68 Dec 6, 2022
CVPR 2021 - Official code repository for the paper: On Self-Contact and Human Pose.

SMPLify-XMC This repo is part of our project: On Self-Contact and Human Pose. [Project Page] [Paper] [MPI Project Page] License Software Copyright Lic

Lea Müller 83 Dec 14, 2022
Official repository for the paper "Going Beyond Linear Transformers with Recurrent Fast Weight Programmers"

Recurrent Fast Weight Programmers This is the official repository containing the code we used to produce the experimental results reported in the pape

IDSIA 36 Nov 15, 2022
Official repository for the paper "Can You Learn an Algorithm? Generalizing from Easy to Hard Problems with Recurrent Networks"

Easy-To-Hard The official repository for the paper "Can You Learn an Algorithm? Generalizing from Easy to Hard Problems with Recurrent Networks". Gett

Avi Schwarzschild 52 Sep 8, 2022
Official repository for the CVPR 2021 paper "Learning Feature Aggregation for Deep 3D Morphable Models"

Deep3DMM Official repository for the CVPR 2021 paper Learning Feature Aggregation for Deep 3D Morphable Models. Requirements This code is tested on Py

null 38 Dec 27, 2022
Official repository for the paper, MidiBERT-Piano: Large-scale Pre-training for Symbolic Music Understanding.

MidiBERT-Piano Authors: Yi-Hui (Sophia) Chou, I-Chun (Bronwin) Chen Introduction This is the official repository for the paper, MidiBERT-Piano: Large-

null 137 Dec 15, 2022
Official repository of my book: "Deep Learning with PyTorch Step-by-Step: A Beginner's Guide"

This is the official repository of my book "Deep Learning with PyTorch Step-by-Step". Here you will find one Jupyter notebook for every chapter in the book.

Daniel Voigt Godoy 340 Jan 1, 2023