Machine learning on ESP-32?

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
tylersuard
Posts: 9
Joined: Mon Jan 21, 2019 4:09 pm

Machine learning on ESP-32?

Post by tylersuard » Fri Apr 26, 2019 3:12 pm

Hello! I have the ESP-EYE, which comes with a camera and some face recognition algorithms on the chip. Unfortunately, all the software is written in C. I'd like to:

a. Create new firmware for it in Micropython
b. Have that firmware access the onboard camera
c. Detect faces and particularly whether or not a face is smiling.

Does anyone have any recommendations as to how to get started? I'm not finding anything online for machine learning in Micropython.

Really appreciate it!
Thanks,
Tyler

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Machine learning on ESP-32?

Post by jimmo » Sat Apr 27, 2019 2:01 pm

Hi,

There's already an ESP32 port of Micropython (see http://micropython.org/download#esp32 and https://github.com/micropython/micropyt ... /README.md ). For accessing the camera module, it's hard to tell which camera module is used on the ESP-EYE but from some quick reading it seemed like it might be an OV2640, in which case perhaps it's possible you might be able to use or adapt https://github.com/namato/micropython-ov2640?

For the machine learning stuff, although it's common to use regular Python for machine learning (e.g. Tensorflow and related projects), the actual number crunching is typically done in C (and hopefully offloaded to GPU), and the Python is just a nice wrapper around it. Even numpy offloads all its matrix calculations to C (well... Fortran coverted to C). You really don't want to be doing massive neural network evaluations in pure Python / MicroPython.

If you're interested in learning more about how Espressif's software does the face recognition, have a look here https://github.com/espressif/esp-face/ and if you're interested in the underlying neural network stuff:
- https://arxiv.org/abs/1801.04381
- https://arxiv.org/abs/1604.02878
- https://arxiv.org/abs/1801.07698

It would of course be possible to make a MicroPython wrapper around the esp-face libraries - I'm not aware of any such thing though.

reyal
Posts: 2
Joined: Thu Jul 07, 2022 7:47 pm

Re: Machine learning on ESP-32?

Post by reyal » Thu Jul 27, 2023 5:06 am

Hi,
It's been 3+ years since the question was raised regarding the use of Micropython and ESP-EYE.
Any news about this?
Has anyone managed to do that and access the camera HW?
Looking for such a solution myself.
Thanks,
Eyal

Post Reply