This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: Does SDK 7.1 support Yolov3 ?

Part Number: TDA4VM

Hi Sir/Madam,

I am using TDA4VM EVM and SDK 7.1 .
Does SDK 7.1 support Yolov3?

Can "Object Detection Application" use Yolov3 ?
Can "Camera based Image Classification Application" use Yolov3?
If the application can use Yolov3.
Could you give me the setup steps?

If SDK 7.1 support Yolov3.
Is there any limit?
How about inference accuracy?

Best regards

-Jason

  • Hi Kumar,

    Thank you about your reply.
    I tried to use Yolov3.
    But the screen hang when "Object Detection Application" use Yolov3 model.
    Could you give me suggestion?

    Following are my test steps.


    Step 1 :
    download yolov3 model from github.com/.../yolov3-10.onnx

    Step 2 :
    convert yolov3-10.onnx to bin files.

    jason@:~/ti_tda4x_7_01/ti-processor-sdk-rtos-j721e-evm-07_01_00_11/tidl_j7_01_03_00_11/ti_dl/utils/tidlModelImport$ ./out/tidl_model_import.out ~/ti_tda4x_7_01/ti-processor-sdk-rtos-j721e-evm-07_01_00_11/tidl_j7_01_03_00_11/ti_dl/test/testvecs/config/import/public/onnx/tidl_import_yolo3.txt

    Step 3:
    upload tidl_io_yolo3_1.bin tidl_net_yolo3.bin to TDA4VM EVM

    from
    PC : /home/jason/ti_tda4x_7_01/ti-processor-sdk-rtos-j721e-evm-07_01_00_11/tidl_j7_01_03_00_11/ti_dl/test/testvecs/config/tidl_models/onnx/
    to
    TDA4VM EVM : /opt/vision_apps/test_data/psdkra/tidl_models

    Step 4:
    modify configuration file to following

    root@j7-evm:/opt/vision_apps# cat app_od_yolo.cfg
    # location of conifg
    #tidl_config /opt/vision_apps/test_data/psdkra/tidl_models/tidl_io_peele_300_1.bin
    tidl_config /opt/vision_apps/test_data/psdkra/tidl_models/tidl_io_yolo3_1.bin

    # location of network
    #tidl_network /opt/vision_apps/test_data/psdkra/tidl_models/tidl_net_peele_300.bin
    tidl_network /opt/vision_apps/test_data/psdkra/tidl_models/tidl_net_yolo3.bin

    # location of input files
    input_file_path /opt/vision_apps/test_data/psdkra/tidl_demo_images


    # location of output files
    output_file_path ./app_tidl_od_out

    # start frame Number
    start_frame 500


    # number of frames
    num_frames 400


    # input size (width height)
    in_size 1024 512


    # size given to DL network (width height)
    # This should should not be less than 4x of input width or height
    dl_size 1024 512

    # size given for display (width height)
    # This should should not be less than 4x of input width or height
    out_size 1024 512

    # vizualization threshold
    viz_th 0.95

    # Maximum number of Object Detection classes
    num_classes 90

    # delay in milli seconds (max 2000ms)
    delay_in_msecs 0

    # Enable or disable output image writing. 1 Enables it , 0 disables it
    en_out_img_write 0

    # If 1 - Enable display 0 - Disable display
    display_option 1

    # number of iterations to loop the inputs
    num_iterations 1

    # interactive input mode 1: yes, 0: no
    is_interactive 1
    root@j7-evm:/opt/vision_apps#

    Step 5:
    run application

    root@j7-evm:/opt/vision_apps# source ./vision_apps_init.sh
    root@j7-evm:/opt/vision_apps# ./vx_app_tidl_od.out --cfg app_od_yolo.cfg
    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=4) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
    APP: Init ... Done !!!
    5001.937688 s: VX_ZONE_INIT:Enabled
    5001.937713 s: VX_ZONE_ERROR:Enabled
    5001.937737 s: VX_ZONE_WARNING:Enabled
    5001.938442 s: VX_ZONE_INIT:[tivxInit:71] Initialization Done !!!
    5001.938619 s: VX_ZONE_INIT:[tivxHostInit:48] Initialization Done for HOST !!!
    Computing checksum at 0x0000FFFFA80B0DC0, size = 849584
    [C7x_1 ] 5003.729802 s: VX_ZONE_WARNING:[tivxKernelTIDLCreate:614] All Interrupts DISABLED during TIDL process


    =========================
    TIDL Demo - Object Detection
    =========================

    p: Print performance statistics

    x: Exit

    Enter Choice:


    Best regards

    -Jason

  • Hi Kumar,

    My last mail descript the error when use Yolov3 model.
    Can you duplicate the problem?
    Is there any update about the problem?

    Best regards

    -Jason

  • Hi Kumar,

    Following are my test steps and result.

    <<change cmd_list.txt to>>
    1 testvecs/config/infer/public/onnx/tidl_infer_yolo3.txt
    0

    <<run application>>
    root@j7-evm:/opt/tidl_test# ./TI_DEVICE_a72_test_dl_algo_host_rt.out
    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=4) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
    APP: Init ... Done !!!
    2434.143078 s: VX_ZONE_INIT:Enabled
    2434.143169 s: VX_ZONE_ERROR:Enabled
    2434.143235 s: VX_ZONE_WARNING:Enabled
    2434.143721 s: VX_ZONE_INIT:[tivxInit:71] Initialization Done !!!
    2434.143920 s: VX_ZONE_INIT:[tivxHostInit:48] Initialization Done for HOST !!!

    Processing config file #0 : testvecs/config/infer/public/onnx/tidl_infer_yolo3.txt
    ----------------------- TIDL Process with TARGET DATA FLOW ------------------------
    # 0 . .. TSC Mega Cycles = 31.29 ... .... .....root@j7-evm:/opt/tidl_test#

    <<output>>
    root@j7-evm:/opt/tidl_test/testvecs/output# ls
    airshow_j11.bin
    tidl_yolo3_od.bin
    tidl_yolo3_od.bin_ti_lindau_000020.bmp_000000.txt
    tidl_yolo3_od.bin_ti_lindau_000020.bmp_000000_tidl_post_proc2.bmp

    Following is tidl_yolo3_od.bin_ti_lindau_000020.bmp_000000_tidl_post_proc2.bmp

    The final picture look good.

    But the "Object Detection Application"  fail when use Yolov3.

    The test steps of "Object Detection Application"  are at 2020/12/21 mail.

    Could you give me suggestion about the problem?

    Best regards

    -Jason

  • Hi Kumar,

    "Object Detection Application" have error when use Yolov3.
    Is there any update about the problem?

    Best regards

    -Jason

  • Hi Kumar,

    "Object Detection Application" have error when use Yolov3.
    Can you duplicate the problem?
    Could you give me update about the problem?

    Best regards

    -Jason

  • Hi Jason,
        Sorry for delay in responding this thread. We have made some fixes for YoloV3 network. Can you try it again on latest SDK release and let us know if your issue still exists? You can download the latest SDK release from following link : 

    https://www.ti.com/tool/download/PROCESSOR-SDK-RTOS-J721E/07.03.00.07


    Regards,
    Anshu

  • Hi Anshu,

    Thank you about your information.

    I tried the SDK 7.03.
    But the "object detection application" run fail when I use yolov3.
    The screen is freeze. The image frame don't normal display on the screen.
    Could you give me the suggestion?
    Do you run OK about the "object detection application" when use yolov3?

    Following are my test steps.
    Step1 :
    Download yolov3 model from github.com/.../yolov3-10.onnx

    Step2 :
    I use tidl_model_import.out.
    Convert yolov3-10.onnx to bin files(tidl_io_yolo3_1.bin, tidl_net_yolo3.bin).
    .

    Step3 :
    upload (tidl_io_yolo3_1.bin, tidl_net_yolo3.bin) to TDA4VM EVM

    Step4 :
    The SSD replace with Yolov3.
    To create app_od_yolo.cfg, run_app_tidl_od_yolo.sh

    root@j7-evm:/opt/vision_apps# cat run_app_tidl_od_yolo.sh                       
    /opt/vision_apps/vx_app_tidl_od.out --cfg app_od_yolo.cfg

    root@j7-evm:/opt/vision_apps# cat app_od_yolo.cfg                               
    # location of conifg                                                            
    tidl_config   /opt/vision_apps/test_data/psdkra/tidl_models/tidl_io_yolo3_1.bin
    # location of network                                                           
    tidl_network  /opt/vision_apps/test_data/psdkra/tidl_models/tidl_net_yolo3.bin  
                                                                                    
    # location of input files                                                       
    input_file_path   /opt/vision_apps/test_data/psdkra/tidl_demo_images            
                                                                                    
    # location of output files                                                      
    output_file_path ./app_tidl_od_out                                              
                                                                                    
    # start frame Number                                                            
    start_frame 500                                                                 
                                                                                    
    # number of frames                                                              
    num_frames  400                                                                 
                                                                                    
    # input size (width height)                                                     
    in_size   1024 512                                                              
                                                                                    
    # size given to DL network (width height)                                       
    # This should should not be less than 4x of input width or height               
    dl_size   1024 512                                                              
                                                                                    
    # size given for display (width height)                                         
    # This should should not be less than 4x of input width or height               
    out_size  1024 512                                                              
                                                                                    
    # vizualization threshold                                                       
    viz_th    0.95                                                                  
                                                                                    
    # Maximum number of Object Detection classes                                    
    num_classes 90                                                                  
                                                                                    
    # delay in milli seconds (max 2000ms)                                           
    delay_in_msecs 0                                                                
                                                                                    
    # Enable or disable output image writing. 1 Enables it , 0 disables it          
    en_out_img_write    0                                                           
                                                                                    
    # If 1 - Enable display 0 - Disable display                                     
    display_option      1                                                           
                                                                                    
    # number of iterations to loop the inputs                                       
    num_iterations      1                                                           
                                                                                    
    # interactive input mode 1: yes, 0: no                                          
    is_interactive      1

    Step5 :
    run application

    root@j7-evm:/opt/vision_apps# source ./vision_apps_init.sh
    root@j7-evm:/opt/vision_apps# ./run_app_tidl_od_yolo.sh                         
    APP: Init ... !!!                                                               
    MEM: Init ... !!!                                                               
    MEM: Initialized DMA HEAP (fd=4) !!!                                            
    MEM: Init ... Done !!!                                                          
    IPC: Init ... !!!                                                               
    IPC: Init ... Done !!!                                                          
    REMOTE_SERVICE: Init ... !!!                                                    
    REMOTE_SERVICE: Init ... Done !!!                                               
        71.426773 s: GTC Frequency = 200 MHz                                        
    APP: Init ... Done !!!                                                          
        71.428692 s:  VX_ZONE_INIT:Enabled                                          
        71.428713 s:  VX_ZONE_ERROR:Enabled                                         
        71.428718 s:  VX_ZONE_WARNING:Enabled                                       
        71.430975 s:  VX_ZONE_INIT:[tivxInit:71] Initialization Done !!!            
        71.431212 s:  VX_ZONE_INIT:[tivxHostInit:48] Initialization Done for HOST !!
    Computing checksum at 0x0000FFFFA9890DC0, size = 849584                         
    [C7x_1 ]     73.135026 s:  VX_ZONE_WARNING:[tivxKernelTIDLCreate:615] All Inters
                                                                                    
                                                                                    
     =========================                                                      
     TIDL Demo - Object Detection                                                   
     =========================                                                      
                                                                                    
     p: Print performance statistics                                                
                                                                                    
     x: Exit                                                                        
                                                                                    
     Enter Choice:

    Step6 :
    Test result : The screen is freeze. The image frame don't normal display on the screen.


    Best regards

    -Jason


  • Hi Jason,

        Before running the application via SDK demo, can you confirm if you are able to run the model with TIDL standalone test bench ( first in PC emulation mode and then with EVM). You can refer the following steps for this : 

    https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/latest/exports/docs/tidl_j7_02_00_00_07/ti_dl/docs/user_guide_html/md_tidl_sample_test.html

       I just want to confirm whether the model import is correct before we test with SDK demo's. I am also attaching the import config files which we have used for YoloV3 network as part of our internal testing ( these are available as part of the SDK also).

    modelType          = 2
    numParamBits       = 8
    numFeatureBits     = 8
    quantizationStyle  = 3
    #quantizationStyle  = 2
    inputNetFile       = "../../test/testvecs/models/public/onnx/yolov3-10.onnx"
    outputNetFile      = "../../test/testvecs/config/tidl_models/onnx/tidl_net_yolo3.bin"
    outputParamsFile   = "../../test/testvecs/config/tidl_models/onnx/tidl_io_yolo3_"
    inDataNorm  = 1
    inMean = 0 0 0
    inScale = 0.003921568627 0.003921568627 0.003921568627
    inDataFormat = 1
    inWidth  = 416
    inHeight = 416 
    inNumChannels = 3
    numFrames = 1
    inData  =   "../../test/testvecs/config/detection_list.txt"
    perfSimConfig = ../../test/testvecs/config/import/device_config.cfg
    inElementType = 0
    #outDataNamesList = "convolution_output,convolution_output1,convolution_output2"
    metaArchType = 4
    metaLayersNamesList =  "../../test/testvecs/config/import/public/onnx/tidl_import_yolo3_metaarch.prototxt"
    postProcType = 2
    
    
    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/tidl_5F00_import_5F00_yolo3_5F00_metaarch.prototxt


    Regards,

    Anshu

  • Hi Anshu,

    Following are my test steps and result.
    <<change /opt/tidl_test/testvecs/config/config_list.txt to>>
    1 testvecs/config/infer/public/onnx/tidl_infer_yolo3.txt
    0

    <<copy bin files>>

    Copy tidl_io_yolo3_1.bin, tidl_net_yolo3.bin to /opt/tidl_test/testvecs/config/tidl_models/onnx directory


    <<run applicatin>>
    root@j7-evm:/opt/tidl_test# ./TI_DEVICE_a72_test_dl_algo_host_rt.out            
    APP: Init ... !!!                                                               
    MEM: Init ... !!!                                                               
    MEM: Initialized DMA HEAP (fd=4) !!!                                            
    MEM: Init ... Done !!!                                                          
    IPC: Init ... !!!                                                               
    IPC: Init ... Done !!!                                                          
    REMOTE_SERVICE: Init ... !!!                                                    
    REMOTE_SERVICE: Init ... Done !!!                                               
       303.516086 s: GTC Frequency = 200 MHz                                        
    APP: Init ... Done !!!                                                          
       303.519276 s:  VX_ZONE_INIT:Enabled                                          
       303.519292 s:  VX_ZONE_ERROR:Enabled                                         
       303.519297 s:  VX_ZONE_WARNING:Enabled                                       
       303.522963 s:  VX_ZONE_INIT:[tivxInit:71] Initialization Done !!!            
       303.523121 s:  VX_ZONE_INIT:[tivxHostInit:48] Initialization Done for HOST !!
                                                                                    
    Processing config file #0 : testvecs/config/infer/public/onnx/tidl_infer_yolo3.
     ----------------------- TIDL Process with TARGET DATA FLOW --------------------
                                                                                    
    #    0 . .. TSC Mega Cycles =    29.57  DDR_READ_WRITE_TOTAL_MB =     3.70,

    <<output>>
    root@j7-evm:/opt/tidl_test# ls testvecs/output/                                 
    tidl_yolo3_od.bin                                                               
    tidl_yolo3_od.bin_ti_lindau_000020.bmp_000000.txt                               
    tidl_yolo3_od.bin_ti_lindau_000020.bmp_000000_tidl_post_proc2.bmp

    Following is tidl_yolo3_od.bin_ti_lindau_000020.bmp_000000_tidl_post_proc2.bmp

    The picture look good.


    But the "Object Detection Application"  fail when use Yolov3.
    Could you give me suggestion about the problem?

    Best regards

    -Jason

  • Hi Jason,

    Do you know what is the dl resolution of the Yolov3 network and can you try updating the config file with the same value and run the demo again? Currently set as below,

    # size given to DL network (width height)                                       
    # This should should not be less than 4x of input width or height               
    dl_size   1024 512 

    Also if can provide screenshot when it hangs.

    Regards,
    Shyam

  • Hi Shyam,

    I follow your suggestion to change dl_size.
    I also refer stackoverflow.com/.../yolov3-resolution-and-execution-time-per-image-inference.
    It said Yolov3 that have three type resolution.
    I did follow tests.

    <<case 1>>
    dl_size 416 416

    This case work.

    <<case 2>>
    dl_size 608 608

    This case NO work.
    Following are log messages


    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=4) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
       812.037546 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
       812.039674 s:  VX_ZONE_INIT:Enabled
       812.039704 s:  VX_ZONE_ERROR:Enabled
       812.039710 s:  VX_ZONE_WARNING:Enabled
       812.042085 s:  VX_ZONE_INIT:[tivxInit:71] Initialization Done !!!
       812.042285 s:  VX_ZONE_INIT:[tivxHostInit:48] Initialization Done for HOST !!
    Computing checksum at 0x0000FFFFB3E40DC0, size = 849584
       813.452055 s:  VX_ZONE_ERROR:[tivxAddKernelVpacMscScaleValidate:618] 'out_imt
       813.452101 s:  VX_ZONE_ERROR:[ownGraphNodeKernelValidate:531] node kernel va0
       813.452108 s:  VX_ZONE_ERROR:[vxVerifyGraph:1930] Node kernel Validate failed
       813.452113 s:  VX_ZONE_ERROR:[vxVerifyGraph:2098] Graph verify failed
    MSC: Node send command failed!
       813.962093 s:  VX_ZONE_INIT:[tivxHostDeInit:56] De-Initialization Done for H!
       813.966421 s:  VX_ZONE_INIT:[tivxDeInit:111] De-Initialization Done !!!
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    MEM: Alloc's: 14 alloc's of 67599960 bytes
    MEM: Free's : 14 free's  of 67599960 bytes
    MEM: Open's : 0 allocs  of 0 bytes
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!



    If Yolov3 network resolution use 608x608.
    It will have more accurate.
    Do you have any suggestion about resolution 608x608 error?

    Best regards

    -Jason

  • Hi Shyam,

    I used the "Camera based Object Detection Application" to test Yolov3.
    The dl_size use 416x416.
    The cameras use IMX390.

    It will have distortion problem when LDC function enable.
    I modified the main.c of "Camera based Object Detection Application".
    In order to disable the LDC function of main.c.
    I attach my main.c in the mail.

    I also attach my configuration file in the mail.

    The FPS of "Camera based Object Detection Application" is not good when use Yolov3.
    The FPS is 31.94 when use one camera.
    The FPS is 18.13 when use 2 cameras at the same time.
    The FPS is 12.43 when use 3 cameras at the same time.
    The FPS is 7.68  when use 4 cameras at the same time.

    Could you give me suggestion about low FPS problem?

    Thank you very much.

    Best regards

    -Jason

    app_od_cam_yolo.cfg

    /*
     *
     * Copyright (c) 2020 Texas Instruments Incorporated
     *
     * All rights reserved not granted herein.
     *
     * Limited License.
     *
     * Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
     * license under copyrights and patents it now or hereafter owns or controls to make,
     * have made, use, import, offer to sell and sell ("Utilize") this software subject to the
     * terms herein.  With respect to the foregoing patent license, such license is granted
     * solely to the extent that any such patent is necessary to Utilize the software alone.
     * The patent license shall not apply to any combinations which include this software,
     * other than combinations with devices manufactured by or for TI ("TI Devices").
     * No hardware patent is licensed hereunder.
     *
     * Redistributions must preserve existing copyright notices and reproduce this license
     * (including the above copyright notice and the disclaimer and (if applicable) source
     * code license limitations below) in the documentation and/or other materials provided
     * with the distribution
     *
     * Redistribution and use in binary form, without modification, are permitted provided
     * that the following conditions are met:
     *
     * *       No reverse engineering, decompilation, or disassembly of this software is
     * permitted with respect to any software provided in binary form.
     *
     * *       any redistribution and use are licensed by TI for use only with TI Devices.
     *
     * *       Nothing shall obligate TI to provide you with source code for the software
     * licensed and provided to you in object code.
     *
     * If software source code is provided to you, modification and redistribution of the
     * source code are permitted provided that the following conditions are met:
     *
     * *       any redistribution and use of the source code, including any resulting derivative
     * works, are licensed by TI for use only with TI Devices.
     *
     * *       any redistribution and use of any object code compiled from the source code
     * and any resulting derivative works, are licensed by TI for use only with TI Devices.
     *
     * Neither the name of Texas Instruments Incorporated nor the names of its suppliers
     *
     * may be used to endorse or promote products derived from this software without
     * specific prior written permission.
     *
     * DISCLAIMER.
     *
     * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
     * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     * IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
     * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
     * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
     * OF THE POSSIBILITY OF SUCH DAMAGE.
     *
     */
    
    #include <utils/draw2d/include/draw2d.h>
    #include <utils/perf_stats/include/app_perf_stats.h>
    #include <utils/console_io/include/app_get.h>
    #include <utils/grpx/include/app_grpx.h>
    #include <VX/vx_khr_pipelining.h>
    
    #include "app_common.h"
    #include "app_sensor_module.h"
    #include "app_capture_module.h"
    #include "app_viss_module.h"
    #include "app_aewb_module.h"
    #include "app_ldc_module.h"
    #include "app_scaler_module.h"
    #include "app_pre_proc_module.h"
    #include "app_tidl_module.h"
    #include "app_draw_detections_module.h"
    #include "app_img_mosaic_module.h"
    #include "app_display_module.h"
    
    #define APP_BUFFER_Q_DEPTH   (4)
    #define APP_PIPELINE_DEPTH   (7)
    
    typedef struct {
    
        SensorObj         sensorObj;
        CaptureObj        captureObj;
        VISSObj           vissObj;
        AEWBObj           aewbObj;
        LDCObj            ldcObj;
        ScalerObj         scalerObj;
        PreProcObj        preProcObj;
        TIDLObj           tidlObj;
        DrawDetectionsObj drawDetectionsObj;
        ImgMosaicObj      imgMosaicObj;
        DisplayObj        displayObj;
    
        vx_char input_file_path[APP_MAX_FILE_PATH];
        vx_char output_file_path[APP_MAX_FILE_PATH];
    
        /* OpenVX references */
        vx_context context;
        vx_graph   graph;
    
        vx_uint32 is_interactive;
    
        vx_uint32 num_frames_to_run;
    
        vx_uint32 num_frames_to_write;
        vx_uint32 num_frames_to_skip;
    
        tivx_task task;
        vx_uint32 stop_task;
        vx_uint32 stop_task_done;
    
        app_perf_point_t total_perf;
        app_perf_point_t fileio_perf;
        app_perf_point_t draw_perf;
    
        int32_t pipeline;
    
        int32_t enqueueCnt;
        int32_t dequeueCnt;
    
        int32_t write_file;
    
    } AppObj;
    
    AppObj gAppObj;
    
    static void app_parse_cmd_line_args(AppObj *obj, vx_int32 argc, vx_char *argv[]);
    static vx_status app_init(AppObj *obj);
    static void app_deinit(AppObj *obj);
    static vx_status app_create_graph(AppObj *obj);
    static vx_status app_verify_graph(AppObj *obj);
    static vx_status app_run_graph(AppObj *obj);
    static vx_status app_run_graph_interactive(AppObj *obj);
    static void app_delete_graph(AppObj *obj);
    static void app_default_param_set(AppObj *obj);
    static void app_update_param_set(AppObj *obj);
    static void add_graph_parameter_by_node_index(vx_graph graph, vx_node node, vx_uint32 node_parameter_index);
    static void app_pipeline_params_defaults(AppObj *obj);
    #ifndef x86_64
    static void app_draw_graphics(Draw2D_Handle *handle, Draw2D_BufInfo *draw2dBufInfo, uint32_t update_type);
    #endif
    
    static vx_status app_run_graph_for_one_frame_pipeline(AppObj *obj, vx_int32 frame_id);
    
    
    static void app_show_usage(vx_int32 argc, vx_char* argv[])
    {
        printf("\n");
        printf(" TIDL Demo - Camera based Object Detection (c) Texas Instruments Inc. 2020\n");
        printf(" ========================================================\n");
        printf("\n");
        printf(" Usage,\n");
        printf("  %s --cfg <config file>\n", argv[0]);
        printf("\n");
    }
    
    static char menu[] = {
        "\n"
        "\n =========================================="
        "\n TIDL Demo - Camera based Object Detection"
        "\n =========================================="
    #ifdef APP_WRITE_INTERMEDIATE_OUTPUTS
        "\n"
        "\n s: Save intermediate outputs"
    #endif
        "\n"
        "\n p: Print performance statistics"
        "\n"
        "\n x: Exit"
        "\n"
        "\n Enter Choice: "
    };
    
    static void app_run_task(void *app_var)
    {
        AppObj *obj = (AppObj *)app_var;
    
        while(!obj->stop_task)
        {
            app_run_graph(obj);
        }
        obj->stop_task_done = 1;
    }
    
    static int32_t app_run_task_create(AppObj *obj)
    {
        tivx_task_create_params_t params;
        int32_t status;
    
        tivxTaskSetDefaultCreateParams(&params);
        params.task_main = app_run_task;
        params.app_var = obj;
    
        obj->stop_task_done = 0;
        obj->stop_task = 0;
    
        status = tivxTaskCreate(&obj->task, &params);
    
        return status;
    }
    
    static void app_run_task_delete(AppObj *obj)
    {
        while(obj->stop_task_done==0)
        {
             tivxTaskWaitMsecs(100);
        }
    
        tivxTaskDelete(&obj->task);
    }
    
    static vx_status app_run_graph_interactive(AppObj *obj)
    {
        vx_status status;
        uint32_t done = 0;
    
        char ch;
        FILE *fp;
        app_perf_point_t *perf_arr[1];
    
        status = app_run_task_create(obj);
        if(status!=0)
        {
            printf("app_tidl: ERROR: Unable to create task\n");
        }
        else
        {
            appPerfStatsResetAll();
            while(!done)
            {
                printf(menu);
                ch = getchar();
                printf("\n");
    
                switch(ch)
                {
                    case 'p':
                        appPerfStatsPrintAll();
                        tivx_utils_graph_perf_print(obj->graph);
                        appPerfPointPrint(&obj->fileio_perf);
                        appPerfPointPrint(&obj->total_perf);
                        printf("\n");
                        appPerfPointPrintFPS(&obj->total_perf);
                        printf("\n");
    
                        break;
                    case 'e':
                        perf_arr[0] = &obj->total_perf;
                        fp = appPerfStatsExportOpenFile(".", "dl_demos_app_tidl_od_cam");
                        if (NULL != fp)
                        {
                            appPerfStatsExportAll(fp, perf_arr, 1);
                            tivx_utils_graph_perf_export(fp, obj->graph);
                            appPerfStatsExportCloseFile(fp);
                            appPerfStatsResetAll();
                        }
                        else
                        {
                            printf("fp is null\n");
                        }
                        break;
    #ifdef APP_WRITE_INTERMEDIATE_OUTPUTS
                    case 's':
                        obj->write_file = 1;
                        break;
    #endif
                    case 'x':
                        obj->stop_task = 1;
                        done = 1;
                        break;
                }
            }
            app_run_task_delete(obj);
        }
        return status;
    }
    
    static void app_set_cfg_default(AppObj *obj)
    {
        snprintf(obj->captureObj.output_file_path,APP_MAX_FILE_PATH, ".");
        snprintf(obj->vissObj.output_file_path,APP_MAX_FILE_PATH, ".");
        snprintf(obj->ldcObj.output_file_path,APP_MAX_FILE_PATH, ".");
        snprintf(obj->scalerObj.output_file_path,APP_MAX_FILE_PATH, ".");
    
        obj->captureObj.en_out_capture_write = 0;
        obj->vissObj.en_out_viss_write = 0;
        obj->ldcObj.en_out_ldc_write = 0;
        obj->scalerObj.en_out_scaler_write = 0;
    
        obj->num_frames_to_write = 0;
        obj->num_frames_to_skip = 0;
    
        snprintf(obj->tidlObj.config_file_path,APP_MAX_FILE_PATH, ".");
        snprintf(obj->tidlObj.network_file_path,APP_MAX_FILE_PATH, ".");
    
        snprintf(obj->input_file_path,APP_MAX_FILE_PATH, ".");
    
    }
    
    static void app_parse_cfg_file(AppObj *obj, vx_char *cfg_file_name)
    {
        FILE *fp = fopen(cfg_file_name, "r");
        vx_char line_str[1024];
        vx_char *token;
    
        if(fp==NULL)
        {
            printf("# ERROR: Unable to open config file [%s]\n", cfg_file_name);
            exit(0);
        }
    
        while(fgets(line_str, sizeof(line_str), fp)!=NULL)
        {
            vx_char s[]=" \t";
    
            if (strchr(line_str, '#'))
            {
                continue;
            }
    
            /* get the first token */
            token = strtok(line_str, s);
            if(token != NULL)
            {
              if(strcmp(token, "sensor_index")==0)
              {
                  token = strtok(NULL, s);
                  if(token != NULL)
                  {
                    obj->sensorObj.sensor_index = atoi(token);
                  }
              }
              else
              if(strcmp(token, "is_interactive")==0)
              {
                  token = strtok(NULL, s);
                  if(token != NULL)
                  {
                    token[strlen(token)-1]=0;
                    obj->is_interactive = atoi(token);
                    if(obj->is_interactive > 1)
                      obj->is_interactive = 1;
                  }
                  obj->sensorObj.is_interactive = obj->is_interactive;
              }
              else
                if(strcmp(token, "tidl_config")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      token[strlen(token)-1]=0;
                      strcpy(obj->tidlObj.config_file_path, token);
                    }
                }
                else
                if(strcmp(token, "tidl_network")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      token[strlen(token)-1]=0;
                      strcpy(obj->tidlObj.network_file_path, token);
                    }
                }
                else
                if(strcmp(token, "dl_size")==0)
                {
                    vx_int32 width, height;
    
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      width =  atoi(token);
                      obj->scalerObj.output[0].width   = width;
    
                      token = strtok(NULL, s);
                      if(token != NULL)
                      {
                        if(token[strlen(token)-1] == '\n')
                          token[strlen(token)-1]=0;
    
                        height =  atoi(token);
                        obj->scalerObj.output[0].height  = height;
                      }
                    }
                }
                else
                if(strcmp(token, "out_size")==0)
                {
                    vx_int32 width, height;
    
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      width =  atoi(token);
                      obj->scalerObj.output[1].width   = width;
    
                      token = strtok(NULL, s);
                      if(token != NULL)
                      {
                        if(token[strlen(token)-1] == '\n')
                          token[strlen(token)-1]=0;
    
                        height =  atoi(token);
                        obj->scalerObj.output[1].height  = height;
                      }
                    }
                }
                else
                if(strcmp(token, "viz_th")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      obj->drawDetectionsObj.params.viz_th = atof(token);
                    }
                }
                else
                if(strcmp(token, "num_classes")==0)
                {
    
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                        obj->drawDetectionsObj.params.num_classes = atoi(token);
                    }
                }
                else
                if(strcmp(token, "display_option")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      obj->displayObj.display_option = atoi(token);
                    }
                }
    #ifdef APP_WRITE_INTERMEDIATE_OUTPUTS
              else
              if(strcmp(token, "num_frames_to_run")==0)
              {
                token = strtok(NULL, s);
                if(token != NULL)
                {
                  token[strlen(token)-1]=0;
                  obj->num_frames_to_run = atoi(token);
                }
              }
              else
              if(strcmp(token, "en_out_capture_write")==0)
              {
                  token = strtok(NULL, s);
                  if(token != NULL)
                  {
                    token[strlen(token)-1]=0;
                    obj->captureObj.en_out_capture_write = atoi(token);
                    if(obj->captureObj.en_out_capture_write > 1)
                      obj->captureObj.en_out_capture_write = 1;
                  }
              }
              else
              if(strcmp(token, "en_out_viss_write")==0)
              {
                  token = strtok(NULL, s);
                  if(token != NULL)
                  {
                    token[strlen(token)-1]=0;
                    obj->vissObj.en_out_viss_write = atoi(token);
                    if(obj->vissObj.en_out_viss_write > 1)
                      obj->vissObj.en_out_viss_write = 1;
                  }
              }
              else
              if(strcmp(token, "en_out_ldc_write")==0)
              {
                  token = strtok(NULL, s);
                  if(token != NULL)
                  {
                    token[strlen(token)-1]=0;
                    obj->ldcObj.en_out_ldc_write = atoi(token);
                    if(obj->ldcObj.en_out_ldc_write > 1)
                      obj->ldcObj.en_out_ldc_write = 1;
                  }
              }
              else
              if(strcmp(token, "en_out_scaler_write")==0)
              {
                  token = strtok(NULL, s);
                  if(token != NULL)
                  {
                    token[strlen(token)-1]=0;
                    obj->scalerObj.en_out_scaler_write = atoi(token);
                    if(obj->scalerObj.en_out_scaler_write > 1)
                      obj->scalerObj.en_out_scaler_write = 1;
                  }
              }
              else
              if(strcmp(token, "en_out_pre_proc_write")==0)
              {
                  token = strtok(NULL, s);
                  if(token != NULL)
                  {
                    token[strlen(token)-1]=0;
                    obj->preProcObj.en_out_pre_proc_write = atoi(token);
                    if(obj->preProcObj.en_out_pre_proc_write > 1)
                      obj->preProcObj.en_out_pre_proc_write = 1;
                  }
              }
              else
              if(strcmp(token, "output_file_path")==0)
              {
                  token = strtok(NULL, s);
                  if(token != NULL)
                  {
                    token[strlen(token)-1]=0;
                    strcpy(obj->captureObj.output_file_path, token);
                    strcpy(obj->vissObj.output_file_path, token);
                    strcpy(obj->ldcObj.output_file_path, token);
                    strcpy(obj->scalerObj.output_file_path, token);
                    strcpy(obj->preProcObj.output_file_path, token);
                  }
              }
              else
              if(strcmp(token, "num_frames_to_write")==0)
              {
                  token = strtok(NULL, s);
                  if(token != NULL)
                  {
                      token[strlen(token)-1]=0;
                      obj->num_frames_to_write = atoi(token);
                  }
              }
              else
              if(strcmp(token, "num_frames_to_skip")==0)
              {
                  token = strtok(NULL, s);
                  if(token != NULL)
                  {
                      token[strlen(token)-1]=0;
                      obj->num_frames_to_skip = atoi(token);
                  }
              }
    #endif
            }
        }
    
        fclose(fp);
    }
    
    static void app_parse_cmd_line_args(AppObj *obj, vx_int32 argc, vx_char *argv[])
    {
        vx_int32 i;
    
        app_set_cfg_default(obj);
    
        if(argc==1)
        {
            app_show_usage(argc, argv);
            exit(0);
        }
    
        for(i=0; i<argc; i++)
        {
            if(strcmp(argv[i], "--cfg")==0)
            {
                i++;
                if(i>=argc)
                {
                    app_show_usage(argc, argv);
                }
                app_parse_cfg_file(obj, argv[i]);
                break;
            }
            else
            if(strcmp(argv[i], "--help")==0)
            {
                app_show_usage(argc, argv);
                exit(0);
            }
        }
    
        #ifdef x86_64
        obj->displayObj.display_option = 0;
        obj->is_interactive = 0;
        #endif
    
        return;
    }
    
    vx_int32 app_tidl_od_cam_main(vx_int32 argc, vx_char* argv[])
    {
        vx_status status = VX_SUCCESS;
    
        AppObj *obj = &gAppObj;
    
        /*Optional parameter setting*/
        app_default_param_set(obj);
        APP_PRINTF("Default param set! \n");
    
        /*Config parameter reading*/
        app_parse_cmd_line_args(obj, argc, argv);
        APP_PRINTF("Parsed user params! \n");
        /* Querry sensor parameters */
        app_querry_sensor(&obj->sensorObj);
        APP_PRINTF("Sensor params queried! \n");
    
        /*Update of parameters are config file read*/
        app_update_param_set(obj);
        APP_PRINTF("Updated user params! \n");
    
        app_init(obj);
        APP_PRINTF("App Init Done! \n");
    
        app_create_graph(obj);
        APP_PRINTF("App Create Graph Done! \n");
    
        status = app_verify_graph(obj);
        APP_PRINTF("App Verify Graph Done! \n");
    
        if(status == VX_SUCCESS)
        {
            if(obj->is_interactive)
            {
                app_run_graph_interactive(obj);
            }
            else
            {
                app_run_graph(obj);
            }
            APP_PRINTF("App Run Graph Done! \n");
        }
    
        app_delete_graph(obj);
        APP_PRINTF("App Delete Graph Done! \n");
    
        app_deinit(obj);
        APP_PRINTF("App De-init Done! \n");
    
        return 0;
    }
    
    static vx_status app_init(AppObj *obj)
    {
        vx_status status = VX_SUCCESS;
        app_grpx_init_prms_t grpx_prms;
    
        /* Create OpenVx Context */
        obj->context = vxCreateContext();
        APP_ASSERT_VALID_REF(obj->context);
        APP_PRINTF("Creating context done!\n");
    
        tivxHwaLoadKernels(obj->context);
        tivxImagingLoadKernels(obj->context);
        tivxImgProcLoadKernels(obj->context);
        tivxTIDLLoadKernels(obj->context);
        tivxFileIOLoadKernels(obj->context);
        APP_PRINTF("Kernel loading done!\n");
    
        /* Initialize modules */
    
        app_init_sensor(&obj->sensorObj, "sensor_obj");
        APP_PRINTF("Sensor init done!\n");
    
        app_init_capture(obj->context, &obj->captureObj, &obj->sensorObj, "capture_obj", APP_BUFFER_Q_DEPTH);
        APP_PRINTF("Capture init done!\n");
    
        app_init_viss(obj->context, &obj->vissObj, &obj->sensorObj, "viss_obj");
        APP_PRINTF("VISS init done!\n");
    
        app_init_aewb(obj->context, &obj->aewbObj, &obj->sensorObj, "aewb_obj");
        APP_PRINTF("AEWB init done!\n");
    //Jason mark LDC
        //app_init_ldc(obj->context, &obj->ldcObj, &obj->sensorObj, "ldc_obj");
        //APP_PRINTF("LDC init done!\n");
    
        printf("Scaler output1 width   = %d\n", obj->scalerObj.output[0].width);
        printf("Scaler output1 height  = %d\n", obj->scalerObj.output[0].height);
        printf("Scaler output2 width   = %d\n", obj->scalerObj.output[1].width);
        printf("Scaler output2 height  = %d\n", obj->scalerObj.output[1].height);
    
        app_init_scaler(obj->context, &obj->scalerObj, "scaler_obj", obj->sensorObj.num_cameras_enabled, 2);
        APP_PRINTF("Scaler init done!\n");
    
        /* Initialize TIDL first to get tensor I/O information from network */
        app_init_tidl(obj->context, &obj->tidlObj, "tidl_obj", obj->sensorObj.num_cameras_enabled);
        APP_PRINTF("TIDL Init Done! \n");
    
        /* Update pre-proc parameters with TIDL config before calling init */
        app_update_pre_proc(obj->context, &obj->preProcObj, obj->tidlObj.config, obj->sensorObj.num_cameras_enabled);
        APP_PRINTF("Pre Proc Update Done! \n");
    
        app_init_pre_proc(obj->context, &obj->preProcObj, "pre_proc_obj");
        APP_PRINTF("Pre Proc Init Done! \n");
    
        /* Update ioBufDesc in draw detections object */
        app_update_draw_detections(&obj->drawDetectionsObj, obj->tidlObj.config);
        APP_PRINTF("Draw detections Update Done! \n");
    
        app_init_draw_detections(obj->context, &obj->drawDetectionsObj, "draw_detections_obj", obj->sensorObj.num_cameras_enabled);
        APP_PRINTF("Draw Detections Init Done! \n");
    
        app_init_img_mosaic(obj->context, &obj->imgMosaicObj, "img_mosaic_obj", APP_BUFFER_Q_DEPTH);
        APP_PRINTF("Img Mosaic init done!\n");
    
        app_init_display(obj->context, &obj->displayObj, "display_obj");
        APP_PRINTF("Display init done!\n");
    
        #ifndef x86_64
        if(obj->displayObj.display_option == 1)
        {
          appGrpxInitParamsInit(&grpx_prms, obj->context);
          grpx_prms.draw_callback = app_draw_graphics;
          appGrpxInit(&grpx_prms);
        }
        #endif
    
        appPerfPointSetName(&obj->total_perf , "TOTAL");
        appPerfPointSetName(&obj->fileio_perf, "FILEIO");
    
        return status;
    }
    
    static void app_deinit(AppObj *obj)
    {
        app_deinit_sensor(&obj->sensorObj);
        APP_PRINTF("Sensor deinit done!\n");
    
        app_deinit_capture(&obj->captureObj, APP_BUFFER_Q_DEPTH);
        APP_PRINTF("Capture deinit done!\n");
    
        app_deinit_viss(&obj->vissObj);
        APP_PRINTF("VISS deinit done!\n");
    
        app_deinit_aewb(&obj->aewbObj);
        APP_PRINTF("AEWB deinit done!\n");
    //Jason mark LDC
        //app_deinit_ldc(&obj->ldcObj);
        //APP_PRINTF("LDC deinit done!\n");
    
        app_deinit_scaler(&obj->scalerObj);
        APP_PRINTF("Scaler deinit done!\n");
    
        app_deinit_pre_proc(&obj->preProcObj);
        APP_PRINTF("Pre proc deinit done!\n");
    
        app_deinit_tidl(&obj->tidlObj);
        APP_PRINTF("TIDL deinit done!\n");
    
        app_deinit_draw_detections(&obj->drawDetectionsObj);
        APP_PRINTF("Draw detections deinit done!\n");
    
        app_deinit_img_mosaic(&obj->imgMosaicObj, APP_BUFFER_Q_DEPTH);
        APP_PRINTF("Img Mosaic deinit done!\n");
    
        app_deinit_display(&obj->displayObj);
        APP_PRINTF("Display deinit done!\n");
    
        #ifndef x86_64
        if(obj->displayObj.display_option == 1)
        {
          appGrpxDeInit();
        }
        #endif
    
        tivxTIDLUnLoadKernels(obj->context);
        tivxHwaUnLoadKernels(obj->context);
        tivxImagingUnLoadKernels(obj->context);
        tivxImgProcUnLoadKernels(obj->context);
        tivxFileIOUnLoadKernels(obj->context);
        APP_PRINTF("Kernels unload done!\n");
    
    
        vxReleaseContext(&obj->context);
        APP_PRINTF("Release context done!\n");
    }
    
    static void app_delete_graph(AppObj *obj)
    {
        app_delete_capture(&obj->captureObj);
        APP_PRINTF("Capture delete done!\n");
    
        app_delete_viss(&obj->vissObj);
        APP_PRINTF("VISS delete done!\n");
    
        app_delete_aewb(&obj->aewbObj);
        APP_PRINTF("AEWB delete done!\n");
    //Jason mark LDC
        //app_delete_ldc(&obj->ldcObj);
        //APP_PRINTF("LDC delete done!\n");
    
        app_delete_scaler(&obj->scalerObj);
        APP_PRINTF("Scaler delete done!\n");
    
        app_delete_pre_proc(&obj->preProcObj);
        APP_PRINTF("Pre Proc delete done!\n");
    
        app_delete_tidl(&obj->tidlObj);
        APP_PRINTF("TIDL delete done!\n");
    
        app_delete_draw_detections(&obj->drawDetectionsObj);
        APP_PRINTF("Post Proc delete done!\n");
    
        app_delete_img_mosaic(&obj->imgMosaicObj);
        APP_PRINTF("Img Mosaic delete done!\n");
    
        app_delete_display(&obj->displayObj);
        APP_PRINTF("Display delete done!\n");
    
        vxReleaseGraph(&obj->graph);
        APP_PRINTF("Graph delete done!\n");
    }
    
    static vx_status app_create_graph(AppObj *obj)
    {
        vx_status status = VX_SUCCESS;
        vx_graph_parameter_queue_params_t graph_parameters_queue_params_list[2];
        vx_int32 graph_parameter_index;
    
        obj->graph = vxCreateGraph(obj->context);
        status = vxGetStatus((vx_reference)obj->graph);
        vxSetReferenceName((vx_reference)obj->graph, "app_tidl_od_cam_graph");
        APP_PRINTF("Graph create done!\n");
    
        if(status == VX_SUCCESS)
        {
            status = app_create_graph_capture(obj->graph, &obj->captureObj);
            APP_PRINTF("Capture graph done!\n");
        }
    
        if(status == VX_SUCCESS)
        {
            status = app_create_graph_viss(obj->graph, &obj->vissObj, obj->captureObj.raw_image_arr[0]);
            APP_PRINTF("VISS graph done!\n");
        }
    
        if(status == VX_SUCCESS)
        {
            status = app_create_graph_aewb(obj->graph, &obj->aewbObj, obj->vissObj.h3a_stats_arr);
            APP_PRINTF("AEWB graph done!\n");
        }
    /*Jason mark LDC
        if(status == VX_SUCCESS)
        {
            status = app_create_graph_ldc(obj->graph, &obj->ldcObj, obj->vissObj.output_arr);
            APP_PRINTF("LDC graph done!\n");
        }
    */
        if(status == VX_SUCCESS)
        {   //Jason change
            //app_create_graph_scaler(obj->context, obj->graph, &obj->scalerObj, obj->ldcObj.output_arr);
            app_create_graph_scaler(obj->context, obj->graph, &obj->scalerObj, obj->vissObj.output_arr);
            APP_PRINTF("Scaler graph done!\n");
        }
    
        if(status == VX_SUCCESS)
        {
            app_create_graph_pre_proc(obj->graph, &obj->preProcObj, obj->scalerObj.output[0].arr);
            APP_PRINTF("Pre proc graph done!\n");
        }
    
        if(status == VX_SUCCESS)
        {
          app_create_graph_tidl(obj->context, obj->graph, &obj->tidlObj, obj->preProcObj.output_tensor_arr);
          APP_PRINTF("TIDL graph done!\n");
        }
    
        if(status == VX_SUCCESS)
        {
          app_create_graph_draw_detections(obj->graph, &obj->drawDetectionsObj, obj->tidlObj.output_tensor_arr[0], obj->scalerObj.output[1].arr);
          APP_PRINTF("Draw detections graph done!\n");
        }
    
        vx_int32 idx = 0;
        obj->imgMosaicObj.input_arr[idx++] = obj->drawDetectionsObj.output_image_arr;
        obj->imgMosaicObj.num_inputs = idx;
    
        if(status == VX_SUCCESS)
        {
            status = app_create_graph_img_mosaic(obj->graph, &obj->imgMosaicObj);
            APP_PRINTF("Img Mosaic graph done!\n");
        }
    
        if(status == VX_SUCCESS)
        {
            status = app_create_graph_display(obj->graph, &obj->displayObj, obj->imgMosaicObj.output_image[0]);
            APP_PRINTF("Display graph done!\n");
        }
    
        if(status == VX_SUCCESS)
        {
            graph_parameter_index = 0;
            add_graph_parameter_by_node_index(obj->graph, obj->captureObj.node, 1);
            obj->captureObj.graph_parameter_index = graph_parameter_index;
            graph_parameters_queue_params_list[graph_parameter_index].graph_parameter_index = graph_parameter_index;
            graph_parameters_queue_params_list[graph_parameter_index].refs_list_size = APP_BUFFER_Q_DEPTH;
            graph_parameters_queue_params_list[graph_parameter_index].refs_list = (vx_reference*)&obj->captureObj.raw_image_arr[0];
            graph_parameter_index++;
    
            vxSetGraphScheduleConfig(obj->graph,
                    VX_GRAPH_SCHEDULE_MODE_QUEUE_AUTO,
                    graph_parameter_index,
                    graph_parameters_queue_params_list);
    
            tivxSetGraphPipelineDepth(obj->graph, APP_PIPELINE_DEPTH);
    
            tivxSetNodeParameterNumBufByIndex(obj->vissObj.node, 6, APP_BUFFER_Q_DEPTH);
            tivxSetNodeParameterNumBufByIndex(obj->vissObj.node, 9, APP_BUFFER_Q_DEPTH);
            tivxSetNodeParameterNumBufByIndex(obj->aewbObj.node, 4, APP_BUFFER_Q_DEPTH);
    //Jason mark LDC
            //tivxSetNodeParameterNumBufByIndex(obj->ldcObj.node, 7, APP_BUFFER_Q_DEPTH);
    
            /*This output is accessed slightly later in the pipeline by mosaic node so queue depth is larger */
            tivxSetNodeParameterNumBufByIndex(obj->scalerObj.node, 1, 6);
            tivxSetNodeParameterNumBufByIndex(obj->scalerObj.node, 2, 6);
    
            tivxSetNodeParameterNumBufByIndex(obj->preProcObj.node, 2, APP_BUFFER_Q_DEPTH);
    
            tivxSetNodeParameterNumBufByIndex(obj->tidlObj.node, 4, APP_BUFFER_Q_DEPTH);
            tivxSetNodeParameterNumBufByIndex(obj->tidlObj.node, 7, APP_BUFFER_Q_DEPTH);
    
            tivxSetNodeParameterNumBufByIndex(obj->drawDetectionsObj.node, 3, APP_BUFFER_Q_DEPTH);
    
            tivxSetNodeParameterNumBufByIndex(obj->imgMosaicObj.node, 1, APP_BUFFER_Q_DEPTH);
    
            APP_PRINTF("Pipeline params setup done!\n");
        }
    
        return status;
    }
    
    
    
    static vx_status app_verify_graph(AppObj *obj)
    {
        vx_status status = VX_SUCCESS;
    
        status = vxVerifyGraph(obj->graph);
    
        if(status == VX_SUCCESS)
        {
            APP_PRINTF("Grapy verify SUCCESS!\n");
        }
        else
        {
            APP_PRINTF("Grapy verify FAILURE!\n");
            status = VX_FAILURE;
        }
    
        #if 1
        if(VX_SUCCESS == status)
        {
          status = tivxExportGraphToDot(obj->graph,".", "vx_app_tidl_od_cam");
        }
        #endif
    
        if(VX_SUCCESS == status)
        {
            if (obj->captureObj.enable_error_detection)
            {
                status = app_send_error_frame(&obj->captureObj);
                APP_PRINTF("App Send Error Frame Done! %d \n", obj->captureObj.enable_error_detection);
            }
        }
        /* wait a while for prints to flush */
        tivxTaskWaitMsecs(100);
    
        return status;
    }
    
    
    static vx_status app_run_graph_for_one_frame_pipeline(AppObj *obj, vx_int32 frame_id)
    {
      vx_status status = VX_SUCCESS;
    
      appPerfPointBegin(&obj->total_perf);
    
      CaptureObj *captureObj = &obj->captureObj;
    
      if(obj->pipeline <= 0)
      {
        /* Enqueue outpus */
    
        /* Enqueue inputs during pipeup dont execute */
        vxGraphParameterEnqueueReadyRef(obj->graph, captureObj->graph_parameter_index, (vx_reference*)&captureObj->raw_image_arr[obj->enqueueCnt], 1);
    
        obj->enqueueCnt++;
        obj->enqueueCnt   = (obj->enqueueCnt  >= APP_BUFFER_Q_DEPTH)? 0 : obj->enqueueCnt;
        obj->pipeline++;
      }
    
    
      if(obj->pipeline > 0)
      {
        vx_image capture_input_image;
        uint32_t num_refs;
    
        /* Dequeue input */
        vxGraphParameterDequeueDoneRef(obj->graph, captureObj->graph_parameter_index, (vx_reference*)&capture_input_image, 1, &num_refs);
    
    
        /* Enqueue input - start execution */
        vxGraphParameterEnqueueReadyRef(obj->graph, captureObj->graph_parameter_index, (vx_reference*)&capture_input_image, 1);
    
        obj->enqueueCnt++;
        obj->dequeueCnt++;
    
        obj->enqueueCnt = (obj->enqueueCnt >= APP_BUFFER_Q_DEPTH)? 0 : obj->enqueueCnt;
        obj->dequeueCnt = (obj->dequeueCnt >= APP_BUFFER_Q_DEPTH)? 0 : obj->dequeueCnt;
    
      }
    
      appPerfPointEnd(&obj->total_perf);
    
      return status;
    }
    
    
    static vx_status app_run_graph(AppObj *obj)
    {
        vx_status status = VX_SUCCESS;
    
        SensorObj *sensorObj = &obj->sensorObj;
        vx_int32 frame_id;
    
        app_pipeline_params_defaults(obj);
    
        if(NULL == sensorObj->sensor_name)
        {
            printf("sensor name is NULL \n");
            return VX_FAILURE;
        }
        status = appStartImageSensor(sensorObj->sensor_name, ((1 << sensorObj->num_cameras_enabled) - 1));
    
        for(frame_id = 0; frame_id < obj->num_frames_to_run; frame_id++)
        {
    #ifdef APP_WRITE_INTERMEDIATE_OUTPUTS
            if(obj->write_file == 1)
            {
                if(obj->captureObj.en_out_capture_write == 1)
                {
                    app_send_cmd_capture_write_node(&obj->captureObj, frame_id, obj->num_frames_to_write, obj->num_frames_to_skip);
                }
                if(obj->vissObj.en_out_viss_write == 1)
                {
                    app_send_cmd_viss_write_node(&obj->vissObj, frame_id, obj->num_frames_to_write, obj->num_frames_to_skip);
                }
    /* Jason mark LDC
                if(obj->ldcObj.en_out_ldc_write == 1)
                {
                    app_send_cmd_ldc_write_node(&obj->ldcObj, frame_id, obj->num_frames_to_write, obj->num_frames_to_skip);
                }
    */
                if(obj->scalerObj.en_out_scaler_write == 1)
                {
                    app_send_cmd_scaler_write_node(&obj->scalerObj, frame_id, obj->num_frames_to_write, obj->num_frames_to_skip);
                }
                if(obj->preProcObj.en_out_pre_proc_write == 1)
                {
                    app_send_cmd_pre_proc_write_node(&obj->preProcObj, frame_id, obj->num_frames_to_write, obj->num_frames_to_skip);
                }
                obj->write_file = 0;
            }
    #endif
            app_run_graph_for_one_frame_pipeline(obj, frame_id);
    
            /* user asked to stop processing */
            if(obj->stop_task)
              break;
        }
    
        vxWaitGraph(obj->graph);
    
        obj->stop_task = 1;
    
        status = appStopImageSensor(obj->sensorObj.sensor_name, ((1 << sensorObj->num_cameras_enabled) - 1));
    
        return status;
    }
    
    static void set_display_defaults(DisplayObj *displayObj)
    {
      displayObj->display_option = 1;
    }
    
    static void app_pipeline_params_defaults(AppObj *obj)
    {
      obj->pipeline       = -APP_BUFFER_Q_DEPTH + 1;
      obj->enqueueCnt     = 0;
      obj->dequeueCnt     = 0;
    }
    
    static void set_sensor_defaults(SensorObj *sensorObj)
    {
        strcpy(sensorObj->sensor_name, SENSOR_SONY_IMX390_UB953_D3);
    
        sensorObj->num_sensors_found = 0;
        sensorObj->sensor_features_enabled = 0;
        sensorObj->sensor_features_supported = 0;
        sensorObj->sensor_dcc_enabled = 0;
        sensorObj->sensor_wdr_enabled = 0;
        sensorObj->sensor_exp_control_enabled = 0;
        sensorObj->sensor_gain_control_enabled = 0;
    
        sensorObj->enable_ldc = 1;
        sensorObj->num_cameras_enabled = 1;
        sensorObj->usecase_option = APP_SENSOR_FEATURE_CFG_UC0;
        sensorObj->is_interactive = 1;
    
    }
    
    static void set_scaler_defaults(ScalerObj *scalerObj)
    {
        scalerObj->color_format = VX_DF_IMAGE_NV12;
    }
    
    static void set_pre_proc_defaults(PreProcObj *preProcObj)
    {
        vx_int32 i;
        for(i = 0; i < 4; i++ )
        {
            preProcObj->params.pad_pixel[i] = 0;
        }
    
        for(i = 0; i< 3 ; i++){
          preProcObj->params.scale_val[i] = 1.0;
          preProcObj->params.mean_pixel[i] = 0.0;
        }
    
        preProcObj->params.ip_rgb_or_yuv = 1; /* YUV-NV12 default */
        preProcObj->params.color_conv_flag = TIADALG_COLOR_CONV_YUV420_BGR;
    }
    
    static void app_default_param_set(AppObj *obj)
    {
        set_sensor_defaults(&obj->sensorObj);
    
        set_scaler_defaults(&obj->scalerObj);
    
        set_pre_proc_defaults(&obj->preProcObj);
    
        set_display_defaults(&obj->displayObj);
    
        app_pipeline_params_defaults(obj);
    
        obj->captureObj.enable_error_detection = 0; /* disable by default */
        obj->is_interactive = 1;
        obj->write_file = 0;
        obj->num_frames_to_run = 1000000000;
    
    }
    
    static vx_int32 calc_grid_size(vx_uint32 ch)
    {
        if(0==ch)
        {
            return -1;
        }
        else if(1==ch)
        {
            return 1;
        }
        else if(4>=ch)
        {
            return 2;
        }
        else if(9>=ch)
        {
            return 3;
        }
        else if(16>=ch)
        {
            return 4;
        }else
        {
            return -1;
        }
    }
    
    static void update_img_mosaic_defaults(ImgMosaicObj *imgMosaicObj, vx_uint32 in_width, vx_uint32 in_height, vx_int32 numCh)
    {
        vx_int32 idx, ch;
        vx_int32 grid_size = calc_grid_size(numCh);
        imgMosaicObj->out_width    = DISPLAY_WIDTH;
        imgMosaicObj->out_height   = DISPLAY_HEIGHT;
        imgMosaicObj->num_inputs   = 1;
    
        tivxImgMosaicParamsSetDefaults(&imgMosaicObj->params);
    
        idx = 0;
        for(ch = 0; ch < numCh; ch++)
        {
            vx_int32 startX, startY, winX, winY, winWidth, winHeight;
    
            winX = ch%grid_size;
            winY = ch/grid_size;
    
            if((in_width * grid_size) >= imgMosaicObj->out_width)
            {
                winWidth = imgMosaicObj->out_width / grid_size;
                startX = 0;
            }
            else
            {
                winWidth = in_width;
                startX = (imgMosaicObj->out_width - (in_width * grid_size)) / 2;
            }
    
            if((in_height * grid_size) >= imgMosaicObj->out_height)
            {
                winHeight = imgMosaicObj->out_height / grid_size;
                startY = 0;
            }
            else
            {
                winHeight = in_height;
                startY = (imgMosaicObj->out_height - (in_height * grid_size)) / 2;
            }
    
            imgMosaicObj->params.windows[idx].startX  = startX + (winWidth * winX);
            imgMosaicObj->params.windows[idx].startY  = startY + (winHeight * winY);
            imgMosaicObj->params.windows[idx].width   = winWidth;
            imgMosaicObj->params.windows[idx].height  = winHeight;
            imgMosaicObj->params.windows[idx].input_select   = 0;
            imgMosaicObj->params.windows[idx].channel_select = idx;
            idx++;
        }
    
        imgMosaicObj->params.num_windows  = idx;
    
        /* Number of time to clear the output buffer before it gets reused */
        imgMosaicObj->params.clear_count  = APP_BUFFER_Q_DEPTH;
        /* imgMosaicObj->params.enable_overlay = 0; */
    }
    
    static void update_draw_detections_defaults(AppObj *obj, DrawDetectionsObj *drawDetectionsObj)
    {
        vx_int32 i;
    
        drawDetectionsObj->params.width  = obj->scalerObj.output[1].width;
        drawDetectionsObj->params.height = obj->scalerObj.output[1].height;
    
        for(i = 0; i < drawDetectionsObj->params.num_classes; i++)
        {
            drawDetectionsObj->params.color_map[i][0] = (vx_uint8)(rand() % 256);
            drawDetectionsObj->params.color_map[i][1] = (vx_uint8)(rand() % 256);
            drawDetectionsObj->params.color_map[i][2] = (vx_uint8)(rand() % 256);
        }
    }
    
    static void app_update_param_set(AppObj *obj)
    {
        obj->sensorObj.sensor_index = 0; /* App works only for IMX390 2MP cameras */
    
        update_draw_detections_defaults(obj, &obj->drawDetectionsObj);
    
        update_img_mosaic_defaults(&obj->imgMosaicObj, obj->scalerObj.output[1].width, obj->scalerObj.output[1].height, obj->sensorObj.num_cameras_enabled);
    
    }
    
    /*
     * Utility API used to add a graph parameter from a node, node parameter index
     */
    static void add_graph_parameter_by_node_index(vx_graph graph, vx_node node, vx_uint32 node_parameter_index)
    {
        vx_parameter parameter = vxGetParameterByIndex(node, node_parameter_index);
    
        vxAddParameterToGraph(graph, parameter);
        vxReleaseParameter(&parameter);
    }
    
    
    #ifndef x86_64
    static void app_draw_graphics(Draw2D_Handle *handle, Draw2D_BufInfo *draw2dBufInfo, uint32_t update_type)
    {
    
      appGrpxDrawDefault(handle, draw2dBufInfo, update_type);
    
      if(update_type == 0)
      {
        Draw2D_FontPrm sHeading;
    
        sHeading.fontIdx = 4;
        Draw2D_drawString(handle, 580, 5, "TIDL - Object Detection Demo", &sHeading);
    
      }
    
      return;
    }
    #endif
    

  • Hi Jason,

    Can you please send me the performance summary for a better understanding? You can get this by pressing 'p' on the console and providing me the summary log for each usecase (1, 2, 3, 4 cameras)

    I am especially interested in C7x DSP load when Yolov3 runs for single camera?

    Regards,
    Shyam

  • Hi Shyam,

    I attach 4 logs when use Yolov3.
    For example, 2_cameras_performance.txt that is 2 cameras run at same time.

    I see the C7x on screen.
    1 camera : C7x 91%.
    2 cameras : C7x 99%
    3 cameras : C7x 99%
    4 cameras : C7x 99% (I attach a picture in the mail)

    The C7x value of 3,4 cameras log don't match the screen value.
    They seem have errors about log.


    Thank you very much.

    Best regards

    -Jason

    one camera:

    ==========================================                                     
     TIDL Demo - Camera based Object Detection                                      
     ==========================================                                     
                                                                                    
     p: Print performance statistics                                                
                                                                                    
     x: Exit                                                                        
                                                                                    
     Enter Choice: [MCU2_0]    187.360400 s: DHCP client timed out. Retrying.....   
    p                                                                               
                                                                                    
                                                                                    
    Summary of CPU load,                                                            
    ====================                                                            
                                                                                    
    CPU: mpu1_0: TOTAL LOAD =   0.84 % ( HWI =   0. 5 %, SWI =   0. 1 % )           
    CPU: mcu2_0: TOTAL LOAD =  14.47 % ( HWI =   2.78 %, SWI =   0.90 % )           
    CPU: mcu2_1: TOTAL LOAD =   0.14 % ( HWI =   0. 6 %, SWI =   0. 3 % )           
    CPU:  c6x_1: TOTAL LOAD =   1.27 % ( HWI =   0. 6 %, SWI =   0. 5 % )           
    CPU:  c6x_2: TOTAL LOAD =   1.16 % ( HWI =   0. 7 %, SWI =   0. 5 % )           
    CPU:  c7x_1: TOTAL LOAD =  90.74 % ( HWI =   0. 3 %, SWI =   0. 3 % )           
                                                                                    
                                                                                    
    HWA performance statistics,                                                     
    ===========================                                                     
                                                                                    
    HWA:   VISS: LOAD =  10.85 % ( 63 MP/s )                                        
    HWA:   MSC0: LOAD =  20.12 % ( 126 MP/s )                                       
                                                                                    
                                                                                    
    DDR performance statistics,                                                     
    ===========================                                                     
                                                                                    
    DDR: READ  BW: AVG =   2880 MB/s, PEAK =   2910 MB/s                            
    DDR: WRITE BW: AVG =    427 MB/s, PEAK =    447 MB/s                            
    DDR: TOTAL BW: AVG =   3307 MB/s, PEAK =   3357 MB/s                            
                                                                                    
                                                                                    
    Detailed CPU performance/memory statistics,                                     
    ===========================================                                     
                                                                                    
    CPU: mcu2_0: TASK:           IPC_RX:   0.13 %                                   
    CPU: mcu2_0: TASK:       REMOTE_SRV:   0. 3 %                                   
    CPU: mcu2_0: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU: mcu2_0: TASK:         TIVX_CPU:   1.29 %                                   
    CPU: mcu2_0: TASK:          TIVX_NF:   0. 0 %                                   
    CPU: mcu2_0: TASK:        TIVX_LDC1:   0. 0 %                                   
    CPU: mcu2_0: TASK:        TIVX_MSC1:   2.61 %                                   
    CPU: mcu2_0: TASK:        TIVX_MSC2:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_VISS1:   2.93 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT1:   0.54 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT2:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_DISP1:   0.57 %                                   
    CPU: mcu2_0: TASK:       TIVX_DISP2:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_CSITX:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT3:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT4:   0. 0 %                                   
                                                                                    
    CPU: mcu2_0: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   16400896 B ()
    CPU: mcu2_0: HEAP:           L3_MEM: size =     131072 B, free =     114688 B ()
    CPU: mcu2_0: HEAP:  DDR_NON_CACHE_M: size =   16777216 B, free =   16777216 B ()
                                                                                    
    CPU: mcu2_1: TASK:           IPC_RX:   0. 0 %                                   
    CPU: mcu2_1: TASK:       REMOTE_SRV:   0. 1 %                                   
    CPU: mcu2_1: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU: mcu2_1: TASK:         TIVX_SDE:   0. 0 %                                   
    CPU: mcu2_1: TASK:         TIVX_DOF:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VDEC1:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VDEC2:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VENC1:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VENC2:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU: mcu2_1: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   16774912 B ()
    CPU: mcu2_1: HEAP:           L3_MEM: size =     131072 B, free =     131072 B ()
    CPU: mcu2_1: HEAP:  DDR_NON_CACHE_M: size =  117440512 B, free =   97542144 B ()
                                                                                    
    CPU:  c6x_1: TASK:           IPC_RX:   0. 2 %                                   
    CPU:  c6x_1: TASK:       REMOTE_SRV:   0. 0 %                                   
    CPU:  c6x_1: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU:  c6x_1: TASK:         TIVX_CPU:   1.10 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU:  c6x_1: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   16762624 B ()
    CPU:  c6x_1: HEAP:           L2_MEM: size =     229376 B, free =          0 B ()
    CPU:  c6x_1: HEAP:  DDR_SCRATCH_MEM: size =   50331648 B, free =   50331648 B ()
                                                                                    
    CPU:  c6x_2: TASK:           IPC_RX:   0. 1 %                                   
    CPU:  c6x_2: TASK:       REMOTE_SRV:   0. 0 %                                   
    CPU:  c6x_2: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU:  c6x_2: TASK:         TIVX_CPU:   0.99 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU:  c6x_2: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   16774912 B ()
    CPU:  c6x_2: HEAP:           L2_MEM: size =     229376 B, free =     229376 B ()
    CPU:  c6x_2: HEAP:  DDR_SCRATCH_MEM: size =   50331648 B, free =   50331648 B ()
                                                                                    
    CPU:  c7x_1: TASK:           IPC_RX:   0. 2 %                                   
    CPU:  c7x_1: TASK:       REMOTE_SRV:   0. 0 %                                   
    CPU:  c7x_1: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU:  c7x_1: TASK:         TIVX_CPU:  90.64 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU:  c7x_1: HEAP:   DDR_SHARED_MEM: size = 1073741824 B, free =  940216064 B ()
    CPU:  c7x_1: HEAP:           L3_MEM: size =    8159232 B, free =          0 B ()
    CPU:  c7x_1: HEAP:           L2_MEM: size =     491520 B, free =     491520 B ()
    CPU:  c7x_1: HEAP:           L1_MEM: size =      16384 B, free =          0 B ()
    CPU:  c7x_1: HEAP:  DDR_SCRATCH_MEM: size =  268435456 B, free =  251771584 B ()
                                                                                    
                                                                                    
    GRAPH: app_tidl_od_cam_graph (#nodes =   9, #executions =   3454)               
     NODE:   CAPTURE1:             capture_node: avg =  33268 usecs, min/max =  3314
     NODE: VPAC_VISS1:                viss_node: avg =   4684 usecs, min/max =   404
     NODE:     IPU1-0:                aewb_node: avg =    349 usecs, min/max =     4
     NODE:  VPAC_MSC1:               ScalerNode: avg =   5342 usecs, min/max =   524
     NODE:      DSP-1:              PreProcNode: avg =    313 usecs, min/max =    34
     NODE:   DSP_C7-1:                 TIDLNode: avg =  30338 usecs, min/max =  3014
     NODE:      DSP-2:    DrawBoxDetectionsNode: avg =   1890 usecs, min/max =   184
     NODE:  VPAC_MSC1:              mosaic_node: avg =   1734 usecs, min/max =   164
     NODE:   DISPLAY1:              DisplayNode: avg =   2731 usecs, min/max =    14
                                                                                    
     PERF:           FILEIO: avg =      0 usecs, min/max = 4294967295 /      0 usec0
     PERF:            TOTAL: avg =  33308 usecs, min/max =      5 /  50406 usecs, #9
                                                                                    
     PERF:            TOTAL:   30. 2 FPS                                            
                                                                                    
                                    
    

    2 cameras

    ==========================================                                     
     TIDL Demo - Camera based Object Detection                                      
     ==========================================                                     
                                                                                    
     p: Print performance statistics                                                
                                                                                    
     x: Exit                                                                        
                                                                                    
     Enter Choice: [MCU2_0]    186.299592 s: DHCP client timed out. Retrying.....   
    [MCU2_0]    354.299597 s: DHCP client timed out. Retrying.....                  
    [MCU2_0]    522.300649 s: DHCP client timed out. Retrying.....                  
    p                                                                               
                                                                                    
                                                                                    
    Summary of CPU load,                                                            
    ====================                                                            
                                                                                    
    CPU: mpu1_0: TOTAL LOAD =   0.77 % ( HWI =   0. 5 %, SWI =   0. 1 % )           
    CPU: mcu2_0: TOTAL LOAD =  14.71 % ( HWI =   3.46 %, SWI =   0.95 % )           
    CPU: mcu2_1: TOTAL LOAD =   0.13 % ( HWI =   0. 6 %, SWI =   0. 3 % )           
    CPU:  c6x_1: TOTAL LOAD =   1.36 % ( HWI =   0. 6 %, SWI =   0. 5 % )           
    CPU:  c6x_2: TOTAL LOAD =   1.34 % ( HWI =   0. 7 %, SWI =   0. 4 % )           
    CPU:  c7x_1: TOTAL LOAD = 100. 0 % ( HWI =   0. 0 %, SWI =   0. 0 % )           
                                                                                    
                                                                                    
    HWA performance statistics,                                                     
    ===========================                                                     
                                                                                    
    HWA:   VISS: LOAD =  12. 1 % ( 68 MP/s )                                        
    HWA:   MSC0: LOAD =  20.10 % ( 119 MP/s )                                       
    HWA:   MSC1: LOAD =   3.11 % ( 16 MP/s )                                        
                                                                                    
                                                                                    
    DDR performance statistics,                                                     
    ===========================                                                     
                                                                                    
    DDR: READ  BW: AVG =   3045 MB/s, PEAK =   4035 MB/s                            
    DDR: WRITE BW: AVG =    575 MB/s, PEAK =    766 MB/s                            
    DDR: TOTAL BW: AVG =   3620 MB/s, PEAK =   4801 MB/s                            
                                                                                    
                                                                                    
    Detailed CPU performance/memory statistics,                                     
    ===========================================                                     
                                                                                    
    CPU: mcu2_0: TASK:           IPC_RX:   0.12 %                                   
    CPU: mcu2_0: TASK:       REMOTE_SRV:   0. 3 %                                   
    CPU: mcu2_0: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU: mcu2_0: TASK:         TIVX_CPU:   1.18 %                                   
    CPU: mcu2_0: TASK:          TIVX_NF:   0. 0 %                                   
    CPU: mcu2_0: TASK:        TIVX_LDC1:   0. 0 %                                   
    CPU: mcu2_0: TASK:        TIVX_MSC1:   2.20 %                                   
    CPU: mcu2_0: TASK:        TIVX_MSC2:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_VISS1:   2.89 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT1:   0.41 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT2:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_DISP1:   0.37 %                                   
    CPU: mcu2_0: TASK:       TIVX_DISP2:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_CSITX:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT3:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT4:   0. 0 %                                   
                                                                                    
    CPU: mcu2_0: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   16100352 B ()
    CPU: mcu2_0: HEAP:           L3_MEM: size =     131072 B, free =      98304 B ()
    CPU: mcu2_0: HEAP:  DDR_NON_CACHE_M: size =   16777216 B, free =   16777216 B ()
                                                                                    
    CPU: mcu2_1: TASK:           IPC_RX:   0. 0 %                                   
    CPU: mcu2_1: TASK:       REMOTE_SRV:   0. 1 %                                   
    CPU: mcu2_1: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU: mcu2_1: TASK:         TIVX_SDE:   0. 0 %                                   
    CPU: mcu2_1: TASK:         TIVX_DOF:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VDEC1:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VDEC2:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VENC1:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VENC2:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU: mcu2_1: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   16774912 B ()
    CPU: mcu2_1: HEAP:           L3_MEM: size =     131072 B, free =     131072 B ()
    CPU: mcu2_1: HEAP:  DDR_NON_CACHE_M: size =  117440512 B, free =   97542144 B ()
                                                                                    
    CPU:  c6x_1: TASK:           IPC_RX:   0. 1 %                                   
    CPU:  c6x_1: TASK:       REMOTE_SRV:   0. 0 %                                   
    CPU:  c6x_1: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU:  c6x_1: TASK:         TIVX_CPU:   1.21 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU:  c6x_1: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   16761856 B ()
    CPU:  c6x_1: HEAP:           L2_MEM: size =     229376 B, free =          0 B ()
    CPU:  c6x_1: HEAP:  DDR_SCRATCH_MEM: size =   50331648 B, free =   50331648 B ()
                                                                                    
    CPU:  c6x_2: TASK:           IPC_RX:   0. 0 %                                   
    CPU:  c6x_2: TASK:       REMOTE_SRV:   0. 0 %                                   
    CPU:  c6x_2: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU:  c6x_2: TASK:         TIVX_CPU:   1.20 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU:  c6x_2: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   16774912 B ()
    CPU:  c6x_2: HEAP:           L2_MEM: size =     229376 B, free =     229376 B ()
    CPU:  c6x_2: HEAP:  DDR_SCRATCH_MEM: size =   50331648 B, free =   50331648 B ()
                                                                                    
    CPU:  c7x_1: TASK:           IPC_RX:   0. 0 %                                   
    CPU:  c7x_1: TASK:       REMOTE_SRV:   0. 0 %                                   
    CPU:  c7x_1: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU:  c7x_1: TASK:         TIVX_CPU:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU:  c7x_1: HEAP:   DDR_SHARED_MEM: size = 1073741824 B, free =  806690304 B ()
    CPU:  c7x_1: HEAP:           L3_MEM: size =    8159232 B, free =          0 B ()
    CPU:  c7x_1: HEAP:           L2_MEM: size =     491520 B, free =     491520 B ()
    CPU:  c7x_1: HEAP:           L1_MEM: size =      16384 B, free =          0 B ()
    CPU:  c7x_1: HEAP:  DDR_SCRATCH_MEM: size =  268435456 B, free =  251771584 B ()
                                                                                    
                                                                                    
    GRAPH: app_tidl_od_cam_graph (#nodes =   9, #executions =   6878)               
     NODE:   CAPTURE1:             capture_node: avg =    219 usecs, min/max =    18
     NODE: VPAC_VISS1:                viss_node: avg =   9225 usecs, min/max =   818
     NODE:     IPU1-0:                aewb_node: avg =    681 usecs, min/max =     8
     NODE:  VPAC_MSC1:               ScalerNode: avg =  10720 usecs, min/max =  1058
     NODE:      DSP-1:              PreProcNode: avg =    674 usecs, min/max =    68
     NODE:   DSP_C7-1:                 TIDLNode: avg =  62143 usecs, min/max =  6168
     NODE:      DSP-2:    DrawBoxDetectionsNode: avg =   4260 usecs, min/max =   418
     NODE:  VPAC_MSC1:              mosaic_node: avg =   2315 usecs, min/max =   198
     NODE:   DISPLAY1:              DisplayNode: avg =   8724 usecs, min/max =     8
                                                                                    
     PERF:           FILEIO: avg =      0 usecs, min/max = 4294967295 /      0 usec0
     PERF:            TOTAL: avg =  62113 usecs, min/max =      4 /  84532 usecs, #7
                                                                                    
     PERF:            TOTAL:   16. 9 FPS                                            
                                                                                    
                                                                                    
                                                                                    
     ==========================================                                     
     TIDL Demo - Camera based Object Detection                                      
     ==========================================                                     
                                                                                    
     p: Print performance statistics                                                
                                                                                    
     x: Exit                                                                        
                                                                                    
     Enter Choice:                                                                  
                                                                                    
                                                                                    
     ==========================================                                     
     TIDL Demo - Camera based Object Detection                                      
     ==========================================                                     
                                                                                    
     p: Print performance statistics                                                
                                                                                    
     x: Exit                                                                        
                                                                                    
     Enter Choice: 
    
    

    3 cameras:

     ==========================================                                     
     TIDL Demo - Camera based Object Detection                                      
     ==========================================                                     
                                                                                    
     p: Print performance statistics                                                
                                                                                    
     x: Exit                                                                        
                                                                                    
     Enter Choice: p                                                                
                                                                                    
                                                                                    
    Summary of CPU load,                                                            
    ====================                                                            
                                                                                    
    CPU: mpu1_0: TOTAL LOAD =   0.61 % ( HWI =   0. 5 %, SWI =   0. 0 % )           
    CPU: mcu2_0: TOTAL LOAD =  15.84 % ( HWI =   3.81 %, SWI =   0.92 % )           
    CPU: mcu2_1: TOTAL LOAD =   0.12 % ( HWI =   0. 6 %, SWI =   0. 3 % )           
    CPU:  c6x_1: TOTAL LOAD =   1.25 % ( HWI =   0. 6 %, SWI =   0. 6 % )           
    CPU:  c6x_2: TOTAL LOAD =   1.11 % ( HWI =   0. 6 %, SWI =   0. 3 % )           
    CPU:  c7x_1: TOTAL LOAD =   0. 7 % ( HWI =   0. 3 %, SWI =   0. 2 % )           
                                                                                    
                                                                                    
    HWA performance statistics,                                                     
    ===========================                                                     
                                                                                    
    HWA:   VISS: LOAD =  11.76 % ( 65 MP/s )                                        
    HWA:   MSC0: LOAD =  20.18 % ( 117 MP/s )                                       
    HWA:   MSC1: LOAD =   1.88 % ( 10 MP/s )                                        
                                                                                    
                                                                                    
    DDR performance statistics,                                                     
    ===========================                                                     
                                                                                    
    DDR: READ  BW: AVG =   2958 MB/s, PEAK =   3011 MB/s                            
    DDR: WRITE BW: AVG =    704 MB/s, PEAK =    863 MB/s                            
    DDR: TOTAL BW: AVG =   3662 MB/s, PEAK =   3874 MB/s                            
                                                                                    
                                                                                    
    Detailed CPU performance/memory statistics,                                     
    ===========================================                                     
                                                                                    
    CPU: mcu2_0: TASK:           IPC_RX:   0. 7 %                                   
    CPU: mcu2_0: TASK:       REMOTE_SRV:   0.10 %                                   
    CPU: mcu2_0: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU: mcu2_0: TASK:         TIVX_CPU:   1.37 %                                   
    CPU: mcu2_0: TASK:          TIVX_NF:   0. 0 %                                   
    CPU: mcu2_0: TASK:        TIVX_LDC1:   0. 0 %                                   
    CPU: mcu2_0: TASK:        TIVX_MSC1:   3.19 %                                   
    CPU: mcu2_0: TASK:        TIVX_MSC2:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_VISS1:   2.51 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT1:   0.27 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT2:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_DISP1:   0.20 %                                   
    CPU: mcu2_0: TASK:       TIVX_DISP2:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_CSITX:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT3:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT4:   0. 0 %                                   
                                                                                    
    CPU: mcu2_0: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   15799808 B ()
    CPU: mcu2_0: HEAP:           L3_MEM: size =     131072 B, free =      81920 B ()
    CPU: mcu2_0: HEAP:  DDR_NON_CACHE_M: size =   16777216 B, free =   16777216 B ()
                                                                                    
    CPU: mcu2_1: TASK:           IPC_RX:   0. 0 %                                   
    CPU: mcu2_1: TASK:       REMOTE_SRV:   0. 1 %                                   
    CPU: mcu2_1: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU: mcu2_1: TASK:         TIVX_SDE:   0. 0 %                                   
    CPU: mcu2_1: TASK:         TIVX_DOF:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VDEC1:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VDEC2:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VENC1:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VENC2:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU: mcu2_1: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   16774912 B ()
    CPU: mcu2_1: HEAP:           L3_MEM: size =     131072 B, free =     131072 B ()
    CPU: mcu2_1: HEAP:  DDR_NON_CACHE_M: size =  117440512 B, free =   97542144 B ()
                                                                                    
    CPU:  c6x_1: TASK:           IPC_RX:   0. 2 %                                   
    CPU:  c6x_1: TASK:       REMOTE_SRV:   0. 0 %                                   
    CPU:  c6x_1: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU:  c6x_1: TASK:         TIVX_CPU:   1. 8 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU:  c6x_1: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   16761088 B ()
    CPU:  c6x_1: HEAP:           L2_MEM: size =     229376 B, free =          0 B ()
    CPU:  c6x_1: HEAP:  DDR_SCRATCH_MEM: size =   50331648 B, free =   50331648 B ()
                                                                                    
    CPU:  c6x_2: TASK:           IPC_RX:   0. 0 %                                   
    CPU:  c6x_2: TASK:       REMOTE_SRV:   0. 0 %                                   
    CPU:  c6x_2: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU:  c6x_2: TASK:         TIVX_CPU:   0.99 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU:  c6x_2: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   16774912 B ()
    CPU:  c6x_2: HEAP:           L2_MEM: size =     229376 B, free =     229376 B ()
    CPU:  c6x_2: HEAP:  DDR_SCRATCH_MEM: size =   50331648 B, free =   50331648 B ()
                                                                                    
    CPU:  c7x_1: TASK:           IPC_RX:   0. 0 %                                   
    CPU:  c7x_1: TASK:       REMOTE_SRV:   0. 0 %                                   
    CPU:  c7x_1: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU:  c7x_1: TASK:         TIVX_CPU:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU:  c7x_1: HEAP:   DDR_SHARED_MEM: size = 1073741824 B, free =  673164544 B ()
    CPU:  c7x_1: HEAP:           L3_MEM: size =    8159232 B, free =          0 B ()
    CPU:  c7x_1: HEAP:           L2_MEM: size =     491520 B, free =     491520 B ()
    CPU:  c7x_1: HEAP:           L1_MEM: size =      16384 B, free =          0 B ()
    CPU:  c7x_1: HEAP:  DDR_SCRATCH_MEM: size =  268435456 B, free =  251771584 B ()
                                                                                    
                                                                                    
    GRAPH: app_tidl_od_cam_graph (#nodes =   9, #executions =     87)               
     NODE:   CAPTURE1:             capture_node: avg =   3562 usecs, min/max =    17
     NODE: VPAC_VISS1:                viss_node: avg =  13857 usecs, min/max =  1247
     NODE:     IPU1-0:                aewb_node: avg =   1326 usecs, min/max =    17
     NODE:  VPAC_MSC1:               ScalerNode: avg =  16638 usecs, min/max =  1587
     NODE:      DSP-1:              PreProcNode: avg =    990 usecs, min/max =    97
     NODE:   DSP_C7-1:                 TIDLNode: avg =  95664 usecs, min/max =  9487
     NODE:      DSP-2:    DrawBoxDetectionsNode: avg =   6288 usecs, min/max =   627
     NODE:  VPAC_MSC1:              mosaic_node: avg =   5425 usecs, min/max =   407
     NODE:   DISPLAY1:              DisplayNode: avg =  10852 usecs, min/max =     7
                                                                                    
     PERF:           FILEIO: avg =      0 usecs, min/max = 4294967295 /      0 usec0
     PERF:            TOTAL: avg =  87364 usecs, min/max =      4 / 118123 usecs, #7
                                                                                    
     PERF:            TOTAL:   11.44 FPS             
    

    4 cameras:

    ==========================================                                     
     TIDL Demo - Camera based Object Detection                                      
     ==========================================                                     
                                                                                    
     p: Print performance statistics                                                
                                                                                    
     x: Exit                                                                        
                                                                                    
     Enter Choice: p                                                                
                                                                                    
                                                                                    
    Summary of CPU load,                                                            
    ====================                                                            
                                                                                    
    CPU: mpu1_0: TOTAL LOAD =   0.76 % ( HWI =   0. 7 %, SWI =   0. 7 % )           
    CPU: mcu2_0: TOTAL LOAD =  16.98 % ( HWI =   4. 9 %, SWI =   0.97 % )           
    CPU: mcu2_1: TOTAL LOAD =   0.14 % ( HWI =   0. 6 %, SWI =   0. 4 % )           
    CPU:  c6x_1: TOTAL LOAD =   1.11 % ( HWI =   0. 5 %, SWI =   0. 3 % )           
    CPU:  c6x_2: TOTAL LOAD =   0.95 % ( HWI =   0. 6 %, SWI =   0. 3 % )           
    CPU:  c7x_1: TOTAL LOAD =   0. 7 % ( HWI =   0. 3 %, SWI =   0. 2 % )           
                                                                                    
                                                                                    
    HWA performance statistics,                                                     
    ===========================                                                     
                                                                                    
    HWA:   VISS: LOAD =  12.16 % ( 64 MP/s )                                        
    HWA:   MSC0: LOAD =  19.31 % ( 109 MP/s )                                       
    HWA:   MSC1: LOAD =   2.42 % ( 13 MP/s )                                        
                                                                                    
                                                                                    
    DDR performance statistics,                                                     
    ===========================                                                     
                                                                                    
    DDR: READ  BW: AVG =   2871 MB/s, PEAK =   2962 MB/s                            
    DDR: WRITE BW: AVG =    830 MB/s, PEAK =   1062 MB/s                            
    DDR: TOTAL BW: AVG =   3701 MB/s, PEAK =   4024 MB/s                            
                                                                                    
                                                                                    
    Detailed CPU performance/memory statistics,                                     
    ===========================================                                     
                                                                                    
    CPU: mcu2_0: TASK:           IPC_RX:   0. 5 %                                   
    CPU: mcu2_0: TASK:       REMOTE_SRV:   0.15 %                                   
    CPU: mcu2_0: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU: mcu2_0: TASK:         TIVX_CPU:   1.29 %                                   
    CPU: mcu2_0: TASK:          TIVX_NF:   0. 0 %                                   
    CPU: mcu2_0: TASK:        TIVX_LDC1:   0. 0 %                                   
    CPU: mcu2_0: TASK:        TIVX_MSC1:   3.34 %                                   
    CPU: mcu2_0: TASK:        TIVX_MSC2:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_VISS1:   2.78 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT1:   0.27 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT2:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_DISP1:   0.18 %                                   
    CPU: mcu2_0: TASK:       TIVX_DISP2:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_CSITX:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT3:   0. 0 %                                   
    CPU: mcu2_0: TASK:       TIVX_CAPT4:   0. 0 %                                   
                                                                                    
    CPU: mcu2_0: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   15488512 B ()
    CPU: mcu2_0: HEAP:           L3_MEM: size =     131072 B, free =      65536 B ()
    CPU: mcu2_0: HEAP:  DDR_NON_CACHE_M: size =   16777216 B, free =   16777216 B ()
                                                                                    
    CPU: mcu2_1: TASK:           IPC_RX:   0. 0 %                                   
    CPU: mcu2_1: TASK:       REMOTE_SRV:   0. 1 %                                   
    CPU: mcu2_1: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU: mcu2_1: TASK:         TIVX_SDE:   0. 0 %                                   
    CPU: mcu2_1: TASK:         TIVX_DOF:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VDEC1:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VDEC2:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VENC1:   0. 0 %                                   
    CPU: mcu2_1: TASK:       TIVX_VENC2:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU: mcu2_1: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   16774912 B ()
    CPU: mcu2_1: HEAP:           L3_MEM: size =     131072 B, free =     131072 B ()
    CPU: mcu2_1: HEAP:  DDR_NON_CACHE_M: size =  117440512 B, free =   97542144 B ()
                                                                                    
    CPU:  c6x_1: TASK:           IPC_RX:   0. 0 %                                   
    CPU:  c6x_1: TASK:       REMOTE_SRV:   0. 0 %                                   
    CPU:  c6x_1: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU:  c6x_1: TASK:         TIVX_CPU:   0.99 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU:  c6x_1: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   16760320 B ()
    CPU:  c6x_1: HEAP:           L2_MEM: size =     229376 B, free =          0 B ()
    CPU:  c6x_1: HEAP:  DDR_SCRATCH_MEM: size =   50331648 B, free =   50331648 B ()
                                                                                    
    CPU:  c6x_2: TASK:           IPC_RX:   0. 0 %                                   
    CPU:  c6x_2: TASK:       REMOTE_SRV:   0. 0 %                                   
    CPU:  c6x_2: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU:  c6x_2: TASK:         TIVX_CPU:   0.83 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c6x_2: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU:  c6x_2: HEAP:   DDR_SHARED_MEM: size =   16777216 B, free =   16774912 B ()
    CPU:  c6x_2: HEAP:           L2_MEM: size =     229376 B, free =     229376 B ()
    CPU:  c6x_2: HEAP:  DDR_SCRATCH_MEM: size =   50331648 B, free =   50331648 B ()
                                                                                    
    CPU:  c7x_1: TASK:           IPC_RX:   0. 0 %                                   
    CPU:  c7x_1: TASK:       REMOTE_SRV:   0. 0 %                                   
    CPU:  c7x_1: TASK:        LOAD_TEST:   0. 0 %                                   
    CPU:  c7x_1: TASK:         TIVX_CPU:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_RX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %                                   
                                                                                    
    CPU:  c7x_1: HEAP:   DDR_SHARED_MEM: size = 1073741824 B, free =  539638784 B ()
    CPU:  c7x_1: HEAP:           L3_MEM: size =    8159232 B, free =          0 B ()
    CPU:  c7x_1: HEAP:           L2_MEM: size =     491520 B, free =     491520 B ()
    CPU:  c7x_1: HEAP:           L1_MEM: size =      16384 B, free =          0 B ()
    CPU:  c7x_1: HEAP:  DDR_SCRATCH_MEM: size =  268435456 B, free =  251771584 B ()
                                                                                    
                                                                                    
    GRAPH: app_tidl_od_cam_graph (#nodes =   9, #executions =     41)               
     NODE:   CAPTURE1:             capture_node: avg =   6979 usecs, min/max =    11
     NODE: VPAC_VISS1:                viss_node: avg =  19697 usecs, min/max =  1721
     NODE:     IPU1-0:                aewb_node: avg =   1972 usecs, min/max =    11
     NODE:  VPAC_MSC1:               ScalerNode: avg =  22967 usecs, min/max =  2211
     NODE:      DSP-1:              PreProcNode: avg =   1314 usecs, min/max =   121
     NODE:   DSP_C7-1:                 TIDLNode: avg = 132638 usecs, min/max = 13041
     NODE:      DSP-2:    DrawBoxDetectionsNode: avg =   8546 usecs, min/max =   841
     NODE:  VPAC_MSC1:              mosaic_node: avg =   6558 usecs, min/max =   401
     NODE:   DISPLAY1:              DisplayNode: avg =  10233 usecs, min/max =    11
                                                                                    
     PERF:           FILEIO: avg =      0 usecs, min/max = 4294967295 /      0 usec0
     PERF:            TOTAL: avg = 110021 usecs, min/max =      4 / 161886 usecs, #1
                                                                                    
     PERF:            TOTAL:    9. 8 FPS                                            
                                                                                    
                                                                                    
                                                                                    
     ==========================================                                     
     TIDL Demo - Camera based Object Detection                                      
     ==========================================                                     
                                                                                    
     p: Print performance statistics                                                
                                                                                    
     x: Exit                                                                        
                                                                                    
     Enter Choice:                                                                  
                                                                                    
                                                                                    
     ==========================================                                     
     TIDL Demo - Camera based Object Detection                                      
     ==========================================                                     
                                                                                    
     p: Print performance statistics                                                
                                                                                    
     x: Exit                                                                        
                                                                                    
     Enter Choice: 
    
    

  • Hi Shyam,

    Do you have schedule that improve the performance of Yolov3?

    Best regards

    -Jason

  • Hi Shyam,

    Sorry, I have one more question about Yolov3.
    Can I adjust any parameter to improve object detection FPS?

    Thank you very much.

    -Jason

  • Hi Jason,

    You adjust below parameters in "tidl_import_yolo3_metaarch.prototxt" to improve the FPS to some extent.

    Increase confidence_threshold  or decrease top_k/keep_top_k.

    top_k: 200
    }
    code_type: CENTER_SIZE
    keep_top_k: 100
    confidence_threshold: 0.15

    Above may help in increasing FPS marginally.

    If you have option of retraining Yolo v3 model, we would recommend to replace leakyRelu with ReLU to get better performance/FPS.