hi, I’m doing an image classification project and it works fine thanks to the edge impulse platform, but the code is huge is there any simple code that i can easily edit to make some action like led on and led off or just anyone show me where is the predicted line in the code to edit?
please help me
Hello @abdulmola2000,
You can have a look at this thread for a similar issue: The voice model is trained on the Edge Ipulse to control the lighting and turning off of LED - #5 by louis
Basically, look for something like:
EI_IMPULSE_ERROR err = run_classifier(&signal, &result, debug_nn);
if (err != EI_IMPULSE_OK) {
ei_printf("ERR: Failed to run classifier (%d)\n", err);
return;
}
// print the predictions
ei_printf("Predictions (DSP: %d ms., Classification: %d ms., Anomaly: %d ms.): \n",
result.timing.dsp, result.timing.classification, result.timing.anomaly);
for (size_t ix = 0; ix < EI_CLASSIFIER_LABEL_COUNT; ix++) {
ei_printf(" %s: ", result.classification[ix].label);
ei_printf_float(result.classification[ix].value);
ei_printf("\n");
}
In the for loop you can add your custom logic to turn on or off leds.
Best,
Louis