what is the ground truth?
lfydegithub opened this issue · comments
pony commented
in yolo_layer.py:
target[b, a, j, i, 0] = truth_x_all[b, ti] - truth_x_all[b, ti].to(torch.int16).to(torch.float)
target[b, a, j, i, 1] = truth_y_all[b, ti] - truth_y_all[b, ti].to(torch.int16).to(torch.float)
target_x is most close to 0???!!!!
Motoki Kimura commented
Hi, @lfydegithub. Sorry for late response.
target_x = target[:, :, :, :, 0]
and target_y = target[:, :, :, :, 1]
are bbox center x/y coord measured from top-left corner of the grid on the feature map. So they fall between 0 and 1.
In the implementation, truth_x_all[b, ti].to(torch.int16)
or truth_y_all[b, ti].to(torch.int16)
are the grid top-left corner (following .to(torch.float)
is just a cast operation).
Does this answer your question?