Vision Apps User Guide
Semantic Segmentation Application

Introduction

This example shows how to write an OpenVx application which runs pre-processing, post-processing nodes on C66x DSP and runs TIDL node on C7x DSP for Semantic Segmentation. The demo is validated on tiadsegNet_v2 network. The trained network is imported using TIDL import tool and raw NV12 input files of resolution 1024x512 is read from SD card or USB 3.0 typec-pen-drive or PCIe memory. The input files are scaled using VPAC multi-scaler MSC to produce a DL resolution of 768x384 as required by the network. As a pre-processing step, the scaled NV12 resolution is converted to RGB format and padded as required on C66x_1 DSP. The pre-processed input is given to TIDL running on C7x DSP for inference. As a post-processing step, the TIDL output is read and each pixel is blended with a color map on the provided image on C66x_2 DSP. The final output is blended with system performance statistics and displayed on a 1920x1080 screen.

Supported plaforms

Platform Linux x86_64 Linux+RTOS mode QNX+RTOS mode SoC
Support YES YES YES J721e

Data flow

app_tidl_seg_data_flow.jpg

Steps to run the application on J721e EVM

  1. Build the application and related libraries as mentioned in Build Instructions for Linux+TI-RTOS mode
  2. A sample "app_seg.cfg" for Semantic Segmentation is provided under "/opt/vision_apps/" on the rootfs partition.
  3. 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".
  4. In case a different network is chosen, update the dl_size accordingly for network input resolution.
  5. Run the app as shown below
    ./run_app_tidl_seg.sh

Steps to run the application on PC Linux x86_64

  1. Build the application and related libraries as mentioned in Build Instructions for PC emulation mode
  2. A sample "app_seg.cfg" for Semantic Segmentation is provided under "${PSDKR_PATH}/vision_apps/apps/dl_demos/app_tidl_seg/config" folder.
  3. 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".
  4. In case a different network is chosen, update the dl_size accordingly for network input resolution.
  5. Create an output directory
    mkdir app_tidl_seg_out
  6. Run the app as shown below
    ./vx_app_tidl_seg --cfg ${PSDKR_PATH}/vision_apps/apps/dl_demos/app_tidl_seg/config/app_seg.cfg
  7. The output will be written in "app_tidl_seg_out" folder in .yuv (NV12) format.

Sample Output

Shown below is a example input and its corresponding output

app_tidl_seg_demo.png