Closed lukaswozniak closed 2 years ago
What's the pretrained model you're using for this (eg from the darknet model zoo)? I can check using that. It seems to run the model OK from the log output - e.g. nothing has crashed... but if things were detected you'd see that in the log.
I've not had any trouble with yolov4-tiny using the COCO val set so would be good to check.
Sure the config is correct? That's a yolov3 and the weights are v4. I'll double check on the latest release, maybe something's affected inference - yolov4 tiny definitely works.
Can you check with e.g. the pre-trained COCO model? e.g.
yolov4-tiny.weights yolov4-tiny.cfg
Sure the config is correct? That's a yolov3 and the weights are v4. I'll double check on the latest release, maybe something's affected inference - yolov4 tiny definitely works.
Can you check with e.g. the pre-trained COCO model? e.g.
yolov4-tiny.weights yolov4-tiny.cfg coco.names
make a project with some random test images of everyday things and try running that.
I pasted wrong cfg, should be this one: https://github.com/AlexeyAB/darknet/blob/master/cfg/yolov4-tiny-3l.cfg Im sure its correct, definitely works when Im using it with the darknet.exe cmd line tool.
I will check tomorrow with COCO model.
Great, thanks. I don't know why a custom model would fail, but perhaps that's the issue. Though OpenCV would probably error out if it failed to load properly.
I found what is the bug, but I'm not sure how to fix it in code. My network uses size 960x960, not the default 416x416. I even can see that the program recognizes it correctly here:
But after some debugging I found that actual values used was 416x416. Adding this code to DetectorOpenCV::inferDarknet fixes it for me:
std::cout << "input_width: " << input_width << std::endl; // prints 416
std::cout << "input_height: " << input_height << std::endl; // prints 416
input_width = 960;input_height = 960; // fix working only in my case
auto input_size = cv::Size(input_width, input_height);
bool swap_rb = true; // BGR->RGB?
bool crop = false; // Use the entire image
auto blob = cv::dnn::blobFromImage(image, scale_factor, input_size, mean, swap_rb, crop);
I don't know the project well enough to make actual fix, but if you want I may try.
Merged, thanks!
After I configure object detector and run it on any image it doesn't show any new annotations.
I tried "Set threshold" to 0,01 but it didn't change anything. Setting it to CPU also doesn't help.
My configuration:
After pressing the magic wand button (no new annotation added):
Proof that my model is able to detect the object:
Is there anything I can do to debug this more? Please help