Tencent / ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform
Other
20.42k stars 4.16k forks source link

安卓,多次运行deeplabv3 分割模型,结果不一致。 #5757

Open zhaoyk1986 opened 1 week ago

zhaoyk1986 commented 1 week ago

运行环境

Android Studio : Koala Feature Drop | 2024.1.2 ndk : 23.1.7779620 ncnn版本 : ncnn-20220721-android-shared ncnn-20230223-android-shared ncnn-20240820-android-shared 3个版本都试过。

model | 模型 | モデル

  1. 模型的params foreHead.zip

问题: 安卓,多次运行deeplabv3 分割模型,结果不一致。

1228462C7D7F26DC3882BF20A08B7854

wzyforgit commented 1 week ago

你咋多次运行的?来个最小复现代码

zhaoyk1986 commented 1 week ago

这个是调用的cpp 我是在app写了个按钮,按一次跑一次。

zhaoyk1986 commented 1 week ago

[Uploading CWrinkleDet.zip…]()

zhaoyk1986 commented 1 week ago
    CWrinkleDet * foreheadDet = new CWrinkleDet();
    //
    string param_path =  "/storage/emulated/0/Android/data/com.example.hairdetect/files/model/foreHead.param";
    string bin_path =  "/storage/emulated/0/Android/data/com.example.hairdetect/files/model/foreHead.bin";
    foreheadDet->load(param_path, bin_path, false);
    foreheadDet->detect(foreHeadImg, 2048, 2048, segMap);

    delete foreheadDet;
    foreheadDet = NULL;