Skip to content

Commit

Permalink
Add OTX version to exported models
Browse files Browse the repository at this point in the history
  • Loading branch information
sovrasov committed Dec 13, 2024
1 parent 4e069a4 commit 2c9b5ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/otx/core/types/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from dataclasses import dataclass, fields
from enum import Enum

import otx
from otx.core.config.data import TileConfig
from otx.core.types.label import HLabelInfo, LabelInfo

Expand Down Expand Up @@ -122,6 +123,7 @@ def to_metadata(self) -> dict[tuple[str, str], str]:
("model_info", "labels"): all_labels.strip(),
("model_info", "label_ids"): all_label_ids.strip(),
("model_info", "optimization_config"): json.dumps(self.optimization_config),
("model_info", "otx_version"): otx.__version__,
}

if isinstance(self.label_info, HLabelInfo):
Expand Down
1 change: 1 addition & 0 deletions tests/unit/core/types/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ def test_wrap(fxt_label_info, task_type):
assert ("model_info", "tile_size") in metadata
assert ("model_info", "tiles_overlap") in metadata
assert ("model_info", "max_pred_number") in metadata
assert ("model_info", "otx_version") in metadata

0 comments on commit 2c9b5ec

Please sign in to comment.