Real-time traffic monitoring system using computer vision and AI, with WebSocket-based communication for efficient real-time updates.
-
Core Controller (
AutomoBee
)- Centralized system initialization and coordination
- Resource management and cleanup
- Component lifecycle management
-
Services
- WebSocket server for real-time communication
- Async stream manager for video processing
- Zone-based detection service
- Performance monitoring and optimization
- Components
- Real-time dashboard with WebSocket updates
- Interactive map with zone visualization
- HLS video stream viewer
- Performance metrics display
- Asynchronous video stream processing
- Batch-based vehicle detection
- Zone-based monitoring
- Real-time WebSocket updates
- Automatic performance optimization
- Resource usage monitoring
- Comprehensive error handling
- Create Python virtual environment:
python -m venv .venv
source .venv/bin/activate # Linux/Mac
# or
.venv\Scripts\activate # Windows
- Install dependencies:
pip install -r requirements.txt
- Configure environment:
cp .env.example .env
# Edit .env with your settings
- Initialize configuration:
mkdir -p config logs
cp config/cameras.json.example config/cameras.json
# Edit cameras.json with your camera configurations
- Start the system:
python main.py
{
"camera_id": {
"name": "Camera Name",
"lat": 36.1699,
"lng": -115.1398,
"stream_url": "rtsp://camera-url",
"fps": 30,
"zones": [
{
"name": "Zone 1",
"coordinates": [
{"lat": 36.1699, "lng": -115.1398},
{"lat": 36.1700, "lng": -115.1399},
{"lat": 36.1701, "lng": -115.1397}
]
}
]
}
}
See .env.example
for all available configuration options.
automobee/
├── src/
│ ├── backend/
│ │ ├── core/
│ │ │ └── automobee.py
│ │ └── services/
│ │ ├── detection_service.py
│ │ ├── stream_manager.py
│ │ ├── websocket_server.py
│ │ └── metrics_collector.py
│ └── frontend/
│ ├── components/
│ │ ├── map.js
│ │ └── stream-viewer.js
│ └── services/
│ └── websocket.js
├── config/
│ ├── cameras.json
│ └── logging.yaml
├── models/
│ ├── yolov8m.pt
│ └── vehicle_classifier.pt
└── logs/
├── automobee.log
├── error.log
└── metrics.log
Run tests with:
pytest tests/
Access metrics and health information:
- System metrics:
logs/metrics.log
- Application logs:
logs/automobee.log
- Error tracking:
logs/error.log
The system automatically optimizes:
- Batch processing size
- Frame skip rate
- Detection confidence threshold
- Resource utilization
Monitor performance through:
- Detection rate per camera
- Classification confidence
- Processing latency
- Memory usage
- GPU utilization
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT License - see LICENSE file for details