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

add option to load metrics with kwargs #688

Conversation

jpcbertoldo
Copy link
Contributor

@jpcbertoldo jpcbertoldo commented Nov 5, 2022

Description

Changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which refactors the code base)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • My code follows the pre-commit style and check guidelines of this project.
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes

@github-actions github-actions bot added Callbacks Metrics Metric Component. labels Nov 5, 2022
Copy link
Contributor

@samet-akcay samet-akcay left a comment

Choose a reason for hiding this comment

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

I agree that it would be good to follow the same convention as the PL CLI.
Only few minor comments.

anomalib/utils/metrics/__init__.py Show resolved Hide resolved
anomalib/utils/metrics/__init__.py Show resolved Hide resolved
anomalib/utils/metrics/__init__.py Outdated Show resolved Hide resolved
@jpcbertoldo
Copy link
Contributor Author

Since i'm working on this file, could be nice to solve #685 as well?

@samet-akcay
Copy link
Contributor

Since i'm working on this file, could be nice to solve #685 as well?

Apologies, just seen that issue. Yeah, I agree. It would make sense to move it to test helpers if the tests are the only place of use.

@jpcbertoldo
Copy link
Contributor Author

Both done

@jpcbertoldo jpcbertoldo requested review from samet-akcay and removed request for ashwinvaidya17 November 7, 2022 12:55
@jpcbertoldo
Copy link
Contributor Author

image

I adressed the codacy checks above.

@jpcbertoldo
Copy link
Contributor Author

Should this go to docs or can we just assume people will guess it because it's consistent with other parts of the config? 🙃

@samet-akcay
Copy link
Contributor

Should this go to docs or can we just assume people will guess it because it's consistent with other parts of the config? 🙃

would be good to document it somewhere; otherwise, it might stay as a hidden gem :)

Not sure about where to document it though. @ashwinvaidya17, any thoughts?

Copy link
Collaborator

@ashwinvaidya17 ashwinvaidya17 left a comment

Choose a reason for hiding this comment

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

Thanks for the efforts. This is a good addition to metrics configuration flexibility. I have a few comments though.

anomalib/utils/metrics/__init__.py Show resolved Hide resolved
anomalib/utils/metrics/__init__.py Outdated Show resolved Hide resolved
anomalib/utils/metrics/__init__.py Show resolved Hide resolved
@ashwinvaidya17
Copy link
Collaborator

Should this go to docs or can we just assume people will guess it because it's consistent with other parts of the config? 🙃

would be good to document it somewhere; otherwise, it might stay as a hidden gem :)

Not sure about where to document it though. @ashwinvaidya17, any thoughts?

I agree if we now support this it would be nice to mention it somewhere as well. How about docs/source/reference_guide/api/metrics.rst? We can have it above automodule.

@github-actions github-actions bot added the Docs label Nov 7, 2022
@jpcbertoldo jpcbertoldo requested review from ashwinvaidya17 and removed request for samet-akcay and ashwinvaidya17 November 7, 2022 17:26
@jpcbertoldo
Copy link
Contributor Author

I believe i addressed everything.

@samet-akcay
Copy link
Contributor

I believe i addressed everything.

Thanks @jpcbertoldo. Can you please check the failed tests?

tests/helpers/dummy.py Outdated Show resolved Hide resolved
tests/helpers/dummy.py Outdated Show resolved Hide resolved
tests/helpers/dummy.py Outdated Show resolved Hide resolved
@jpcbertoldo
Copy link
Contributor Author

I believe i addressed everything.

Thanks @jpcbertoldo. Can you please check the failed tests?

Done.

@ashwinvaidya17 I forgot to mention that there was a check bothering about the fact that a few dummy classes where repeated in the tests so i put them in tests/helpers/dummy.py

@samet-akcay
Copy link
Contributor

I believe i addressed everything.

Thanks @jpcbertoldo. Can you please check the failed tests?

Done.

@ashwinvaidya17 I forgot to mention that there was a check bothering about the fact that a few dummy classes where repeated in the tests so i put them in tests/helpers/dummy.py

@jpcbertoldo, thanks for organising them.
The tests needs another round of refactoring anyway, which we were planning on executing sometime this quarter. Would be a start.

@samet-akcay
Copy link
Contributor

I believe i addressed everything.

Thanks @jpcbertoldo. Can you please check the failed tests?

Done.

@jpcbertoldo, looks like the tests still fail unfortunately :/

@jpcbertoldo
Copy link
Contributor Author

I dont understand, it was all green last night 🤨🤔. Ok will take a look.

@ashwinvaidya17
Copy link
Collaborator

I believe i addressed everything.

Thanks @jpcbertoldo. Can you please check the failed tests?

Done.

@ashwinvaidya17 I forgot to mention that there was a check bothering about the fact that a few dummy classes where repeated in the tests so i put them in tests/helpers/dummy.py

Thanks for doing that. We have a lot of dummy modules and dataloaders peppered around the tests. That's something that needs to be addressed in the redesign as well.

Copy link
Collaborator

@ashwinvaidya17 ashwinvaidya17 left a comment

Choose a reason for hiding this comment

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

Thanks. One minor comment.

anomalib/utils/metrics/__init__.py Outdated Show resolved Hide resolved
@jpcbertoldo
Copy link
Contributor Author

I believe i addressed everything.

Thanks @jpcbertoldo. Can you please check the failed tests?

Done.

@jpcbertoldo, looks like the tests still fail unfortunately :/

Ok, it was the test that had a little refactor, my bad!

=========================== short test summary info ============================
ERROR tests/pre_merge/utils/callbacks/visualizer_callback/test_visualizer.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!

I think it'lll fix.
I'm struggling to run tox locally because of some env var so let's see...

Copy link
Collaborator

@ashwinvaidya17 ashwinvaidya17 left a comment

Choose a reason for hiding this comment

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

Thanks

Copy link
Contributor

@samet-akcay samet-akcay left a comment

Choose a reason for hiding this comment

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

@jpcbertoldo, thanks looking good now!

@samet-akcay samet-akcay merged commit b430573 into openvinotoolkit:main Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Metrics Metric Component. Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

impossible to pass args to the metrics
3 participants