Browse Source

remove TTA 1 pixel offset (#2325)

5.0
Glenn Jocher GitHub 3 years ago
parent
commit
fd96810518
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      models/yolo.py

+ 2
- 2
models/yolo.py View File

@@ -109,9 +109,9 @@ class Model(nn.Module):
# cv2.imwrite(f'img_{si}.jpg', 255 * xi[0].cpu().numpy().transpose((1, 2, 0))[:, :, ::-1]) # save
yi[..., :4] /= si # de-scale
if fi == 2:
yi[..., 1] = img_size[0] - 1 - yi[..., 1] # de-flip ud
yi[..., 1] = img_size[0] - yi[..., 1] # de-flip ud
elif fi == 3:
yi[..., 0] = img_size[1] - 1 - yi[..., 0] # de-flip lr
yi[..., 0] = img_size[1] - yi[..., 0] # de-flip lr
y.append(yi)
return torch.cat(y, 1), None # augmented inference, train
else:

Loading…
Cancel
Save