Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•—
โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• 
โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•— โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•— 
โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•—
โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•  โ•šโ•โ•

เคฐเค•เฅเคทเค• โ€” The Shield of Vigilance

Turning passive surveillance into proactive protection.
An edge-optimized AI perception platform that sees threats before they escalate.


Python TypeScript Jupyter Stars Forks License


YOLOv8 FastAPI Next.js MediaPipe WebSocket


๐Ÿ“– What is Rakshak?

Rakshak (Sanskrit: เคฐเค•เฅเคทเค•, "protector") is an autonomous, edge-first AI surveillance platform that goes far beyond conventional CCTV. Rather than passively recording footage, Rakshak actively interprets the scene โ€” understanding human intent, detecting physical dangers, and triggering emergency responses in real time.

Built for a world where every second of delay costs lives, Rakshak eliminates the bottleneck of human monitoring through a multi-model AI perception stack that runs at the edge with sub-second latency.

๐Ÿ† Developed and deployed for HACKACHINO 4.0.


โœจ Core Capabilities

๐Ÿง  AI Perception Engine

Module Technology What It Does
๐ŸฅŠ Violence Detection YOLOv8 (custom-trained) Identifies physical altercations โ€” punching, kicking, fighting โ€” in real time
๐Ÿง Fall & Health Monitor MediaPipe Pose Detects sudden collapses, fainting, and health emergencies via skeletal estimation
๐Ÿšจ Proximity Harassment Spatial Heuristics Flags suspicious physical closeness and potential harassment scenarios
๐Ÿ”ฅ Fire & Smoke Analytics Dedicated Vision Node Identifies smoke plumes and open flames with high-confidence alerting

๐Ÿ•น๏ธ Command & Control Interface

Feature Description
๐Ÿ“Š Tactical Dashboard High-performance Next.js 14 dashboard with real-time multi-camera grid synchronization
๐Ÿ—บ๏ธ Spatial Intelligence Predictive risk density maps visualizing threat hot-spots and incident concentration
๐Ÿš” EOC Command Mode Dedicated Emergency Operations Center view for high-stakes incident management
๐Ÿ“ก Integrated Dispatch One-click dispatch for Police, Fire & EMS with real-time incident telemetry

๐Ÿ—๏ธ System Architecture

                        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                        โ”‚           RAKSHAK PLATFORM                   โ”‚
                        โ”‚                                               โ”‚
   ๐Ÿ“ท Camera Feeds โ”€โ”€โ–บ  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
                        โ”‚  โ”‚  AI ENGINE  โ”‚     โ”‚  COMMAND CENTER   โ”‚  โ”‚
   ๐Ÿ“ท RTSP Streams โ”€โ”€โ–บ  โ”‚  โ”‚             โ”‚ WS  โ”‚                   โ”‚  โ”‚  โ—„โ”€โ”€  ๐Ÿ‘ฎ Operator
                        โ”‚  โ”‚  YOLOv8     โ”‚โ—„โ”€โ”€โ”€โ–บโ”‚  Next.js 14       โ”‚  โ”‚
   ๐Ÿ“ท IP Cameras  โ”€โ”€โ–บ  โ”‚  โ”‚  MediaPipe  โ”‚     โ”‚  Dashboard        โ”‚  โ”‚
                        โ”‚  โ”‚  OpenCV     โ”‚     โ”‚  EOC Mode         โ”‚  โ”‚
                        โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
                        โ”‚        โ”‚                        โ”‚             โ”‚
                        โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
                        โ”‚  โ”‚           FastAPI Backend                โ”‚ โ”‚
                        โ”‚  โ”‚   SQLAlchemy ยท LiteLLM ยท WebSockets      โ”‚ โ”‚
                        โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
                        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                             โ”‚
                               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                               โ”‚     EMERGENCY DISPATCH    โ”‚
                               โ”‚   ๐Ÿš” Police  ๐Ÿš’ Fire      โ”‚
                               โ”‚   ๐Ÿš‘ EMS Integrated       โ”‚
                               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ› ๏ธ Technical Stack

๐Ÿ–ฅ๏ธ Frontend

  • Framework: Next.js 14 (App Router)
  • Styling: Tailwind CSS v4
  • Animation: Framer Motion + GSAP
  • Charts: Recharts
  • Data: TanStack Query
  • Real-time: WebSocket client

โš™๏ธ Backend

  • API: FastAPI (Python)
  • ORM: SQLAlchemy
  • LLM Proxy: LiteLLM โ†’ Gemma 3 / GLM-5
  • CV Models: YOLOv8 / YOLOv10
  • Pose: MediaPipe Pose
  • Vision: OpenCV
  • Transport: Full-duplex WebSockets

๐Ÿ“ Project Structure

