Real-time AI-powered navigation assistance with obstacle detection, voice guidance, and GPS emergency alerts. Designed for visually impaired users and pedestrian safety.
Camera Sees β AI Decides β Voice Speaks
- App Opens β Camera ON, GPS ON β no manual setup needed
- Live Monitoring β AI continuously analyzes the camera feed
- Smart Navigation β Voice tells you where to go
| Situation | Command |
|---|---|
| Path clear | "Go straight" |
| Obstacle ahead, left free | "Move left" |
| Obstacle ahead, right free | "Move right" |
| All sides blocked | "Stop" |
| Stairs detected | "Stairs ahead, proceed with caution" |
| Vehicle approaching | "Vehicle coming, stay alert" |
| Vehicle very close | "Stop immediately" |
| Pothole ahead | "Pothole ahead, move left/right" |
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (PWA) β
β Camera β Frame Capture β WebSocket β AR Overlay β
β GPS β Location Tracking β Emergency Alerts β
β Web Speech API β Voice Guidance β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β WebSocket (binary frames)
ββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
β Backend (FastAPI) β
β YOLOv8 Detection β Decision Engine β Response β
β GPS Processing β Emergency Alert Generation β
β TTS Service (pyttsx3 fallback) β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
| Layer | Technology |
|---|---|
| Backend Framework | FastAPI + Uvicorn |
| Object Detection | YOLOv8 (Ultralytics) |
| Computer Vision | OpenCV |
| AI Runtime | PyTorch |
| Voice (Server) | pyttsx3 (offline) |
| Voice (Client) | Web Speech API |
| Frontend | Vanilla JS PWA |
| Communication | WebSocket (binary frames) |
| GPS | Browser Geolocation API |
| Deployment | Docker |
- πΆ Person
- π Vehicle (car, bus, truck, motorcycle, bicycle)
- πͺ Stairs (heuristic + custom model)
- π§± Wall (heuristic + custom model)
β οΈ Pothole (custom model)- π§ Generic obstacles
- Python 3.10+
- pip
git clone https://github.com/yashab-cyber/Augmented-Reality-Navigation-System.git
cd Augmented-Reality-Navigation-System
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
# venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txtcp .env.example .env
# Edit .env to customize settingspython run.pyOpen http://localhost:8000 on your phone or desktop browser.
Mobile Access: Connect your phone to the same network and open
http://<your-ip>:8000
docker compose up --buildβββ backend/
β βββ __init__.py
β βββ config.py # App configuration (env vars)
β βββ main.py # FastAPI app + WebSocket handler
β βββ models/
β β βββ __init__.py
β β βββ schemas.py # Pydantic models
β βββ services/
β βββ __init__.py
β βββ detection.py # YOLOv8 object detection
β βββ decision_engine.py # Navigation logic
β βββ tts_service.py # Text-to-Speech
β βββ gps_service.py # GPS processing
β βββ frame_processor.py # Pipeline orchestrator
βββ frontend/
β βββ index.html # Main UI
β βββ manifest.json # PWA manifest
β βββ css/
β β βββ styles.css # Full responsive styles
β βββ js/
β βββ app.js # Main app orchestrator
β βββ camera.js # Camera management
β βββ websocket.js # WebSocket client
β βββ tts.js # Client-side TTS
β βββ gps.js # GPS module
β βββ ar-renderer.js # AR overlay renderer
βββ tests/
β βββ test_decision_engine.py # Decision logic tests
β βββ test_gps_service.py # GPS service tests
β βββ test_api.py # API endpoint tests
βββ run.py # Entry point
βββ requirements.txt # Python dependencies
βββ Dockerfile # Container image
βββ docker-compose.yml # Container orchestration
βββ .env.example # Environment template
βββ .gitignore
| Method | Path | Description |
|---|---|---|
GET |
/ |
Serve frontend app |
GET |
/api/status |
System health status |
POST |
/api/gps |
Update GPS coordinates |
POST |
/api/emergency |
Trigger emergency alert |
GET |
/api/location |
Get current location info |
Client β Server:
| Format | Description |
|---|---|
| Binary (JPEG) | Camera frame for detection |
{"type": "frame", "data": {"image": "<base64>"}} |
Base64 frame |
{"type": "gps", "data": {"latitude": ..., "longitude": ...}} |
GPS update |
{"type": "emergency"} |
Emergency alert |
{"type": "status"} |
Request status |
Server β Client:
{
"type": "analysis",
"data": {
"frame_id": 42,
"fps": 15.2,
"detections": [
{
"category": "person",
"confidence": 0.89,
"bbox": [0.3, 0.2, 0.6, 0.9],
"zone": "center",
"label": "person"
}
],
"command": {
"action": "move_left",
"message": "Obstacle ahead. Move left.",
"priority": 5,
"speak": true
}
}
}pip install pytest httpx
pytest tests/ -vAll settings can be configured via environment variables or .env file:
| Variable | Default | Description |
|---|---|---|
SERVER_PORT |
8000 |
Server port |
YOLO_MODEL_PATH |
yolov8n.pt |
YOLOv8 model file |
YOLO_CONFIDENCE |
0.45 |
Detection threshold |
YOLO_DEVICE |
cpu |
cpu, cuda, or mps |
FRAME_SKIP |
2 |
Process every Nth frame |
TTS_COOLDOWN |
2.0 |
Seconds between same voice messages |
CUSTOM_MODEL_PATH |
Path to custom model for stairs/pothole/wall |
# For NVIDIA GPU
YOLO_DEVICE=cuda python run.py
# For Apple Silicon
YOLO_DEVICE=mps python run.pyTo improve stairs/pothole/wall detection, train a custom YOLOv8 model:
from ultralytics import YOLO
model = YOLO('yolov8n.pt')
model.train(
data='custom_dataset.yaml',
epochs=100,
imgsz=640,
classes=['stairs', 'wall', 'pothole', 'obstacle']
)Then set CUSTOM_MODEL_PATH=runs/detect/train/weights/best.pt in your .env.
The frontend is a Progressive Web App (PWA):
- Open the app URL on your phone's browser
- Tap "Add to Home Screen"
- The app will run fullscreen like a native app
- Camera and GPS permissions will be requested automatically
Note: For camera access on mobile, the app must be served over HTTPS or localhost.
MIT License