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

Refactor and restructure anomalib.data #2302

Conversation

samet-akcay
Copy link
Contributor

πŸ“ Description

  • Split Torch datasets and Lightning Datamodules into datasets and datamodules
  • Move dataclasses into data

✨ Changes

Select what type of change your PR is:

  • 🐞 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)
  • πŸ“š Documentation update
  • πŸ”’ Security update

βœ… Checklist

Before you submit your pull request, please make sure you have completed the following steps:

  • πŸ“‹ I have summarized my changes in the CHANGELOG and followed the guidelines for my type of change (skip for minor changes, documentation updates, and test enhancements).
  • πŸ“š I have made the necessary updates to the documentation (if applicable).
  • πŸ§ͺ I have written tests that support my changes and prove that my fix is effective or my feature works (if applicable).

For more information about code review checklists, see the Code Review Checklist.

Copy link
Contributor

@djdameln djdameln left a comment

Choose a reason for hiding this comment

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

As discussed, I'm in favor of this new structure. It seems the datasets submodule is missing though.

@samet-akcay
Copy link
Contributor Author

As discussed, I'm in favor of this new structure. It seems the datasets submodule is missing though.

no idea what's wrong though. Tests locally pass πŸ™ƒ

Copy link

Check out this pull request onΒ  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link

codecov bot commented Sep 10, 2024

Codecov Report

Attention: Patch coverage is 91.29464% with 78 lines in your changes missing coverage. Please review.

Please upload report for BASE (feature/design-simplifications@1f9a7e0). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/anomalib/data/dataclasses/torch/image.py 84.00% 24 Missing ⚠️
src/anomalib/data/dataclasses/numpy/video.py 66.66% 9 Missing ⚠️
src/anomalib/data/datamodules/base/video.py 35.71% 9 Missing ⚠️
...rc/anomalib/data/datamodules/video/shanghaitech.py 80.85% 9 Missing ⚠️
src/anomalib/data/datamodules/video/ucsd_ped.py 83.87% 5 Missing ⚠️
src/anomalib/data/datasets/image/mvtec.py 87.80% 5 Missing ⚠️
src/anomalib/data/datasets/video/avenue.py 92.15% 4 Missing ⚠️
src/anomalib/data/dataclasses/torch/base.py 93.33% 2 Missing ⚠️
src/anomalib/data/dataclasses/torch/video.py 97.10% 2 Missing ⚠️
src/anomalib/data/datasets/image/btech.py 93.75% 2 Missing ⚠️
... and 7 more
Additional details and impacted files
@@                        Coverage Diff                        @@
##             feature/design-simplifications    #2302   +/-   ##
=================================================================
  Coverage                                  ?   80.32%           
=================================================================
  Files                                     ?      273           
  Lines                                     ?    11185           
  Branches                                  ?        0           
=================================================================
  Hits                                      ?     8984           
  Misses                                    ?     2201           
  Partials                                  ?        0           

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

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.

So from what I understand, the intent of the PR is to split data into dataclasses and datamodules?

src/anomalib/data/datamodules/base/__init__.py Outdated Show resolved Hide resolved
@samet-akcay
Copy link
Contributor Author

So from what I understand, the intent of the PR is to split data into dataclasses and datamodules?

and also datasets. Overall, data will contain the dataclasses (item, batch etc.), datasets (torch) and datamodules (lightning)

@samet-akcay samet-akcay merged commit 897b23b into openvinotoolkit:feature/design-simplifications Sep 11, 2024
5 checks passed
@samet-akcay samet-akcay deleted the restructure-data branch September 11, 2024 11:35
djdameln pushed a commit to djdameln/anomalib that referenced this pull request Sep 12, 2024
* Move datamodules to datamodule sub-package

* Move datamodules to datamodule sub-package

* Split datamodules and datasets

* Restructure dataclasses to data

* Fix relative imports

* Use absolute imports

* Add datasets dir

* Add relative imports for torch datasets

* Update src/anomalib/data/datamodules/base/__init__.py

Co-authored-by: Ashwin Vaidya <[email protected]>

---------

Co-authored-by: Ashwin Vaidya <[email protected]>
djdameln pushed a commit that referenced this pull request Sep 12, 2024
* Move datamodules to datamodule sub-package

* Move datamodules to datamodule sub-package

* Split datamodules and datasets

* Restructure dataclasses to data

* Fix relative imports

* Use absolute imports

* Add datasets dir

* Add relative imports for torch datasets

* Update src/anomalib/data/datamodules/base/__init__.py

Co-authored-by: Ashwin Vaidya <[email protected]>

---------

Co-authored-by: Ashwin Vaidya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants