I’ve come across this related issue and posted a comment, but it hasn’t had a response and since it referred to the C++ library, thought I’d open a new thread for the python library.
I’ve finetuned a yolo11n on VisDrone using Ultralytics - then used the DFC to parse and optimize the model to a model.har. I then run the inference with this model and seem to have a lot of overlapping detections.
Overall, these duplicates are shaving about 0.1 off the yolo11n.onnx mAP@50, so really need to fix it.
example issue here:
Parsing step:
runner = ClientRunner(hw_arch=chosen_hw_arch)
hn, npz = runner.translate_onnx_model(
onnx_path,
onnx_model_name,
start_node_names=["/model.0/conv/Conv"],
end_node_names=["/model.23/cv2.0/cv2.0.2/Conv",
"/model.23/cv3.0/cv3.0.2/Conv",
"/model.23/cv2.1/cv2.1.2/Conv",
"/model.23/cv3.1/cv3.1.2/Conv",
"/model.23/cv2.2/cv2.2.2/Conv",
"/model.23/cv3.2/cv3.2.2/Conv"],
net_input_shapes={"/model.0/conv/Conv": [1, 3, 640, 640]},
)
Optimise:
alls = """
normalization1 = normalization([0.0, 0.0, 0.0], [255.0, 255.0, 255.0])
change_output_activation(conv54, sigmoid)
change_output_activation(conv65, sigmoid)
change_output_activation(conv80, sigmoid)
nms_postprocess("/local/shared_with_docker/visdrone/yolov11_nms_config_visdrone.json", meta_arch=yolov8, engine=cpu)
model_optimization_config(calibration, batch_size=16, calibset_size=256)
post_quantization_optimization(finetune, policy=enabled, learning_rate=0.00001, epochs=8, batch_size=16, dataset_size=3000)
allocator_param(width_splitter_defuse=disabled)
"""
runner.optimize(calib_dataset)
the JSON config is more or less unchanged from the repo - but updated for my class number. Do I need to update the nms_iou_th
or nms_scores_th
value?
Finally, I;ll run inference as:
with runner.infer_context(InferenceContext.SDK_QUANTIZED) as ctx:
output = runner.infer(ctx, input_data)
where the input_data
is an np.array of images
This seems to be happening in all my yolo11n models, not getting any so far without these overlaps.
Any help whatsoever would be greatly appreciated