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.
 
 
 
 
 
 
mht 8a209ad4f1 Intial commit 2 weeks ago
.idea Intial commit 2 weeks ago
bin Intial commit 2 weeks ago
build Intial commit 2 weeks ago
cimp Intial commit 2 weeks ago
cmake-build-debug Intial commit 2 weeks ago
exported_weights Intial commit 2 weeks ago
ltr Intial commit 2 weeks ago
pytracking Intial commit 2 weeks ago
vcpkg@8f54ef5453 Intial commit 2 weeks ago
CMakeLists.txt Intial commit 2 weeks ago
README.md Intial commit 2 weeks ago
bb_regressor_stats.txt Intial commit 2 weeks ago
build.sh Intial commit 2 weeks ago
classifier_stats.txt Intial commit 2 weeks ago
demo.py Intial commit 2 weeks ago
run_demo.sh Intial commit 2 weeks ago
vcpkg-toolchain.cmake Intial commit 2 weeks ago
vcpkg.json Intial commit 2 weeks 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:

  1. BBRegressor: Implements the IoU (Intersection over Union) network for bounding box regression
  2. Classifier: Implements the feature extraction for target classification

Requirements

  • CMake (3.18 or higher)
  • C++17 compatible compiler
  • LibTorch (PyTorch C++ API)
  • CUDA (optional, for GPU acceleration)

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:

  1. Check for CUDA availability
  2. Download LibTorch if not already installed
  3. Configure the project with CMake
  4. Build the project
  5. 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:

# Set the library path to include LibTorch
LD_LIBRARY_PATH=$HOME/libtorch/lib:$LD_LIBRARY_PATH ./bin/tracking_demo

Or use the provided script:

./run_demo.sh

Project Structure

  • cimp/: Main C++ implementation
    • bb_regressor/: Bounding box regressor implementation
    • classifier/: Feature extractor implementation
    • demo.cpp: Demo application
  • exported_weights/: Directory containing exported PyTorch weights
    • backbone/: Backbone network weights
    • bb_regressor/: Bounding box regressor weights
    • classifier/: Classifier weights
  • ltr/: Reference Python implementation
  • bin/: Built executables

Known Issues

  • The PrRoIPooling implementation requires CUDA, but there's a fallback CPU implementation
  • Some CUDA operations may fail on certain GPU configurations; the code includes fallbacks

Comparing Python and C++ Implementations

To compare the outputs between Python and C++ implementations:

  1. Run the Python implementation to generate reference outputs:
python demo.py
  1. Run the C++ implementation:
./run_demo.sh
  1. Compare the output statistics in the generated files:
    • bb_regressor_stats.txt
    • classifier_stats.txt

License

This project is licensed under the MIT License - see the LICENSE file for details.