Installing KPCV
After obtaining the KPCV software package, install it as the root user and then run the source command to make the KPCV environment variables take effect.
Installing the KPCV Software Package
- Obtain the KPCV software package based on Obtaining the Software Package and decompress it to obtain the binary RPM package.
- Install the KPCV RPM package.
1rpm -ivh boostkit-kp_cv-xxxx-1.aarch64.rpm
In the preceding command, xxxx indicates the KPCV version.
After the installation, check whether header files and dynamic libraries exist in the /usr/local/include/KPCV and /usr/local/lib/KPCV directories.
- Run the following command to validate environment variables:
1source /etc/profile
- To achieve the optimal performance of the CV image operator, you need to configure an environment variable after installing the RPM package.
If hyper-threading is disabled, run export OMP_PROC_BIND=close to set the environment variable. If hyper-threading is enabled, you do not need to set the environment variable.
- If the system displays a message indicating that the header files cannot be found after the RPM package is installed, run the following commands to check whether the KPCV paths added to /etc/profile takes effect:
1 2
echo $C_INCLUDE_PATH echo $CPLUS_INCLUDE_PATH
If the paths have not taken effect, perform the following operation:
- Run the following command on the current terminal to validate the environment variables:
1source /etc/profile
- Validate the environment variables for each newly created terminal.
1echo "source /etc/profile" >> ~/.bashrc
- Run the following command on the current terminal to validate the environment variables:
Using the CV Image Operator
The CV image operator relies on OpenCV. Before using this operator, compile OpenCV first. For details, see OpenCV Installation.
Using the KP_LITHO_IMG Operator
Before using KP_LITHO_IMG, configure related header files, dynamic libraries, and KML dependency libraries, and add corresponding options during compilation. For details, see Usage Description.
Using the PyTorch Image Operator
Before calling PyTorch image operator interfaces, configure the PyTorch and TorchVision environments and apply the required patch file. For details, see Installation and Usage Description.