RealSR-NCNN-Android

tumuyan更新放缓

在安卓手机上本地跑 Real-ESRGAN、Real-CUGAN、Waifu2x 等超分模型,把模糊图片放大变清晰,还支持插值和多种缩放算法。

An Android application for super-resolution & interpolation. Contains RealSR-NCNN, SRMD-NCNN, RealCUGAN-NCNN, Real-ESRGAN-NCNN, Waifu2x-NCNN, Anime4kcpp, nearest, bilinear, bicubic, AVIR...

1.13.2发布于 2026-05-30 08:52 UTC2,181star165fork同步于 2026-11-07 07:33 UTC

怎么上手

由 README 提炼,执行前请确认
从 GitHub Release 下载 APK 安装;自行构建需先获取 assets.zip 并解压到 RealSR-NCNN-Android-GUI/app/src/main/assets/ 下,再用 Android Studio 构建
硬件要求按 README 说明

README 未说明具体 CPU/GPU 型号或显存要求;应用基于 ncnn 和 MNN 在 Android 设备上运行,需 Android 手机或平板。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

安卓端超分与插值工具,集成多种 NCNN 模型,可离线放大图片和 GIF

在安卓手机上本地跑 Real-ESRGAN、Real-CUGAN、Waifu2x 等超分模型,把模糊图片放大变清晰,还支持插值和多种缩放算法。

核心能力

  • 集成 RealSR、Real-ESRGAN、Waifu2x、RealCUGAN、SRMD、Anime4k 等超分模型
  • 支持 nearest、bilinear、bicubic、avir、lancir 经典插值缩放
  • 从相册分享或应用内选图,运行后可预览并保存结果
  • 支持从 sdcard 自定义模型目录,自动加载额外模型
  • 支持 MNN 格式模型,可转换 ONNX、TFLITE、TorchScript 等

容易踩的坑

