Skip to content

Commit

Permalink
Fixed detector recall
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyAB committed Apr 2, 2018
1 parent c3c6703 commit 726cebd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion build/darknet/x64/darknet_web_cam_voc.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# play video from Web-Camera number 0

darknet.exe detector demo data/voc.data cfg/yolov2-voc.cfg yolo-voc.weights -c 0
rem darknet.exe detector demo data/voc.data cfg/yolov2-voc.cfg yolo-voc.weights -c 0


darknet.exe detector demo data/coco.data cfg/yolov3.cfg yolov3.weights -c 0


pause
4 changes: 2 additions & 2 deletions src/detector.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ void validate_detector_recall(char *datacfg, char *cfgfile, char *weightfile)
++total;
box t = { truth[j].x, truth[j].y, truth[j].w, truth[j].h };
float best_iou = 0;
for (k = 0; k < l.w*l.h*l.n; ++k) {
for (k = 0; k < nboxes; ++k) {
float iou = box_iou(dets[k].bbox, t);
if (dets[k].objectness > thresh && iou > best_iou) {
best_iou = iou;
Expand Down Expand Up @@ -828,7 +828,7 @@ int anchors_comparator(const void *pa, const void *pb)
{
anchors_t a = *(anchors_t *)pa;
anchors_t b = *(anchors_t *)pb;
float diff = b.w - a.w;
float diff = b.w*b.h - a.w*a.h;
if (diff < 0) return 1;
else if (diff > 0) return -1;
return 0;
Expand Down

0 comments on commit 726cebd

Please sign in to comment.