Skip to main content
. 2024 Oct 30;24(21):6983. doi: 10.3390/s24216983
Algorithm 3 Real-ESRGAN Inference Pipeline

Libraries Required: Git, Python, Real-ESRGAN, OpenCV

Input: Low-resolution image Ilow

Output: High-resolution image Ihigh

  •   1:

    Step 1: Setup

  •   2:
    Clone the repository and install dependencies:
    gitcloneReal−ESRGAN,pipinstall−rrequirements.txt
  •   3:

    Step 2: Image Upload

  •   4:
    Prepare upload folder:
    rm-rfupload/,mkdirupload/
  •   5:

    Step 3: Inference

  •   6:
    Run the inference script:
    Ihigh=SR(Ilow,f=4)(face_enhanceoptional)
    where f is the upscaling factor.
  •   7:

    Step 4: Visualization

  •   8:
    Compare input and output images:
    display(Ilow,Ihigh)

    Print properties of Ihigh

  •   9:

    Step 5: Download Results

  • 10:
    Compress and download results:
    zip Real−ESRGAN_result.zip