Skip to content

Robotics-Ark/lc_Real-ESRGAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lc_Real-ESRGAN

Original (blurry) Upscaled (Real-ESRGAN)

Original    Upscaled

Expose Real-ESRGAN with local_comm. This allows Real-ESRGAN to be isolated into a conda environment and called from another with minimal dependancies.

Install

  1. Clone the repo (remember to include the --recursive flag)
  2. Create conda environment and activate: conda create -n lc_realesrgan python=3.10 (only tested for Python 3.10)
  3. Change directory cd lc_Real-ESRGAN
  4. Install dependencies
  • Install Real-ESRGAN
    • Change directory: cd extern/Real-ESRGAN
    • See instructions, here.
  • Install local_comm:
    • Change directory: cd ../..
    • Install: pip install extern/local_comm
  1. Install: pip install .

You can start the server using

conda activate lc_realesrgan
python -m lc_realesrgan.image_upscale_server

A client needs to send and receive an image as bytes. It is recommended that you use pillow. See the scripts/test_client.py example to see how to interface with the server.

Examples

Basic example

The Real-ESRGAN has several inference scripts you can run. For example, the following

cd /path/to/lc_Real-ESRGAN/extern/Real-ESRGAN
conda activate lc_realesrgan
python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs

Server/client

In one terminal

conda activate lc_realesrgan
python -m lc_realesrgan.image_upscale_server

In a second terminal

# conda activate ...
pip install pillow
python scripts/test_client.py scripts/old.jpg

Troubleshooting

  • ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor': see here

About

Expose Real-ESRGAN with local_comm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages