YOLOv8 Β· OpenCV Β· Flask Β· React Β· Three.js
Shipped and running β no setup required.
| Layer | Platform | URL |
|---|---|---|
| π₯οΈ Frontend | Vercel | prahar-eight.vercel.app |
| βοΈ Backend API | HuggingFace Spaces (Docker) | harsha-tarot117-prahar-backend.hf.space |
PRAHAR processes uploaded drone videos frame-by-frame using YOLOv8, detects military threats (enemy soldiers & vehicles), overlays bounding boxes with confidence scores, and visualizes the results in a military-grade dark themed dashboard with 3D terrain maps.
cd prahar/backend
pip install -r requirements.txt
python app.pyBackend starts on
http://localhost:5000
cd prahar/frontend
npm install
npm run devFrontend starts on
http://localhost:5173
Upload Video β Flask Backend β OpenCV Frame Extraction
β
YOLOv8 Inference
β
Detection Mapping + Bounding Box Draw
β
Output Video (MP4) + JSON Metrics
β
React Dashboard β Axios HTTP Client
β β
Video Playback MetricsPanel
(with HUD overlay) TerrainMap (Three.js)
prahar/
βββ backend/
β βββ app.py # Flask server, API routes
β βββ video_processor.py # YOLOv8 + OpenCV processing pipeline
β βββ utils.py # Threat mapping, drawing utilities
β βββ requirements.txt
βββ frontend/
β βββ src/
β βββ App.jsx # Root component & layout
β βββ index.css # Military dark theme CSS
β βββ components/
β βββ MetricsPanel.jsx # Animated stats + threat level
β βββ TerrainMap.jsx # Three.js 3D terrain
β βββ ActivityLog.jsx # Live event log
βββ README.md
| YOLO Class | Threat Type | Marker Color |
|---|---|---|
person |
Enemy Soldier | π΄ Red |
car, truck |
Military Vehicle | π‘ Yellow |
bus, boat |
Military Vehicle | π‘ Yellow |
airplane |
Military Vehicle | π‘ Yellow |
| Condition | Threat Level | UI Color |
|---|---|---|
| Any enemy soldiers detected | HIGH |
π΄ Red flashing |
| Only military vehicles | MEDIUM |
π‘ Yellow |
| No threats | LOW |
π’ Green |
Upload a drone video for threat analysis.
Request: multipart/form-data with field video
Response:
{
"video_url": "/video/output_abc123.mp4",
"threat_level": "HIGH | MEDIUM | LOW",
"total_detections": 42,
"enemy_count": 12,
"vehicle_count": 8,
"fps": 18.4,
"duration": 34.5,
"frame_count": 863,
"resolution": "1920x1080",
"threat_coordinates": [
{ "x": 15.5, "y": -20.1, "z": 2.1, "type": "Enemy Soldier", "confidence": 87.3 }
]
}Serve the processed output video.
System health check.
Built with Three.js β generates a procedural terrain using sinusoidal noise:
- Green terrain β elevation-colored geometry
- Wireframe overlay β military grid aesthetic
- Auto-rotating camera β continuous orbit around the battlefield
- Red markers β Enemy Soldier positions
- Yellow markers β Military Vehicle positions
- Pulsing rings β animated threat indicators
This section explains how PRAHAR can scale from a prototype to a production-ready military AI system using Datature's annotation and training platform.
Datature is a no-code AI platform for building, training, and deploying computer vision models. It provides:
- Annotation Tools β Bounding box, polygon, semantic & instance segmentation
- Model Training β Train YOLOv8, Detectron2, EfficientDet on custom datasets
- Model Hub β Version-controlled model registry
- Deployment β One-click inference API deployment
| Stage | Tool | Description |
|---|---|---|
| Dataset Curation | Datature Annotator | Label drone footage with enemy/vehicle classes |
| Model Training | Datature Nexus | Fine-tune YOLOv8 on military terrain images |
| Model Export | Datature Hub | Export .pt model β deploy to edge device |
| Edge Inference | PRAHAR Backend | Run Datature model via Ultralytics API |
# Current: Generic YOLOv8 pretrained on COCO
model = YOLO("yolov8n.pt")
# Scalable: Datature-trained military detection model
model = YOLO("datature_military_v2.pt") # Exported from Datature HubThe swap is one line β the entire PRAHAR pipeline scales automatically.
- Terrain-specific accuracy β Model trained on camouflage, night-vision, aerial footage
- Custom class vocabulary β
sniper,armored_vehicle,bunker,weapon_cache - Continual learning β Retrain via Datature as new footage is labeled
- Edge-optimized β Export TFLite/ONNX for Jetson/Raspberry Pi deployment
- Military dark theme with green accent colors (
#00ff8c) - Real-time clock in UTC
- Blinking HIGH threat alert on video frame
- Animated metric counters (count-up animation)
- Drag & drop video upload
- HUD overlay on processed video frames (brackets, crosshair, progress bar, timestamp)
- Activity log with timestamped events
- 3D rotating terrain with threat markers
If ultralytics is not installed or the model fails to load, PRAHAR automatically enters Demo Mode:
- Generates synthetic detections per frame
- Still draw bounding boxes, HUD, metrics
- Full UI experience without real ML inference
- Great for showcase without a GPU
| Component | Minimum | Recommended |
|---|---|---|
| Python | 3.10+ | 3.11+ |
| RAM | 8 GB | 16 GB |
| GPU | None (CPU mode) | NVIDIA 8GB VRAM |
| Storage | 2 GB | 10 GB |
| Node.js | 18+ | 20+ |
MIT License β Free for hackathon use.
Built for the PRAHAR Defense-Tech Hackathon Β· Edge AI Β· Drone Surveillance Β· Real-Time Threat Detection