Implementation and comparison of different car tracking algorithms: SORT, DeepSORT, ByteTrack, and HybridTrack.
This project provides a comprehensive framework for tracking vehicles in video streams using state-of-the-art tracking algorithms. It includes implementations of SORT, DeepSORT, ByteTrack, and a custom HybridTrack algorithm.
| Tracker | FPS | Tracks/Frame | Detection (ms) | Tracking (ms) | MOTA (%) | ID Switches |
|---|---|---|---|---|---|---|
| ByteTrack | 6.45 | 7.36 | 151.45 | 3.54 | 83 | 46 |
| DeepSORT | 3.59 | 5.08 | 141.25 | 137.00 | 79 | 75 |
| SORT | 34.87 | 4.62 | 17.49 | 11.19 | 65 | 137 |
| HybridTrack | 19.53 | 4.78 | 49.84 | 1.38 | 94 | 15 |
- HybridTrack achieves balanced performance between speed and accuracy
- Improved track consistency with enhanced filtering
- Better handling of occlusions and ID switches
- ✅ Added multi-tracker comparison visualization
- ✅ Implemented real-time performance metrics
- ✅ Enhanced tracker initialization
- ✅ Improved visualization system
- ✅ Added comprehensive results analysis
- ✅ Three tracking algorithms implemented:
- SORT (Simple Online and Realtime Tracking)
- DeepSORT (Deep Learning enhanced SORT)
- ByteTrack (State-of-the-art tracking)
- ✅ Multiple detector options:
- Simple detector (background subtraction)
- YOLOv8 detector
- ByteYOLO detector (optimized for ByteTrack)
- ✅ Real-time visualization
- ✅ Configurable parameters via YAML
- ✅ Interactive demo application
- Clone the repository:
git clone https://github.com/yourusername/Car_Tracking_Algorithms.git
cd Car_Tracking_Algorithms- Install dependencies:
pip install -r requirements.txt
pip install ultralytics # For YOLOv8 detector
- Create required directories:
mkdir -p data/datasets
mkdir -p data/models
mkdir -p data/outputs
- Add video files:
- Place your video files in
data/datasets/ - Supported formats: .avi, .mp4
- Verify configurations:
- Check that config files exist in
configs/ - Verify parameters in config files
- From project root directory:
python demo/demo.py
- Follow the interactive prompts to:
- Select tracking configuration (SORT, DeepSORT, or ByteTrack)
- Select input video
- View results:
- Real-time tracking visualization will be shown
- Processed video will be saved to
data/outputs/ - Press 'q' to quit the demo
- Simple and fast tracking
- Uses Kalman filter for motion prediction
- IoU-based matching
- Best for simple scenarios with clear visibility
- Enhanced tracking with deep learning features
- Better identity preservation
- Uses YOLOv8 for detection
- Good balance of speed and accuracy
- State-of-the-art performance
- Handles low-confidence detections
- Advanced state estimation
- Best for complex scenarios
- Based on ByteTrack's proven framework
- Enhanced track management system
- Efficient Kalman filtering
- IoU-based matching with Hungarian algorithm
- Good balance between speed and accuracy
- Suitable for real-time applications with moderate complexity
Each tracker has its own configuration file in configs/:
sort_config.yamldeep_sort_config.yamlbyte_track_config.yaml
Key parameters can be adjusted in these files.
Car_Tracking_Algorithms/
├── configs/ # Configuration files
├── data/ # Data storage
│ ├── datasets/ # Input videos
│ ├── models/ # Model weights
│ └── outputs/ # Processed videos
├── demo/ # Demo application
├── src/ # Source code
│ ├── trackers/ # Tracker implementations
│ └── utils/ # Shared utilities
└── tests/ # Test suite
If you encounter issues:
- Verify all dependencies are installed
- Check video file exists in data/datasets
- Ensure you're running from project root
- Verify config files exist in configs directory
- Check that data/outputs directory exists for saving results
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Our HybridTrack algorithm successfully combines the strengths of three leading tracking methods:
-
From SORT:
- Efficient Kalman filter for motion prediction
- Hungarian algorithm for optimal assignment
- Fast IoU-based matching
-
From DeepSORT:
- Enhanced track management system
- Robust track validation criteria
- Hit streak based confirmation
-
From ByteTrack:
- Dual-threshold detection handling
- Advanced state estimation
- Track recovery mechanism
-
Sequential ID Management:
- Strictly increasing ID assignment
- No ID recycling to prevent confusion
- Continuous tracking history preservation
-
Stable Track Maintenance:
- Combined motion and IoU matching
- Adaptive track validation criteria
- Enhanced state prediction
-
Robust Detection Association:
- Two-stage matching strategy
- High/low confidence detection handling
- Improved occlusion handling
- Maintains consistent tracking through occlusions
- Sequential ID assignment (1,2,3...)
- Stable bounding boxes
- Efficient computation (~20 FPS)
- Fork the repository.
- Create your feature branch.
- Commit your changes.
- Push to the branch.
- Create a new Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.

