I’m using RPI with Hailo AI kit (version 4.20.0)
I’m trying to inference an image and getting the following error:
[HailoRT] [error] CHECK failed - Memory size of vstream yolov8n/input_layer1 does not match the frame count! (Expected 25165824000, got 19660800)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INVALID_ARGUMENT(2)
this is my code:
imageDetections = []
file = request.files['image']
image = Image.open(file)
image_height = image.height
image_width = image.width
devices = Device.scan()
with VDevice(device_ids=devices) as target:
hef = HEF(f'resources/{model}.hef')
utils = ObjectDetectionUtils(f"resources/{model}.txt")
# Convert the image to a numpy array
image = image.resize((1280, 1280))
image = np.array(image)
network_group = configure_and_get_network_group(hef, target)
network_group_params = network_group.create_params()
input_vstreams_params, output_vstreams_params = create_input_output_vstream_params(network_group)
# print info of input & output
input_vstream_info, output_vstream_info = print_input_output_vstream_info(hef)
start_time = time.time()
with InferVStreams(network_group, input_vstreams_params, output_vstreams_params) as infer_pipeline:
total_inference_time = 0
with network_group.activate(network_group_params):
np_array = np.array(image, dtype=np.float32) / 255.0
input_data = {input_vstream_info[0].name: np_array}
raw_image = infer_pipeline.infer(input_data)
detections = utils.extract_detections(raw_image[next(iter(output_vstream_info)).name][0], range)
#print(detections)
for detection in detections:
imageDetections.append(detection)
end_time = time.time()
total_inference_time = (end_time - start_time)
logger.info("Total inference time: {} sec", total_inference_time)
#im = Image.open(BytesIO(base64.b64decode(data['image'])))
return jsonify(imageDetections)
this is my hef file:
Architecture HEF was compiled for: HAILO8
Network group name: yolov8n, Single Context
Network name: yolov8n/yolov8n
VStream infos:
Input yolov8n/input_layer1 UINT8, NHWC(1280x1280x3)
Output yolov8n/yolov8_nms_postprocess FLOAT32, HAILO NMS BY CLASS(number of classes: 2, maximum bounding boxes per class: 100, maximum frame size: 4008)
Operation:
Op YOLOV8
Name: YOLOV8-Post-Process
Score threshold: 0.200
IoU threshold: 0.70
Classes: 2
Cross classes: false
NMS results order: BY_CLASS
Max bboxes per class: 100
Image height: 1280
Image width: 1280
Any idea what can be the problem? I tried to look for previous messages but i’m not ablt to find useful information