mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Changed class to class_id
This commit is contained in:
@ -232,7 +232,7 @@ dbox diou(box a, box b)
|
||||
|
||||
typedef struct{
|
||||
int index;
|
||||
int class;
|
||||
int class_id;
|
||||
float **probs;
|
||||
} sortable_bbox;
|
||||
|
||||
@ -240,7 +240,7 @@ int nms_comparator(const void *pa, const void *pb)
|
||||
{
|
||||
sortable_bbox a = *(sortable_bbox *)pa;
|
||||
sortable_bbox b = *(sortable_bbox *)pb;
|
||||
float diff = a.probs[a.index][b.class] - b.probs[b.index][b.class];
|
||||
float diff = a.probs[a.index][b.class_id] - b.probs[b.index][b.class_id];
|
||||
if(diff < 0) return 1;
|
||||
else if(diff > 0) return -1;
|
||||
return 0;
|
||||
@ -253,13 +253,13 @@ void do_nms_sort(box *boxes, float **probs, int total, int classes, float thresh
|
||||
|
||||
for(i = 0; i < total; ++i){
|
||||
s[i].index = i;
|
||||
s[i].class = 0;
|
||||
s[i].class_id = 0;
|
||||
s[i].probs = probs;
|
||||
}
|
||||
|
||||
for(k = 0; k < classes; ++k){
|
||||
for(i = 0; i < total; ++i){
|
||||
s[i].class = k;
|
||||
s[i].class_id = k;
|
||||
}
|
||||
qsort(s, total, sizeof(sortable_bbox), nms_comparator);
|
||||
for(i = 0; i < total; ++i){
|
||||
|
Reference in New Issue
Block a user