2021-05-06

respond_bbox  = label[:, :, :, :, 4:5]  # 置信度,判断网格内有无物体
giou = tf.expand_dims(self.bbox_giou(pred_xywh, label_xywh), axis=-1 
# 2 - 相对面积
bbox_loss_scale = 2.0 - 1.0 * label_xywh[:, :, :, :, 2:3] * label_xywh[:, :, :, :, 3:4] / (input_size ** 2)
giou_loss = respond_bbox * bbox_loss_scale * (1 - giou)

你可能感兴趣的:(2021-05-06)