Rakshak/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ backend/                 # FastAPI core, AI models & APIs
โ”‚   โ”œโ”€โ”€ app/                    # Application logic & routing
โ”‚   โ””โ”€โ”€ models/                 # Model weight references
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ frontend/                # Next.js 14 tactical dashboard
โ”‚   โ”œโ”€โ”€ src/                    # Application source code
โ”‚   โ””โ”€โ”€ public/                 # Static assets & project logos
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ models/                  # Shared model weights
โ”‚   โ”œโ”€โ”€ best.pt                 # Violence detection model
โ”‚   โ””โ”€โ”€ fire.pt                 # Fire & smoke detection model
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ scripts/                 # Database seeding & model utilities
โ”œโ”€โ”€ ๐Ÿ“‚ docs/                    # Documentation & diagrams
โ”œโ”€โ”€ ๐Ÿ“‚ scratch/                 # Experimental notebooks
โ”‚
โ”œโ”€โ”€ ๐Ÿ““ Voilence.ipynb           # Violence detection training notebook
โ”œโ”€โ”€ โš™๏ธ  yolov8n.pt              # Base YOLOv8 nano weights
โ””โ”€โ”€ ๐Ÿ“„ README.md

โšก Quick Start

Prerequisites

Make sure you have the following installed:

  • Python 3.10+
  • Node.js 18+ and npm
  • Git

1๏ธโƒฃ Clone the Repository

git clone https://github.com/Awesome06/Rakshak.git
cd Rakshak

2๏ธโƒฃ Backend Setup

# Navigate to backend
cd backend

# Create and activate virtual environment
python -m venv venv

# On Windows:
venv\Scripts\activate

# On macOS/Linux:
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Start the FastAPI server
python -m uvicorn app.main:app --reload

๐ŸŒ Backend will be live at http://localhost:8000
๐Ÿ“– API docs available at http://localhost:8000/docs

3๏ธโƒฃ Frontend Setup

# In a new terminal, navigate to frontend
cd frontend

# Install dependencies
npm install

# Start the development server
npm run dev

๐ŸŒ Dashboard will be live at http://localhost:3000

4๏ธโƒฃ Environment Configuration

Create a .env file inside the backend/ directory:

# Required
GEMMA_API_KEY=your_gemma_api_key_here

# Optional (defaults shown)
DATABASE_URL=sqlite:///./rakshak.db
WEBSOCKET_HOST=0.0.0.0
WEBSOCKET_PORT=8001

๐Ÿง  AI Models

Model File Purpose Format
yolov8n.pt Base object detection (nano) PyTorch
models/best.pt Custom violence detection PyTorch
models/fire.pt Fire & smoke detection PyTorch

๐Ÿ’ก Model weights larger than 100MB are excluded from the repo. Use the download script:

python scripts/download_models.py

๐Ÿ”Œ API Reference

Once the backend is running, explore the full interactive API at:

http://localhost:8000/docs      โ† Swagger UI
http://localhost:8000/redoc     โ† ReDoc

Key endpoints include:

Method Endpoint Description
GET /api/v1/cameras List all registered camera feeds
POST /api/v1/cameras Register a new camera
GET /api/v1/incidents Retrieve all detected incidents
GET /api/v1/incidents/{id} Get incident detail with telemetry
POST /api/v1/dispatch Trigger emergency dispatch
WS /ws/stream/{cam_id} Real-time video inference stream
WS /ws/alerts Live alert notification channel

๐Ÿ“Š Detection Performance

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         MODEL METRICS (Validation)      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Module             โ”‚ mAP@0.5  โ”‚ FPS     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Violence Detection โ”‚  0.87    โ”‚  28+    โ”‚
โ”‚ Fire & Smoke       โ”‚  0.91    โ”‚  30+    โ”‚
โ”‚ Pose (Fall)        โ”‚  0.93    โ”‚  25+    โ”‚
โ”‚ Proximity Heuristicโ”‚    โ€”     โ”‚  Real-time โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ—บ๏ธ Roadmap

  • Violence detection with YOLOv8
  • Fall & health monitoring via MediaPipe
  • Fire & smoke vision node
  • Real-time Next.js tactical dashboard
  • WebSocket-based telemetry streaming
  • EOC Command Mode
  • One-click emergency dispatch integration
  • Multi-camera PTZ auto-tracking
  • Mobile EOC companion app
  • Federated edge node mesh network
  • On-device inference (Jetson Nano / RPi 5)
  • Incident report auto-generation via LLM

๐Ÿค Contributing

Contributions are welcome! Here's how to get started:

# Fork the repo, then:
git checkout -b feature/your-feature-name
git commit -m "feat: add your feature"
git push origin feature/your-feature-name
# Open a Pull Request ๐Ÿš€

Please follow Conventional Commits for commit messages.


๐Ÿ“œ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.


๐Ÿ™ Acknowledgements

  • Ultralytics YOLOv8 โ€” for the world-class detection backbone
  • Google MediaPipe โ€” for blazing-fast pose estimation
  • FastAPI โ€” for the elegant async API framework
  • Vercel / Next.js โ€” for the production-grade frontend toolkit
  • HACKACHINO 4.0 โ€” for the stage to build something that matters

Built with โค๏ธ to protect what matters most.

Rakshak โ€” Operating beyond the limits of human perception.

GitHub

About

Turning passive surveillance into proactive protection. Rakshak-AI automates real-time threat detection and triage using an edge-optimized AI perception pipeline to eliminate emergency response delays.

Topics

Resources

Stars

14 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages