Skip to content

A blazing-fast, modern C++ multi-object tracking library featuring SORT, ByteTrack, OC-SORT, BoostTrack, and more built for real-time performance, cross-platform deployment, and MOT benchmarks.

License

Notifications You must be signed in to change notification settings

Geekgineer/motcpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

30 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

motcpp

motcpp

Modern C++ Multi-Object Tracking Library

ByteTrack
ByteTrack
OC-SORT
OC-SORT
BoostTrack
BoostTrack
SORT
SORT

CI Coverage Release License Stars

Features โ€ข Installation โ€ข Quick Start โ€ข Trackers โ€ข Benchmarks โ€ข Documentation


motcpp is a high-performance, production-ready C++ library for multi-object tracking. It provides state-of-the-art tracking algorithms with a clean, modern C++17 API designed for real-time applications.

โœจ Features

  • ๐ŸŽฏ 9 State-of-the-Art Trackers โ€” SORT, ByteTrack, OC-SORT, DeepOC-SORT, StrongSORT, BoT-SORT, BoostTrack, HybridSORT, UCMCTrack
  • โšก Blazing Fast โ€” Optimized C++ implementation, 10-100x faster than Python equivalents
  • ๐Ÿ”ง Easy Integration โ€” Modern CMake, single-header option, vcpkg support
  • ๐Ÿงช Well Tested โ€” Comprehensive unit tests with >90% code coverage
  • ๐Ÿ“ฆ Cross-Platform โ€” Linux, macOS, Windows
  • ๐Ÿ”Œ Flexible ReID โ€” ONNX Runtime backend for appearance embeddings
  • ๐Ÿ“Š MOT Benchmark Ready โ€” Built-in evaluation tools for MOT17/MOT20

๐Ÿ“Š Benchmarks

MOT17 Ablation Split

Tracker HOTAโ†‘ MOTAโ†‘ IDF1โ†‘ FPS
SORT 62.4 75.2 69.2 1250
ByteTrack 66.5 76.4 77.6 1100
OC-SORT 64.6 73.9 74.4 850
UCMCTrack 64.0 75.6 73.9 980
BoostTrack 67.5 77.1 79.2 75

Evaluation on the second half of the MOT17 training set using YOLOX detections and FastReID embeddings. Pre-generated data available in releases. FPS measured on Intel i9-13900K.

C++ vs Python Performance

Tracker C++ (FPS) Python (FPS) Speedup
ByteTrack 1100 45 24x
OC-SORT 850 32 27x
StrongSORT 95 8 12x

๐Ÿš€ Installation

Prerequisites

  • C++17 compiler (GCC 9+, Clang 10+, MSVC 2019+)
  • CMake 3.16+
  • OpenCV 4.x
  • Eigen3

Build from Source

git clone https://github.com/Geekgineer/motcpp.git
cd motcpp
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)
sudo cmake --install build

CMake Integration

find_package(motcpp REQUIRED)
target_link_libraries(your_target PRIVATE motcpp::motcpp)

๐ŸŽฎ Quick Start

#include <motcpp/trackers/bytetrack.hpp>
#include <opencv2/opencv.hpp>

int main() {
    // Create tracker
    motcpp::trackers::ByteTrack tracker;
    
    cv::VideoCapture cap("video.mp4");
    cv::Mat frame;
    
    while (cap.read(frame)) {
        // Your detector outputs: [x1, y1, x2, y2, confidence, class_id]
        Eigen::MatrixXf detections = your_detector(frame);
        
        // Update tracker
        Eigen::MatrixXf tracks = tracker.update(detections, frame);
        
        // tracks: [x1, y1, x2, y2, track_id, confidence, class_id, det_index]
        for (int i = 0; i < tracks.rows(); ++i) {
            int track_id = static_cast<int>(tracks(i, 4));
            cv::Rect box(tracks(i, 0), tracks(i, 1), 
                        tracks(i, 2) - tracks(i, 0), 
                        tracks(i, 3) - tracks(i, 1));
            
            cv::rectangle(frame, box, motcpp::BaseTracker::id_to_color(track_id), 2);
        }
        
        cv::imshow("Tracking", frame);
        if (cv::waitKey(1) == 27) break;
    }
    
    return 0;
}

