easytarget / esp32-cam-webserver

Expanded version of the Espressif ESP webcam
https://hackaday.io/project/168563-7-esp32-cam-example-expanded
GNU Lesser General Public License v2.1
1.28k stars 344 forks source link

Face recognition Database #28

Closed easytarget closed 3 years ago

easytarget commented 4 years ago

Can this be saved/restored?

If so:

  1. Save/Restore to LittleFS
  2. Rename/Delete entries
  3. Upload/Download from the clients browser

The first is probably the easiest, json makes sense for the format rather than binary. The first step is to read the IDE build settings (to check that space is reserved for the filesystem) and, if so, run an example on the ESP-CAM board to demo saving/restoring a filestructure to that. Adding buttons to the UI and a new action handler to process that should be relatively easy.

The second involves setting up a handler that can return the name list, a dialog to obtain that and offer rename/delete on entries, then a receiver to import the update and modify the in-ram Db. The dialog involves extending the javascript somewhat.

The third involves another handler/reciever pair to provide the current db from ram as a Json file, and a reciever to import that. The JS for this is also a bit complex, the upload needs a progress bar and fail/success notification etc.

trevor-sonic commented 4 years ago

Default face recognition functionality is very basic and useless without ability to reuse after rebooting. Ability to Save/Restore would be fundamentally needed.

easytarget commented 4 years ago

I agree, but I also consider face recognition a low-priority in this project. I fully intend to remove it completely in V5 so that I can put OTA updates in. I've just expanded this request, and added the 'Help wanted' label, I'd love to work on it but I need to put this project aside for a while after v3..

easytarget commented 4 years ago

The LittleFS part of this is common to #20

trevor-sonic commented 4 years ago

OTA is important from programmer point of view but face recognition is very unique feature compare to other ip camera on the market (I bought it just for this). I would say please don't remove (of course this is your repo, decision ), or keep a git branch with it. If you make an initial start point I may improve and ask merge request for your repo.

easytarget commented 4 years ago

Dont worry, there will be a v4 dev and maintenance branch..

easytarget commented 4 years ago

spiffs branch is a POC for preferences saving; but the initial commit there also shows how to read/write a C struct to spiffs. This should be doable for the face recognition db; by saving mtmn_config and id_list. (declared as static here)

easytarget commented 4 years ago

I just merged #49 which, as well as the preferences save/restore includes stubbed-out code and commented out html for the FaceDB save/restore operations and UI.

It also has Debug dumping of some facedb data sizes, I lost several hours going through the esp-face code without really getting a handle on how this works. It looks like the structures are dynamic with static indexes.

Needs more thought.

easytarget commented 4 years ago

https://github.com/espressif/esp-face/blob/master/face_recognition/fr_flash.c Saves/reads from flash memory; but needs a change to the board partition scheme and I wish to keep this project simple enough to use with a unmodified Arduino IDE.

otoh; it shows me what I need to save; and how to save it to a block device on a partition.. Good basis for a SPIFFS implementation.

easytarget commented 3 years ago

I've just forked the 3.x branch into a maintenance mode. 4.x (going forward) has dropped face recognition entirely. Closing this issue now as no longer relevant.