This uses the following repo: https://github.com/xinntao/Real-ESRGAN
Images pushed to dockerhub as well as GitHub
docker pull ralphv/realesrgan
docker pull ralphv/realesrgan-with-models
OR
docker pull ghcr.io/ralphv/realesrgan
docker pull ghcr.io/ralphv/realesrgan-with-models
make build
By default, this will create three images:
ralphv/realesrgan-base
: Base image functional without volumesralphv/realesrgan
: The main image to use that creates some volumes to retain downloadsralphv/realesrgan-with-models
: Image with pre-downloaded models (recommended)
WARNING: The produced images are very large, close to 10 GB
- Run to get the help information:
docker run --rm ralphv/realesrgan
- Run on a sample input file
test.jpg
to produce the output astest_out.jpg
in same folderdocker run --rm --gpus all -v .:/data ralphv/realesrgan-with-models -o /data/ -i /data/test.jpg
- Run on all files in current directory
docker run --rm --gpus all -v .:/data ralphv/realesrgan-with-models -o /data/ -i /data/
You can create .env
file and define a custom image name using the variable IMAGE_NAME
IMAGE_NAME: <custom>/realesrgan
--face_enhance
: Enhances faces but sometimes can create weird faces.--fp32
: Use fp32 precision during inference. Default: fp16 (half precision).-s 2
: The scaling factor, can be put to 1 to just enhance images.
You can find more info at the main repo of the library here.
alias enhance='docker run --rm --gpus all -v .:/data ralphv/realesrgan-with-models --fp32 -i /data/ -o /data/ -s 1'
alias enlarge='docker run --rm --gpus all -v .:/data ralphv/realesrgan-with-models --fp32 -i /data/ -o /data/ -s 2'
alias enhancef='docker run --rm --gpus all -v .:/data ralphv/realesrgan-with-models --face_enhance --fp32 -i /data/ -o /data/ -s 1'
alias enlargef='docker run --rm --gpus all -v .:/data ralphv/realesrgan-with-models --face_enhance --fp32 -i /data/ -o /data/ -s 2'