File size: 3,490 Bytes
1d42e6a 6f99abd 1d42e6a 6f99abd e2b88de 6f99abd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | ---
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](BACKUP.md).
1. Download [firmware.bin](firmware.bin?download=true). 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](https://espressif.github.io/esptool-js/).
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:
```sh
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/](source/) | Native C inference, display driver, and ESP-IDF project |
| [training/](training/) | Original PyTorch architecture, training, data preparation, and export code |
| [data/](data/) | Exact INT8 weights, tensor layout, original model export, and reference tensors |
| [data/dataset.json](data/dataset.json) | Training dataset source, pinned revision, and preprocessing metadata |
| [BUILD.md](BUILD.md) | Build versions and commands |
| [release.json](release.json) / [SHA256SUMS](SHA256SUMS) | Flash layout, versions, and file hashes |
Training used all **8,189 Oxford Flowers102 images**, from the
[pufanyi/flowers102 mirror](https://huggingface.co/datasets/pufanyi/flowers102),
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](LICENSE).
Third-party code and dataset terms remain separate; see [NOTICE.md](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.
|