-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Custom loops PoC] Extend compatibility to tests #1032
[Custom loops PoC] Extend compatibility to tests #1032
Conversation
Note: Breaks the sweep and benchmarking. This is temporary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, just two comments.
src/anomalib/deploy/export.py
Outdated
|
||
|
||
def get_metadata(task: TaskType, transform: dict[str, Any], model: AnomalyModule) -> dict[str, Any]: | ||
def get_metadata(trainer: AnomalibTrainer, transform: dict[str, Any]) -> dict[str, Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe for another PR, but I was wondering if it were possible to access the transform
from trainer
? For example, to get the training transforms,
>>> trainer.datamodule.train_data.transform.to_dict()
{'__version__': '1.3.0', 'transform': {'__class_fullname__': 'Compose', 'p': 1.0, 'transforms': [...], 'bbox_params': None, 'keypoint_params': None, 'additional_targets': {...}}}
For the test transforms:
>>> trainer.datamodule.test_data.transform.to_dict()
{'__version__': '1.3.0', 'transform': {'__class_fullname__': 'Compose', 'p': 1.0, 'transforms': [...], 'bbox_params': None, 'keypoint_params': None, 'additional_targets': {...}}}
if self.threshold_method == ThresholdMethod.ADAPTIVE: | ||
if self.trainer.image_threshold is not None: | ||
self.trainer.image_threshold.compute() | ||
if self.trainer.task_type in (TaskType.SEGMENTATION, TaskType.DETECTION): | ||
self.trainer.pixel_threshold.compute() | ||
else: | ||
self.trainer.pixel_threshold.value = self.trainer.image_threshold.value | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part will change with the thresholding refactor, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks a lot!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
fa8fb87
into
openvinotoolkit:feature/custom_loops
Description