dme-compunet/YoloV8

Getting lower confidence values

sabihoshi opened this issue · 2 comments

I am getting a lower confidence value, Typically lower with the one from python. The model is not OBB.
Even with the image resized to 640x640 or 640 with the same aspect ratio.

Ultralytics YOLOv8.1.20 🚀 Python-3.10.11 torch-2.2.1+cu118 CPU (AMD Ryzen 9 7950X 16-Core Processor)

yolo predict model="...\best.onnx" source="...\cavity.jpg" save_txt=True save_conf=True device=cpu

cavity
resized

.Net 8.0 SDK
YoloV8.GPU 3.1.1

using Compunet.YoloV8;
using Compunet.YoloV8.Plotting;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Processing;

var image = @"...\cavity.jpg";
var model = @"...\best.onnx";

using var predictor = new YoloV8(model);

using var origin = Image.Load(image);
using var resizedImage = origin.Clone(ctx => ctx.Resize(new ResizeOptions
{
    Size = new Size(640, 640),
    Mode = ResizeMode.Max
}));

var result = await predictor.DetectAsync(origin);
using var plotted = await result.PlotImageAsync(origin);
plotted.Save(Path.Combine("output", Path.GetFileName(image)));

cavity
cavity

So you can test the model yourself
weights.zip

Hi @sabihoshi
In the last published version there is a problem with the non-max suppression algorithm, which caused some problems (and also decrease in the confidence percentage), version 4.0.0 will be published soon and it is likely that these problems will be solved there.

Thank you. I can confirm v4.0.0 solved my issues. Cheers!