xinntao / Real-ESRGAN-ncnn-vulkan

NCNN implementation of Real-ESRGAN. Real-ESRGAN aims at developing Practical Algorithms for General Image Restoration.
https://github.com/xinntao/Real-ESRGAN
Other
1.46k stars 182 forks source link

Request: offer sample apps for Android and IOS #21

Open AndroidDeveloperLB opened 2 years ago

AndroidDeveloperLB commented 2 years ago

As the title says. It seems this repository should make it possible, because of this:

https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-android https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-ios-on-macos-with-xcode

If you create a sample project (here or somewhere else and link to it), it could be easier for everyone to use it. Please, if you do it, show also how to update it in case there are new versions of the libraries.

I would really appreciate it.

xinntao commented 2 years ago

I am not an expert at it.

Wait for someone to help :-)

AndroidDeveloperLB commented 2 years ago

@xinntao I'm not either. Even though I do develop for Android, I never used such a library.

AndroidDeveloperLB commented 2 years ago

@xinntao I've found this: https://github.com/tumuyan/RealSR-NCNN-Android Do you know of it?

Sun-ZhenXing commented 2 years ago

I have used Android Native to create APP and it works fine. If you need to know more, you can contact me.

I am still trying to integrate other models (e.g. waifu2x) in my APP, but have encountered some problems, I will open source if the problems are solved.

AndroidDeveloperLB commented 2 years ago

@Sun-ZhenXing Please share it on Github.

Sun-ZhenXing commented 2 years ago

@AndroidDeveloperLB

Here's a Fact: If you deploy Real-ESRGAN on a mobile device, it will run your mobile device's graphics card at full capacity for several minutes. No other work can be done during that time, and this obviously cannot be used in production.

I have not studied Android development myself, so it may need to be refactored. This is experimental software and not a lot of engineering has been done.

There were too many incompatibilities with the Android NDK and un-debuggable failures when exporting JNI interfaces. So I chose to build the dynamic link library (.so) on Android itself, and it worked. I've built several models using Termux, tested them with Python scripts, and they work fine in Termux. I felt this step was important, so I wanted to write a document describing how to build on Android itself. Obviously this approach is not cross-platform, and I can only run it on arm64-v8a devices.

My Android project is Sun-ZhenXing/Real-ESRGAN-android, but it doesn't include docs for building dynamic link libraries. And it retains the command mode, which invokes the model by command-like means. I hope you can Pull Request to improve it.