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/MASRThe 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
datarootandtest_datarootargument in./options/realSR_MASR.pyto 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.pyusing script filetrain_pc.sh
bash train_pc.sh- You can find the results in
./experiments/MASR_x4if theexp_nameargument in./options/realSR_MASR.pyisMASR_x4.
- Download our pre-trained models to
./modelsfolder or use your pre-trained models - Change the
test_datarootargument inCDC_test.pyto the place where images are located - Run
CDC_test.pyusing script filetest_models_pc.sh
bash test_models_pc.sh- You can find the enlarged images in
./resultsfolder.