Skip to content

Commit

Permalink
change according to new APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
majianjia committed Mar 30, 2019
1 parent d4ec7b4 commit 0901bba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/mnist-simple/mcu/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -68,15 +68,16 @@ 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
print_img((int8_t*)&img[index][0]);

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) );
Expand Down

0 comments on commit 0901bba

Please sign in to comment.