aselsan-research-imaging-team/bicubic-plusplus

How to run inference (not test)

asrlhhh opened this issue · 9 comments

Is there a script to run inference only where you can input a LR image and let it save the output HR image?

same question.

You can run the test script for either a folder or a file that is defined in the config file. It saves the files as default and reports the PSNR and SSIM.

could you please illustrate clearly , thanks!
I default the config choose : date -> val -> hr_path as [""], but test script report " Total length of 'DateLoader' across ranks is zero"

It means the path is not set, you need to set the high resolution image path (and generate it with JPEG Quality set to 90 if you want to recreate research setting).

  1. download DIV2K dataset
  2. unpack train and valid
  3. use snippet like
input_paths = sorted(glob.glob(input_img_dir+"*.png")) # natural sort

for in_path in input_paths:
    print(in_path)
    filename = in_path.split("/")[-1].split(".")[0]
    a = cv2.imread(in_path)
    cv2.imwrite(output_dir+"/"+filename+".jpg", a, [cv2.IMWRITE_JPEG_QUALITY, 90])

where in_paths path to original images, and output_dir the dir with JPEG quality 90 images.

set the generated train_img_dir (need lr (low resolution) and hr (high resolution) to train: lr_path:["path/to/dir"] and hr_path:["path/to/dir"]

and set the generated val_img_dir to val: lr_path: ["/path/to/val_imgs_low_reso"] and hr_path: ["path/to/val_imgs_high_reso"]

It means the path is not set, you need to set the high resolution image path (and generate it with JPEG Quality set to 90 if you want to recreate research setting).

thanks for your reply! Forgive me for not expressing myself clearly for the first time.
In fact. I want to ask the same question ---"Is there a script to run inference only where you can input a LR image and let it save the output HR image?",
until see your reply---"You can run the test script for either a folder or a file that is defined in the config file."
so that i want to ask you for advice: how can i set the conf.yaml ,thanks~

I have released an unofficial repo that includes inference code, maybe you can refer to it

You may follow @Ysnower's and @OuterSpaceTraveller's approaches for now. However, we are going to include the official inference scripts (without requiring any ground truth images), 3-stage training pipeline scripts, and an online notebook for providing cloud inference very soon.

I have released an unofficial repo that includes inference code, maybe you can refer to it

Could you refer the repo here ? and any news about the inference scripts ?

I have released an unofficial repo that includes inference code, maybe you can refer to it

Could you refer the repo here ? and any news about the inference scripts ?

https://github.com/Ysnower/bicubic-plusplus