Skip to content

Commit

Permalink
Make anomaly task compatible with older albumentations versions (#2363)
Browse files Browse the repository at this point in the history
* fix transforms export in metadata

* wrap transform dict

* add todo for updating to_dict call
  • Loading branch information
djdameln authored Jul 17, 2023
1 parent c1c0463 commit 895bd36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion requirements/anomaly.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Anomaly Requirements.
albumentations>=1.3.0
torchvision<0.15.1
torchtext<0.15.1
anomalib==0.5.1
Expand Down
3 changes: 2 additions & 1 deletion src/otx/algorithms/anomaly/tasks/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@ def _get_metadata_dict(self) -> Dict[str, Any]:
else:
transform = self.trainer.datamodule.train_dataloader().dataset.transform
metadata = {
"transform": transform.to_dict(),
# TODO: Replace with transform.to_dict() when OTX supports albumentations 1.3.0
"transform": {"transform": transform._to_dict()},
"image_threshold": image_threshold,
"pixel_threshold": pixel_threshold,
"image_shape": list(self.config.model.input_size),
Expand Down

0 comments on commit 895bd36

Please sign in to comment.