Copy of the SCIoT project to work on the python clients
Questa è una copia del progetto per testare l'implementazione dei client Python.
- Commentate le configurazione MQTT e WebSocket dal file settings.yaml in modo da eseguire solo la versione http. Non è quindi necessario fare il punto 2 della guida a come lanciare (premere
CTRL + C) all'avvio. - Aggiunta la cartella 'simulated_results' contenente lo script 'simulated_scenario.py' utilizzato per creare i file .csv dei risultati simulati.
- il best offloading layer viene scelto correttamente, non più in modo randomico.
- Quando viene fatto l'offloading su certi layer va in errore. Credo che il problema sia dovuto al fatto che per alcuni layer l'edge si aspetta di ricevere un numero di pesi differente.
- Per intervenire su la latency: message_data.py → get_latency()
- Per intervenire su edge inference time: models/model_manager.py → wrapper()
Creato lo script server_client_light/client/http_client.py (clone del codice per ESP32)
- Attualmente il best offloading layer viene scelto in modo random per simulare condizioni in cui le performance della rete degradano → capire come fare.
- Inserire codice su server per salvare su file i tempi di inferenza
-
Seguire le istruzioni scritte da Mattia per l'avvio del server (eventualmente inserire
tensorflowper macOS nel fileconfig) -
All'avvio di
run_edge.py, premereCTRL + Cper terminare la modalità websocket e far partire la modalità HTTP -
Avviare il client:
python server_client_light/client/http_client.py
===========================================================================================================================================
The Split Computing on IoT (SCIoT) project provides tools to use Edge Impulse models in ESP32 devices, using split computing techniques.
If you use this work, please consider citing our work:
- F. Bove, S. Colli and L. Bedogni, "Performance Evaluation of Split Computing with TinyML on IoT Devices," 2024 IEEE 21st Consumer Communications & Networking Conference (CCNC), Las Vegas, NV, USA, 2024, pp. 1-6, DOI Link.
- F. Bove and L. Bedogni, "Smart Split: Leveraging TinyML and Split Computing for Efficient Edge AI," 2024 IEEE/ACM Symposium on Edge Computing (SEC), Rome, Italy, 2024, pp. 456-460, DOI Link.
Clone the repository and navigate into it:
git clone https://github.com/UBICO/SCIoT.git
cd SCIoTCreate the virtual environment and install the dependencies:
uv syncActivate the virtual environment:
source .venv/bin/activate- Save your keras model as
test_model.h5insrc/server/models/test/test_model/ - Save your test image as
test_image.pnginsrc/server/models/test/test_model/pred_data/ - Split the model by running
python3 model_split.pyfromsrc/server/models/ - Configure the paths as needed using
src/server/commons.py
- Configure the server using
src/server/settings.yaml
From the repository's root directory, activate the virtual environment:
source .venv/bin/activateStart the MQTT broker:
docker compose upRun the edge server:
python3 src/server/edge/run_edge.pyRun the analytics dashboard:
streamlit run src/server/web/webpage.py