yolo_tensorflow
yolo_tensorflow copied to clipboard
Help! why there is a "np.square()" in the test.py?
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
I got it! We hope the predicted width equals the square root of the width of the ground truth box.