{"id":26779136,"url":"https://github.com/l-nmch/hailo-mnist","last_synced_at":"2026-04-24T21:31:47.217Z","repository":{"id":283913955,"uuid":"953271880","full_name":"l-nmch/hailo-mnist","owner":"l-nmch","description":"A guide on training a model, testing it, and optimizing it for deployment on a Hailo8L NPU unsing MNIST","archived":false,"fork":false,"pushed_at":"2025-03-31T21:00:00.000Z","size":30,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-10T20:49:06.562Z","etag":null,"topics":["ai","cnn","hailo8l","machine-learning","mnist","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/l-nmch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-23T00:41:53.000Z","updated_at":"2025-06-02T08:01:53.000Z","dependencies_parsed_at":"2025-03-23T02:18:31.056Z","dependency_job_id":"b8d10109-1193-4b4a-9993-91ccb2a63f09","html_url":"https://github.com/l-nmch/hailo-mnist","commit_stats":null,"previous_names":["l-nmch/hailo-mnist"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/l-nmch/hailo-mnist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l-nmch%2Fhailo-mnist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l-nmch%2Fhailo-mnist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l-nmch%2Fhailo-mnist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l-nmch%2Fhailo-mnist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/l-nmch","download_url":"https://codeload.github.com/l-nmch/hailo-mnist/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l-nmch%2Fhailo-mnist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32241591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","cnn","hailo8l","machine-learning","mnist","tensorflow"],"created_at":"2025-03-29T06:14:54.291Z","updated_at":"2026-04-24T21:31:47.201Z","avatar_url":"https://github.com/l-nmch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MNIST Model for Hailo8L\n\nThis repository provides a guide to training and running a TensorFlow-based MNIST model locally, and deploying it on the [Hailo8L](https://www.raspberrypi.com/products/ai-hat/) chip. It includes tools for training, testing, generating images, as well as instructions for converting the trained model to a format that can be optimized and deployed on the Hailo8L.\n\n## Features\n\n- Train a Convolutional Neural Network (CNN) model on the MNIST dataset using TensorFlow.\n\n- Export the trained model in various formats (.keras, .tflite, .onnx).\n\n- Run inference locally on the trained model.\n\n- A utility to generate images for the MNIST model, if needed.\n\n- Instructions for converting and optimizing the model using Hailo8L's DFC (Hailo Dataflow Compiler) (installation and usage instructions in a separate document).\n\n## Setup\n\n1. Install Dependencies\n\nTo get started, clone this repository :\n\n```sh\ngit clone https://github.com/l-nmch/hailo-mnist.git\ncd hailo-mnist\n```\n\nCreate a virtualenv :\n\n```sh\npython3 -m venv .venv\nsource .venv/bin/activate\n```\n\nInstall the required Python libraries\n\n```sh\npython3 -m pip install -r requirements.txt\n```\n\n2. Train the Model\n\nOnce the dependencies are installed, you can train the MNIST model using the following command:\n\n```sh\npython3 src/model.py --save mnist.keras\n```\n\nThis will train the model on the MNIST dataset and save it in the .keras format as mnist.keras.\n\n3. Test the Model Locally\n\nTo perform inference locally, use the predict.py script. For example, if you have an image (e.g., images/0.png), run:\n\n```sh\npython3 src/predict.py --model mnist.keras --input_file images/0.png\n```\n\n## Documentation\n\nFor further explanation on how to run the model on Hailo NPU, head to the [Documentation](./docs/README.md)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl-nmch%2Fhailo-mnist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fl-nmch%2Fhailo-mnist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl-nmch%2Fhailo-mnist/lists"}