cleanup and files added

This commit is contained in:
2025-08-26 13:24:53 -07:00
parent a379d7a063
commit 51a14cd61c
8968 changed files with 1292619 additions and 0 deletions

View File

@@ -0,0 +1,158 @@
# Hybrid Desktop + Services Architecture Implementation Plan
## Overview
This implementation adds MQTT + InfluxDB + Grafana to create a professional-grade monitoring system alongside the existing PySide6 desktop application.
## Architecture
```
Desktop App (PySide6) → MQTT Broker → InfluxDB → Grafana Dashboard
↓ ↓ ↓ ↓
Qt Signals Real-time Events Time Series Rich Analytics
Local UI MQTT Topics Database Visualizations
```
## Phase 1: Prerequisites & Downloads
### 1.1 Download Required Software (No Accounts Needed)
#### Mosquitto MQTT Broker
- **Download**: https://mosquitto.org/download/
- **File**: mosquitto-2.0.18-install-windows-x64.exe
- **Size**: ~8MB
- **Purpose**: Message broker for real-time event streaming
#### InfluxDB v2
- **Download**: https://portal.influxdata.com/downloads/
- **File**: influxdb2-2.7.4-windows-amd64.zip
- **Size**: ~90MB
- **Purpose**: Time series database for metrics storage
#### Grafana
- **Download**: https://grafana.com/grafana/download?platform=windows
- **File**: grafana-10.2.2.windows-amd64.zip
- **Size**: ~180MB
- **Purpose**: Analytics dashboard and visualization
### 1.2 Python Dependencies
```bash
pip install paho-mqtt influxdb-client grafana-api requests-async asyncio
```
## Phase 2: Service Installation
### 2.1 Install Mosquitto MQTT
1. Run mosquitto installer as Administrator
2. Install to default location: `C:\Program Files\mosquitto\`
3. Will create Windows service automatically
4. Default port: 1883 (unencrypted), 8883 (encrypted)
### 2.2 Setup InfluxDB
1. Extract InfluxDB zip to `C:\InfluxDB\`
2. Create data directory: `C:\InfluxDB\data\`
3. Will run as standalone service
4. Default port: 8086 (HTTP API)
### 2.3 Setup Grafana
1. Extract Grafana zip to `C:\Grafana\`
2. Create configuration directory
3. Will run as standalone service
4. Default port: 3000 (Web UI)
## Phase 3: Configuration Files
### 3.1 Mosquitto Configuration
**File**: `C:\Program Files\mosquitto\mosquitto.conf`
```conf
# Smart Intersection MQTT Configuration
port 1883
listener 1883 0.0.0.0
allow_anonymous true
persistence true
persistence_location C:\Program Files\mosquitto\data\
log_dest file C:\Program Files\mosquitto\logs\mosquitto.log
log_type all
```
### 3.2 InfluxDB Configuration
**File**: `C:\InfluxDB\config.yml`
```yaml
http-bind-address: ":8086"
storage-engine: tsm1
storage-directory: C:\InfluxDB\data
storage-wal-directory: C:\InfluxDB\wal
```
### 3.3 Grafana Configuration
**File**: `C:\Grafana\conf\defaults.ini` (modify)
```ini
[server]
http_port = 3000
domain = localhost
[security]
admin_user = admin
admin_password = admin
[database]
type = sqlite3
path = grafana.db
```
## Phase 4: Desktop Application Integration
### 4.1 MQTT Publisher Service
- Modify SmartIntersectionController to publish to MQTT topics
- Topics: `traffic/detection`, `traffic/violations`, `traffic/performance`
- Real-time event streaming
### 4.2 InfluxDB Writer Service
- Background service to write metrics to InfluxDB
- Time series data: FPS, object counts, processing times
- Automatic batching and error handling
### 4.3 Grafana Dashboard Integration
- Pre-configured dashboards for traffic analytics
- Real-time charts and graphs
- Alerting system for violations
## Phase 5: Service Management
### 5.1 Windows Services Setup
- Create batch scripts to start/stop services
- Optional: Install as Windows services for auto-start
- Health monitoring and restart capabilities
### 5.2 Desktop Integration
- Add service status monitoring to desktop app
- Quick access buttons to open Grafana dashboards
- Service health indicators in UI
## Resource Usage Estimates
- **Mosquitto**: ~5-10MB RAM
- **InfluxDB**: ~50-100MB RAM
- **Grafana**: ~100-150MB RAM
- **Total Additional**: ~200-300MB RAM
## Benefits
✅ Professional monitoring and analytics
✅ Real-time event streaming via MQTT
✅ Rich Grafana dashboards
✅ Multiple device/remote access capability
✅ Time series data analysis
✅ Automated alerting system
✅ Scalable architecture
## Implementation Timeline
- **Phase 1-2**: 30 minutes (downloads + installation)
- **Phase 3**: 15 minutes (configuration)
- **Phase 4**: 2 hours (desktop integration)
- **Phase 5**: 30 minutes (service management)
- **Total**: ~3-4 hours for complete implementation
## Next Steps
1. Download required software
2. Follow installation guide
3. Configure services
4. Integrate with desktop application
5. Create Grafana dashboards
6. Test end-to-end functionality

View File

@@ -0,0 +1,107 @@
# How to Use Smart Intersection Features in Desktop App
This guide explains how to use the Smart Intersection analytics features integrated into the Traffic Monitoring Desktop Application.
## Overview
The Smart Intersection features provide advanced scene-based analytics for traffic monitoring, including multi-camera object tracking and region-of-interest analysis.
## Getting Started
### 1. Launch the Application
- Run `python main.py` from the qt_app_pyside1 directory
- The application will start with Intel Arc GPU acceleration enabled
- Wait for the splash screen to complete initialization
### 2. Access Smart Intersection Features
#### Configuration Panel
1. Navigate to the **Config** tab in the main window
2. Select **Smart Intersection** from the configuration categories
3. Configure the following settings:
- **Camera Settings**: Add multiple camera sources for scene analytics
- **Tracker Parameters**: Adjust tracking sensitivity and frame rate handling
- **ROI Definition**: Define regions of interest for analytics
- **Performance Settings**: Optimize for your Intel Arc GPU
#### Analytics Dashboard
1. Go to the **Analytics** tab
2. View real-time scene analytics including:
- Multi-camera object tracking
- Region-based event detection
- Traffic flow analysis
- Pedestrian safety monitoring
#### VLM Insights
1. The VLM insights panel provides AI-powered analysis
2. Enable scene-based insights for enhanced understanding
3. View contextual information about detected events
## Key Features
### Multi-Camera Scene Analytics
- **Object Tracking**: Track objects across multiple camera views
- **Scene Fusion**: Combine data from multiple cameras for comprehensive view
- **Real-time Processing**: All processing occurs locally with GPU acceleration
### Region of Interest (ROI) Analytics
- **Crosswalk Monitoring**: Detect pedestrians in crosswalk areas
- **Lane Analysis**: Monitor vehicle dwell time and traffic flow
- **Safety Zones**: Define areas for safety monitoring and alerts
### Performance Optimization
- **Intel Arc GPU**: Optimized for Intel Arc GPU acceleration
- **Local Processing**: No cloud dependency, all processing local
- **Real-time Feedback**: Immediate response to traffic events
## Configuration Options
### Tracker Settings
```json
{
"max_unreliable_frames": 10,
"non_measurement_frames_dynamic": 8,
"non_measurement_frames_static": 16,
"baseline_frame_rate": 30
}
```
### Camera Configuration
- **Camera ID**: Unique identifier for each camera
- **Position**: Physical position in the intersection
- **Calibration**: Camera calibration parameters
- **ROI Mapping**: Define which regions each camera monitors
## Troubleshooting
### Common Issues
1. **GPU Not Detected**: Ensure Intel Arc GPU drivers are installed
2. **Poor Tracking**: Adjust tracker parameters in configuration
3. **Performance Issues**: Check GPU utilization in Performance tab
### Performance Tips
- Use appropriate frame rates for your hardware
- Configure ROI regions efficiently
- Monitor GPU memory usage
- Adjust tracking parameters based on scene complexity
## Advanced Usage
### Custom ROI Definition
1. Load video or connect cameras
2. Pause on a representative frame
3. Use the ROI drawing tools to define areas
4. Save configuration for reuse
### Integration with Existing Workflows
- Export analytics data for further analysis
- Configure alerts for specific events
- Integrate with external systems via configuration
## Support
For additional help:
- Check the **Help****User Guide** menu
- Review system requirements
- Consult troubleshooting documentation
- Check performance metrics in the Performance tab

View File

@@ -0,0 +1,53 @@
# Smart Intersection Analytics - Desktop Integration
## Overview
This documentation describes the Smart Intersection analytics capabilities integrated into the Traffic Monitoring Desktop Application. The system demonstrates how edge AI technologies can address traffic management challenges using scene-based analytics.
## Key Features Integrated
### Multi-Camera Scene Analytics
- **Multi-camera multi-object tracking**: Enables tracking of objects across multiple camera views
- **Scene based analytics**: Regions of interest that span multiple views can be easily defined
- **Real-time processing**: Object tracks and analytics available in near real-time
### Use Cases
- **Pedestrian Safety**: Enhance safety for vulnerable road users (VRUs) at crosswalks
- Scene-based region of interest (ROI) analytics help identify VRUs actively using crosswalks
- Detect unsafe situations, such as pedestrians walking outside designated crosswalk areas
- **Vehicle Analytics**: Measure average vehicle count and average dwell time in each lane
- Vehicles spending too much time in a lane indicates anomalies such as stalled vehicles, accidents, and congestion
### Desktop Application Benefits
- **Reduced TCO**: Works with existing cameras and simplifies business logic development
- **Local Processing**: All analytics run locally with Intel Arc GPU acceleration
- **Integrated UI**: Scene analytics configuration and monitoring within the main application
- **Real-time Insights**: VLM-powered insights for enhanced understanding of traffic patterns
## Configuration
### Scene Analytics Settings
The application includes configuration options for:
- **Tracker Parameters**: Frame rate handling, measurement thresholds
- **Camera Setup**: Multi-camera calibration and positioning
- **ROI Definition**: Define regions of interest for analytics
- **Performance Tuning**: Optimize for Intel Arc GPU acceleration
### Access Through UI
- Navigate to the **Config** tab in the main application
- Select **Smart Intersection** settings
- Configure parameters and apply changes
- View live analytics in the **Analytics** tab
## Technical Integration
The desktop application integrates scene-based analytics through:
- **Scene Adapter**: Python utilities for object detection processing
- **Configuration Management**: JSON-based settings for tracker and scene parameters
- **Signal Processing**: Qt signals for real-time data flow between components
- **GPU Acceleration**: OpenVINO optimized pipelines for Intel Arc GPU
## Getting Started
1. Open the Traffic Monitoring Desktop Application
2. Navigate to **Config****Smart Intersection**
3. Configure your camera settings and ROI definitions
4. Apply settings and view analytics in the **Analytics** tab
5. Access detailed insights through the **Help****User Guide** menu