yolo_tensorflow icon indicating copy to clipboard operation
yolo_tensorflow copied to clipboard

Help! why there is a "np.square()" in the test.py?

Open KLH1472 opened this issue 6 years ago • 1 comments

The following codes are from interpret_output() in test.py.

boxes[:, :, :, 0] += offset boxes[:, :, :, 1] += np.transpose(offset, (1, 0, 2)) boxes[:, :, :, :2] = 1.0 * boxes[:, :, :, 0:2] / self.cell_size boxes[:, :, :, 2:] = np.square(boxes[:, :, :, 2:]) #Why there is a "square" ? Why calculate the square of w and h ?

boxes *= self.image_size

KLH1472 avatar Jun 26 '18 11:06 KLH1472

I got it! We hope the predicted width equals the square root of the width of the ground truth box.

KLH1472 avatar Jun 26 '18 12:06 KLH1472