How josh-test-1120/handgestures works
Project Type & Purpose
• This is a full‐stack ML application for recognizing hand gestures.
• Purpose: collect raw sensor data via Arduino, train/evaluate an ML model (in a Jupyter notebook), then expose inference through a Django web frontend for live demos and summaries.
Key Architectural Components
a. Sensor Layer
– Component: Arduino running sensor_collect_arduino_sketch.ino
– Role: reads hand‐gesture sensor readings and streams them over serial/USB.
b. Ingestion & Storage Layer
– Component: Data‐sample CSV (backend/data-sample.csv)
c. Model Training Layer
– Component: Jupyter notebook (Capstone-ML-Model-Prototype.ipynb)
– Role: cleans data, engineers features, trains a classifier/regressor, outputs a serialized model artifact.
d. Model Serving Layer
– Component: Python service or Django endpoint wrapping the trained model
– Role: loads the saved model artifact, accepts new sensor input, returns predictions via a REST API.
e. Frontend Web Layer
– Component: Django project under frontend/handgestures
– Subcomponents:
• main_app/views.py – serves HTML pages and calls the model API for live inference
• templates/main_app/*.html – demo and live_demo pages
• static/main_app/js – handles real‐time data push/pull (e.g., via AJAX or WebSocket)
– Role: user interface for viewing live predictions, browsing summaries, and contacting the team.
f. Optional Persistence Layer
– Component: SQLite database (frontend/handgestures/db.sqlite3)
– Role: stores user inputs, logs of inferences, demo sessions, etc.
Relationships & Data Flow (Pipeline Style)
1. Sensor Arduino → serial/USB → CSV (or direct ingestion service)
2. CSV → Notebook → Trained Model artifact
3. Trained Model → Model Serving Service (loaded in memory)
4. Model Serving Service ↔ Django Frontend (REST API calls)
5. Django Frontend → Browser (HTML/JS live demo pages)
Architectural Patterns & Principles
• Separation of concerns: hardware vs. data vs. model vs. UI
• Pipeline stages: Data collection → preprocessing → model training → serving → presentation
• MVC in the frontend: Django models/views/templates
• “Single responsibility” for each layer makes it easy to swap out CSV for a message queue or replace the model with a different algorithm.