This is a fork of https://github.com/xinntao/Real-ESRGAN with some modifications to perform super-resolution enhancement specifically for J-Resolved NMR spectral data.
- Python >= 3.7 (Recommend to use Anaconda or Miniconda)
- PyTorch >= 1.7
-
Clone repo
git clone https://github.com/yanyan5420/J-RESRGAN.git cd J-RESRGAN
-
Install dependent packages
# Install the modified basicsr - https://github.com/yanyan5420/BasicSR # We use BasicSR for both training and inference pip install git+https://github.com/yanyan5420/BasicSR.git pip install -r requirements.txt python setup.py develop
- Download pre-trained model: JRESRGAN_x2plus.pth
wget https://github.com/yanyan5420/J-RESRGAN/releases/download/v1.0.0/JRESRGAN_x2plus.pth -P weights
- Inference:
First, put a J-Res spectrum into
inputs
folder; and run the command:
python inference_realesrgan.py -n JRESRGAN_x2plus -i inputs -s 2
Common command options:
-h show this help
-i --input Input image or folder. Default: inputs
-o --output Output folder. Default: results
-n --model_name Model name. Default: JRESRGAN_x2plus
-s, --outscale The final upsampling scale of the image. Default: 2
-t, --tile Tile size, 0 for no tile during testing. Default: 0
--fp32 Use fp32 precision during inference. Default: fp16 (half precision).
Outputs will show in the results
folder.
You can use the Online Inference Demo to get a quick inference.
If you have any question, please email [email protected]
.