jomjol / AI-on-the-edge-device

Easy to use device for connecting "old" measuring units (water, power, gas, ...) to the digital world
https://jomjol.github.io/AI-on-the-edge-device-docs/
5.88k stars 640 forks source link

Distibuted compute #2711

Open stefanh12 opened 11 months ago

stefanh12 commented 11 months ago

The Feature

I've been using AI-on-the-edge-device for a year now and its really great! It would be great if we could offload the processing of the image since it takes quite a long time to either multiple esp32 devices or to a docker container on HA or such. multiple esp32 devices could then split the digital / analog up and really speed up the handling. On HA as a container it would I guess only take seconds to process too.

caco3 commented 11 months ago

But what will you save with this?

My devices have an interval of 2 minutes which is already far more what effectively is needed. Also it will not save you any power as the ESP32-CAM does not support power saving.

A goal of this project is to make usage as easy as possible for non-techy people. Having to learn about docker is way beyond most users will want to look into.

BTW, @jomjol originally had offline processing in docker but moved it all to the ESP.

stefanh12 commented 11 months ago

For me running at 240mhz each processing takes 3 minutes with analysis of 4 digits and 4 analog clocks. I would like to speed this up since 3-4 minutes delay equals to around 70-90 liters of hot water when both kids shower. If we could distribute compute between 2-4 esp devices it would be 1,5 to less than a minute, resulting in better resolution and the possibility to take action before hot water is all spent.

Power management on an esp not running on battery is not really an issue

Slider0007 commented 11 months ago

@stefanh12: If you'd like to speed up the process it is possible to optimize this without adding addtional computing power / complexity.

The following things affect the processing time.


Just for reference:

image

friedpa commented 11 months ago

@Slider0007: Would be in my opinion good to add this in the wiki. So if someone has needs to speed up, he can find this parameter setting szenario quickly.

Edit: I have not done any of the recommendations above and my Round Completed time is in average 35 sec

stefanh12 commented 11 months ago

That helped a lot, processing time is now way lower!

friedpa commented 11 months ago

Do improve it further you can set the CPU frequency to 240MHz

caco3 commented 11 months ago

Would be in my opinion good to add this in the wiki.

We are always open for support. I am also willing to show how to extend the documentation!

I have a device which processes 3 digits and 4 pointers, taking 50s at 160 MHz

friedpa commented 11 months ago

Ok, let me know how it works.

caco3 commented 11 months ago

can you have a look on https://github.com/jomjol/AI-on-the-edge-device-docs/blob/main/README.md for an introduction? Afterwards we could do an online meeting to clarify open questions.

friedpa commented 11 months ago

Ok, mache ich...