Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/code2k13/cnn_circuit_python
This repository contains code for running Convolutional Neural Networks (CNNs) on CircuitPython. It contains code to train models using Tensorflow on computers and convert them to CircuitPython.
https://github.com/code2k13/cnn_circuit_python
circuitpython convolutional-neural-networks edge-computing edgeai image-classification machine-learning rp2040 tinyml
Last synced: 6 days ago
JSON representation
This repository contains code for running Convolutional Neural Networks (CNNs) on CircuitPython. It contains code to train models using Tensorflow on computers and convert them to CircuitPython.
- Host: GitHub
- URL: https://github.com/code2k13/cnn_circuit_python
- Owner: code2k13
- License: apache-2.0
- Created: 2024-06-29T02:12:45.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-29T11:52:42.000Z (7 months ago)
- Last Synced: 2024-11-13T20:20:23.202Z (2 months ago)
- Topics: circuitpython, convolutional-neural-networks, edge-computing, edgeai, image-classification, machine-learning, rp2040, tinyml
- Language: Python
- Homepage: https://ashishware.com/2024/06/29/pipico_digit_classification_cnn/
- Size: 2.13 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Running Convolutional Neural Networks on CircuitPython
![The code in action](cnn_cp_demo.gif)
This repository contains code for running Convolutional Neural Networks (CNNs) on CircuitPython. It contains code to train models using Tensorflow on computers and convert them to CircuitPython.
> This code was tested with CircuitPython 8 , the mpy file will not work with higher versions of CircuitPython
For more information, please visit: https://ashishware.com/2024/06/29/pipico_digit_classification_cnn/
Here's a table detailing the files and their functions:
| **File Name** | **Description** |
|-----------------------|----------------------------------------------------------------------------------------------------------------------------|
| `code.py` | Main program that runs on your CircuitPython board. Copy this file to the root directory of the CircuitPython board. |
| `mnist_clf.mpy` | Module that contains the converted model. Copy this to the `/lib` folder of the CircuitPython board. |
| `mnist_clf.py` | Plain CircuitPython implementation of the above file. Does not load when imported in CircuitPython due to memory limitations on the Raspberry Pi Pico (not tested with other boards). |
| `mnist_clf_pc.py` | A version of the converted model that can be tested and debugged on a normal PC. Uses a tiny subset of `numpy` features. |
| `mnist_clf_template.py` | Template file used by `training_and_export.ipynb` notebook. Utilized during the generation or updating of `mnist_clf.mpy`. |
| `libs_list.txt` | Contains a list of all libraries present in the `/lib` folder of the Raspberry Pi Pico during testing. |
| `training_and_export.ipynb` | Jupyter notebook which contains code to train and export a CNN model to CircuitPython. A live version of the notebook can be found here: https://www.kaggle.com/code/finalepoch/image-classification-using-cnns-on-circuitpython |