Skip to content

Commit 895bd36

Browse files
authored
Make anomaly task compatible with older albumentations versions (#2363)
* fix transforms export in metadata * wrap transform dict * add todo for updating to_dict call
1 parent c1c0463 commit 895bd36

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

requirements/anomaly.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
22
# Anomaly Requirements.
3-
albumentations>=1.3.0
43
torchvision<0.15.1
54
torchtext<0.15.1
65
anomalib==0.5.1

src/otx/algorithms/anomaly/tasks/inference.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,8 @@ def _get_metadata_dict(self) -> Dict[str, Any]:
425425
else:
426426
transform = self.trainer.datamodule.train_dataloader().dataset.transform
427427
metadata = {
428-
"transform": transform.to_dict(),
428+
# TODO: Replace with transform.to_dict() when OTX supports albumentations 1.3.0
429+
"transform": {"transform": transform._to_dict()},
429430
"image_threshold": image_threshold,
430431
"pixel_threshold": pixel_threshold,
431432
"image_shape": list(self.config.model.input_size),

0 commit comments

Comments
 (0)