RealSR-NCNN-Android is a simple Android application that based on Waifu2x-NCNN, SRMD-NCNN, RealCUGAN-NCNN, RealSR-NCNN, & Real-ESRGAN, Anime4KCPP.
The application does not collect any private information from your device.
Download: Github Release
This repository contains 3 project:
nearest
bilinear
bicubic
and avir
lancir
.Two ways of selecting files:
Select Image
to select an imageTow ways of running:
Run
button and wait some time. The photo view will show the result when the progrem finish its work. If you like the result, you could click the Save
button. help
and get more info)input & output
RealSR-NCNN-Android-GUI could load extra models from sdcard automatily in ver 1.7.6. You could download more models from https://huggingface.co/tumuyan2/realsr-models .
Path for custom models (RealSR/ESRGAN/Waifu2x)
and save.Also you could convert ESRGAN pth moddls by yourself.
models-Real-ESRGAN-AnimeSharp // directory should have a suffix of models-Real- or models-ESRGAN-
├─x4.bin // models name as x[n], n is scale
├─x4.param
Real-ESRGAN is a Practical Algorithms for General Image Restoration.
[Paper] [Project Page] [YouTube Video] [Bilibili] [Poster] [PPT slides]
Xintao Wang, Liangbin Xie, Chao Dong, Ying Shan
Tencent ARC Lab; Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences
Note that RealESRGAN may still fail in some cases as the real-world degradations are really too complex.
[paper] [project] [NTIRE 2020 Challenge on Real-World Image Super-Resolution: Methods and Results]
[project]
Real-CUGAN is an AI super resolution model for anime images, trained in a million scale anime dataset, using the same architecture as Waifu2x-CUNet.
[[Project]](- https://github.com/TianZerL/Anime4KCPP)
Anime4KCPP provides an optimized bloc97's Anime4K algorithm version 0.9, and it also provides its own CNN algorithm ACNet, it provides a variety of way to use, including preprocessing and real-time playback, it aims to be a high performance tools to process both image and video.
This project is for learning and the exploration task of algorithm course in SWJTU.
https://github.com/Tencent/ncnn/releases
download ncnn-yyyymmdd-android-vulkan-shared.zip.
https://github.com/webmproject/libwebp
download the source of libwebp.
https://opencv.org/releases/
download opencv-android-sdk.
extract ncnn-yyyymmdd-android-vulkan-shared.zip
into ../3rdparty/ncnn-android-vulkan-shared
extract the source of libwebp into ../3rdparty/libwebp
extract opencv-version-android-sdk
into ../3rdparty/opencv-android-sdk
RealSR-NCNN-Android
├─3rdparty
│ ├─opencv-android-sdk
│ │ └─sdk
│ ├─libwebp
│ └─ncnn-android-vulkan-shared
│ └─arm64-v8a
├─RealSR-NCNN-Android-CLI
│ ├─Anime4k
│ ├─RealCUGAN
│ ├─Waifu2x
│ ├─RealSR
│ ├─SRMD
│ └─ReSize
└─RealSR-NCNN-Android-GUI
Open this project with Android Studio, rebuild it and then you could find the program in RealSR-NCNN-Android-CLI\*\build\intermediates\cmake\release\obj\arm64-v8a
or RealSR-NCNN-Android-CLI\*\build\intermediates\cmake\debug\obj\arm64-v8a
Click 3rdparty/copy_cli_build_result.bat
and it could copy the build result to GUI project.
You could download assets.zip
from github release page and unzip it to get models, or download models from https://github.com/tumuyan/realsr-models .
Make sure the elf file has execute permission. Then input command
./realsr-ncnn -i input.jpg -o output.jpg
The usage of others program is same as realsr-ncnn.
Usage: realsr-ncnn -i infile -o outfile [options]...
-h show this help
-v verbose output
-i input-path input image path (jpg/png/webp) or directory
-o output-path output image path (jpg/png/webp) or directory
-s scale upscale ratio (4, default=4)
-t tile-size tile size (>=32/0=auto, default=0) can be 0,0,0 for multi-gpu
-m model-path realsr model path (default=models-DF2K_JPEG)
-g gpu-id gpu device to use (default=0) can be 0,1,2 for multi-gpu, -1 use cpu
-j load:proc:save thread count for load/proc/save (default=1:2:2) can be 1:2,2,2:2 for multi-gpu
-x enable tta mode
-f format output image format (jpg/png/webp, default=ext/png)
input-path
and output-path
accept either file path or directory pathscale
= scale level, 4 = upscale 4xtile-size
= tile size, use smaller value to reduce GPU memory usage, default selects automaticallyload:proc:save
= thread count for the three stages (image decoding + realsr upscaling + image encoding), using larger values may increase GPU usage and consume more GPU memory. You can tune this configuration with "4:4:4" for many small-size images, and "2:2:2" for large-size images. The default setting usually works fine for most situations. If you find that your GPU is hungry, try increasing thread count to achieve faster processing.format
= the format of the image to be output, png is better supported, however webp generally yields smaller file sizes, both are losslessly encodedIf you encounter crash or error, try to upgrade your derive
Download assets.zip
from github release page, the zip file contains models & elf files. Unzip and put them to this folder, then build it with Android Studio.
The direct download link for current version: https://github.com/tumuyan/RealSR-NCNN-Android/releases/download/1.9.6/assets.zip
RealSR-NCNN-Android-GUI\app\src\main\assets\
└─realsr
│ Anime4k
│ colors.xml
│ delegates.xml
│ libc++_shared.so
│ libncnn.so
│ libomp.so
│ magick
│ realcugan-ncnn
│ realsr-ncnn
│ resize-ncnn
│ srmd-ncnn
│ waifu2x-ncnn
│
├─models-nose
│ up2x-no-denoise.bin
│ up2x-no-denoise.param
│
├─models-pro
│ up2x-conservative.bin
│ up2x-conservative.param
│ up2x-denoise3x.bin
│ up2x-denoise3x.param
│ up2x-no-denoise.bin
│ up2x-no-denoise.param
│ up3x-conservative.bin
│ up3x-conservative.param
│ up3x-denoise3x.bin
│ up3x-denoise3x.param
│ up3x-no-denoise.bin
│ up3x-no-denoise.param
│
├─models-Real-ESRGAN
│ x4.bin
│ x4.param
│
├─models-Real-ESRGAN-anime
│ x4.bin
│ x4.param
│
├─models-Real-ESRGANv2-anime
│ x2.bin
│ x2.param
│ x4.bin
│ x4.param
│
├─models-Real-ESRGANv3-anime
│ x2.bin
│ x2.param
│ x3.bin
│ x3.param
│ x4.bin
│ x4.param
│
├─models-ESRGAN-Nomos8kSC
│ x4.bin
│ x4.param
|
└─models-se
up2x-conservative.bin
up2x-conservative.param
up2x-denoise1x.bin
up2x-denoise1x.param
up2x-denoise2x.bin
up2x-denoise2x.param
up2x-denoise3x.bin
up2x-denoise3x.param
up2x-no-denoise.bin
up2x-no-denoise.param
up3x-conservative.bin
up3x-conservative.param
up3x-denoise3x.bin
up3x-denoise3x.param
up3x-no-denoise.bin
up3x-no-denoise.param
up4x-conservative.bin
up4x-conservative.param
up4x-denoise3x.bin
up4x-denoise3x.param
up4x-no-denoise.bin
up4x-no-denoise.param
Most of the C code is copied from Nihui, cause of the directory structure had to be adjusted, the original git was broken