def METHOD_NAME(self, image_data):
    import groundingdino.datasets.transforms as T
    image_path = image_data[self.image_key]["filename"]
    image_pil = PIL.Image.open(image_path).convert("RGB")
    transform = T.Compose(
        [
            T.RandomResize([800], max_size=1333),
            T.ToTensor(),
            T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]),
        ]
    )
    image, _ = transform(image_pil, None)  # 3, h, w
    return image