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.
The following sections show how to set up the development environment, build and run the included sample applications.
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:
This will copy the samples to the directory $HOME/NVIDIA_VPI-3.1-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.1-samples/assets and can be referred directly.
In order to build the sample applications, these packages must be installed:
On Ubuntu, this can be achieved by executing:
Then, from within a sample directory, execute:
The sample is built into an executable in the same directory.
Once built, execute each sample application as described by its documentation.
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.
The provided sample applications, along with instructions on how to run them, are as follows.