Hello I’m stuck since a few days and I would need some help.
I have fined tuned a yolov8n model to detect a specific object and then exported it to onnx. When I ran inference on my onnx model it showed good results.
I then parsed, optimized and compiled my onnx model to it’s final hef format using this script:
#!/usr/bin/env bash
# set -e
MODEL_NAME= best_02
# parse
hailo parser onnx \
--har-path models/${MODEL_NAME}.har \
--hw-arch hailo8 \
--end-node-names "/model.22/cv2.0/cv2.0.2/Conv" "/model.22/cv3.0/cv3.0.2/Conv" "/model.22/cv2.1/cv2.1.2/Conv" "/model.22/cv3.1/cv3.1.2/Conv" "/model.22/cv2.2/cv2.2.2/Conv" "/model.22/cv3.2/cv3.2.2/Conv" \
-- \
models/${MODEL_NAME}.onnx
# --end-node-names "/model.22/Concat_3"
# optimize
hailo optimize \
--output-har-path models/${MODEL_NAME}_calib.har \
--hw-arch hailo8 \
--use-random-calib-set \
--model-script models/${MODEL_NAME}.alls \
models/${MODEL_NAME}.har
#
# hailo optimize \
# --output-har-path ${MODEL_NAME}_calib.har \
# --hw-arch hailo8 \
# --calib-set-path calibration_data.npy \
# --model-script model_scripts/optimization_1_compression_0.alls \
# models/${MODEL_NAME}.har
# compile
hailo compiler \
--output-dir models/ \
--output-har-path ${MODEL_NAME}_compiled.har \
--hw-arch hailo8 \
--model-script models/${MODEL_NAME}.alls \
models/${MODEL_NAME}_calib.har
The .alls file was this:
normalization1 = normalization([0.0, 0.0, 0.0], [255.0, 255.0, 255.0])
change_output_activation(conv42, sigmoid)
change_output_activation(conv53, sigmoid)
change_output_activation(conv63, sigmoid)
#nms_postprocess("../../postprocess_config/yolov8n_nms_config.json", meta_arch=yolov8, engine=gpu)
allocator_param(width_splitter_defuse=disabled)
However I can’t find a way to make my inference work using a jpg test image. I have applied nms during the optimization of my model (when asked do you want to apply y/n). Now, I have tried to write my own custom inference script following the hailo tutorial on jupyter but I either get error messages or get output images without any detecting boxes on them.
I also tried running the object detection script from the hailo application code exemple but that also always gave me error messages (wrong output shapes or other).
Is there anything you recommend for the inference of a finetuned yolo model? I’m using the hailo 8m chip and the 4.19 hailo dfc and hailort.
Thank you!