Introduction
This example shows how to write an OpenVx application which runs pre-processing, post-processing nodes on ARM core and runs TIDL node on C7x DSP for Object Detection. The demo is validated on the yolo_8200_416 network. The trained network is imported using the TIDL import tool, and raw NV12 input files of resolution 1024×512 are read from SD card or USB 3.0 type-C pen drive or PCIe memory. The input files are scaled using the VPAC multi-scaler MSC to produce a DL resolution of 416x416 as required by the network. As a pre-processing step, the scaled NV12 resolution is converted to RGB format and padded as required, which runs on the ARM core. The pre-processed input is then given to TIDL running on the C7x DSP for inference. As a post-processing step, the TIDL output is read and top detections are rendered as 2D boxes on the provided image, which also runs on the ARM core. The final output is blended with system performance statistics and displayed on a 1920×1080 screen.
Supported plaforms
Platform | Linux x86_64 | Linux+RTOS mode | QNX+RTOS mode | SoC |
Support | YES | YES | YES | J721e / J721S2 / J784S4 / J742S2 / J722S |
Data flow
Steps to run the application on J7 EVM
- Build the application and related libraries as mentioned in Build Instructions for Linux+RTOS mode
- A sample "app_od.cfg" for Object detection is provided under "/opt/vision_apps/" on the rootfs partition.
- Create a folder and keep all the .yuv files used for detection, there are a few images under "/opt/vision_apps/test_data/psdkra/tidl_demo_images".
- In case a different network is choosen, update the dl_size accordingly for network input resolution.
- Run the app as shown below
Steps to run the application on PC Linux x86_64
- Build the application and related libraries as mentioned in Build Instructions for PC emulation mode
- A sample "app_od.cfg" for Object detection is provided under "${PSDKR_PATH}/vision_apps/apps/dl_demos/app_tidl_od/config" folder.
- Create a folder and keep all the .yuv files used for detection, there are a few images under "/opt/vision_apps/test_data/psdkra/tidl_demo_images".
- In case a different network is chosen, update the dl_size accordingly for network input resolution.
- Create an output directory
- Run the app as shown below
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(PSDK_RTOS_PATH)/edgeai/HOST/usr/lib/
./vx_app_tidl_od --cfg ${PSDKR_PATH}/vision_apps/apps/dl_demos/app_tidl_od/config/app_od.cfg
- The output will be written in "app_tidl_od_out" folder in .yuv (NV12) format.
Sample Output
Shown below is a example input and its corresponding output