Skip to content
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

metrics: standalone log() #57

Merged
merged 2 commits into from
Jul 12, 2024
Merged

metrics: standalone log() #57

merged 2 commits into from
Jul 12, 2024

Conversation

casperdcl
Copy link
Member

@casperdcl casperdcl self-assigned this Jul 11, 2024
@casperdcl casperdcl requested a review from KrisThielemans July 11, 2024 22:38
@casperdcl casperdcl added the enhancement New feature or request label Jul 11, 2024
Copy link
Member

@KrisThielemans KrisThielemans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I'd see this more as

class QualityMetrics:
    def __call__(...) # as is in this PR
    def metrics(self, test_im):
        ret = []
        test_im_arr = test_im.as_array()
        res.append(("RMSE_whole_object", some_calc(test_im_arr)))
        res.append(("metric2", some_other_calc(test_im_arr)))             

   def log(self, test_im, iteration):
        m = self.metrics(test_im)
        # some TB stuff

That way, we can say

   metrics = QualityMetrics(reference_image, whole_object_mask, background_mask, other_VOI_stuff)
   print(metrics.compute(some_image))

and make nice plots for lots of stored images... Otherwise, it'd always go to TB, which in my mind makes my life harder (maybe it shouldn't)

@casperdcl
Copy link
Member Author

@KrisThielemans better now?

Copy link
Member

@KrisThielemans KrisThielemans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! I haven't tried it yet though, I'm assume you did. In that case, merge! Thanks a lot

@casperdcl casperdcl merged commit 11112d2 into main Jul 12, 2024
2 checks passed
@casperdcl casperdcl deleted the metrics-log branch July 12, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

petric.QualityMetrics: call without algorithm
2 participants