How aarzusharma07/safespace---ai-stress-detection works
SafeSpace combines account access with separate webcam, voice, survey, and physiological-sensor experiences. The central user workflow is to enter the web app, submit one or more modalities for analysis, and view or retrieve stress-related results; webcam and survey services explicitly persist results, while the sampled voice service returns a prediction. The README documents the multimodal design, but the repository contains multiple Flask entry points and the sampled services do not establish one unified end-to-end result pipeline. Some branches are therefore shown only where source or README evidence supports them.
Main entry points: login.php Login · config.php DB connection · home.php Home dashboard · webcam.html Webcam interface
Components 20
Accounts and access
- Account forms
login.html - Login
login.php - Registration
register.php - DB connection
config.php - Accounts database
- Home dashboard
home.php
Stress analysis
- Webcam interface
templates/webcam.html - Webcam inference
templates/app.py - Frame detection API
server.py - Voice stress analysis
read_and_predict.py - Keras custom ops
custom_objects.py - Emotion recognition
emotiondetect.py
Results and surveys
- Survey interface
static/survey.html - Stress form API
app.py - Survey and latest results API
survey_api.py - Detection results database
Physiological sensors
- Sensor dashboard
public/hardware.html - MQTT and Socket.IO bridge
script.js
Other components
- User
- MQTT broker
Connections 25
- User → Account forms: uses
README.md - Account forms → Login: submits to
login.php - Login → DB connection: includes
login.php - Registration → DB connection: includes
register.php - DB connection → Accounts database: connects to
config.php - Login → Accounts database: queries
login.php - Registration → Accounts database: queries and inserts
register.php - Login → Home dashboard: redirects to
login.php - User → Home dashboard: opens
home.php - Home dashboard → Webcam interface: links to
home.php - User → Webcam interface: uses
README.md - Webcam interface → Webcam inference: served by
templates/app.py - User → Frame detection API: uploads frame
server.py - Frame detection API → Detection results database: inserts detections
server.py - User → Voice stress analysis: submits audio
read_and_predict.py - Voice stress analysis → Keras custom ops: loads custom ops
read_and_predict.py - User → Emotion recognition: uses webcam
README.md - User → Survey interface: submits survey
README.md - Survey interface → Survey and latest results API: posts answers
- User → Stress form API: submits responses
app.py - Stress form API → Detection results database: inserts prediction
app.py - Survey and latest results API → Detection results database: updates and reads
survey_api.py - User → Sensor dashboard: views sensor data
README.md - Sensor dashboard → MQTT and Socket.IO bridge: receives events
script.js - MQTT broker → MQTT and Socket.IO bridge: publishes messages
script.js