This commit is contained in:
Glenn Jocher 2019-11-30 17:03:47 -08:00
parent 1ff01f0973
commit 3cdbf246c9
1 changed files with 1 additions and 1 deletions

View File

@ -440,7 +440,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
# Normalized xywh to pixel xyxy format # Normalized xywh to pixel xyxy format
labels = x.copy() labels = x.copy()
labels[:, 1] = ratio[0] * w * (x[:, 1] - x[:, 3] / 2) + pad[0] # pad width labels[:, 1] = ratio[0] * w * (x[:, 1] - x[:, 3] / 2) + pad[0] # pad width
labels[:, 2] = ratio[1] * h * (x[:, 2] - x[:, 4] / 2) + pad[1] labels[:, 2] = ratio[1] * h * (x[:, 2] - x[:, 4] / 2) + pad[1] # pad height
labels[:, 3] = ratio[0] * w * (x[:, 1] + x[:, 3] / 2) + pad[0] labels[:, 3] = ratio[0] * w * (x[:, 1] + x[:, 3] / 2) + pad[0]
labels[:, 4] = ratio[1] * h * (x[:, 2] + x[:, 4] / 2) + pad[1] labels[:, 4] = ratio[1] * h * (x[:, 2] + x[:, 4] / 2) + pad[1]