๐Ÿ“‹ Trackers

Tracker Type Speed Paper
SORT Motion โšกโšกโšกโšกโšก Bewley et al., 2016
ByteTrack Motion โšกโšกโšกโšกโšก Zhang et al., ECCV 2022
OC-SORT Motion โšกโšกโšกโšก Cao et al., CVPR 2023
UCMCTrack Motion โšกโšกโšกโšก Yi et al., AAAI 2024
DeepOC-SORT ReID โšกโšกโšก Maggiolino et al., 2023
StrongSORT ReID โšกโšก Du et al., TMM 2023
BoT-SORT ReID โšกโšก Aharon et al., 2022
BoostTrack ReID โšกโšก Stanojevic et al., MVA 2024
HybridSORT ReID โšกโšก Yang et al., AAAI 2024

Tracker Selection Guide

Need maximum speed?     โ†’ SORT, ByteTrack
General purpose?        โ†’ ByteTrack, OC-SORT
Heavy occlusions?       โ†’ OC-SORT, UCMCTrack
Moving camera?          โ†’ UCMCTrack, BoT-SORT
Re-identification?      โ†’ StrongSORT, BoostTrack
State-of-the-art?       โ†’ BoostTrack

๐Ÿ“š Documentation

Resource Description
๐Ÿ“– Getting Started Installation and first steps
๐Ÿ” API Reference Complete API documentation
๐Ÿ“ Tutorials Step-by-step guides
๐Ÿ’ก Examples Code examples
๐ŸŽฏ Tracker Guide Choosing the right tracker
๐Ÿ—๏ธ Architecture System design
๐Ÿ“Š Benchmarking Run your own benchmarks

๐Ÿงช Testing

cmake -B build -DMOTCPP_BUILD_TESTS=ON
cmake --build build
cd build && ctest --output-on-failure

๐Ÿค Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

๐Ÿ“œ Citation

If you use motcpp in your research, please cite:

@software{motcpp2026,
  author = {motcpp contributors},
  title = {motcpp: Modern C++ Multi-Object Tracking Library},
  year = {2026},
  url = {https://github.com/Geekgineer/motcpp},
  license = {AGPL-3.0}
}

๐Ÿ“„ License

This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

Special Thanks

This project draws inspiration from and builds upon the excellent work of:

Project Description
BoxMOT The original Python multi-object tracking library by Mikel Brostrรถm. Our C++ implementation follows similar architecture patterns and algorithm implementations.

Tracking Algorithms

Algorithm Paper Authors
SORT Simple Online and Realtime Tracking Bewley et al., 2016
ByteTrack ByteTrack: Multi-Object Tracking by Associating Every Detection Box Zhang et al., ECCV 2022
OC-SORT Observation-Centric SORT Cao et al., CVPR 2023
StrongSORT StrongSORT: Make DeepSORT Great Again Du et al., TMM 2023
BoT-SORT BoT-SORT: Robust Associations Multi-Pedestrian Tracking Aharon et al., 2022
UCMCTrack UCMCTrack: Multi-Object Tracking with Uniform Camera Motion Compensation Yi et al., AAAI 2024
BoostTrack BoostTrack: Boosting the Similarity Measure and Detection Confidence Stanojevic et al., MVA 2024
HybridSORT Hybrid-SORT: Weak Cues Matter for Online Multi-Object Tracking Yang et al., AAAI 2024

Benchmark Data & Tools

Resource Source Citation
MOT17 Dataset MOTChallenge Milan et al., 2016
YOLOX Detections YOLOX Ge et al., 2021
ReID Embeddings FastReID He et al., 2020

Made with โค๏ธ by the motcpp community

About

A blazing-fast, modern C++ multi-object tracking library featuring SORT, ByteTrack, OC-SORT, BoostTrack, and more built for real-time performance, cross-platform deployment, and MOT benchmarks.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published