Train a 2 layer Vision CNN AI model in the browser · Export weights to PC and the to ESP32 SD card · WebSerial ESP32 camera capture · Flash firmware from browser
Base github for this page at github.com/webmcu-ai/webmcu-vision-web.
While proof of concept esp32s3 on-device training github is at https://github.com/webmcu-ai/on-device-vision-ai
Flash compiled ESP32 .bin files directly from the browser using esptool-js v0.5.7.
Requires Chrome/Edge · HTTPS or localhost · USB CDC On Boot: Enabled
If you want to look at the code and load the sketch onto your Arduino IDE it is here in text form firmware.ino
Flashes only the application partition at 0x10000. Fast. Preserves bootloader and NVS.
Use when the bootloader is already on the device (standard re-flash).
Flashes a single merged binary: bootloader + partition table + app at 0x0.
Use for fresh chips or after partition changes.
YourSketch.ino.bin → 0x10000YourSketch.ino.merged.bin → 0x0
· ESP32 WebSerial & SD BrowserConnect your XIAO ESP32S3 Sense via USB · requires Chrome/Edge · USB CDC On Boot: Enabled Not Connected
Serial Monitor Serial output will appear here... ⊿
|
SD Card Browser
Browse, view, and delete files on the ESP32 SD card. Requires firmware with SD_LIST / SD_DELETE support (esp_all_menu_image_train_infer68).
/ (root)
Connect ESP32 then press Refresh to browse SD card
Sync config from SD card Read /header/config.json from SD and update all fields including class names. |
4 · Camera & Data CollectionSet BEFORE starting — 3x smaller model, needs more data Training resolution: 64x64 — conv2 out: 29x29
⊿
📁 PC Project Folder
None — images held in RAM only
Pick a project root folder — mirrors SD card structure exactly: root/images/ClassName/ and root/header/ are created automatically.
Every Capture saves to images/ClassName/img_NNNN.jpg.Maximum images held in browser RAM per class. Set high enough to hold all your images — disk folder holds all images regardless. Lower only if you hit browser memory limits. Class 0: 0 samples
Class 1: 0 samples
Class 2: 0 samples
📷 Capture = grab frame · auto-saves to |
Ready...
(ESP32 on-device inference · slightly reduces ESP32 FPS) (webcam / ESP32 stream · runs in browser, no ESP32 FPS impact) 5 · Training ProgressBatches Trained: 0Min Samples: Avg Loss: -- Status: Waiting... Leave unchecked to protect a well-trained model from being overwritten during continued training. Manual Export myWeights.bin and Export myWeights.h buttons always work on demand. Confusion MatrixActivity LogLogs will appear here...
|
6 · ESP32 Export (SD Format)Exports weights + config for the XIAO ESP32S3 Sense. Copy files to SD card /header/ folder. imagesToPsram = preload all training images to PSRAM before training. validationImages = last N images per class held out for validation. Binary: JSON header + float32 weights. Saves to C header file — copy to sketch folder alongside your .ino, then uncomment |
config.json — Direct Download Live textarea — edit freely before saving. Syncs from fields above. Downloads button saves to your computer — copy to SD card /header/config.json manually. |
By Jeremy Ellis (hpssjellis) · LinkedIn · Support opencollective/mlsysbook · XIAO ML Kit $22 USD · Use at your own risk · MIT License