TI Deep Learning Library User Guide
TIDL: Input and Output Tensors Format

Introduction

In this section describes below

  • Input and Output Tensor formats TIDL Inference
  • Input and Output File Formats of Test Application and Import tool

Input and Output Tensor formats TIDL Inference

  • The Input and Output Tensor formats of a network for running inference is described by the sTIDL_IOBufDesc_t.
  • This information is generated by import tool during model translation "outputParamsFile"
  • If the network has more than one input, the tensor names in the original network is provided as part of "inDataName"
  • The below image describes properties of one channel in a tensor (Both input and output).
IO_Tensor_channel_1.PNG
TIDL Input Tensor - One 2D Channel
  • If the input has more than one channel then these channels are stacked continuously in the memory.
IO_Tensor_channel_2.PNG
TIDL Input Tensor - 3 Channels
  • The Padded region in the input buffer has to be filled with zero by application. This can be done once by application during buffer allocation during system boot time.

Supported data/Element types for the input Tensor

  • TIDL_UnsignedChar
  • TIDL_SignedChar
  • TIDL_UnsignedShort
  • TIDL_SignedShort

Supported data/Element types for the output Tensor

  • TIDL_UnsignedChar
  • TIDL_SignedChar
  • TIDL_UnsignedShort
  • TIDL_SignedShort
  • TIDL_SinglePrecFloat (Only for softmax and SSD Post Processing Layer)

The element size (8 or 16bit) of all the input tensor shall be same

  • All the Input and output tensor follow the above described buffer format, including the SSD post processing layer. Additionally TIDL_ODLayerHeaderInfo and TIDL_ODLayerObjInfo can be used to access the detected objects.
  • Refer the gParams.postProcType == 2 in tidl_image_postproc.c for more information OD-SSD output

IO File Formats of Test Application and Import tool

  • The TIDL test application accepts BMP file as input creates the input tensor as required by the Library. This test application is used for Import process as well.
  • JPEG and PNG files also supported when running the import tool or PC Host emulations. But only BMP is supported or target (EVM).
  • Output is always stored in RAW format to file along with any post processing requested by user TIDL: Output Post Processing in Test Application
  • If the input is not an image, then array of size NumChannels x inHeight x inWidth x elementSize can be provided as binary file to the test application and import tools (inFileFormat = 1)
    • If the more the one input tensor is used by network, then all the input array are sequentially read from the input binary file.
    • For more than one process of network, all the input tensors can be appended to the file