EDP32-EYE - 'struct ei_impulse_result_t' has no member named 'classification'

Question/Issue:
I’m trying to deploy my project using Arduino IDE, into ESP32-EYE.
I created and imported the zip, opened the example, using “static_buffer”.
While compiling, I’m getting the following error:

/Users/xxx/Documents/Arduino/libraries/Apylo-v0_inferencing/examples/static_buffer/static_buffer.ino: In function 'void loop()':
static_buffer:92:34: error: 'struct ei_impulse_result_t' has no member named 'classification'
         ei_printf("%.5f", result.classification[ix].value);
                                  ^~~~~~~~~~~~~~
static_buffer:108:44: error: 'struct ei_impulse_result_t' has no member named 'classification'
         ei_printf("    %s: %.5f\n", result.classification[ix].label, result.classification[ix].value);
                                            ^~~~~~~~~~~~~~
static_buffer:108:77: error: 'struct ei_impulse_result_t' has no member named 'classification'
         ei_printf("    %s: %.5f\n", result.classification[ix].label, result.classification[ix].value);
                                                                             ^~~~~~~~~~~~~~
exit status 1
'struct ei_impulse_result_t' has no member named 'classification'

I’m stuck and will appreciate any help - Thank you!

Project ID:
127972

Context/Use case:
This is a detection model of two classes. The current model is very small, just for testing.

Hi @tamir,

Our static buffer example doesn’t have object detection support, I’ll open an issue on our side.
In the meantime you can just modify it as follows:


    // print the predictions
    ei_printf("Predictions ");
    ei_printf("(DSP: %d ms., Classification: %d ms., Anomaly: %d ms.)",
        result.timing.dsp, result.timing.classification, result.timing.anomaly);
    ei_printf(": \n");
#if EI_CLASSIFIER_OBJECT_DETECTION == 1
    bool bb_found = result.bounding_boxes[0].value > 0;
    for (size_t ix = 0; ix < result.bounding_boxes_count; ix++) {
        auto bb = result.bounding_boxes[ix];
        if (bb.value == 0) {
            continue;
        }

        ei_printf("    %s (", bb.label);
        ei_printf_float(bb.value);
        ei_printf(") [ x: %u, y: %u, width: %u, height: %u ]\n", bb.x, bb.y, bb.width, bb.height);
    }

    if (!bb_found) {
        ei_printf("    No objects found\n");
    }
#else
    ei_printf("[");
    for (size_t ix = 0; ix < EI_CLASSIFIER_LABEL_COUNT; ix++) {
        ei_printf("%.5f", result.classification[ix].value);
#endif

Also, I’d recommend using esp-idf instead of Arduino IDE to get better performances, our official support is for esp-idf only.

Aurelien

Thanks @aurel for both the workaround and for submitting feature request for the future.
I’m aware that in my case, for object detection it is better to use idf and i already tried that, but go some failures while building it. That’s why I tried to check the Arduino IDE version first.
Based on your recommendation, I will go back and try the idf again and open an issue if needed.
I appreciate your help.
You guys at EI are AWESOME!!

1 Like

@aurel and the EI team,

I need to add my own code and do some changes to the project that was exported as a c++ project (to be flashed using idf).
Which file/files actually run the inference/loop that I should update?

Thanks,
Tamir