Skip to content

Commit a72bb05

Browse files
committed
Show GIoU/IoU loss instead of RMSE by default
1 parent 4ee3be7 commit a72bb05

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ layer parse_yolo(list *options, size_params params)
454454
}
455455
//assert(l.outputs == params.inputs);
456456

457-
l.show_details = option_find_int_quiet(options, "show_details", 0);
457+
l.show_details = option_find_int_quiet(options, "show_details", 1);
458458
l.max_delta = option_find_float_quiet(options, "max_delta", FLT_MAX); // set 10
459459
char *cpc = option_find_str(options, "counters_per_class", 0);
460460
l.classes_multipliers = get_classes_multipliers(cpc, classes, l.max_delta);

src/yolo_layer.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ typedef struct train_yolo_args {
380380
int b;
381381

382382
float tot_iou;
383+
float tot_giou_loss;
383384
int count;
384385
int class_count;
385386
} train_yolo_args;
@@ -720,6 +721,7 @@ void forward_yolo_layer(const layer l, network_state state)
720721
yolo_args[b].b = b;
721722

722723
yolo_args[b].tot_iou = 0;
724+
yolo_args[b].tot_giou_loss = 0;
723725
yolo_args[b].count = 0;
724726
yolo_args[b].class_count = 0;
725727

@@ -731,6 +733,7 @@ void forward_yolo_layer(const layer l, network_state state)
731733
pthread_join(threads[b], 0);
732734

733735
tot_iou += yolo_args[b].tot_iou;
736+
tot_giou_loss += yolo_args[b].tot_giou_loss;
734737
count += yolo_args[b].count;
735738
class_count += yolo_args[b].class_count;
736739
}
@@ -891,7 +894,7 @@ void forward_yolo_layer(const layer l, network_state state)
891894

892895
float avg_iou_loss = 0;
893896
*(l.cost) = loss;
894-
/*
897+
895898
// gIOU loss + MSE (objectness) loss
896899
if (l.iou_loss == MSE) {
897900
*(l.cost) = pow(mag_array(l.delta, l.outputs * l.batch), 2);
@@ -908,7 +911,7 @@ void forward_yolo_layer(const layer l, network_state state)
908911
}
909912
*(l.cost) = avg_iou_loss + classification_loss;
910913
}
911-
*/
914+
912915

913916
loss /= l.batch;
914917
classification_loss /= l.batch;

0 commit comments

Comments
 (0)