Open Moadab-AI opened 5 years ago
@moabaom Hi,
You can compile Darknet as libdarknet.so
library with LIBSO=1
in the Makefile, and use this library in your own application to detect object with low threshold=0.0001 and then filter it with higher threshold in your code multiple times as you want.
@moabaom Hi,
You can compile Darknet as
libdarknet.so
library withLIBSO=1
in the Makefile, and use this library in your own application to detect object with low threshold=0.0001 and then filter it with higher threshold in your code multiple times as you want.
Thanks, but I had already compiled with LIBSO=1 originally(I thought it was the default way). Can you be more specific as to how after I got results with thresh=0.0001 I could sweep over different threshold values and get different results ? I was browsing through the code to see how threshold is used and it looks like threshold is applied to every layer of the network separately. doesnt that mean I have to do a separate forward pass for every threshold separately? :
int num_detections(network *net, float thresh) { int i; int s = 0; for (i = 0; i < net->n; ++i) { layer l = net->layers[i]; if (l.type == YOLO) { s += yolo_num_detections(l, thresh); } if (l.type == DETECTION || l.type == REGION) { s += l.w*l.h*l.n; } } return s; }
Basically, what he mean is that you have to add a post-processing script after you get the results from YOLOv4. The script will again calculate the IOU between your ground truth and predictions. Once its done, you can put different threshold for different classes before calculating the mAP and average precision. This blog post might be helpful: https://towardsdatascience.com/evaluating-performance-of-an-object-detection-model-137a349c517b
Hey AlexeyAB,
Thanks for the repository. I would like to know whether I have to forward pass for every different threshold at inference time separately? in other words is the threshold setting intertwined with the CNN layers or its just set at the end of forward pass?
I am interested in setting the lowest threshold (e.e. 0.0001) and pass the image once at detections time and have all possible detections (for higher thresholds) and be able to chose the correct threshold then by means of a sliding toggle over all thresholds. I have a feeling this is not possible, but just wanted to make sure. Thanks