nilboy / tensorflow-yolo

tensorflow implementation of 'YOLO : Real-Time Object Detection'(train and test)
774 stars 312 forks source link

I think the coordinate loss is computed by error #62

Open nmxnql opened 6 years ago

nmxnql commented 6 years ago

In yolo_net.py line 278-281 ,the coordinate is wrong . The yolo paper says that "Each bounding box consists of 5 predictions: x, y, w, h, and confidence. The (x,y) coordinates represent the center of the box relative to the bounds of the grid cell. The width and height are predicted relative to the whole image".But it is not implemented correctly according to niboy' codes . By the way , the demp.py is in accordance with the yolo paper.

thangvip4321 commented 5 years ago

I don't see any mistake there. Because these line compute loss not coordinate.

Jerryzhangzhao commented 5 years ago

@nmxnql I think the loss of coordinate calculate calculated here is not wrong, parameter p_x is defined in line 248 where p_x = predict_boxes[:, :, :, 0]. But tensor predict_boxes is not the network's original prediction, it is processed in line 204-219. So the code is still accordance with yolo paper.