|
1 | 1 | [中文说明](./README_CHS.md) |
| 2 | +# MNN-SR |
| 3 | + |
| 4 | +This module is a [mnn](https://github.com/alibaba/MNN) implementation for super resolution. |
| 5 | +1. MNN can be compatible with more model architectures than NCNN. |
| 6 | + |
| 7 | +2. This module supports compilation with GCC, VS, and AS, meaning that not only Android but also Windows, Linux, and even other PC systems now have a more universal super-resolution tool that operates independently of Python! |
| 8 | + |
| 9 | +3. MNN supports multiple backends. The current configuration for Android includes Vulkan, OpenCL, and CPU, with OpenCL recommended. For Windows, it supports Vulkan, OpenCL, CPU, and CUDA. However, CUDA produces incorrect output on my computer and requires further testing and feedback. OpenCL does not show GPU usage in the system task manager, but the GPU can be fully utilized as seen in the nvidia-smi tool. On Linux, it supports Vulkan, OpenCL, CPU, and CUDA. In my test environment, CUDA is the fastest, Vulkan fails to utilize the GPU, and OpenCL performs well. Overall, all platforms function properly with speeds no lower than NCNN. |
| 10 | + **🙏Waiting your help!** |
| 11 | + |
| 12 | +### How to build in Android Studio |
| 13 | + |
| 14 | +1. download opencv lib and others libs and extract them to RealSR-NCNN-Android/3rdparty just like the ncnn modules. |
| 15 | + |
| 16 | +2. download mnn lib and extract them to RealSR-NCNN-Android/3rdparty |
| 17 | + |
| 18 | + ``` |
| 19 | + ├─libwebp |
| 20 | + ├─mnn_android |
| 21 | + │ ├─arm64-v8a |
| 22 | + │ ├─armeabi-v7a |
| 23 | + │ └─include |
| 24 | + ``` |
| 25 | + |
| 26 | +3. sync and build this module |
| 27 | + |
| 28 | +4. copy models and *.so from mnn_android to assets dir and build the GUI App. |
| 29 | + |
| 30 | +5. run mnnsr commands in App |
| 31 | + |
| 32 | + |
| 33 | +### How to build in VS for Windows |
| 34 | +1. download Windows libs just like Android. if you need cuda, you should build mnn by yourself. |
| 35 | +2. modify the path in cmake file according to actually libs path. |
| 36 | +3. open the jni path and build |
| 37 | + |
| 38 | + |
| 39 | +### How to build in Linux |
| 40 | +refer to ci script |
| 41 | + |
| 42 | + |
| 43 | +### Usages |
| 44 | + |
| 45 | +The usage of others program is same as realsr-ncnn. Add these param: |
| 46 | + |
| 47 | + -b backend forward backend type(CPU=0,AUTO=4,CUDA=2,OPENCL=3,OPENGL=6,VULKAN=7,NN=5,USER_0=8,USER_1=9, default=3) |
| 48 | + -c color-type model & output color space type (RGB=1, BGR=2, YCbCr=5, YUV=6, GRAY=10, GRAY model & YCbCr output=11, GRAY model & YUV output=12, default=1) |
| 49 | + -d decensor-mode remove censor mode (Not=-1, Mosaic=0, default=-1) |
| 50 | + |
2 | 51 |
|
3 | 52 | # NCNN-Modules |
4 | 53 |
|
@@ -42,6 +91,8 @@ RealSR-NCNN-Android |
42 | 91 | Open this project with Android Studio, rebuild it and the build result in `RealSR-NCNN-Android-CLI\*\build\intermediates\cmake\release\obj\arm64-v8a` or `RealSR-NCNN-Android-CLI\*\build\intermediates\cmake\debug\obj\arm64-v8a` could copy to the GUI project automatilly. |
43 | 92 | Click `3rdparty/copy_cli_build_result.bat` and it could copy the other files to GUI project. |
44 | 93 |
|
| 94 | + |
| 95 | + |
45 | 96 | ## How to use RealSR-NCNN-Android-CLI |
46 | 97 |
|
47 | 98 | ### Download models |
@@ -82,37 +133,4 @@ Usage: realsr-ncnn -i infile -o outfile [options]... |
82 | 133 | - `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. |
83 | 134 | - `format` = the format of the image to be output, png is better supported, however webp generally yields smaller file sizes, both are losslessly encoded |
84 | 135 |
|
85 | | -If you encounter crash or error, try to upgrade your derive |
86 | | - |
87 | | -# MNN-SR |
88 | | - |
89 | | -This module is a [mnn](https://github.com/alibaba/MNN) implementation for super resolution. MNN could support more models than ncnn. |
90 | | -I am trying to make this module a CLI program that can be compiled in both VS(for Windows) and AS(for Android), but it not fast than ncnn. **🙏Waiting your help!** |
91 | | - |
92 | | -### How to build in Android Studio |
93 | | - |
94 | | -1. download opencv lib and others libs and extract them to RealSR-NCNN-Android/3rdparty just like the ncnn modules. |
95 | | - |
96 | | -2. download mnn lib and extract them to RealSR-NCNN-Android/3rdparty |
97 | | - |
98 | | - ``` |
99 | | - ├─libwebp |
100 | | - ├─mnn_android |
101 | | - │ ├─arm64-v8a |
102 | | - │ ├─armeabi-v7a |
103 | | - │ └─include |
104 | | - ``` |
105 | | - |
106 | | -3. sync and build this module |
107 | | - |
108 | | -4. copy models and *.so from mnn_android to assets dir and build the GUI App. |
109 | | - |
110 | | -5. run mnnsr commands in App |
111 | | - |
112 | | -### Usages |
113 | | - |
114 | | -The usage of others program is same as realsr-ncnn. Add these param: |
115 | | - |
116 | | - -b backend forward backend type(CPU=0,AUTO=4,CUDA=2,OPENCL=3,OPENGL=6,VULKAN=7,NN=5,USER_0=8,USER_1=9, default=3) |
117 | | - -c color-type model & output color space type (RGB=1, BGR=2, YCbCr=5, YUV=6, GRAY=10, GRAY model & YCbCr output=11, GRAY model & YUV output=12, default=1) |
118 | | - -d decensor-mode remove censor mode (Not=-1, Mosaic=0, default=-1) |
| 136 | +If you encounter crash or error, try to upgrade your derive |
0 commit comments