Real-ESRGAN is a deep learning-based image super-resolution model that can effectively remove noise while restoring details in low-resolution images, and is widely used in image and video enhancement processing.
git clone https://huggingface.co/AXERA-TECH/Real-ESRGAN
File Description:
m5stack@raspberrypi:~/rsp/Real-ESRGAN $ ls -lh
total 428K
drwxrwxr-x 2 m5stack m5stack 4.0K Aug 13 09:12 ax630c
drwxrwxr-x 2 m5stack m5stack 4.0K Aug 13 09:12 ax650
-rw-rw-r-- 1 m5stack m5stack 0 Aug 13 09:11 config.json
-rw-rw-r-- 1 m5stack m5stack 2.9K Aug 13 09:11 main.py
drwxrwxr-x 2 m5stack m5stack 4.0K Aug 13 09:12 onnx
-rw-rw-r-- 1 m5stack m5stack 387K Aug 13 09:12 output_test_256.jpg
-rw-rw-r-- 1 m5stack m5stack 3.9K Aug 13 09:11 README.md
-rw-rw-r-- 1 m5stack m5stack 19K Aug 13 09:11 test_256.jpeg
python -m venv esrgan
source esrgan/bin/activate
pip install https://github.com/AXERA-TECH/pyaxengine/releases/download/0.1.3.rc1/axengine-0.1.3-py3-none-any.whl
pip install argparse numpy opencv-python
python3 main.py --input test_256.jpeg --output test_256_20e.jpeg --model ax650/realesrgan-x4-256.axmodel
Execution result:
(esrgan) m5stack@raspberrypi:~/rsp/Real-ESRGAN $ python3 main.py --input test_256.jpeg --output test_256_20e.jpeg --model ax650/realesrgan-x4-256.axmodel
[INFO] Available providers: ['AXCLRTExecutionProvider']
[INFO] Using provider: AXCLRTExecutionProvider
[INFO] SOC Name: AX650N
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Compiler version: 3.4 3dfd5692
input.1 [1, 256, 256, 3] uint8
1895 [1, 1024, 1024, 3] float32
Original Image Shape: (243, 243, 3)
Preprocessed Image Shape: (1, 256, 256, 3)
Inference Time: 454.03 ms
Output Shape: (1, 1024, 1024, 3)
Final Output Image Shape: (1024, 1024, 3)
Original image:
Output: