Deep View Validator Installation Guide
This article will describe the process of installing Deep View Validator and its model dependencies to evaluate the performance of vision models for object detection, semantic segmentation, and pose tasks.
It is recommended to set up a python virtual environment before moving forward with the next steps to ensure the same dependencies specified in the project.
Deep View Validator Installation
Upgrade PIP to ensure the latest Python packages are installed.
python -m pip install --upgrade pip
The validator package can be installed using this command.
pip install deepview-validator
Note: Certain models will require certain dependencies, the next sections will include other variations of Deep View-Validator installations which includes the model dependencies specific to the type of model.
Model Dependencies
Certain models will require certain dependencies to run.
1. Deep View RT models have an extension .rtm which require the VAAL library, but the library installation requires specific steps depending on the machine's processor that is used to run validator.
- Deep View RT models that are being validated with x86 architectures will require Debian installations. In the installations, it is not needed to install Visionpack or vaal-samples. Instead, use the following command to install the VAAL library.
apt install vaal-python
One way to check if VAAL is successfully installed is to import the library using the following command.
import deepview.vaal as vaal
- Deep View RT models that are being validated in the EVK (ARM architectures) will require VisionPack or VAAL installations.
For VAAL installations, the VAAL zipped directory needs to be extracted and the VAAL library needs to be preloaded using the following command.
LD_PRELOAD=<path to the libvaal.so>
- Deep View RT models are also ran using the ModelClient library which is part of the Deep View RT library and also requires the Debian package installations. The library can be installed using the following command.
sudo apt install deepview-rt-python
One way to check if ModelClient is installed is to import the library using the following command.
from deepview.rt.modelclient import ModelClient
2. Keras models have an extension .h5 which require the TensorFlow library and can only be ran in machines with x86 architectures. Deep View-Validator can be installed with the dependencies required for these models using the command below.
pip install deepview-validator[keras]
However, the TensorFlow library can be separately pip installed using the terminal with the command.
pip install "tensorflow>=2.8.0,<2.16.0"
Certain TensorFlow/Keras models may require NMS from PyTorch which can be installed using the command below.
pip install torchvision~=0.15.2
3. TensorRT engines have an extension .trt which require TensorRT and PyCuda dependencies.
4. TFLite models have an extension .tflite which require the tflite_runtime or TensorFlow library. Deep View Validator can be installed with the dependencies required for these models using the command below.
pip install deepview-validator[tflite]
However, the libraries can be separately pip installed using the commands below depending on the system.
- Windows, Python 3.8
pip install tflite-runtime>=2.5.0
- Ubuntu 20.04, 22.04
pip install tflite-runtime>=2.13.0
Other dependencies such as TensorFlow is also accepted.
pip install "tensorflow>=2.8.0,<2.16.0"
Furthermore, certain models require PyTorch for its NMS which is installed using the command below.
pip install torchvision~=0.15.2
5. ONNX models have an extension .onnx which require onnxruntime library. Deep View Validator can be installed with the dependencies required for these models using the command below.
pip install deepview-validator[onnx]
However, these libraries can be separately installed via pip by either one of the following commands.
pip install onnxruntime~=1.16.3
pip install onnxruntime-gpu~=1.16.3
Furthermore, certain ONNX models may require NMS from PyTorch or TensorFlow which are installed using the commands below.
pip install torchvision~=0.15.2
pip install "tensorflow>=2.8.0,<2.16.0"
6. Hailo models have an extension .hef which requires the HailoRT library. Deep View Validator can be installed with the dependencies required for these models using the command below.
pip install deepview-validator[hailo]
However, these dependencies can be installed separately using the commands below.
Currently, HailoRT 4.15.0 (no pip installation) requires NumPy 1.23.3.
pip install numpy==1.23.3
7. If the model has no extension, Deep View Validator will search for a keras_metadata.pb or saved_model.pb which is a TensorFlow saved model format. Otherwise, it will assume it is a directory of text files that contains the model prediction annotations in the format described below: cls xc yc width height score
This is the same as the YOLO format annotations except score is at the last index.
Conclusion
This article has shown the steps for installing Deep View Validator and as well as model dependencies required to support running Deep View RT, Keras, TFLite, and ONNX models.
Comments
0 comments
Please sign in to leave a comment.