From 8ca0f24909418084273795c252beeaf92731fcb2 Mon Sep 17 00:00:00 2001 From: Nicolas Granger Date: Fri, 9 Sep 2022 10:47:16 +0200 Subject: [PATCH] Fix #6550 Changes image size convention to (h, w). I don't think this is used by models other than SSD which assumes this convention. --- torchvision/models/detection/anchor_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/torchvision/models/detection/anchor_utils.py b/torchvision/models/detection/anchor_utils.py index 34fb8d23069..f42c10d8208 100644 --- a/torchvision/models/detection/anchor_utils.py +++ b/torchvision/models/detection/anchor_utils.py @@ -213,8 +213,8 @@ def _grid_default_boxes( for k, f_k in enumerate(grid_sizes): # Now add the default boxes for each width-height pair if self.steps is not None: - x_f_k = image_size[0] / self.steps[k] - y_f_k = image_size[1] / self.steps[k] + x_f_k = image_size[1] / self.steps[k] + y_f_k = image_size[0] / self.steps[k] else: y_f_k, x_f_k = f_k