BadgeImageGen / README.md
utkucoban's picture
Update README.md
e2b88de verified
|
Raw History Blame Contribute Delete
3.49 kB
metadata
license: mit
tags:
  - esp32-c3
  - e-paper
  - gan
  - flowers
  - int8
  - embedded
pipeline_tag: unconditional-image-generation

Flower GAN on an ePaper badge

A 3.42-million-parameter INT8 flower generator running entirely on the Espruino ESP32-C3 ePaper Badge. Images generate in about 48 seconds, with the next generation overlapping the four-color screen refresh.

The model generates 320 × 176 RGB. The original 320 × 172 crop is enlarged to 800 × 430 and dithered to black, white, yellow, and red. Small borders show timing, free RAM, image number, and seed. Hardware: ESP32-C3, 4 MiB flash, 800 × 480 panel, maker's rev 1.2 pin mapping. Other ESP32 boards need their own port.

Easiest flash: your browser

This replaces the original app and saved badge data. Back up first if you want to preserve your photo, contacts, and settings; see backup instructions.

  1. Download firmware.bin. It includes the application and all model weights.
  2. Connect a USB data cable. In the original summit app, hold the rear SHARE button until the LEDs stay solid blue, then release. Close other serial apps.
  3. In desktop Chrome or Edge, open Espressif's ESP Tool. Click Connect in the Program section and select the badge's USB serial/JTAG device. It should identify as ESP32-C3; leave WebUSB (CH340) unchecked.
  4. Choose firmware.bin in one file row at Flash Address 0x0. Set flash mode, frequency, and size to keep. Leave Erase all unchecked and click Program.
  5. Wait for verification and automatic reset. The first flower appears in about one minute; subsequent images advance automatically. Both buttons are unassigned.

No custom installer scripts or build tools are required. For terminal users:

python -m pip install esptool==5.6.0
python -m esptool --chip esp32c3 --port PORT --baud 460800 --before usb-reset --after hard-reset write-flash 0x0 firmware.bin

Replace PORT with your device's port. If it does not appear, check the cable, solid-blue mode, and whether another app has the port open.

Code, weights, and data

Path Contents
source/ Native C inference, display driver, and ESP-IDF project
training/ Original PyTorch architecture, training, data preparation, and export code
data/ Exact INT8 weights, tensor layout, original model export, and reference tensors
data/dataset.json Training dataset source, pinned revision, and preprocessing metadata
BUILD.md Build versions and commands
release.json / SHA256SUMS Flash layout, versions, and file hashes

Training used all 8,189 Oxford Flowers102 images, from the pufanyi/flowers102 mirror, revision b61e48cb66625272ca3bf36442062362587fa9bb. Images are not mirrored here; the source and preparation code are included. The original floating-point training checkpoint was not in the supplied bundle; the original INT8 export is included.

Original project code and trained weights are released under MIT. Third-party code and dataset terms remain separate; see NOTICE.md. The release contains no private badge data. The inference implementation matched its reference byte for byte across seven seeds and ran successfully on the badge.