自行构建 GUI 时必须先下载 assets.zip 并放入 assets 目录,否则缺少模型和 ELF 文件;自定义模型需按命名规则包含倍率信息,否则可能无法识别;批量处理和 GIF 处理不支持预览,结果直接保存到相册。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本1.13.2
  1. 1.13.2最新正式版2026-05-30 · 2026-05-30 08:52 UTC

    fix in v1.13.2

    1. update ncnn, fix #109 #107 #106 ; update mnn & imagick
    2. Fix path injection vulnerability

    new featrue in pre-release v1.13.1

    1. feature: hidden special program in command list. if your device use snapdragon 8E5, Adreno (TM) 840 , may be you should hidden realsr-ncnn waifu2x-ncnn realcugan-ncnn

    2. feature: process folder

  2. 1.13.1pre-release2026-04-27 · 2026-04-27 15:16 UTC
    查看更新说明
    1. feature: hidden special program in command list. if your device use snapdragon 8E5, Adreno (TM) 840 , may be you should hidden realsr-ncnn waifu2x-ncnn realcugan-ncnn

    2. feature: process folder

  3. 1.13.02026-04-02 · 2026-04-02 15:10 UTC
    查看更新说明

    Release Notes / 版本更新说明

    Most of the changes in this version were done by AI. 这个版本的代码基本由AI完成

    Feature / 功能

    Custom Command Labels. Added the ability to customize display names in the command dropdown list. 自定义命令列表备注

    IMG_20260404_005902

    Bug Fixes / 错误修复

    1. Android GPU Segmentation Fault 修复 / Android 端段错误修复 Fixed a segmentation fault when processing the last tile row 修复了处理最后一个 tile 行发生段错误(exit code 139)的问题。

    2. Fixed black border artifacts on the right and bottom edges of output images (associate to image dimensions) 修复了某些图像尺寸下,输出图像右侧和底部出现黑边的问题:

    3. Alpha 通道与右边缘像素修复 / Alpha Channel Pixel Fix in Right Edge

    4. Introduced a consistent "alpha-external" strategy across all NCNN-based modules (RealSR, RealCUGAN, SRMD, Waifu2x): 在所有基于 NCNN 的模块(RealSR、RealCUGAN、SRMD、Waifu2x)中引入统一的"alpha 外置"策略

    Automated Testing / 自动化测试

    Added test-all.sh / test-all.bat automated test scripts covering all CLI programs (Resize, RealCUGAN, RealSR, SRMD, Waifu2x, MNN-SR) with HTML-based image consistency evaluation reports. 新增 test-all.sh / test-all.bat 自动化测试脚本,覆盖所有 CLI 程序(Resize、RealCUGAN、RealSR、SRMD、Waifu2x、MNN-SR),并生成基于 HTML 的图像一致性评估报告。 这些测试对研判黑边、杂色产生了至关重要的作用

  4. 1.12.02025-11-28 · 2025-11-28 12:16 UTC
    查看更新说明
    1. fix #93
    2. change notification logic
    3. add ProcessingService
  5. 1.11.52025-11-23 · 2025-11-23 15:07 UTC
    查看更新说明

    Update mnn & ncnn Optimize mnnsr Refactoring CommandBuilder & ImageProcessor

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    RealSR-NCNN-Android

    中文说明

    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:

    1. RealSR-NCNN-Android-CLI can build programs that can be used by the console (for example, Termux) for Android. It contains 7 modules (Anime4k, MNN-SR, RealSR, RealCUGAN, SRMD, Waifu2x and Resize)
      • The RealSR program could use realsr models and real-esrgan models with ncnn format.
      • The MNN-SR program could use mnn format models.
      • The Resize program contains classical interpolation mode nearest bilinear bicubic and avir lancir.
    2. RealSR-NCNN-Android-GUI can build a APK (has a GUI and easy to use). Actually it is a shell for the programs build from RealSR-NCNN-Android-CLI.
    3. Resize-CLI just a demo like the Resize-NCNN-Android-CLI, but it not need ncnn and could build by VS.

    How to use RealSR-NCNN-Android-GUI

    Two ways of selecting files:

    1. Share one or more images from other apps (e.g. Gallery) to this app
    2. In this app, click Select Image to select an image

    Two ways of running:

    1. chose a model, click the Run button and wait some time. The photo view will show the result when the program finish its work. If you like the result, you could click the Save button.
    2. input shell command and enter. (You can input help and get more info)

    input & output

    Add more models to RealSR-NCNN-Android-GUI

    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 .

    1. Make a directory in sdcard.
    2. Input the directory path to Path for custom models (RealSR/ESRGAN/Waifu2x) and save.
    3. Download and copy models to the directory you make.
    4. Return the main activity, then you could select the new models.

    Convert models to mnn format

    ✨ ver 1.11 support mnn models. MNN could support more models than ncnn. ver 1.12 could use -c param or model file name to config the color space. refer to https://mnn-docs.readthedocs.io/en/latest/tools/convert.html , you could convert ONNX, TFLITE, TorchScript, Tensorflow models to mnn format.

    1. pip install mnn
    2. (for example, convert onnx to mnn) MNNConvert -f ONNX --modelFile "{onnx_path}" --MNNModel "{mnn_path}" --bizCode biz --fp16 --info --detectSparseSpeedUp
    3. modify mnn model filename, contains scale info just like4xabcdefg.mnn abc-x4-def.mnn or abc_4x_def.mnn, copy to your custom model folder. If the filename contains Grayscale Gray2YCbCr Gray2YUV YCbCr YUV, the App will apply these color space.

    Convert pth models to ncnn format by yourself

    Also you could convert ESRGAN pth models by yourself.

    1. Download ESRGAN pytorch models from OpenModelDB and unzip it to somewhere.

    2. Download cupscale and unzip it in your PC.

    3. Convert pytorch models to ncnn. Open CupscaleData\bin\pth2ncnn, use pth2ncnn.exe to convert pth files to ncnn file.

    4. Rename models, just like this:

      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
      
    • This tool can only convert ESRGAN models, not Real-ESRGAN models. If there are Real-ESRGAN models with perfect effect that need to be converted, I can help you convert them manually.

    Another way to convert models:

    1. Download the model from OpenModelDB.
    2. Download and install chaiNNer (this requires a good internet connection).
    3. Open chaiNNer, link the nodes, or use the project I provided: https://github.com/tumuyan/RealSR-NCNN-Android/raw/main/chainner-pth2ncnn.chn
    4. Drag the model onto the leftmost node, click the run button, and wait. Note that not every model can be converted to an ncnn model.
    5. Rename the file (same as the previous method). If you used the project file I provided, this step is unnecessary.

    How to build RealSR-NCNN-Android-GUI

    Build RealSR-NCNN-Android-CLI by yourself or 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.11.1/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
    

    Limitations

    This is a very simple tool, flexible and powerful, has the following shortcomings (and there are no plans for improvement):

    About Batch Processing

    1. You can load multiple images by opening the album, selecting multiple pictures, sharing, and choosing realsr, but you cannot select multiple images within the app.
    2. After loading multiple images, only one image can be previewed; there is no image list.
    3. After processing, the results will not be previewed and will be saved directly to the album.
    4. Magick (including the quick menu in the top right corner) does not support batch processing.

    About GIF Animation

    1. Processing can only be done in GIF animation mode when one GIF is opened; otherwise, only one frame can be processed.
    2. GIFs cannot be previewed.
    3. After processing is complete, the results will not be previewed and will be saved directly to the album.
    4. Magick (including the quick menu in the top right corner) does not support GIF processing.

    Acknowledgement

    original super-resolution projects

    ncnn projects and models

    Most of the C code is copied from Nihui, cause of the directory structure had to be adjusted, the original git was broken

    Others Open-Source Code Used

    Others packaged models

    • Real-ESRGAN model Nomos8kSC trained by Phhofm.
    • Real-ESRGAN model MoeSR trained by luoyily.