EdgeLab Data introduces an on-device persistent storage API. You can access the resources through the DataDelegate class:
The Models class enables runtime memory mapping, allowing direct loading of TFLite models from flash storage. It supports plain TFLite models and packed TFLite models (with a header for faster loading). It can automatically discard duplicate models based on the model address. Refer to data_models_demo for detailed usage.
packed model header: [ 24-bit magic code | 4-bit ID | 4-bit type | 24-bit size (unsigned) | 8-bit unused padding ]
The Storage class enables persistent on-device storage (based on FlashDB). You can store or read data from flash using key-value pairs. It's also compatible with standard iterators, << and >> pipe operators, and provides alternative methods like emplace and try_emplace. See data_storage_demo for detailed usage.
EdgeLab Utility offers powerful and user-friendly utilities:
el_results_2_json provides a unified API to parse various invoke results into a JSON string.
Added support for new algorithms and introduced template abstractions for type-safe input and output:
The AlgorithmFOMO class supports invoking FOMO models for object detection. Input: el_img_t, Output: list<el_box_t>.
The AlgorithmPFLD class supports invoking PFLD models for pose detection (for pointer meters). Input: el_img_t, Output: list<el_point_t>.
Giant performance improvements:
rgb_to_rgb up to 80% faster in color conversion and linear nearest resizing.
el_draw_rect up to 50% faster in draw boxes (with boundary check).
ReplServer up to 50% faster in parsing commands and run callbacks.
Thread-safe ReplServer and ReplExecutor.
New Examples:
at_server_demo: A command-line CLI that allows interaction with the device through the serial port. It facilitates smooth switching between algorithms (currently supporting FOMO, PFLD, and YOLO), models, and sensors. It also enables obtaining sample images and invoke results directly.
task_executor_demo: Underlying infrastructure for AT server, allowing task execution from the queue in a background thread. It includes atomic-based tiny stop tokens.
fomo_detection_demo, mobilenetv2_classification_demo and pfld_meter_demo: Now implemented.
data_models_demo and data_storage_demo: Previously introduced.
serial_echo_demo: reuse JTAG serial (for test only).
Other Changes:
Added support for reusing JTAG serial for sending and receiving data via the serial port.
Resolved issues related to esp-nn (elementwise add operator issue when data is unaligned).
Added four new models and their packed binary models, updated partition table for DB and models.
Refactor ReplServer, Algorithm, added TaskExecutor for parallel task execution.
Minor bug fixes and code style improvements.
TODO (not planed in this release)
Transition to common C-style variable initialization (potentially volatile ISOCPP ES.23).
Build system and C/C++ header integration refactor.
Documentation.
Address additional code style issues (cleanup required for AT server demo) and build system-related fixes.
Note:
Currently we use forward_list instead of map or unordered_map due to limited memory resource, current design has flaw in lookup time consistency when dealing with large amounts data.
Highlights
EdgeLab Data introduces an on-device persistent storage API. You can access the resources through the
DataDelegate
class:Models
class enables runtime memory mapping, allowing direct loading of TFLite models from flash storage. It supports plain TFLite models and packed TFLite models (with a header for faster loading). It can automatically discard duplicate models based on the model address. Refer to data_models_demo for detailed usage.Storage
class enables persistent on-device storage (based on FlashDB). You can store or read data from flash using key-value pairs. It's also compatible with standard iterators,<<
and>>
pipe operators, and provides alternative methods likeemplace
andtry_emplace
. See data_storage_demo for detailed usage.EdgeLab Utility offers powerful and user-friendly utilities:
el_make_storage_kv
creates type-safe key-value pairs.el_make_storage_kv_from_type
provides compile-time reflection to generate key-value pairs from types without RTTI enabled. Keys are generated from type names and hashed using the djb2 hash, then efficiently cached in a static buffer list. https://github.com/Seeed-Studio/edgelab-example-esp32/blob/aea97c52021604493198ab42adce964340a03186/components/edgelab/src/data/el_data_storage.hpp#L87-L120el_results_2_json
provides a unified API to parse various invoke results into a JSON string.Added support for new algorithms and introduced template abstractions for type-safe input and output:
AlgorithmFOMO
class supports invoking FOMO models for object detection. Input:el_img_t
, Output:list<el_box_t>
.AlgorithmPFLD
class supports invoking PFLD models for pose detection (for pointer meters). Input:el_img_t
, Output:list<el_point_t>
.Giant performance improvements:
rgb_to_rgb
up to 80% faster in color conversion and linear nearest resizing.el_draw_rect
up to 50% faster in draw boxes (with boundary check).ReplServer
up to 50% faster in parsing commands and run callbacks.Thread-safe
ReplServer
andReplExecutor
.New Examples:
at_server_demo
: A command-line CLI that allows interaction with the device through the serial port. It facilitates smooth switching between algorithms (currently supporting FOMO, PFLD, and YOLO), models, and sensors. It also enables obtaining sample images and invoke results directly.task_executor_demo
: Underlying infrastructure for AT server, allowing task execution from the queue in a background thread. It includes atomic-based tiny stop tokens.fomo_detection_demo
,mobilenetv2_classification_demo
andpfld_meter_demo
: Now implemented.data_models_demo
anddata_storage_demo
: Previously introduced.serial_echo_demo
: reuse JTAG serial (for test only).Other Changes:
esp-nn
(elementwise add
operator issue when data is unaligned).ReplServer
,Algorithm
, addedTaskExecutor
for parallel task execution.TODO (not planed in this release)
esp-nn
acceleratedelementwise add
operator (EE instruction).Note:
forward_list
instead ofmap
orunordered_map
due to limited memory resource, current design has flaw in lookup time consistency when dealing with large amounts data.