longcw / yolo2-pytorch

YOLOv2 in PyTorch
1.54k stars 421 forks source link

How to understand the value we put in _iou_mask? #110

Open lizhe960118 opened 5 years ago

lizhe960118 commented 5 years ago
iou_penalty = 0 - iou_pred_np[best_ious < cfg.iou_thresh]
_iou_mask[best_ious <= cfg.iou_thresh] = cfg.noobject_scale * iou_penalty
iou_pred_cell_anchor = iou_pred_np[cell_ind, a, :]
_iou_mask[cell_ind, a, :] = cfg.object_scale * (1 - iou_pred_cell_anchor)

when there is no object or the best iou is smaller than thresh, why not just let the value in iou_mask is cfg.noobject_scale, when there is object, let _iou_mask[cell_ind, a, :] to be cfg.object_scale?

lizhe960118 commented 5 years ago

see the issue 23, i think this is a bug to be fixed