Thank you for your interest in contributing to MicroGAN. This project aims to make generative AI accessible on low power microcontrollers, and community help is vital for expanding hardware support and optimizing the pipeline.
There are several ways you can help improve the project:
If you find a bug, please check the existing issues to see if it has already been reported. If not, open a new issue with a clear description of the problem and steps to reproduce it.
New ideas for hardware targets, model architectures, or compression techniques are always welcome. Open an issue to discuss your proposal before starting implementation.
Submit a pull request for bug fixes or new features. For significant changes, please discuss them in an issue first to ensure they align with the project goals.
Improving the guides, adding examples, or fixing typos is a great way to contribute.
To set up your development environment:
- Fork the repository and clone it to your machine.
- Create a virtual environment using Python 3.9.
- Install the dependencies and the package in editable mode:
pip install -r requirements.txt pip install -e . - Run the existing tests to ensure everything is set up correctly.
The project uses the following technologies:
- Python 3.9+ for the training and conversion pipeline.
- PyTorch for model definition and training.
- ONNX and TFLite for model optimization and quantization.
- onnx2tf for stable ONNX to TFLite conversion on macOS and Linux.
- C99 for the embedded inference runtime.
Understanding the directory layout helps in navigating the codebase:
- tinygen/: The main Python CLI and library.
- train/: GAN architectures and training logic.
- compress/: Model quantization and pruning tools.
- convert/: Export utilities for ONNX, TFLite, and C headers.
- validate/: Testing tools for the PC side C runtime.
- hardware/: Hardware profiles and flashing tools.
- runtime/: The C/C++ source for the on-device inference engine.
- backends/: Optimized kernels for specific architectures like CMSIS-NN or Xtensa.
- firmware_templates/: Scaffolding for different boards and frameworks.
- model_zoo/: Pre-trained weights for various image domains.
- datasets/: Scripts for downloading and preprocessing sample data.
- tests/: Python and C unit tests.
When working on a change:
- Create a new branch for your work.
- Keep your changes focused. If you have multiple unrelated fixes, use separate pull requests.
- Write or update tests for any new logic.
- Ensure the code follows the existing style and conventions.
- Provide a clear and concise description in your pull request.
Thank you for helping make MicroGAN better.