add back normalization and negate it in test

This commit is contained in:
Francis Lata
2024-10-25 21:50:42 -07:00
parent 65c561a618
commit 1344871a15
2 changed files with 2 additions and 2 deletions

View File

@@ -122,7 +122,7 @@ class TestOpenImagesDataset(ExternalTestDatasets):
return iter(dataloader)
def test_training_set(self):
img_size, img_mean, img_std, anchors = (800, 800), [0.485, 0.456, 0.406], [0.229, 0.224, 0.225], torch.ones((120087, 4))
img_size, img_mean, img_std, anchors = (800, 800), [0.0, 0.0, 0.0], [1.0, 1.0, 1.0], torch.ones((120087, 4))
tinygrad_dataloader, ref_dataloader = self._create_tinygrad_dataloader("train", anchors.numpy()), self._create_ref_dataloader("train")
transform = GeneralizedRCNNTransform(img_size, img_mean, img_std)

View File

@@ -181,7 +181,7 @@ class GeneralizedRCNNTransform(nn.Module):
if image.dim() != 3:
raise ValueError("images is expected to be a list of 3d tensors "
"of shape [C, H, W], got {}".format(image.shape))
# image = self.normalize(image)
image = self.normalize(image)
image, target_index = self.resize(image, target_index)
images[i] = image
if targets is not None and target_index is not None: