A Unified Framework for Microscopy Defocus Deblur with Multi-Pyramid Transformer and Contrastive Learning
Yuelin Zhang, Pengyu Zheng, Wanquan Yan, Chengyu Fang, Shing Shin Cheng; Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2024, pp. 11125-11136
paper / supplementary material
We release CataBlur dataset. CataBlur is a new surgical microscope defocus blur dataset, including 1208 defocus images collected from 5 cataract surgeries, for evaluation on real surgical defocus blur.
It can be downloaded from Google Drive.
Other open-source datasets can be downloaded from their original websites.
All downloaded datasets should be placed under the Datasets
folder.
conda create -n MPT python=3.11
conda activate MPT
# If necessary, Replace pytorch-cuda=? with the compatible version of your GPU driver.
conda install pytorch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 pytorch-cuda=11.8 -c pytorch -c nvidia
pip install -r requirements.txt
To train the model with multiple GPUs, use the script.
sh train_dist.sh
To train the model with a single GPU, call the python script directly.
python run.py -net MPT -config config_MPT -data DATASETS_THAT_YOU_WANT_TO_USE -train True
All model weights can be downloaded at here.
Put the weight in Weights
directory.
python run_inference.py --data /path/to/your/images --pretrained /path/to/your/weights
python run.py -net MPT -config config_MPT -data DATASETS_THAT_YOU_WANT_TO_USE \
-train False -ckpt_name /path/to/your/weights
If you find our work helpful, please consider citing our paper:
@inproceedings{zhang2024unified,
title={A unified framework for microscopy defocus deblur with multi-pyramid transformer and contrastive learning},
author={Zhang, Yuelin and Zheng, Pengyu and Yan, Wanquan and Fang, Chengyu and Cheng, Shing Shin},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={11125--11136},
year={2024}
}