From dabd0ff70b32f47bb85474b226e5b6a38fbe29d2 Mon Sep 17 00:00:00 2001 From: Bepitic Date: Sun, 24 Mar 2024 21:09:46 +0100 Subject: [PATCH] Add: fix image transform to float Signed-off-by: Bepitic --- src/anomalib/data/base/video.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/anomalib/data/base/video.py b/src/anomalib/data/base/video.py index 7e9461a0a9..b632498aab 100644 --- a/src/anomalib/data/base/video.py +++ b/src/anomalib/data/base/video.py @@ -153,6 +153,7 @@ def __getitem__(self, index: int) -> dict[str, str | torch.Tensor]: msg = "self.indexer must be an instance of ClipsIndexer." raise TypeError(msg) item = self.indexer.get_item(index) + item["image"] = item["image"].to(torch.float32) # include the untransformed image for visualization item["original_image"] = item["image"].to(torch.uint8)