-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: khaoula boutiche <[email protected]>
- Loading branch information
Showing
61 changed files
with
1,330 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.venv | ||
__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as | ||
contributors and maintainers pledge to making participation in our project and | ||
our community a harassment-free experience for everyone, regardless of age, body | ||
size, disability, ethnicity, sex characteristics, gender identity and expression, | ||
level of experience, education, socio-economic status, nationality, personal | ||
appearance, race, religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment | ||
include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or | ||
advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic | ||
address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable | ||
behavior and are expected to take appropriate and fair corrective action in | ||
response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or | ||
reject comments, commits, code, wiki edits, issues, and other contributions | ||
that are not aligned to this Code of Conduct, or to ban temporarily or | ||
permanently any contributor for other behaviors that they deem inappropriate, | ||
threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces | ||
when an individual is representing the project or its community. Examples of | ||
representing a project or community include using an official project e-mail | ||
address, posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. Representation of a project may be | ||
further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by contacting the project team via this [link](https://www.st.com/content/st_com/en/contact-us.html). | ||
All complaints will be reviewed and investigated and will result in a response that | ||
is deemed necessary and appropriate to the circumstances. The project team is | ||
obligated to maintain confidentiality with regard to the reporter of an incident. | ||
Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good | ||
faith may face temporary or permanent repercussions as determined by other | ||
members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4, | ||
available [here](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html). | ||
|
||
For answers to common questions about this code of conduct, refer to the FAQ section [here](https://www.contributor-covenant.org/faq). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Contributing guide | ||
|
||
This document serves as a checklist before contributing to this repository. | ||
It includes links to read up on if topics are unclear to you. | ||
|
||
This guide mainly focuses on the proper use of Git. | ||
|
||
## 1. Issues | ||
|
||
__Before opening an issue__ | ||
|
||
Please check the following boxes before posting an issue: | ||
- [ ] `Make sure you are using the latest commit (major releases are tagged, but corrections are available as new commits).` | ||
- [ ] `Make sure your issue is a question/feedback/suggestions **related to** the software provided in this repository.` | ||
- [ ] `Make sure your issue is not already reported/fixed on GitHub or discussed on a previous issue.` Do not forget to browse into the **closed** issues. | ||
|
||
__Posting the issue__ | ||
|
||
When you have checked the previous boxes, create a new issue from the **Issues** tab of this repository. | ||
|
||
## 2. Pull Requests | ||
|
||
The pull-requests are not supported to submit problems or suggestions related to the software delivered in this repository. | ||
|
||
For any question related to the product, the hardware performance or characteristics, the tools, the environment, you can submit it to the ST Community on the STM32 MCUs related page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# License | ||
|
||
Software BOM : | ||
| Component | License | Copyright | | ||
|:--------- |:------- |:----------| | ||
| image_classification | [BSD-3-Clause](./image_classification/LICENSE.md) | STMicroelectronics | | ||
| object_detection | [BSD-3-Clause](./object_detection/LICENSE.md) | STMicroelectronics | | ||
| utils | [BSD-3-Clause](./utils/LICENSE.md) | STMicroelectronics | | ||
|
||
software BOM of the model zoo: | ||
* [stm32ai-modelzoo](./stm32ai-modelzoo/LICENSE.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,50 @@ | ||
# stm32ai-nota | ||
<h1><span style="color:#03234B"> STM32ai-nota </span></h1> | ||
|
||
<h2> Neural network pruning by using NetsPresso </h2> | ||
|
||
This repository provides a guide on how to compress neural network models to reduce their memory footprints and computational requirements, making deployment on STM32 targets easier. The particular compression method highlighted in this repository is structural pruning, achieved by using Netspresso. Please browse the [Docs](https://nota-netspresso.github.io/PyNetsPresso/) for details about it | ||
|
||
The tutorials are presented as Jupyter notebooks and config files, which will guide you through the process of training, pruning, fine-tuning, and quantizing a deep learning model using Netspresso and the STM32AI Model Zoo. You can then benchmark the models by using the STM32Cube.AI Developer Cloud. The notebooks provide a step-by-step guide for users, making it easy for anyone to compress their neural network models efficiently and deploy them on STM32 targets. | ||
|
||
|
||
<div align="center"> | ||
<p align="center"> | ||
<a href="https://www.python.org/downloads/" target="_blank"><img src="https://img.shields.io/badge/python-3.9%20%7C%203.10-blue" /></a> | ||
<a href="https://www.tensorflow.org/install/pip" target="_blank"><img src="https://img.shields.io/badge/TensorFlow-2.8.3-FF6F00?style=flat&logo=tensorflow&logoColor=#FF6F00&link=https://www.tensorflow.org/install/pip"/></a> | ||
<a href="https://github.com/STMicroelectronics/stm32ai-modelzoo"><img src="https://img.shields.io/badge/stm32ai modelzoo-2.0.0-273B5F?style=flat&logo=github&logoColor=#03234B"/></a> | ||
<br> | ||
<a href="https://netspresso.ai?utm_source=git&utm_medium=text_np&utm_campaign=py_launch"><img src="https://img.shields.io/badge/NetsPresso-Open in Website-1BD2EB?style=flat&link=https://netspresso.ai/"/></a> | ||
<a href="https://stm32ai-cs.st.com/home"><img src="https://img.shields.io/badge/STM32Cube.AI-Developer%20Cloud-FFD700?style=flat&logo=stmicroelectronics&logoColor=white"/></a> | ||
</p> | ||
</div> | ||
</br> | ||
|
||
|
||
## Repository Components | ||
|
||
The repository contains the following folders: | ||
|
||
- **utils**: Contains utility functions used in the notebooks. | ||
- **image_classification**: | ||
- `netspresso_model_pruning.ipynb`: a notebook for image classification model pruning. | ||
- **config_files** : contains the yaml config files to use with the notebook. | ||
- **experiments_outputs** : contains the directories and files created during the runs. | ||
- **pretrained_models** : contains several baseline models and Netspresso pruned models with their performances listed in the [README](image_classification/README.md) | ||
- **object_detection**: Coming soon. | ||
|
||
## Before you start | ||
|
||
* Create an account on myST and then sign in to [STM32Cube.AI Developer Cloud](https://stm32ai-cs.st.com/home) to be able access the service. | ||
* Alternatively, install [STM32Cube.AI](https://www.st.com/en/embedded-software/x-cube-ai.html) locally by following the instructions provided in the [user manual](https://www.st.com/resource/en/user_manual/um2526-getting-started-with-xcubeai-expansion-package-for-artificial-intelligence-ai-stmicroelectronics.pdf) in **section 2**, and get the path to `stm32ai` executable. | ||
* Create an account on [NetsPresso](https://netspresso.ai/?utm_source=git&utm_medium=text_signup&utm_campaign=np_renew). | ||
* If you don't have python already installed, you can download and install it from [here](https://www.python.org/downloads/), a **Python Version <= 3.10** is required to be able to use TensorFlow later on, we recommand using **Python v3.9 or v3.10**. (For Windows systems make sure to check the **Add python.exe to PATH** option during the installation process). | ||
* Install Jupyter server and notebook libraries to run the Jupyter notebooks. | ||
* Clone this repository using the following command: | ||
``` | ||
git clone https://github.com/STMicroelectronics/stm32ai-nota.git | ||
``` | ||
* Create a python virtual environment for the project: | ||
``` | ||
cd stm32ai-nota | ||
python -m venv <env-name> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Report potential product security vulnerabilities | ||
|
||
ST places a high priority on security, and our Product Security Incident Response Team (PSIRT) is committed to rapidly addressing potential security vulnerabilities affecting our products. PSIRT's long history and vast experience in security allows ST to perform clear analyses and provide appropriate guidance on mitigations and solutions when applicable. | ||
|
||
If you wish to report potential security vulnerabilities regarding our products, **please do not report them through public GitHub issues.** Instead, we encourage you to report them to our ST PSIRT following the process described at: **https://www.st.com/content/st_com/en/security/report-vulnerabilities.html** | ||
|
||
|
||
|
||
### IMPORTANT - READ CAREFULLY: | ||
|
||
STMicroelectronics International N.V., on behalf of itself, its affiliates and subsidiaries, (collectively “ST”) takes all potential security vulnerability reports or other related communications (“Report(s)”) seriously. In order to review Your Report (the terms “You” and “Yours” include your employer, and all affiliates, subsidiaries and related persons or entities) and take actions as deemed appropriate, ST requires that we have the rights and Your permission to do so. | ||
|
||
As such, by submitting Your Report to ST, You agree that You have the right to do so, and You grant to ST the rights to use the Report for purposes related to security vulnerability analysis, testing, correction, patching, reporting and any other related purpose or function. | ||
|
||
By submitting Your Report, You agree that ST’s [Privacy Policy](https://www.st.com/content/st_com/en/common/privacy-portal.html) applies to all related communications. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
BSD-3 Clause | ||
|
||
Copyright 2023 STMicroelectronics | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Oops, something went wrong.