GithubHelp home page GithubHelp logo

tumuyan / realsr-ncnn-android Goto Github PK

View Code? Open in Web Editor NEW
848.0 14.0 74.0 5.13 MB

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

License: Other

CMake 0.84% C++ 68.18% C 29.44% Java 1.54%
super-resolution android real-esrgan realsr ncnn srmd waifu2x real-cugan interpolation image-processing

realsr-ncnn-android's Introduction

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 6 modules (Anime4k, RealSR, RealCUGAN, SRMD, Waifu2x and Resize)
  • The RealSR program could use realsr models and real-esrgan models.
  • The Resize program contains classical interpolation mode nearest bilinear bicubic and avir lancir.
  1. 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.
  2. 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

Tow ways of running:

  1. chose a model, click the 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.
  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 pth models by yourself

Also you could convert ESRGAN pth moddls by yourself.

  1. Download ESRGAN pytorch models from https://upscale.wiki/wiki/Model_Database 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.

About Real-ESRGAN

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

img Note that RealESRGAN may still fail in some cases as the real-world degradations are really too complex.

About RealSR

[paper] [project] [NTIRE 2020 Challenge on Real-World Image Super-Resolution: Methods and Results]

About SRMD

[paper] [project] demo demo

About Real-CUGAN

[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.

About Anime4kCPP

[[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.

  • Anime4K is a simple high-quality anime upscale algorithm. The version 0.9 does not use any machine learning approaches, and can be very fast in real-time processing or pretreatment.
  • ACNet is a CNN based anime upscale algorithm. It aims to provide both high-quality and high-performance. HDN mode can better denoise, HDN level is from 1 to 3, higher for better denoising but may cause blur and lack of detail. demo

How to build RealSR-NCNN-Android-CLI

step1

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.

step2

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

step3

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.

How to use RealSR-NCNN-Android-CLI

Download models

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 .

Example Command

Make sure the elf file has execute permission. Then input command

./realsr-ncnn -i input.jpg -o output.jpg

Full Usages

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 path
  • scale = scale level, 4 = upscale 4x
  • tile-size = tile size, use smaller value to reduce GPU memory usage, default selects automatically
  • load: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 encoded

If you encounter crash or error, try to upgrade your derive

How to build RealSR-NCNN-Android-GUI

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

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.

realsr-ncnn-android's People

Contributors

tumuyan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

realsr-ncnn-android's Issues

请教一个问题gui和cli 之间是什么关系呢

这里的RealSR-NCNN-Android-GUI RealSR-NCNN-Android-CLI 这里的gui和cli是什么关系呢 我我是在RealSR-NCNN-Android工程下编译呢 还是分别在RealSR-NCNN-Android-GUI 和RealSR-NCNN-Android-CLI 下编译 或者 只编译RealSR-NCNN-Android-GUI 这个工程 就可以了呢
image

Multiple files

I can only open one image at a time, so if I want to upscale a longer lowres manga/gallery in my tablet it took a long time. Can you add something so i can open multiple images and/or open folder?

is it possible to make GFPGAN work on android?

Similar to how you setup SR GAN , do you think it's possible to make GFPGAN work on images via android.
would be great if you could try to make a similar project.
ncnn gfpgan + android.

black image result

as the title says. no matter what upscaling algorithm I pick, it'll always produce black image.

upscaling with CPU does produce an actual result but it takes a significanly longer time to process.

device: Poco X3 NFC - SD732G - 6/64
rom: latest crDroid 9.2 based on LineageOS 20, Android 13

Screenshot_20230307-221942_RealSR BigImage

安卓移动设备上部分模型发生 vkQueueSubmit failed -4 问题

Redmi Note 12 Turbo
Android 13 - MIUI 14
Qualcomm Snapdragon 7+ Gen 2 (SM7475-AB)
12GB RAM
GPU: Adreno 725
CPU: 1x 2.91 GHz Cortex-A710, 3x 2.49 GHz Cortex-A710, 4x 1.8 GHz Cortex-A510

默认软件设置下,在 real-esrgan-anime-x4, real-esrgan-x4, srmd-x4(3,2) 时,皆表示 vkQueueSubmit failed -4:

[0 Adreno (TM) 725] queueC=0[3] queueG=0[3]
queueT=0[3]
[0 Adreno (TM) 725] bugsbn1=1 bugbilz=0
bugcopc=0 bugihfa=0
[0 Adreno (TM) 725] fp16-p/s/a=1/1/1 int8-p/s/a=1/1/1
[0 Adreno (TM) 725] subgroup=64 basic=1 vote=1 ballot=1 shuffle=1

busy...

stbi_load_from_memory get channel 3
input&output w/h/c 1280/1920/1 5120/7680/1

0.00%
vkQueueSubmit failed -4
1.43%
vkQueueSubmit failed -4
2.86%
...
98.57%
vkQueueSubmit failed -4
save result...
save result use time: 17.008

产出白色图片。

默认软件设置下,在 real-esrganv3(2)-anime-x4(3,2), 所有的 real-cugan 模型时,皆顺利处理图片。
CPU模式下,在上述模型中,只有 real-cugan 系列模型正常,其他模型皆产出撕裂图片(见附件)。


本人另有一部 Realme Q2
Android 11 - REALME UI 2
SoC:MediaTek Dimensity 800U
CPU: 2x 2.4 GHz ARM Cortex-A76, 6x 2.0 GHz ARM Cortex-A55, Cores: 8
GPU: ARM Mali-G57 MC3, Cores:3
4GB RAM
默认软件设置下所以模型运行成功。

求助内容:
不清楚在更高性能的设备上为何会出现问题。
若需要我会提供更多信息。
反馈内容里可能有表述不清晰的地方,请见谅。

多个图片高清导出提示没有待导出的文件,更换其他手机后依旧如此

单个图片可以很好的正常导出高清图片,但数量一变成2或者更多时,显示保存成功,但是导出错误,提示没有待导出的文件,该怎么解决这个问题呢?我在爱发电上也询问了,以下是运行显示内容
search model:models-Real-ESRGANv3-anime/
x2.bin
[O Mali-G715-Immortalis MC11] queueC=0[2]
queueG=0[2] queueT=0[2]
[O Mali-G715-lmmortalis MC11] bugsbn1=0
bugbilz=0 bugcopc=0 bugihfa=0
[O Mali-G715-Immortalis MC11] fp16-p/s/
a=1/1/1 int8-p/s/a=1/1/1
[O Mali-G715-Immortalis MC11] subgroup=16
basic/vote/ballot/shuffle=1/1/1/1
[O Mali-G715-Immortalis MC11]
fp16-matrix-16_8_8/16_8_16/16_16_16=0/0/0
channel=3, stbi_load_from_memory
scale=2, w/h/c 654/1166/1 -> 1308/2332/1
channel=3, stbi_load_from_memory
scale=2, w/h/c 440/247/1 -> 880/494/1
save result use time: 0.238save result use time: 1.473Total use time: 6.258
finish, use 6.366 second
Real-ESRGANv3-anime

Unable to execute realsr-ncnn from another directory

Hello, and thank you for making this software. I appreciate it.

I've been trying to use realsr-ncnn in a script along with gallery-dl, but I cannot execute it unless I'm in it's directory. For example, executing ./realsr/realsr-ncnn in Termux home directory throws this error:

CANNOT LINK EXECUTABLE "realsr-ncnn": library "libncnn.so" not found: needed by main executable

realsr directory content:

total 25060
-rwxrw---- 1 u0_a176 u0_a176     1411 May 30  2022 colors.xml
-rwxrw---- 1 u0_a176 u0_a176    10063 May 30  2022 delegates.xml
-rwxrw---- 1 u0_a176 u0_a176  1014664 May 22 06:43 libc++_shared.so
-rwxrw---- 1 u0_a176 u0_a176 10492512 May 17 06:57 libncnn.so
-rwxrw---- 1 u0_a176 u0_a176   960096 Jul 31  2021 libomp.so
-rwxrw---- 1 u0_a176 u0_a176  8078360 May 22 06:43 magick
drwxrwx--- 2 u0_a176 u0_a176     3488 Sep 23 16:29 models-Real-ESRGAN
drwxrwx--- 2 u0_a176 u0_a176     3488 Sep 23 16:29 models-Real-ESRGAN-SourceBook
drwxrwx--- 2 u0_a176 u0_a176     3488 Sep 23 16:29 models-Real-ESRGAN-anime
drwxrwx--- 2 u0_a176 u0_a176     3488 Sep 23 16:29 models-Real-ESRGANv2-anime
drwxrwx--- 2 u0_a176 u0_a176     3488 Sep 23 16:29 models-Real-ESRGANv3-anime
drwxrwx--- 2 u0_a176 u0_a176     3488 Sep 23 16:29 models-nose
drwxrwx--- 2 u0_a176 u0_a176     3488 Sep 23 16:29 models-pro
drwxrwx--- 2 u0_a176 u0_a176     3488 Sep 23 16:29 models-se
drwxrwx--- 2 u0_a176 u0_a176     3488 Sep 23 16:29 models-srmd
-rwxrw---- 1 u0_a176 u0_a176  1301560 Dec 16  2022 realcugan-ncnn
-rwxrw---- 1 u0_a176 u0_a176   954520 Jun 10 14:30 realsr-ncnn
-rwxrw---- 1 u0_a176 u0_a176   849400 Jun 10 14:50 resize-ncnn
-rwxrw---- 1 u0_a176 u0_a176   979472 Dec 16  2022 srmd-ncnn
-rwxrw---- 1 u0_a176 u0_a176   945384 Dec 16  2022 waifu2x-ncnn

After this error, I've tried making a script that will execute realsr-ncnn in it's directory:

$cat ../usr/bin/realsr
#!/data/data/com.termux/files/usr/bin/bash
HOME=/data/data/com.termux/files/home
cd $HOME/realsr
./realsr-ncnn "$@"

With realsr, it shows the usage, which means it works. But when trying to upscale an image this way, this error is occuring (verbose output):

finding model: models-Real-ESRGANv3-anime/x4.bin
[0 Adreno (TM) 610]  queueC=0[3]  queueG=0[3]  queueT=0[3]
[0 Adreno (TM) 610]  bugsbn1=1  bugbilz=0  bugcopc=0  bugihfa=0
[0 Adreno (TM) 610]  fp16-p/s/a=1/0/0  int8-p/s/a=1/0/1
[0 Adreno (TM) 610]  subgroup=64  basic=1  vote=1  ballot=1  shuffle=1
init heap_budget, use_gpu_count=1
init gpu tilesize 0/1 = 100
init realsr
fopen failed
decode image image.jpg failed
init save_threads 0
init save_threads 1
Total use time: 2.256

This same picture is being upscaled only if I go into the directory where realsr-ncnn resides and execute from there in terminal.
Tried copying libncnn.so to usr/lib/ and this didn't work either. What would be the best approach to this?

Edit: My workaround is the realsr script in /data/data/com.termux/files/usr/bin.
Content:

#!/data/data/com.termux/files/usr/bin/bash
if ! compgen -G "$1" ; 
then 
file=$(realpath "$1") ; 
else 
file="$1" ;
fi
output=$(realpath "$2") ;
HOME=/data/data/com.termux/files/home ;
cd $HOME/realsr ;
cp "$file" . ;
./realsr-ncnn -m "models-Real-ESRGANv3-anime" -s 4 -i "${file##*/}" -o "$output" ;
rm "${file##*/}"

改善插值缩放

问题

  • magick-x0.5 处理后,导出失败

改善

  • 下拉列表预设多种缩小倍率
  • 预设其他缩小算法

思路

  • 为resize-ncnn增加de-nearest模式。假设a图片是从A图使用nearest算法放大x倍而来的,那么输入a后,通过算法自动计算相邻像素的相似性得到x,把a使用nearest算法缩小x倍可以得到与图A非常相似的图b。当输入图片真的为nearest算法放大的图片时,效果比较理想;当计算x错误时,不输出结果。这个算法不确定是否有人做过,暂且命名为de-nearest。

English version of GUI

Hello! Maybe you can add English version of GUI in future releases? I can help for translation

编译resize-cli遇到git 和cmake问题

这里是git的问题image

下面是cmake的问题
Execution failed for task ':app:configureCMakeRelWithDebInfo[arm64-v8a]'.

[CXX1405] error when building with cmake using E:\work_project\RealSR-NCNN-Android\Resize-CLI\app\src\main\jni\CMakeLists.txt: Build command failed.
Error while executing process D:\worksoft\android_sdk\cmake\3.18.1\bin\cmake.exe with arguments {-HE:\work_project\RealSR-NCNN-Android\Resize-CLI\app\src\main\jni -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=24 -DANDROID_PLATFORM=android-24 -DANDROID_ABI=arm64-v8a -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DANDROID_NDK=D:\worksoft\android_sdk\ndk\22.1.7171670 -DCMAKE_ANDROID_NDK=D:\worksoft\android_sdk\ndk\22.1.7171670 -DCMAKE_TOOLCHAIN_FILE=D:\worksoft\android_sdk\ndk\22.1.7171670\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=D:\worksoft\android_sdk\cmake\3.18.1\bin\ninja.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=E:\work_project\RealSR-NCNN-Android\Resize-CLI\app\build\intermediates\cxx\RelWithDebInfo\3s5y3h3d\obj\arm64-v8a -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=E:\work_project\RealSR-NCNN-Android\Resize-CLI\app\build\intermediates\cxx\RelWithDebInfo\3s5y3h3d\obj\arm64-v8a -DCMAKE_BUILD_TYPE=RelWithDebInfo -BE:\work_project\RealSR-NCNN-Android\Resize-CLI\app.cxx\RelWithDebInfo\3s5y3h3d\arm64-v8a -GNinja}
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/worksoft/android_sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/worksoft/android_sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring incomplete, errors occurred!
See also "E:/work_project/RealSR-NCNN-Android/Resize-CLI/app/.cxx/RelWithDebInfo/3s5y3h3d/arm64-v8a/CMakeFiles/CMakeOutput.log".

图片放大错误

我刚刚试了一个图片要放大,生成后保存图片时图片从黑色变成五颜六色 这是怎么回事

hello can you help with models?

Hello
i have a free app with code for thermal camera and i want to try the models you have in this git but the problems is that my app use opencv which know only *.pb or *.onnx models and i'm stuck
can you help me somehow? thank you

Gif / Video support.

Just like in issue #15. Have the app break the gifs / videos into frames, run the model and then combine the frames back. Could be useful. Its a little tiring doing this manually.

How to batch running the images?

I want to upscale manga chapter from mangaplus because its low quality it would be great if I can just put in the folder and it will upscale all the chapter thank you!

file list

I want to upscale several images at once.
Please select multiple images and put the function in the program in the form of a file list so that you can upscale them at once.

KeyError: 'model.0.weight'

I'm trying to convert RealESRNet_x4plus.pth to 'ncnn' using the 'pth2ncnn' tool, but It fails will KeyError: 'model.0.weight'.

Windows machine, Powershell

Here is the full log:

PS E:\Downloads\Cupscale.1.39.0f1\Cupscale 1.39.0f1\CupscaleData\bin\pth2ncnn> .\pth2ncnn.exe .\RealESRGAN_x4plus.pth Loading model Traceback (most recent call last): File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\runpy.py", line 193, in _run_module_as_main File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\runpy.py", line 85, in _run_code File "E:\Downloads\Cupscale.1.39.0f1\Cupscale 1.39.0f1\CupscaleData\bin\pth2ncnn\pth2ncnn.exe\__main__.py", line 440, in <module> File "E:\Downloads\Cupscale.1.39.0f1\Cupscale 1.39.0f1\CupscaleData\bin\pth2ncnn\pth2ncnn.exe\__main__.py", line 361, in main KeyError: 'model.0.weight' PS E:\Downloads\Cupscale.1.39.0f1\Cupscale 1.39.0f1\CupscaleData\bin\pth2ncnn>

Thanks :)

[Feature request] add notification

when there is no notification in the application, android ends up closing the application in the background more easily. please add a notification when starting the upscale

Permission denied

targetSdk 28 是可以正常运行,但是调整为 targetSdk 32 后,会出现 "Permission denied",应该是 Android 11 后权限更严格了,不知道有没有办法解决。

Black Image result on termux cli

./realsr-ncnn -i input.jpg -o output.jpg -m models-Real-ESRGAN -s 3

I used: curl https://huggingface.co/spaces/tumuyan/RealSR/raw/main/install_realsr_android.sh | bash

Result image is black, log: input&output w/h/c 1000/662/1 4000/2648/1
0.00%
vkQueueSubmit failed -4
5.00%
vkQueueSubmit failed -4
10.00%
vkQueueSubmit failed -4
15.00%
vkQueueSubmit failed -4
20.00%
vkQueueSubmit failed -4
vkQueueSubmit failed -4
vkQueueSubmit failed -4
25.00%
vkQueueSubmit failed -4
30.00%
vkQueueSubmit failed -4
35.00%
vkQueueSubmit failed -4
40.00%
vkQueueSubmit failed -4
45.00%
vkQueueSubmit failed -4
vkQueueSubmit failed -4
vkQueueSubmit failed -4
50.00%
vkQueueSubmit failed -4
55.00%
vkQueueSubmit failed -4
60.00%
vkQueueSubmit failed -4
65.00%
vkQueueSubmit failed -4
70.00%
vkQueueSubmit failed -4
vkQueueSubmit failed -4
vkQueueSubmit failed -4
75.00%
vkQueueSubmit failed -4
80.00%
vkQueueSubmit failed -4
85.00%
vkQueueSubmit failed -4
90.00%
vkQueueSubmit failed -4
95.00%
vkQueueSubmit failed -4
save result...
save result use time: 0.792
Total use time: 6.589

改善格式支持

目前主要依赖nihui大佬的一系列ncnn超分项目,原项目只支持jpg bmp webp png四种格式的输入输出。
本项目没有修改原项目对格式的支持,通过前处理-超分-后处理的方式适配更多格式。
其中前处理heif格式输入使用Android自身API预处理为png,其他使用magick(Android端magick支持格式有限)。
ncnn输出结果统一为png。

这涉及了几个问题:

  1. 动图输入,输出一定是静态图片
  2. 效率损失

色彩出现混乱

我使用
/realcugan-ncnn -i /sdcard/DCIM/early_{2}/{f+1}.png -o /sdcard/DCIM/early_{4}/{f+1}.png -m models-pro -n 3 -s 2
(里面的大括号是Python字符串处理中的东西,不用管)
来进行超分
但在进行到16倍或者是32倍的时候
出现了如下图所示的色彩混乱
Screenshot_20230727_110205_bin mt plus

多选图片

由于我想弄大的图片非常多,希望作者能添加多选图片,虽然设置有保存多个图片名字,但是我却不理解为什么不能多选图片

Publish on F-droid

Since the app is open source, I don't see a reason this wouldn't be possible

Not able to run the default algorithms "vkQueueSubmit failed -4"

I can not run real-esrgan and real-cugan algorithms with adreno 618.
When I try to run real-esrgan-x4 it prints the following lines:

[0 Adreno (TM) 618] queueC=0[3] queueC=0[3] queueC=0[3]
[0 Adreno (TM) 618] bugsbn1=1 bugbilz=0 bugcopc=0 bugihfa=0
[0 Adreno (TM) 618] fp16-p/s/a=1/0/1 int8-p/s/a=1/0/1
[0 Adreno (TM) 618] subgroup=64 basic=1 vote=1 ballot=1 shuffle=1
busy...
stbi_load_from_memory get channel 3
input&output w/h/c 529/529/1 2116/2116/1
0.00%
vkQueueSubmit failed -4

I have tried to change the tile size and it does not work with real-esrgan-x4 but it work with realsr-ncnn

[Feature Request] Facial Enhancement

Hey, is it possible to use face enhancement models from GFPGAN or CODEFORMER? I'd love to see them implemented.

I just love what you're doing. ❤

[特性] Android 客户端 UI 优化 | Android client UI optimization

  • 我可以帮助优化UI | I can help optimize the UI
  • 如果我优化,我会引入几个轻量的库,比如rikkax的菜单preference

主要内容如下:

  1. 使用MD3设计(我也希望适配MD2)
  2. 设置页面MD化
  3. 定义一个品牌色
  4. 主页文本修改为黑色
  5. 运行和导出按钮修改为悬浮按钮,设置按钮放置到菜单内
  6. 等等等等

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.