Tool/software:
Hello team,
My team and I are working on running an ML model capable of performing low-light image enhancement on the AM62A EVM. We are trying to offload some of the processing to the DL accelerator. We were able to compile the model using the edgeai_tidl_tools and generate the artifacts of the model.
We used the edgeai_gst_apps to run the model. We wrote the following config file:
title: "Low Light Enhancement" log_level: 2 inputs: input0: source: /dev/video-usb-cam0 format: jpeg width: 1280 height: 720 framerate: 30 input1: source: /home/weston/image.jpg width: 600 height: 400 index: 0 framerate: 1 loop: False models: model0: model_path: /opt/model_zoo/zero_dce_model outputs: output0: sink: kmssink width: 1920 height: 1080 overlay-perf-type: graph output1: sink: /home/weston/image_enhanced.jpg width: 600 height: 400 flows: flow0: [input1,model0,output1]
The paths provided in the config file have been verified. But, running the app_edgeai.py script gives the following output, and the enhanced image is not generated:
Number of subgraphs:8 , 43 nodes delegated out of 51 nodes APP: Init ... !!! 72.527621 s: MEM: Init ... !!! 72.527692 s: MEM: Initialized DMA HEAP (fd=6) !!! 72.527880 s: MEM: Init ... Done !!! 72.527909 s: IPC: Init ... !!! 72.544456 s: IPC: Init ... Done !!! REMOTE_SERVICE: Init ... !!! REMOTE_SERVICE: Init ... Done !!! 72.552242 s: GTC Frequency = 200 MHz APP: Init ... Done !!! 72.555707 s: VX_ZONE_INIT:Enabled 72.555749 s: VX_ZONE_ERROR:Enabled 72.555759 s: VX_ZONE_WARNING:Enabled 72.556967 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:124] Added target MPU-0 72.557151 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:124] Added target MPU-1 72.557257 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:124] Added target MPU-2 72.557352 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:124] Added target MPU-3 72.557366 s: VX_ZONE_INIT:[tivxInitLocal:136] Initialization Done !!! 72.558931 s: VX_ZONE_INIT:[tivxHostInitLocal:106] Initialization Done for HOST !!! INFO: Created TensorFlow Lite XNNPACK delegate for CPU. ==========[INPUT PIPELINE(S)]========== [PIPE-0] multifilesrc location=/home/weston/image.jpg index=1 ! jpegdec ! videoscale qos=True ! capsfilter caps="video/x-raw, width=(int)600, height=(int)400;" ! tiovxdlcolorconvert ! capsfilter caps="video/x-raw, format=(string)NV12;" ! tiovxmultiscaler name=split_01 split_01. ! queue ! capsfilter caps="video/x-raw, width=(int)600, height=(int)400;" ! tiovxdlcolorconvert out-pool-size=4 ! capsfilter caps="video/x-raw, format=(string)RGB;" ! appsink max-buffers=2 drop=True name=sen_0 split_01. ! queue ! capsfilter caps="video/x-raw, width=(int)600, height=(int)400;" ! videoscale qos=True ! capsfilter caps="video/x-raw, width=(int)600, height=(int)600;" ! tiovxdlpreproc out-pool-size=4 channel-order=1 ! capsfilter caps="application/x-tensor-tiovx;" ! appsink max-buffers=2 drop=True name=pre_0 ==========[OUTPUT PIPELINE]========== 73.144299 s: MEM: ERROR: Alloc failed with status = 12 !!! 73.144351 s: VX_ZONE_ERROR:[tivxMemBufferAlloc:90] Shared mem ptr allocation failed 73.145215 s: MEM: ERROR: Alloc failed with status = 12 !!! 73.145253 s: VX_ZONE_ERROR:[tivxMemBufferAlloc:90] Shared mem ptr allocation failed 73.151641 s: MEM: ERROR: Alloc failed with status = 12 !!! 73.151696 s: VX_ZONE_ERROR:[tivxMemBufferAlloc:90] Shared mem ptr allocation failed appsrc do-timestamp=True format=3 block=True name=post_0 ! tiovxdlcolorconvert ! capsfilter caps="video/x-raw, format=(string)NV12, width=(int)600, height=(int)400;" ! v4l2jpegenc ! multifilesink sync=False location=/home/weston/image_enhanced.jpg 73.183287 s: MEM: ERROR: Alloc failed with status = 12 !!! 73.183343 s: VX_ZONE_ERROR:[tivxMemBufferAlloc:90] Shared mem ptr allocation failed 73.184087 s: MEM: ERROR: Alloc failed with status = 12 !!! 73.184120 s: VX_ZONE_ERROR:[tivxMemBufferAlloc:90] Shared mem ptr allocation failed 73.184637 s: MEM: ERROR: Alloc failed with status = 12 !!! 73.184662 s: VX_ZONE_ERROR:[tivxMemBufferAlloc:90] Shared mem ptr allocation failed 73.185169 s: MEM: ERROR: Alloc failed with status = 12 !!! 73.185190 s: VX_ZONE_ERROR:[tivxMemBufferAlloc:90] Shared mem ptr allocation failed +--------------------------------------------------------------------------+ | Low Light Enhancement | +--------------------------------------------------------------------------+ +--------------------------------------------------------------------------+ | Input Src: /home/weston/image.jpg | | Model Name: zero_dce_model | | Model Type: custom | +--------------------------------------------------------------------------+ +--------------------------------------------------------------------------+ +--------------------------------------------------------------------------+ | Low Light Enhancement | +--------------------------------------------------------------------------+ +--------------------------------------------------------------------------+ | Input Src: /home/weston/image.jpg | | Model Name: zero_dce_model | | Model Type: custom | +--------------------------------------------------------------------------+ +--------------------------------------------------------------------------+ 75.493006 s: VX_ZONE_WARNING:[vxReleaseContext:1213] Found a reference 0xffff781164a8 of type 00000815 at external count 7, internal count 0, releasing it 75.493056 s: VX_ZONE_WARNING:[vxReleaseContext:1215] Releasing reference (name=tensor_202) now as a part of garbage collection 75.493091 s: VX_ZONE_WARNING:[vxReleaseContext:1213] Found a reference 0xffff780f7a18 of type 00000813 at external count 1, internal count 0, releasing it 75.493104 s: VX_ZONE_WARNING:[vxReleaseContext:1215] Releasing reference (name=object_array_208) now as a part of garbage collection 75.493524 s: VX_ZONE_WARNING:[vxReleaseContext:1213] Found a reference 0xffff780f7bc0 of type 00000813 at external count 1, internal count 0, releasing it 75.493539 s: VX_ZONE_WARNING:[vxReleaseContext:1215] Releasing reference (name=object_array_210) now as a part of garbage collection 75.493919 s: VX_ZONE_WARNING:[vxReleaseContext:1213] Found a reference 0xffff780f7d68 of type 00000813 at external count 1, internal count 0, releasing it 75.493934 s: VX_ZONE_WARNING:[vxReleaseContext:1215] Releasing reference (name=object_array_214) now as a part of garbage collection 75.494401 s: VX_ZONE_INIT:[tivxHostDeInitLocal:120] De-Initialization Done for HOST !!! 75.499484 s: VX_ZONE_INIT:[tivxDeInitLocal:206] De-Initialization Done !!! APP: Deinit ... !!! REMOTE_SERVICE: Deinit ... !!! REMOTE_SERVICE: Deinit ... Done !!! 75.499976 s: IPC: Deinit ... !!! 75.500485 s: IPC: DeInit ... Done !!! 75.500532 s: MEM: Deinit ... !!! 75.500549 s: DDR_SHARED_MEM: Alloc's: 109 alloc's of 200056184 bytes 75.500561 s: DDR_SHARED_MEM: Free's : 109 free's of 200056184 bytes 75.500571 s: DDR_SHARED_MEM: Open's : 0 allocs of 0 bytes 75.500587 s: MEM: Deinit ... Done !!! APP: Deinit ... Done !!!
The compiled model
zero_dce_model.zip