Commit Graph

2831 Commits

Author SHA1 Message Date
Ibrahim Abdelkader
abe54df3e7
Merge pull request #2274 from openmv/ml_updates
modules/py_ml: ML updates and fix.
2024-07-12 23:40:55 +02:00
iabdalkader
4506682c2d modules/py_ml: Save labels in model object. 2024-07-13 00:33:27 +03:00
iabdalkader
dd1474e22e misc: Export common environment variables from top Makefile. 2024-07-12 23:06:32 +03:00
iabdalkader
0fbc6f114e modules/py_ml: Fix ndarray ndims check. 2024-07-12 22:01:57 +03:00
Ibrahim Abdelkader
829bbc5cf8
Merge pull request #2264 from kwagyeman/kwabena/buffer_check
modules/py_image: Add buffer length sanity check.
2024-07-11 18:42:49 +02:00
Ibrahim Abdelkader
9a67079fd6
Merge pull request #2272 from openmv/tinyusb_debug
misc: Tinyusb debug updates.
2024-07-10 11:38:30 +02:00
Ibrahim Abdelkader
4aab0f1aa4
Merge pull request #2271 from kwagyeman/kwabena/fix_input_buffer_size
modules/py_ml: Fix the size of the input bytearray.
2024-07-10 11:38:20 +02:00
iabdalkader
9c1283c58e ports/all: Wrap more CDC functions.
Just to ensure tud_task is not call by other code while debugging
is enabled.
2024-07-10 12:35:08 +03:00
iabdalkader
0a69b3df16 misc: Update TinyUSB debug code.
* Wrap-up more CDC functions. Note these were moved to common code
upstream, so in the future we'll only need to wrap one or two functions.
* Recover from text ringbuf overflow by resetting it.
* More efficient text ringbuf read/write.
2024-07-10 12:35:05 +03:00
Kwabena W. Agyeman
454fab7448 modules/py_ml: Fix the size of the input bytearray. 2024-07-09 22:19:15 -07:00
iabdalkader
2a3be63d41 misc: Fix malloc heap memory typo. 2024-07-10 00:20:01 +03:00
iabdalkader
0cef6239e0 misc/usbdbg: Add GET_STATE command.
The GET_STATE command is a command that returns flags, frame width,
height, size, and the text buffer (up to 40 bytes), in a single 64
bytes packet to reduce the bandwidth/overhead of the protocol.
The packet format is:
word    word    word    word    2 words     40 bytes
<flags> <width> <height> <size> <reserved>  <null-terminated text>

