longcw / yolo2-pytorch

YOLOv2 in PyTorch
1.54k stars 421 forks source link

exp(w) and exp(h) #18

Open jayshonzs opened 7 years ago

jayshonzs commented 7 years ago

Hi, I cannot understand why have you done these changes? Why the exp of w and h is not needed?

Thank you

longcw commented 7 years ago

I do it later in https://github.com/longcw/yolo2-pytorch/blob/master/darknet.py#L227

jayshonzs commented 7 years ago

Thanks for the reply.

But when training, you will call yolo_to_bbox which will call yolo_to_bbox_c,

there you calculate bw and bh: bw = bbox_pred[b, ind, a, 2] anchors[a][0] / W 0.5 bh = bbox_pred[b, ind, a, 3] anchors[a][1] / H 0.5

and later bw and bh are used to calculate bbox_overlaps, but they are not exp(), is it right?

longcw commented 7 years ago

Thank you for pointing out this bug. I'll fix this and try to train it later.