diff --git a/examples/mnist-simple/mcu/main.c b/examples/mnist-simple/mcu/main.c index 48ed5c9..24b55f9 100644 --- a/examples/mnist-simple/mcu/main.c +++ b/examples/mnist-simple/mcu/main.c @@ -54,7 +54,7 @@ void mnist(int argc, char** argv) { uint32_t tick, time; uint32_t predic_label; - uint32_t prob; + float prob; int32_t index = atoi(argv[1]); if(index >= TOTAL_IMAGE || argc != 2) @@ -68,7 +68,7 @@ void mnist(int argc, char** argv) // copy data and do prediction memcpy(nnom_input_data, (int8_t*)&img[index][0], 784); - nnom_predic_one(model, predic_label, prob); + nnom_predic(model, &predic_label, &prob); time = rt_tick_get() - tick; //print original image to console @@ -76,7 +76,8 @@ void mnist(int argc, char** argv) printf("Time: %d tick\n", time); printf("Truth label: %d\n", label[index]); - printf("Predicted label: %d\n", result); + printf("Predicted label: %d\n", predic_label); + printf("Probability: %d%%\n", (int)(prob*100)); } FINSH_FUNCTION_EXPORT(mnist, mnist(4) );