A real-time web dashboard for monitoring object detection and movement tracking from camera feeds.
- Real-time movement detection status
- Live object counting
- Visual alerts when movement is detected
- Active track monitoring
- Web-based dashboard (no installation needed for viewing)
- Responsive design (works on mobile devices)
roi_crop_track_dashboard.py- Main tracking program with integrated dashboarddashboard_server.py- HTTP server for dashboard APIdashboard.html- Web dashboard interface
No additional packages needed beyond the existing requirements:
pip install opencv-python numpyRun the tracking program with built-in dashboard:
python roi_crop_track_dashboard.pyRun dashboard server separately:
python dashboard_server.pyThen run your tracking program and it will update the dashboard.
- Start the program
- Open your web browser
- Navigate to: http://localhost:8080
- The dashboard will update automatically every second
To view the dashboard from other devices on your network:
-
Find your computer's IP address:
# On macOS/Linux ifconfig | grep "inet " # On Windows ipconfig
-
On another device, navigate to:
http://YOUR_IP_ADDRESS:8080For example:
http://192.168.1.100:8080
- Purple gradient background with pulsing animation
- Red dot icon
- "Movement Detected" text
- Shows number of active objects
- Light gray background
- Green checkmark icon
- "No Movement Detected" text
- "System monitoring..." status
- Total Count: Cumulative number of objects counted
- Active Tracks: Number of currently tracked objects
- Last Updated: Timestamp of last update
- Connection Status: Green dot = connected, Red dot = disconnected
- Tracking Program detects objects and movement
- Status Updates sent to shared status object
- Dashboard Server serves status via HTTP API
- Web Dashboard polls the API every second
- Real-time Display shows current status
The dashboard provides a JSON API at:
http://localhost:8080/api/status
Example response:
{
"movement_detected": true,
"count": 5,
"active_tracks": 2,
"last_update": 1698765432.123,
"status_message": "Movement Detected",
"timestamp": "2024-04-23 14:30:45"
}Edit roi_crop_track_dashboard.py:
run_server_thread(port=9000) # Change to your preferred portEdit dashboard.html to customize:
- Colors and gradients
- Font sizes
- Layout
- Update interval (default: 1 second)
Uncomment the playAlert() function in dashboard.html to enable audio notifications when movement is detected.
Cause: Dashboard server not running or wrong port
Solution:
- Ensure tracking program is running
- Check console for "Dashboard server started" message
- Verify port 8080 is not in use by another application
Cause: Browser cache
Solution:
- Hard refresh the page (Ctrl+F5 or Cmd+Shift+R)
- Clear browser cache
- Try in incognito/private mode
Cause: Port 8080 is already in use
Solution:
- Stop other programs using port 8080
- Or change the port in the code
Cause: Firewall blocking connections
Solution:
- Allow port 8080 in your firewall
- On macOS: System Preferences → Security & Privacy → Firewall → Firewall Options
- Add Python to allowed applications
Terminal 1:
$ python roi_crop_track_dashboard.py
Starting dashboard server...
Dashboard available at: http://localhost:8080
System camera opened: 1280x720
[Select ROI on camera feed]
✅ Reference ROI saved
✅ Using selected ROI crop as reference
Starting tracking...
Count: 1 | Active Tracks: 1 | Movement: True
Count: 2 | Active Tracks: 2 | Movement: True
Browser:
http://localhost:8080
[Shows real-time dashboard with movement status]
To monitor multiple cameras, run separate instances on different ports:
# Camera 1
python roi_crop_track_dashboard.py # Port 8080
# Camera 2 (modify code to use port 8081)
python roi_crop_track_dashboard.py # Port 8081Access dashboards at:
- Camera 1: http://localhost:8080
- Camera 2: http://localhost:8081
This dashboard integrates with the existing object detection system.