ESP32 CAM With Edge Impulse

I am using Edge Impulse and ESP32 CAM to classify image. I am trying code from ESP32-Cam-Edge-Impulse. While executing the code I am getting following error message on serial terminal:

WiFi connected
Starting web server on port: '80'
Starting stream server on port: '81'
Camera Ready! Use 'http://192.168.19.247' to connect
Capture image
Edge Impulse standalone inferencing (Arduino)
ERR: failed to allocate tensor arena
Failed to allocate TFLite arena (error code 1)
run_classifier returned: -6

I could see only the still image in web browser, no interface is seen. Whereas when I use default CameraWebServer.ino example, everything is working fine. What exactly the problem is? I would also like to ask how to capture image automatically on PIR trigger without using the webbrowser.

Hello @timothy.malche,

ERR: failed to allocate tensor arena
Failed to allocate TFLite arena (error code 1)

This error means that you model is too big, can you try using a smaller model (MobileNetV1).
In the advanced version, the web interface is takes some ressources, this is probably why it works with the default example but not with the advanced one.

Also I stopped maintaining the repo on my personal Github account but I moved it on Edge Impulse Github account instead: https://github.com/edgeimpulse/example-esp32-cam

Regards,

Louis

1 Like

Can I choose following:

MobileNetV1 96x96 0.1
Uses around 53.2K RAM and 101K ROM with default settings and optimizations. Works best with 96x96 input size. Supports both RGB and grayscale.

How can I classify image automatically without using the browser interface to capture image?

I don’t think I have implemented that but you can add an interrupt on the button to trigger a function doing something similar to this:

void btn_classify(){
    fb = esp_camera_fb_get();
    if (!fb) {
        Serial.println("Camera capture failed");
    }
    classify();
    esp_camera_fb_return(fb);
}
1 Like

Thanks @louis its working now.

2 Likes