Install Detection Metrics using Docker

To quickly get started with Detection Metrics, we provide a docker image.

  • Download docker image and run it
      docker run -dit --name detection-metrics -v [local_directory]:/root/volume/ -e DISPLAY=host.docker.internal:0 jderobot/detection-metrics:noetic

This will start the GUI, provide a configuration file (appConfig.yml can be used) and you are ready to go. Check out functionality for more information

Install Detection Metrics from source for developers (only Linux)

To use the latest version of Detection Metrics you need to compile and install it from source.


Common deps

Ubuntu MacOS
sudo apt install build-essential git cmake rapidjson-dev libssl-dev
sudo apt install libboost-dev libboost-filesystem-dev libboost-system-dev libboost-program-options-dev python-dev python-numpy
sudo easy_install numpy
brew install cmake boost rapidjson
Ubuntu MacOS
sudo apt install libgoogle-glog-dev libyaml-cpp-dev qt5-default libqt5svg5-dev
sudo apt-get install libjpeg8-dev libtiff5-dev libjasper-dev libpng12-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
brew install glog yaml-cpp qt
Also, just add qt in your PATH by running:
echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile


Install only the inferencers that you need.

  • OpenCV 4.2 (with CUDA GPU support) including Darknet

If you don’t need GPU support (only applicable for Darknet YOLO with OpenCV), just ignore cmake options related with CUDA and GPU.

Ubuntu MacOS
cd ~
wget -O
wget -O
unzip <br> unzip
mv opencv-4.2.0 opencv
mv opencv_contrib-4.2.0 opencv_contrib
brew install opencv
cd ~/opencv
mkdir build
cd build
You must change CUDA_ARCH_BIN version to yours GPU architecture version.
make -j8  
sudo make install  

Reference: How to use OpenCV DNN module with Nvdia GPUs, CUDA and CUDNN

  • Tensorflow

To use Tensorflow and/or Keras, you would need to install them.

To install Tensorflow:

    pip install tensorflow


    pip install tensorflow-gpu
  • Keras

To install Keras:

    pip install keras
  • PyTorch

To install PyTorch:

    pip install torch

Optional Dependencies

CUDA (For GPU support)

    NVIDIA_GPGKEY_SUM=d1be581509378368edeec8c1eb2958702feedf3bc3d17011adbf24efacce4ab5 && \

    NVIDIA_GPGKEY_FPR=ae09fe4bbd223a84b2ccfce3f60f4b3d7fa2af80 && \
        sudo apt-key adv --fetch-keys && \
        sudo apt-key adv --export --no-emit-version -a $NVIDIA_GPGKEY_FPR | tail -n +5 > && \
        echo "$NVIDIA_GPGKEY_SUM" | sha256sum -c --strict - && rm && \

    sudo sh -c 'echo "deb /" > /etc/apt/sources.list.d/cuda.list' && \
    sudo sh -c 'echo "deb /" > /etc/apt/sources.list.d/nvidia-ml.list'

Update and install

    sudo apt-get update
    sudo apt-get install -y cuda

Below is a list of more optional dependencies you may require depending on your usage.

  • Camera Streaming Support

    Detection Metrics can currently read ROS and ICE Camera Streams. So, to enable Streaming support, install any one of them.

Note: Be Sure to checkout functionality for tutorials on how to use the above mentioned functionalities and frameworks.

How to compile Detection Metrics:

Once you have all the required dependencies installed just run:

    git clone
    cd DetectionMetrics/DetectionMetrics
    mkdir build && cd build
    cmake ..

Note: GPU support is enabled by default

    make -j4

Once it is built, you will find various executables in different folders ready to be executed :smile:.

Starting with Detection Metrics

The best way to start is with our beginner’s tutorial for Detection Metrics.

If you have any issue feel free to drop a mail or create an issue for the same.