How ananaya-agarwal/women-safety-analytics-protecting-women-from-safety-threats works
Project Type & Purpose
• This is a prototype full‐stack AI‐powered surveillance solution, combining a mobile (or web) front‐end with a backend gender‐detection engine.
• Purpose: capture camera frames, run gender‐detection in real time (using the YOLOv8 model), detect risky situations (e.g., lone woman with many men or unsafe hours), and automatically trigger an SOS alert with live location.
File Structure & README
• Top‐level files:
• web.py – likely your backend service (e.g., Flask/FastAPI) that loads yolov8n.pt and serves detection endpoints.
• new.html – simple front‐end page (for demo or web‐based camera capture).
• first.ipynb – experiment notebook (proof of concept).
• gender_detection_results.csv – sample output/data.
• yolov8n.pt – pre‐trained YOLOv8 model.
• No explicit “frontend/” or “backend/” folders, so treat web.py + new.html as the minimal full‐stack PoC.
Main Components & How They Interact
a. Mobile/Web Client
• Captures video frames (camera)
• Obtains geolocation via HTML5 or native APIs
• Displays live video and SOS prompt
––> Sends frames (or frame URLs) + location to the backend.
b. Backend AI Service (web.py)
• HTTP endpoint to receive frames
• Loads yolov8n.pt via PyTorch or Ultralytics API
• Runs OpenCV preprocessing + gender‐detection inference
––> Returns counts of males/females + risk flag.
c. Risk Detection Engine
• Business logic: if (woman count ==1 && male count ≥ N) or (time ∈ unsafe hours) → risk = TRUE
––> Triggers SOS event.
d. Notification Service
• On SOS event, pushes a pop‐up on the client or sends push/SMS/email via a third‐party API (e.g., Twilio, FCM, APNs)
––> Optionally logs event to a database.
e. Data Store (optional)
• Stores event logs, locations, gender counts for analytics (CSV or lightweight DB).
f. External Services
• Geolocation API (Google Maps / native)
• Emergency contact endpoints or police‐station APIs
Architectural Patterns & Design Principles
• Separation of concerns: UI vs. AI inference vs. notification logic
• Event‐driven flow: camera frames → inference → decision → alert
• Stateless inference microservice (scalable horizontally)
• Use of a single reusable model artifact (yolov8n.pt)
• Fail‐safe / fallback: if backend is unreachable, client should notify user gracefully.
Putting It All Together
• Lay out the components in logical left‐to‐right or top‐to‐bottom flow
• Related elements (e.g., camera + geolocation under “Client”)
• AI model load point (yolov8n.pt) and runtime inference step
• Critical SOS decision branch (“If risk → SOS”)