Hailo model input layer is UINT8 but expects FLOAT32 during runtime

My Yolov5 Hailo8 model was compiled with an input layer expecting the UINT8 data type:

Architecture HEF was compiled for: HAILO8
Network group name: model, Single Context
** Network name: model/model**
** VStream infos:**
** Input model/input_layer1 UINT8, NHWC(640x640x3)**
** Output model/yolov5_nms_postprocess FLOAT32, HAILO NMS(number of classes: 15, maximum bounding boxes per class: 80, maximum frame size: 24060)**
** Operation:**
** Op YOLOV5**
** Name: YOLOv5-Post-Process**
** Score threshold: 0.200**
** IoU threshold: 0.60**
** Classes: 15**
** Cross classes: false**
** Max bboxes per class: 80**
** Image height: 640**
** Image width: 640**

However, during runtime (using pyhailort 4.19) if I pass a UINT8 array to the model for inference I get the following warning, which causes inference to slow down:

Given input data dtype (uint8) is different than inferred dtype (float32). conversion for every frame will reduce performance

Converting the array to float32 in my software of course will also take a few milliseconds and cause added latency. Thus, are there specific options during compilation or runtime in PyHailoRT that will allow the model to accept UINT8 input like a quantized model normally would?

Hi @connor.malley,

Iit seems like the input type might have been set to FLOAT32 with the hailort API.

Can you share your inference code?

Hi Nina,

You are correct, it seems like the FormatType parameter was set to float32. I had also set quantized=True, but after looking at the pyhailort source code I did not realize this was deprecated and was not being used. Thank you!

1 Like