OTVision is a core module of the OpenTrafficCam framework designed to detect and track objects (road users) in videos recorded by OTCamera or other camera systems. The resulting trajectories can be used for traffic analysis using OTAnalytics.
- Video Conversion: Convert video files (h264 to mp4) with options to set frame rate and rotation
- Object Detection: Detect road users in videos using state-of-the-art YOLO models
- Object Tracking: Track detected objects through video frames using IOU-based tracking algorithms
- Coordinate Transformation: Transform pixel coordinates to real-world UTM coordinates
- Python 3.12 or higher
- CUDA-capable GPU (recommended for faster processing)
- Dependencies listed in requirements.txt
Pre-built releases are available on GitHub for easy installation:
- Go to the OTVision Releases page on GitHub
- Download the appropriate release for your platform:
- Windows: Choose between
otvision-win.zip
(standard) orotvision-win-cuda.zip
(with CUDA support) - Linux: Choose between
otvision-linux.zip
(standard) orotvision-linux-cuda.zip
(with CUDA support) - macOS: Choose
OTVision-macos.zip
- Windows: Choose between
- Extract the downloaded ZIP file
- Run the installation script:
- On Windows: Double-click
install.cmd
- On Linux: Run
./install.sh
- On macOS: Double-click
install.command
- On Windows: Double-click
-
Clone the repository:
git clone https://github.com/OpenTrafficCam/OTVision.git cd OTVision
-
Install the package:
- On Windows:
install.cmd
- On Linux/macOS:
./install.sh
- On Windows:
For development purposes, if you want to contribute to the project:
-
Clone the repository:
git clone https://github.com/OpenTrafficCam/OTVision.git cd OTVision
-
Install the development version:
- On Windows:
install_dev.cmd
- On Linux/macOS:
./install_dev.sh
- On Windows:
OTVision provides several command-line scripts for different functionalities:
Convert video files (e.g., h264 to mp4):
python convert.py --paths /path/to/videos/*.h264 --input-fps 20.0 --rotation 0
Detect objects in videos:
python detect.py --paths /path/to/videos/*.mp4 --weights yolov8s
Track detected objects:
python track.py --paths /path/to/detections/*.otdet
Transform pixel coordinates to UTM coordinates:
python transform.py --paths /path/to/tracks/*.ottrk --refpts-file /path/to/reference_points.json
OTVision can be configured using a YAML configuration file. A default configuration is provided in user_config.otvision.yaml
. You can specify a custom configuration file using the --config
option:
python detect.py --config /path/to/custom_config.yaml
For detailed documentation, visit:
We appreciate your support in the form of both code and comments. Please have a look at the contribute section of the OpenTrafficCam documentation for guidelines on how to contribute to the project.
This software is licensed under the GPL-3.0 License.
- GitHub: https://github.com/OpenTrafficCam
- Email: team@opentrafficcam.org