You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
5 months ago | |
|---|---|---|
| .idea | 5 months ago | |
| bin | 5 months ago | |
| build | 5 months ago | |
| cimp | 5 months ago | |
| cmake-build-debug | 5 months ago | |
| exported_weights | 5 months ago | |
| ltr | 5 months ago | |
| pytracking | 5 months ago | |
| test | 5 months ago | |
| vcpkg@8f54ef5453 | 5 months ago | |
| CMakeLists.txt | 5 months ago | |
| README.md | 5 months ago | |
| bb_regressor_stats.txt | 5 months ago | |
| build.sh | 5 months ago | |
| classifier_stats.txt | 5 months ago | |
| demo.py | 5 months ago | |
| run_demo.sh | 5 months ago | |
| vcpkg-toolchain.cmake | 5 months ago | |
| vcpkg.json | 5 months ago | |
README.md
C++ Tracker Implementation
This project implements a C++ version of the DiMP tracker, focusing on the bounding box regressor and classifier components.
Overview
The project consists of two main components:
- BBRegressor: Implements the IoU (Intersection over Union) network for bounding box regression
- Classifier: Implements the feature extraction for target classification
Requirements
- CMake (3.18 or higher)
- C++17 compatible compiler
- LibTorch (PyTorch C++ API)
- CUDA (required) - This implementation requires CUDA and does not support CPU-only execution
Building the Project
Automatic Build
The easiest way to build the project is to use the provided build script:
chmod +x build.sh
./build.sh
This will:
- Check for CUDA availability (and exit if not found)
- Download LibTorch with CUDA support if not already installed
- Configure the project with CMake
- Build the project
- Install the executable to the
bin/directory
Manual Build
If you prefer to build manually:
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
Running the Demo
To run the demo application:
# Make sure CUDA is properly set up in your environment
./run_demo.sh
The script will check for CUDA availability and set up the necessary environment variables before running the demo.
Project Structure
cimp/: Main C++ implementationbb_regressor/: Bounding box regressor implementationclassifier/: Feature extractor implementationdemo.cpp: Demo application
exported_weights/: Directory containing exported PyTorch weightsbackbone/: Backbone network weightsbb_regressor/: Bounding box regressor weightsclassifier/: Classifier weights
ltr/: Reference Python implementationbin/: Built executables
Implementation Notes
- The PrRoIPooling implementation requires CUDA and has no CPU fallback
- All tensor operations are performed on CUDA devices
- The tracker is optimized for GPU execution only
Comparing Python and C++ Implementations
To compare the outputs between Python and C++ implementations:
- Run the Python implementation to generate reference outputs:
python demo.py
- Run the C++ implementation:
./run_demo.sh
- Compare the output statistics in the generated files:
bb_regressor_stats.txtclassifier_stats.txt
License
This project is licensed under the MIT License - see the LICENSE file for details.