This document explains the dependencies required for the Vigilance System and how to install them.
The Vigilance System relies on several Python packages to function properly. These are categorized by their purpose:
- numpy: For numerical operations and array handling
- opencv-python: For image processing and computer vision
- opencv-contrib-python: For advanced OpenCV features like video stabilization
- pillow: For image handling
- torch: PyTorch for deep learning
- torchvision: Computer vision utilities for PyTorch
- ultralytics: For YOLOv5 object detection models
- av: PyAV for video decoding
- rtsp: RTSP client for streaming
- flask: Web framework for the dashboard
- flask-socketio: Real-time communication for the dashboard
- bidict: Required by flask-socketio
- python-engineio: Required by flask-socketio
- python-socketio: Required by flask-socketio
- twilio: For SMS notifications
- boto3: For AWS SNS notifications
- pyyaml: For YAML configuration files
- python-dotenv: For environment variable management
- loguru: For enhanced logging
- requests: For HTTP requests
- pytest: For unit testing
- pytest-cov: For test coverage reports
The easiest way to install all dependencies is to use the provided setup scripts:
setup.batchmod +x setup.sh
./setup.shThese scripts will:
- Create a virtual environment
- Install all dependencies from requirements.txt
- Install the package in development mode with all extras
If you prefer to install dependencies manually:
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install core dependencies:
pip install --upgrade pip pip install -r requirements.txt
-
Install the package with all extras:
pip install -e .[notifications,dev]
If you only need certain features, you can install specific extras:
# For notification features only
pip install -e .[notifications]
# For development and testing only
pip install -e .[dev]Some Python packages require system-level dependencies:
sudo apt-get update
sudo apt-get install -y libsm6 libxext6 libxrender-dev libgl1-mesa-glxIf you want to use GPU acceleration, make sure you have:
- A CUDA-compatible GPU
- CUDA Toolkit installed (version compatible with your PyTorch version)
- cuDNN installed
-
ImportError: No module named 'cv2'
- Solution:
pip install opencv-python opencv-contrib-python
- Solution:
-
ImportError: DLL load failed while importing _C
- Solution: Make sure you have the Visual C++ Redistributable installed (Windows)
-
No CUDA GPUs are available
- Solution: Check that your GPU is CUDA-compatible and that you have the correct CUDA version installed
-
Error loading YOLOv5 model
- Solution:
pip install ultralytics
- Solution:
To check which packages are installed in your environment:
pip listTo check if a specific package is installed:
pip show package_nameTo update all dependencies to their latest versions:
pip install --upgrade -r requirements.txtTo update a specific package:
pip install --upgrade package_name