I was making a hef file from my yolo11s model and the difference was x stream.
I got true all the chain yolo → onnx ->hef.
the onnx quality was lower than the yolo11s.pt but not very much.
so after asking copilot at github how the system is working and optimize I found the error. I have just did what a lot of youtube videos told me, copy the train library to the shared_with_docker library.
But in this library there is fake pictures and this is defensibly NOT good for hailo hef optimization.
After making a new calib library with only pictures with label I just make a new hef compilation and what a different my hailo.hef file has better conv. than the org. yolo.pt.
in 98% of the frames.
copilot make this python script for me to isolate only pictures with label.
My train library contains
images and labels library.
import os
import shutil
import random
# -- RET disse stier! --
images_dir = "train/images"
labels_dir = "train/labels"
output_dir = "calib500"
max_images = 500
img_exts = [".jpg", ".jpeg", ".png"]
label_ext = ".txt"
os.makedirs(output_dir, exist_ok=True)
# Find billeder med tilhørende label
labeled_imgs = []
for fname in os.listdir(images_dir):
if any(fname.lower().endswith(ext) for ext in img_exts):
base = os.path.splitext(fname)[0]
label_path = os.path.join(labels_dir, base + label_ext)
if os.path.exists(label_path) and os.path.getsize(label_path) > 0:
labeled_imgs.append(fname)
print(f"Fandt {len(labeled_imgs)} billeder med labels.")
if len(labeled_imgs) > max_images:
labeled_imgs = random.sample(labeled_imgs, max_images)
# Kopier billeder til output_dir
for fname in labeled_imgs:
shutil.copy(os.path.join(images_dir, fname), os.path.join(output_dir, fname))
print(f"Kopieret {len(labeled_imgs)} billeder til {output_dir}")