VPI - Vision Programming Interface

3.0 Release

Sample Applications

The provided samples applications show how use some of VPI's functionalities. These are complete programs in both C++ and Python that serve as starting point to build more complex image processing pipelines.

Most of them accept one or more arguments specifying the backend to be used, and the images to be processed. The result is saved back to disk into the same directory.

Instructions

The following sections show how to set up the development environment, build and run the included sample applications.

Environment Setup

Sample applications are installed in /opt/nvidia/vpi3/samples. For convenience, VPI includes a simple script that will copy the samples to a directory you have write access.

To copy the samples to your home directory, enter the following command on a terminal:

vpi3_install_samples.sh $HOME

This will copy the samples to the directory $HOME/NVIDIA_VPI-3.0-samples.

VPI also comes with some example images and videos that can be used as input to some of the sample applications. They are copied to $HOME/NVIDIA_VPI-3.0-samples/assets and can be referred directly.

C++ Samples

In order to build the sample applications, these packages must be installed:

  • cmake >= 3.8
  • g++ or clang (tested with g++-7 and clang-7)
  • OpenCV >= 3.2

On Ubuntu, this can be achieved by executing:

sudo apt-get install g++ cmake libopencv-dev

Then, from within a sample directory, execute:

cmake .
make

The sample is built into an executable in the same directory.

Once built, execute each sample application as described by its documentation.

Python Samples

All included Python scripts have the same functionality as their C++ counterparts. They are designed to work with both Python 3.8 and/or 3.9, depending on the Ubuntu distribution being used.

Ubuntu Version VPI Bindings' Python Version
18.04 3.8
20.04 3.8 and 3.9

Prior running the samples, the following python dependencies must be installed:

Once everything is installed, the sample can be run by invoking the python interpreter, passing as parameters the sample script and the other parameters needed. Consult the samples' documentation for further instructions.

Sample List

The provided sample applications, along with instructions on how to run them, are as follows.

  1. Convolve 2D
  2. Stereo Disparity
  3. Harris Corners Detector
  4. Rescale
  5. KLT Bounding Box Tracker
  6. Benchmarking
  7. FFT
  8. Cross-Compilation Targeting aarch64
  9. Temporal Noise Reduction
  10. Perspective Warp
  11. Fisheye Distortion Correction
  12. Pyramidal LK Optical Flow
  13. Dense Optical Flow
  14. Background Subtractor
  15. Image View
  16. PyTorch/CUDA interoperability
  17. Template Matching
  18. ORB feature detector