The flags are mostly reserved, only the following bits are defined:
0x001 script running
0x010 text buffer valid.
0x100 JPEG frame buffer ready.
2024-07-09 19:18:51 +03:00
Kwabena W. Agyeman
a36ac2db06 modules/py_image: Add buffer length sanity check. 2024-07-08 23:03:07 -07:00
Kwabena W. Agyeman
3f8491cb0e scripts/libraries: Move nms to python. 2024-07-07 23:02:15 -07:00
iabdalkader
93e17a3a8d modules/py_ml: Remove input/output callbacks. 2024-07-07 21:48:42 +03:00
iabdalkader
70b89f4744 modules/py_ml: Update ML API to support multi-input models. 2024-07-07 21:48:42 +03:00
Kwabena W. Agyeman
de0d46fa68 modules/py_image: Add unpacking to bytearray support. 2024-07-07 21:48:42 +03:00
iabdalkader
9a186f4e27 libraries/ml: Convert ml to a package.
Add preprocessing, model wrapper and utils.
2024-07-07 21:48:38 +03:00
Ibrahim Abdelkader
e014e48fe3
Merge pull request #2249 from openmv/py_image_type
modules/py_image: Add Image as a type instead of function.
2024-07-07 07:42:56 +02:00
iabdalkader
9ae3d0355c modules/py_image: Add missing draw hint. 2024-07-06 22:54:40 +03:00
iabdalkader
f481c9df77 modules/py_image: Add Image as a type instead of function.
Otherwise something like isinstance(x, image.Image) does Not work.
2024-07-06 18:38:04 +03:00
Ibrahim Abdelkader
2922d6d1c6
Merge pull request #2209 from kwagyeman/kwabena/add_circle_aa
imlib/draw: Add AA support for draw_circle.
2024-07-04 21:21:35 +02:00
Kwabena W. Agyeman
2493c91e83 ports/stm32: Add mic gain support to py_audio when using dfsdm. 2024-07-03 17:30:43 -07:00
iabdalkader
93f2d4c419 boards/ARDUINO_GIGA: Enable Open-AMP support. 2024-07-03 17:44:41 +02:00
iabdalkader
3cc57fea49 ports/stm32: Remove deprecated CM4 firmware support.
Now replaced with Open-AMP. Examples and docs will follow later.
2024-07-03 17:44:41 +02:00
iabdalkader
edc1a14e46 boards/All: Update Ulab config. 2024-07-03 17:44:41 +02:00
iabdalkader
17ee1838e4 ports/rp2: Use frozen _boot_fat.py to create the FS. 2024-07-03 17:44:41 +02:00
iabdalkader
976aee80ae misc/mp_utils: Add pystack initializer. 2024-07-03 17:44:41 +02:00
iabdalkader
eaeff63f34 ports/stm32: Deinit CYW43 on soft-reset. 2024-07-03 17:44:41 +02:00
iabdalkader
75d968051b ports/mimxrt: Switch to the updated CYW43 driver v7_45_98_102. 2024-07-03 17:44:41 +02:00
iabdalkader
ec02218a1b ports/mimxrt: Deinit CYW43 on soft-reset. 2024-07-03 17:44:38 +02:00
iabdalkader
e758a0f958 ports/All: Update USBDBG to use the VM abort feature.
Replaces the forced PendSV jump with the new VM abort feature.
2024-07-03 15:40:02 +02:00
iabdalkader
0c67aba2ea boards/All: Freeze ssl module.
This module provides compatibility with CPython's SSL module.
2024-07-03 15:40:02 +02:00
iabdalkader
27be6e1f98 ports/All: Update Makefiles to support MicroPython 1.23. 2024-07-03 15:39:59 +02:00
iabdalkader
3a8f1bb540 modules: Switch to the new mp_obj_malloc_with_finaliser. 2024-07-03 14:42:18 +02:00
iabdalkader
f57c2f5e56 misc: Replace deprecated STATIC with static. 2024-07-03 14:42:18 +02:00
iabdalkader
4488f778f5 modules: Update ulab to 6.5.2. 2024-07-03 14:42:18 +02:00
iabdalkader
be03021258 boards/All: Update memory configs.
* DMA buffers regions are automatically rounded up to the next power of 2 via
the linker script. This ensures that these buffers, when rounded up, can actually
fit into their respective memories. It also ensures that when/if the MPU is used
to configure these regions, it will not round up the regions sizes, which may cause
the MPU to configure a region bigger than the DMA buffer.
* GC blocks can be rearranged in any order, including the main heap/first block.
This is very important for boards with limited RAM to avoid fragmenting the contiguous
large heap early before it's actually needed.
* Moved VOSPI memory to its own section. The offset is no longer required, and the
linker script can detect overlaps.
* Renamed GC heap memory to allow more than one heap to exist, and added support for
it in the common linker script. This change allows adding a second heap for malloc/libc
easily if needed.
* For STM32 boards, the domain-specific DMA buffers can now be located anywhere within
their memory regions, as their MPU regions' base addresses and sizes are all set via
linker script variables. Previously, this was defined in headers, and sections could
have easily overlapped without warning.
2024-06-30 17:58:59 +02:00
iabdalkader
c28aea9ea4 misc: Fix first additional GC block name. 2024-06-30 17:32:13 +02:00
iabdalkader
c9de724be0 misc: Rename JPEG buffer size. 2024-06-30 17:32:13 +02:00
iabdalkader
ab92e46edd ports/nrf: Use the common linker script. 2024-06-30 17:32:13 +02:00
iabdalkader
c7a87bce8e ports/stm32: Use the common linker script. 2024-06-30 17:32:13 +02:00
iabdalkader
f06eb8e72e ports/stm32: Add MPU helper function. 2024-06-30 17:32:13 +02:00
iabdalkader
2f8977a5ac ports/mimxrt: Use the common linker script. 2024-06-30 17:32:13 +02:00
iabdalkader
9062a51d31 misc: Add common pre-processor linker script. 2024-06-30 17:32:09 +02:00
iabdalkader
40710a3573 ports/stm32: Support setting audio module samples at runtime. 2024-06-28 16:32:04 +02:00
iabdalkader
54104039b4 boards/All: Freeze the ML extension module for boards with ML support. 2024-06-28 16:32:04 +02:00
iabdalkader
c7228cbb48 modules/py_tf: Refactor TensorFlow module.
This patch decouples the MicroPython TF module from the TensorFlow library,
allowing support for more DL/ML libraries and engines in the future.

The ML backend has been completely redesigned; the model object can now be
passed directly to the backend, allowing it to initialize the model internally.
Additionally, the backend's state/memory is now persistent (surviving across
invocations), which improves inference speed by around 20% and supports models
that require persistent memory, such as LSTM.

Finally, the ML module has been mostly rewritten to handle model input/output
shapes and data properly, and to support models with multiple outputs
2024-06-28 16:32:04 +02:00
iabdalkader
13c99c6332 boards/All: Optimize flash/memory usage to support the new TFLM. 2024-06-28 16:32:04 +02:00
iabdalkader
13cc273318 boards/all: Enable built-in TFLM models.
The new built-in model system allows fine-grained control over which models
get built into the firmware image. This patch enables FOMO for all boards
and audio processing models for boards with mics.
2024-06-28 16:32:04 +02:00