Skip to content

Commit

Permalink
fix result blob in squeezenet example
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Mar 4, 2018
1 parent 68f0169 commit ecaadb2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/squeezencnn/jni/Android.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
LOCAL_PATH := $(call my-dir)

# change this folder path to yours
NCNN_INSTALL_PATH := /home/nihui/dev/qqfacecnn/ncnn/build-android-armv7/install
NCNN_INSTALL_PATH := /home/nihui/dev/ncnn/build-android-armv7/install

include $(CLEAR_VARS)
LOCAL_MODULE := ncnn
Expand Down
7 changes: 3 additions & 4 deletions examples/squeezencnn/jni/squeezencnn_jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,10 @@ JNIEXPORT jstring JNICALL Java_com_tencent_squeezencnn_SqueezeNcnn_Detect(JNIEnv
ncnn::Mat out;
ex.extract(squeezenet_v1_1_param_id::BLOB_prob, out);

cls_scores.resize(out.c);
for (int j=0; j<out.c; j++)
cls_scores.resize(out.w);
for (int j=0; j<out.w; j++)
{
const float* prob = out.channel(j);
cls_scores[j] = prob[0];
cls_scores[j] = out[j];
}
}

Expand Down
7 changes: 3 additions & 4 deletions examples/squeezenet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ static int detect_squeezenet(const cv::Mat& bgr, std::vector<float>& cls_scores)
ncnn::Mat out;
ex.extract("prob", out);

cls_scores.resize(out.c);
for (int j=0; j<out.c; j++)
cls_scores.resize(out.w);
for (int j=0; j<out.w; j++)
{
const float* prob = out.channel(j);
cls_scores[j] = prob[0];
cls_scores[j] = out[j];
}

return 0;
Expand Down

0 comments on commit ecaadb2

Please sign in to comment.