= lenet
{file}
This is a small fork of <activatedgeek LeNet-5> by <Ciro Santilli> adding better integration and automation for:
* <extracting MNIST images> as <PNG>
* <ONNX> CLI inference taking any image files as input
* a <Python tkinter> GUI that lets you draw and see inference live
* running on <GPU>
Install on <Ubuntu 24.10>:
``
sudo apt install protobuf-compiler
cd lenet
virtualenv -p python3 .venv
. .venv/bin/activate
pip install -r requirements-python-3-12.txt
``
Download and extract <MNIST> train, test accuracy, and generate the <ONNX> `lenet.onnx`:
``
./train.py
``
<Extract MNIST images> as <PNG>:
``
./extract_pngs.py
``
Infer some individual images using the <ONNX>:
``
./infer.py data/MNIST/png/test/0/*.png
``
Draw on a <GUI> and see live inference using the <ONNX>:
``
./draw.py
``
TODO: the following are missing for this to work:
* start a background task. This we know how to do: https://stackoverflow.com/questions/1198262/tkinter-locks-python-when-an-icon-is-loaded-and-tk-mainloop-is-in-a-thread/79502287#79502287
* get bytes from the canvas: all methods are ugly: https://stackoverflow.com/questions/9886274/how-can-i-convert-canvas-content-to-an-image
Back to article page