Coder Social home page Coder Social logo

Comments (9)

nihui avatar nihui commented on May 18, 2024

https://github.com/tanyiok1234/waifu2x_srmd-ncnn-vulkan-termux-binary

from srmd-ncnn-vulkan.

mychina75 avatar mychina75 commented on May 18, 2024

啥时间更新预编译的ncnn-android-vulkan-lib?
想在手机上跑跑超分的模型,APK里面。
不过好像需要下面的几个库...
ncnn-android-vulkan-lib/${ANDROID_ABI}/libglslang.a
ncnn-android-vulkan-lib/${ANDROID_ABI}/libOGLCompiler.a
ncnn-android-vulkan-lib/${ANDROID_ABI}/libOSDependent.a
ncnn-android-vulkan-lib/${ANDROID_ABI}/libSPIRV.a)

from srmd-ncnn-vulkan.

nihui avatar nihui commented on May 18, 2024

https://github.com/Tencent/ncnn/releases/tag/20200616

from srmd-ncnn-vulkan.

mychina75 avatar mychina75 commented on May 18, 2024

多谢大神!

from srmd-ncnn-vulkan.

mychina75 avatar mychina75 commented on May 18, 2024

@nihui 帮忙看看是啥问题吧。
在手机上跑了下,512x512的输入
模型load需要2s多,process时间6s多。输出的结果也不太对,保存的图是黑的...
如果用原图尺寸的话,3xxx X 2xxx跑一下时间更久,要几十秒

大概的调用是这样的:
// ncnn from bitmap
ncnn::Mat in = ncnn::Mat::from_android_bitmap_resize(env, bitmap, ncnn::Mat::PIXEL_BGR2RGB,512,512);
int c = 3;
ncnn::Mat out = ncnn::Mat(512 * scale, 512 * scale, (size_t)c, c);
BSTLOGE("before proc out width = %d, height = %d", out.w, out.h);

srmd.process(in, out);
BSTLOGE("out width = %d, height = %d", out.w, out.h);

// ncnn to bitmap
out.to_android_bitmap(env, outBitmap, ncnn::Mat::PIXEL_RGB);

我是在linux上面编译通了这套代码,生成好些*_int8s.spv.hex.h,*_fp16s.spv.hex.h的头文件,然后把这些头文件放在Android工程里面。会不会这些头文件与运行环境有关,在手机上需要专门生成一下?

from srmd-ncnn-vulkan.

nihui avatar nihui commented on May 18, 2024

tilesize太大了?

from srmd-ncnn-vulkan.

mychina75 avatar mychina75 commented on May 18, 2024

这段代码获取的heap_budget是一千多, tilesize就设成了200;

if (tilesize == 0)
{
uint32_t heap_budget = ncnn::get_gpu_device(gpuid)->get_heap_budget();

    // more fine-grained tilesize policy here
    if (model.find(PATHSTR("models-srmd")) != path_t::npos)
    {
        if (heap_budget > 2600)
            tilesize = 400;
        else if (heap_budget > 740)
            tilesize = 200;
        else if (heap_budget > 250)
            tilesize = 100;
        else
            tilesize = 32;
    }
}

from srmd-ncnn-vulkan.

bananaCaptain avatar bananaCaptain commented on May 18, 2024

@mychina75 请问能移植到android不?

from srmd-ncnn-vulkan.

mychina75 avatar mychina75 commented on May 18, 2024

不太行...

from srmd-ncnn-vulkan.

Related Issues (12)

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.