Greetings, I recently started working with hailo8.
I have a learning task to run an inference of a trained custom u-net model for a semantic segmentation task. The initial model is presented in the format .onnx . I have converted the model from the .onnx to .hef format according to the official Hailo manual (https://hailo.ai/developer-zone/documentation/dataflow-compiler-v3-33-0/?sp_referrer=tutorials/tutorials.html).
I tried to launch inference using a ready-made example./runtime/hailo-8/cpp/semantic_segmentation/semseg.cpp from the Hailo-Application-Code-Examples repository ( GitHub - hailo-ai/Hailo-Application-Code-Examples ), but I came across the fact that the pixel classes of the input image belong to non-existent classes:
.venv) admin@raspberrypi:~/Hailo-Application-Code-Examples/runtime/hailo-8/cpp/semantic_segmentation $ ./segmentation_example_cpp -hef=./custom_hailo_models/last_best_model_hailo.hef -path=./image_part_001.mp4
-I- video path: ./image_part_001.mp4
-I- hef: ./custom_hailo_models/last_best_model_hailo.hef
-I---------------------------------------------------------------------
-I- Dir Name
-I---------------------------------------------------------------------
-I- IN: best_model_hailo/input_layer1
-I---------------------------------------------------------------------
-I- OUT: best_model_hailo/conv46
-I---------------------------------------------------------------------
-I- Started write thread ./image_part_001.mp4
-I- Started read thread ./image_part_001.mp4
Class num: 141
segmentation_example_cpp: /home/admin/Hailo-Application-Code-Examples/runtime/hailo-8/cpp/semantic_segmentation/cityscape_labels.hpp:41: cv::Vec3f CityScapeLabels::id_2_color(int): Assertion `i >= 0 && i <= 6' failed.
Aborted
My Model Parameters:
Architecture: U-net;
The size of the entrance: {1, 3, 512, 512};
Output size: {1, 6, 512, 512};
Training sample size: 63;
Batch size: 1;
Color format: RGB.
Optimization parameters:
hw_arch: hailo8;
output_height=512;
output_width=512;
resize_side=512;
alls = “normalization1 = normalization([123.675, 116.28, 103.53], [58.395, 57.12, 57.375])\n”
The thing is, I don’t understand: I made a mistake in the conversion process or misunderstood the operation of the inference. I would be very grateful if you would point out my mistake, give me advice, or at least send me the most complete guide for the correct conversion and launch of the inference of my model.
Thank you in advance!