This repository is an official PyTorch implementation of the paper "Digital rock resolution enhancement and detail recovery with multi attention neural network "
The source code is primarily derived from EDSR and CDCSR. We provide full training and testing codes, pre-trained models used in our paper. You can train your model from scratch, or use a pre-trained model to enlarge your digital rock images.
- Python 3.8.5
- PyTorch = 1.8.1
- numpy
- cv2
- skimage
- tqdm
git clone https://github.com/MHDXing/MASR-for-Digital-Rock-Images.git
cd MASR-for-Digital-Rock-Images-main/MASR
The dataset we used was derived from DeepRockSR. There are 9600, 1200, 1200 HR 2D images (500x500) for training, testing and validation, respectively.
- Download the dataset and unpack them to any place you want. Then, change the
dataroot
andtest_dataroot
argument in./options/realSR_MASR.py
to the place where images are located - You can change the hyperparameters of different models by modifying the files in the
./options/
folder - Run
CDC_train_test.py
using script filetrain_pc.sh
bash train_pc.sh
- You can find the results in
./experiments/MASR_x4
if theexp_name
argument in./options/realSR_MASR.py
isMASR_x4
.
- Download our pre-trained models to
./models
folder or use your pre-trained models - Change the
test_dataroot
argument inCDC_test.py
to the place where images are located - Run
CDC_test.py
using script filetest_models_pc.sh
bash test_models_pc.sh
- You can find the enlarged images in
./results
folder.