keras-YOLOv3-mobilenet
keras-YOLOv3-mobilenet copied to clipboard
Missing: calculation of bounding box center relative to grid cell in `preprocess_true_boxes`
The x and y coordinates in true_boxes are expressed relative to image dimensions in L256-
true_boxes[..., 0:2] = boxes_xy/input_shape[::-1]
Then these values are used in L297-
y_true[l][b, j, i, k, 0:4] = true_boxes[b,t, 0:4]
- Shouldn't the center coordinates - x and y of the bounding box expressed relative to the starting point of the grid, (cx, cy) ?
i = np.floor(true_boxes[b,t,0]*grid_shapes[l][1]).astype('int32')
j = np.floor(true_boxes[b,t,1]*grid_shapes[l][0]).astype('int32')
y_true[l][b, j, i, k, 0] = true_boxes[b,t,0]*grid_shapes[l][1] - i
y_true[l][b, j, i, k, 1] = true_boxes[b,t,1]*grid_shapes[l][0] - j
Are you doing this later in the code? Your insights on these doubts are highly appreciated. Thanks for your time, Thomas.
https://github.com/Adamdad/keras-YOLOv3-mobilenet/blob/d8ac3e269a6f536341305cd8e618ffac3e1e3c73/yolo3/model.py#L297