Skip to content
Snippets Groups Projects
Commit 4961add0 authored by Aymeric Chaumont's avatar Aymeric Chaumont
Browse files

Merge branch 'docs' into 'main'

add docs

See merge request !57
parents 3c26a4fc 69fa93b5
No related branches found
No related tags found
1 merge request!57add docs
Pipeline #44579 passed
......@@ -70,7 +70,6 @@ install-npm-packages:
lint-back:
stage: test
allow_failure: true
before_script:
- python3 -m venv venv/
- source venv/bin/activate
......@@ -82,7 +81,6 @@ lint-back:
lint-front:
image: node:14.6.0
stage: test
allow_failure: true
script:
- cd frontend/
- npm run lint
......
**README**
==========
# Run the server-side FastAPI app
## In development mode
Using the template files, you first need to create backend/.env and backend/cameras.py.
You can start a virtual environment with the following instructions.
```sh
$ cd backend
$ python3.9 -m venv env
$ source env/bin/activate
```
Then you need to install the dependencies by executing `pip install -r requirements.txt`
Comment the app service in the docker-compose.yml then build and run the file.
Start the development server running `python -m uvicorn main:app --reload --port=3001 --host 0.0.0.0`
Navigate to [http://localhost:3001](http://localhost:3001)
# **Eatfast**
Eatfast is a website developed by ViaRézo for monitoring the waiting time in CROUS restaurants.
<br/>
### *Le linter*
So the new commits can be deployed, you'll need to use the linter from backend :
`pycodestyle --config=./setup.cnf --exclude=./env ./`
You can use autoformat with autopep8 running :
`autopep8 --in-place --global-config=./setup.cnf --recursive --exclude=./env --aggressive ./`
## **Installation**
Use the template files in ./backend and ./frontend to define the configuration and environment variables.
<br/>
## In production mode
Build the docker image : `docker-compose build`
Run the server, `docker-compose up -d`
### **In development mode**
<br/>
#### **Run the backend server**
Start the mysql container
`docker run -p 3306:3306 --env-file .env -d mysql:latest mysqld --default-authentication-plugin=mysql_native_password`
Build and start the tensorflow/serving container
`docker build -t model -f ./Dockerfile-model . && docker run -p 8501:8501 --env MODEL_NAME=model -d model`
Form ./backend, install the dependencies by executing `pip install -r requirements.txt` and run directly the uvicorn server :
`python -m uvicorn main:app --reload --port=3001 --host 0.0.0.0`.
# Run the client-side React app in a different terminal window:
<br/>
Using the template file, you first need to create frontend/.env.
#### **Run the frontend server**
Open a new terminal and run :
```sh
$ cd frontend
$ npm install
$ npm run start
$ npm start
```
Navigate to [http://localhost:3000](http://localhost:3000)
<br/>
### **In production mode**
From /backend execute `docker-compose build && docker-compose up -d`.
From /frontend run `npm run build` and serve the build generated.
<br/>
# Documentation
## **Linting**
So the new commits can be deployed, you need to use the linter for the backend and the frontend.
To lint the backend code, run `pycodestyle --config=./setup.cnf ./backend`. To fix the errors, you can use autoformat with autopep8 running `autopep8 --in-place --global-config=./setup.cnf --recursive --aggressive ./`. If you use a virtual environment called env/ you should add `--exclude=./env` in both command so the linter ignore the folder.
To lint the frontend, run `npm run lint`. You can fix most of the errors using `npm run format`.
## Algorithm
<br/>
The crowd-counting AI model used is based on this repository:
https://github.com/ZhengPeng7/W-Net-Keras
The dataset used is ShanghaiTech Part B.
The model is given a 3-channel image and generates a density map of half the size of the input image.
The estimated number of people is obtained by summing on all pixels of the density map.
## **Contributing**
If you would like to contribute, contact us at support@ml.viarezo.fr.
<br/>
# TODO
## Coté algo
- Accéder à d'autre infos telle que l'API des cours sur demande à la DISI pour intégrer ça aux prédictions (ex: cours en promo complète juste implique plus d'attente)
## Coté dev
- Protéger l'interface OpenAPI et mettre en place une interface admin pour les news et potentiellement modération (avec authentification)
- Permettre de définir les masques proprement et de manière à pouvoir généraliser à d'autre RU
- Accorder la charte graphique si le service est intégré à d'autres appli (bordeau/blanc service de CS, charte graphique de VR)
- Réfléchir au système d'authentification, pour juste des commentaires l'authentification ViaRézo suffit mais CAS plus général dans les universités ou Shibboleth avec Renater
## Coté camera et réseau
- Recherche d'un meilleur modèle de caméra par rapport aux contraintes réseau, d'angle de vue, de qualité d'image
- Démarches pour mettre en place les caméras et config réseau
## Coté com et récolte des données
- Préparer la com pour la mise en place : mail NL, affiches, panneaux numérique DPIET
- Exploitation des données après récupération : visualisation et stratégie d'adaptation du modèle
- Réfléchir à un nom pour le service
- Motiver des gens à reprendre le projet
## Documentation
- Documenter le projet au maximum
- Réfléchir à opensourcer (ça peut permettre d'étendre plus facilement à d'autre RU)
## Déploiement
- Monitorer la VM de prod avec Datadog
- Écrire un rôle Ansible de déploiement en prod
- Monitorer la VM de staging avec Datadog
- Écrire un rôle Ansible de déploiement en staging
## **License**
The project doesn't have any license. However, the crowd-counting AI model used is based on this repository:
https://github.com/ZhengPeng7/W-Net-Keras. The dataset used is ShanghaiTech Part B.
The model is given a 3-channel image and generates a density map of half the size of the input image.
The estimated number of people is obtained by summing on all pixels of the density map.
TODO.md 0 → 100644
# TODO
## Coté algo
- Accéder à d'autre infos telle que l'API des cours sur demande à la DISI pour intégrer ça aux prédictions (ex: cours en promo complète juste implique plus d'attente)
## Coté dev
- Accorder la charte graphique si le service est intégré à d'autres appli (bordeau/blanc service de CS, charte graphique de VR)
- Réfléchir au système d'authentification, pour juste des commentaires l'authentification ViaRézo suffit mais CAS plus général dans les universités ou Shibboleth avec Renater
## Coté camera et réseau
- Démarches pour mettre en place les caméras et config réseau
## Coté com et récolte des données
- Préparer la com pour la mise en place : mail NL, affiches, panneaux numérique DPIET
- Exploitation des données après récupération : visualisation et stratégie d'adaptation du modèle
- Réfléchir à un nom pour le service
- Motiver des gens à reprendre le projet
## Documentation
- Documenter le projet au maximum
- Réfléchir à opensourcer pour étendre plus facilement à d'autre RU
## Déploiement
- Monitorer la VM de prod avec Datadog
- Écrire un rôle Ansible de déploiement en prod
- Monitorer la VM de staging avec Datadog
- Écrire un rôle Ansible de déploiement en staging
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment