-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding custom model documentation * Adding run VIO localy doc * Update tflite_serving Readme to add the conda env install * Beautifying main README * Update docs/running_vio_locally.md Co-authored-by: Baptiste O'Jeanson <[email protected]> * Modifications following requests: edit doc / local environment profile / .env file for docker connection * linting * Editing Hub/host differencies * Add parameter description * Update parameters doc * Adding small info about .env * Add Adapters description --------- Co-authored-by: gireg.roussel <[email protected]> Co-authored-by: Baptiste O'Jeanson <[email protected]>
- Loading branch information
1 parent
247c331
commit 370d88e
Showing
11 changed files
with
407 additions
and
15 deletions.
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 |
---|---|---|
@@ -1,14 +1,18 @@ | ||
# VIO - Visual Inspection Orchestrator | ||
<div align="center"> | ||
<h1>VIO - Visual Inspection Orchestrator</h1> | ||
|
||
![CI edge_orchestrator](https://github.com/octo-technology/VIO/actions/workflows/ci_edge_orchestrator.yml/badge.svg) | ||
![CI edge_interface](https://github.com/octo-technology/VIO/actions/workflows/ci_edge_interface.yml/badge.svg) | ||
![GitHub issues](https://img.shields.io/github/issues/octo-technology/VIO) | ||
|
||
Visual Inspection Orchestrator is a modular framework made to ease the deployment of VI usecases. | ||
🎥 Visual Inspection Orchestrator is a modular framework made to ease the deployment of VI usecases 🎥 | ||
|
||
*Usecase example: Quality check of a product manufactured on an assembly line.* | ||
</div> | ||
|
||
VIO full documentation can be found [here](https://octo-technology.github.io/VIO/) | ||
<h1></h1> | ||
|
||
## 🏗️ Modular framework | ||
|
||
The VIO modules are split between: | ||
|
||
|
@@ -24,31 +28,35 @@ The VIO modules are split between: | |
- [The hub monitoring](docs/hub_monitoring.md) | ||
- [The hub deployment playbook](docs/hub_deployment.md) | ||
|
||
## Requirements | ||
**VIO full documentation can be found [here](https://octo-technology.github.io/VIO/)** | ||
|
||
## 🧱 Requirements | ||
|
||
- `docker` installed | ||
- `make` installed | ||
|
||
## Install the framework | ||
## 🚀 Getting started | ||
|
||
### Install the framework | ||
|
||
```shell | ||
git clone [email protected]:octo-technology/VIO.git | ||
``` | ||
|
||
## Run the stack | ||
### Running the stack | ||
|
||
To launch the stack you can use the [Makefile](../Makefile) on the root of the repository which define the different | ||
target based on the [docker-compose.yml](../docker-compose.yml): | ||
target based on the [docker-compose.yml](../docker-compose.yml) as described below, or [run the modules locally](). | ||
|
||
### Start vio | ||
#### Start vio | ||
|
||
To start all edge services (orchestrator, model-serving, interface, db) with local hub monitoring (grafana): | ||
|
||
```shell | ||
make vio-edge-up | ||
``` | ||
|
||
### Stop vio | ||
#### Stop vio | ||
|
||
To stop and delete all running services : | ||
|
||
|
@@ -60,6 +68,8 @@ To check all services are up and running you can run the command `docker ps`, yo | |
|
||
![stack-up-with-docker](docs/images/stack-up-with-docker.png) | ||
|
||
### Accessing the services | ||
|
||
Once all services are up and running you can access: | ||
|
||
- the swagger of the edge orchestrator API (OrchestratoAPI): [http://localhost:8000/docs](http://localhost:8000/docs) | ||
|
@@ -72,16 +82,32 @@ launch the following actions: | |
|
||
![vio-architecture-stack](docs/images/edge_orchestrator-actions.png) | ||
|
||
## Releases | ||
## 🛰️ Technology features | ||
- 🏠 Hosting : | ||
- ☁️ Hub : Cloud possibilities with [Azure](https://portal.azure.com/#home) and [GCP](https://cloud.google.com/) | ||
- 🛸 Host : Using raspberries | ||
- 🐳 Host : [Docker](https://www.docker.com/) or locally with anaconda | ||
- 👮 Fleet management : | ||
- 📦 Fleet integration/deployment with [Ansible](https://docs.ansible.com/ansible/latest/index.html) | ||
- 🕵️ Fleet supervision/observability with [Grafana](https://grafana.com/) & [Open-Telemetry](https://opentelemetry.io/docs/) | ||
- ⚡️Backend API with [FastAPI](https://fastapi.tiangolo.com/) | ||
- 📜 Frontend with [Vue.js](https://fr.vuejs.org/) | ||
- 🏭 Continuous Integration & Continuous Development : | ||
- ♟️ Github actions | ||
- 📝️ Clean code with [Black](https://black.readthedocs.io/en/stable/index.html) & [Flake8](https://flake8.pycqa.org/en/latest/) | ||
- ✅ Tested with [Pytest](https://docs.pytest.org/en/8.0.x/) | ||
- 📈 [Grafana](https://grafana.com/) insight & dashboard | ||
|
||
## 🏭 Releases | ||
|
||
Build Type | Status | Artifacts | ||
-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------- | ||
**Docker images** | [![Status](https://github.com/octo-technology/VIO/actions/workflows/publication_vio_images.yml/badge.svg)](https://github.com/octo-technology/VIO/actions/workflows/publication_vio_images.yml/badge.svg) | [Github registry](https://github.com/orgs/octo-technology/packages) | ||
|
||
## License | ||
## 📝 License | ||
|
||
VIO is licensed under [Apache 2.0 License](docs/LICENSE.md) | ||
|
||
## Contributing | ||
## 🙋 Contributing | ||
|
||
Learn more about how to get involved on [CONTRIBUTING.md](docs/CONTRIBUTING.md) guide |
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
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,57 @@ | ||
# Adding a custom model to VIO | ||
|
||
## Model export & VIO Configuration | ||
### Model format | ||
The edge model serving supports models of 3 types : TensorFlow, TensorFlowLite and Torch. | ||
|
||
This note will present how to add a custom TensorFlowLite model in VIO. The process is similar for the two other types, | ||
for which you can follow the respective ReadMe files ([Torch serving](../edge_model_serving/torch_serving/README.md) and for | ||
[TensorFlow serving](../edge_model_serving/tf_serving/README.md)) and work in their respective edge sub-folder. | ||
|
||
Comming soon: Integration with [Hugging Face](https://huggingface.co/) | ||
|
||
### Saving the model | ||
The model has to be given to the Edge_serving module. Export your custom model to tflite and store it as | ||
`VIO/edge_model_serving/models/tflite/<model_folder_name>/<model_name>.tflite`. (If needed add a .txt file with the | ||
labels/class names) | ||
|
||
The Edge_orchestrator has to know about the new model that is available. To do so, complete the inventory file | ||
`VIO/edge_orchestrator/config/inventory.json` with all the information required depending on you model type under the | ||
````models ```` category. Note that the model name variable should fit the model folder name. You can refer to [this subsection](edge_orchestrator.md#add-a-new-model). | ||
|
||
|
||
### Creating the configuration files | ||
Now that all the components know about your new model, you will need to create a configuration that will use your custom | ||
model. Create a new JSON file in `VIO/edge_orchestrator/config/station_configs` with any config name. You can follow the | ||
configuration of this file in the [Add a new configuration](edge_orchestrator.md#add-a-new-configuration-) subsection. | ||
|
||
## Adapting the code to your model - Optional | ||
|
||
There are two layers of post-processing that may need to be edited to integrate your model. At the Edge Serving inference | ||
level & for the Edge Orchestrator reception. | ||
|
||
- Detection model | ||
|
||
The implemented methods are designed to support Mobilenet_SSD format, where the output of the model is | ||
`List[List[Boxes], List[Classes], List[Scores]]` and box format is `[ymin, xmin, ymax, xmax]`. | ||
|
||
If your custom model doesn't fit this format, you can add custom post-processing methods. | ||
|
||
The Edge Serving `VIO/edge_model_serving/tflite_serving/src/tflite_serving/api_routes.py` calling the model does a first | ||
treatment. Its purpose is separating model's output tensor into a dictionary of the final boxes coordinates, classes and | ||
scores. | ||
|
||
The results are then post processed at the Orchestrator `VIO/edge_orchestrator/edge_orchestrator/infrastructure/ | ||
model_forward/tf_serving_detection_wrapper.py` level to filter the detections of the desired classes and convert the box | ||
coordinates to `Box: [xmin, ymin, xmax, ymax]` then converts the information into a dictionary having a key for each | ||
detection. | ||
|
||
- Classification & other models | ||
|
||
The process is exactly the same as for the detection model, the only difference will be at the Orchestrator level. | ||
Instead of modifying the `tf_serving_detection_wrapper.py` file select the file that corresponds to your model, | ||
modifying the `classification` or `detection_and_classification` wrappers. And you may not have to handle boxes coordinates. | ||
|
||
|
||
|
||
|
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
Oops, something went wrong.