https://github.com/microbit-foundation/micropython-ml4f-poc
Experiment integrating ML4F into MicroPython for micro:bit V2
https://github.com/microbit-foundation/micropython-ml4f-poc
Last synced: over 1 year ago
JSON representation
Experiment integrating ML4F into MicroPython for micro:bit V2
- Host: GitHub
- URL: https://github.com/microbit-foundation/micropython-ml4f-poc
- Owner: microbit-foundation
- License: mit
- Created: 2024-05-09T15:16:13.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-04T18:54:31.000Z (about 2 years ago)
- Last Synced: 2025-01-20T21:56:37.868Z (over 1 year ago)
- Language: C
- Size: 179 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ML4F MicroPython module proof of concept
An experiment to integrate ML4F into MicroPython.
## Build instructions
Clone this repository and initialise the git submodules (recursive submodule
init will unnecessarily initialise all submodules from all MicroPython ports):
```bash
git clone https://github.com/microbit-foundation/micropython-ml4f-poc.git
cd micropython-ml4f-poc
git submodule update --init
git -C micropython-microbit-v2 submodule update --init
git -C ml-module/pxt-ml-runner-poc submodule update --init
```
Changes to the micro:bit MicroPython port are required for this experiment:
```bash
git -C micropython-microbit-v2 apply ../micropython-microbit-v2.patch
```
Build MicroPython's mpy-cross:
```bash
make -C micropython-microbit-v2/lib/micropython/mpy-cross
```
And build MicroPython with the ML module (and example model) included:
```bash
make -C micropython-microbit-v2/src USER_C_MODULES=../../..
```
Copy the hex file to the micro:bit:
```bash
cp micropython-microbit-v2/src/build/MICROBIT.hex /Volumes/MICROBIT
```
Transfer the example Python code into the board with
[microFS](https://github.com/ntoll/microfs):
```bash
ufs put ml-module/model-example/main.py
```