motokimura / PyTorch_Gaussian_YOLOv3

PyTorch implementation of Gaussian YOLOv3 (including training code for COCO dataset)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

what is the ground truth?

lfydegithub opened this issue · comments

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???!!!!

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?