Skip to content

Commit

Permalink
upd: video dtpe transform from torchvision
Browse files Browse the repository at this point in the history
  • Loading branch information
Bepitic committed Mar 25, 2024
1 parent dabd0ff commit a76e7f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/anomalib/data/base/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import torch
from pandas import DataFrame
from torchvision.transforms.v2 import Transform
from torchvision.transforms.v2.functional._misc import to_dtype_video
from torchvision.tv_tensors import Mask

from anomalib import TaskType
Expand Down Expand Up @@ -153,7 +154,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)
item["image"] = to_dtype_video(item["image"])
# include the untransformed image for visualization
item["original_image"] = item["image"].to(torch.uint8)

Expand Down

0 comments on commit a76e7f3

Please sign in to comment.