-
Notifications
You must be signed in to change notification settings - Fork 97
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
Replace imgaug with albumentations #1623
Conversation
Important Auto Review SkippedReview was skipped due to path filters Files ignored due to path filters (2)
WalkthroughThe codebase has transitioned from using the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1623 +/- ##
===========================================
- Coverage 73.38% 73.37% -0.01%
===========================================
Files 134 134
Lines 24064 24063 -1
===========================================
- Hits 17659 17657 -2
- Misses 6405 6406 +1 ☔ View full report in Codecov by Sentry. |
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to filter (3)
- environment.yml
- environment_mac.yml
- environment_no_cuda.yml
Files selected for processing (4)
- .conda/meta.yaml (2 hunks)
- sleap/nn/data/augmentation.py (6 hunks)
- sleap/nn/data/pipelines.py (8 hunks)
- tests/nn/data/test_augmentation.py (2 hunks)
Additional comments: 17
.conda/meta.yaml (2)
33-39: The addition of
albumentations
to thehost
requirements is consistent with the PR objective to replaceimgaug
withalbumentations
. However, ensure that the presence ofopencv
in the requirements is still necessary, as the PR objective mentioned eliminating the dependency on a specific version ofopencv
required byimgaug
.61-67: The addition of
albumentations
to therun
requirements is consistent with the PR objective to replaceimgaug
withalbumentations
. Similar to thehost
requirements, verify the necessity ofopencv
in therun
requirements.sleap/nn/data/augmentation.py (4)
1-11: The import changes from
imgaug
toalbumentations
are consistent with the PR objective to replace the image augmentation library.105-124: The introduction of the
AlbumentationsAugmenter
class is consistent with the PR objective and the summary provided.140-202: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [129-202]
The
from_config
method has been correctly updated to usealbumentations
transformations, aligning with the PR objective.
- 229-244: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [229-260]
The
transform_dataset
method has been updated to applyalbumentations
-based image augmentation, which is in line with the PR objective.sleap/nn/data/pipelines.py (8)
18-24: The import changes from
imgaug
toalbumentations
are consistent with the PR objectives and the summary provided. TheAlbumentationsAugmenter
is correctly imported and replaces the previousImgaugAugmenter
.68-74: The
TRANSFORMERS
tuple has been correctly updated to includeAlbumentationsAugmenter
instead ofImgaugAugmenter
, aligning with the PR objectives and the summary.406-411: The usage of
AlbumentationsAugmenter.from_config
is consistent with the PR objectives to replaceimgaug
withalbumentations
. The configuration is correctly passed to thefrom_config
method.550-555: The usage of
AlbumentationsAugmenter.from_config
within theCentroidConfmapsPipeline
class is consistent with the PR objectives and the summary.713-718: The usage of
AlbumentationsAugmenter.from_config
within theTopdownConfmapsPipeline
class is consistent with the PR objectives and the summary.863-869: The usage of
AlbumentationsAugmenter.from_config
within theBottomUpPipeline
class is consistent with the PR objectives and the summary.1028-1034: The usage of
AlbumentationsAugmenter.from_config
within theBottomUpMultiClassPipeline
class is consistent with the PR objectives and the summary.1186-1192: The usage of
AlbumentationsAugmenter.from_config
within theTopDownMultiClassPipeline
class is consistent with the PR objectives and the summary.tests/nn/data/test_augmentation.py (3)
17-20: The summary incorrectly states that the rotation angle parameters are adjusted from -90 to 90. The hunk shows that both
rotation_min_angle
androtation_max_angle
are set to 90, not from -90 to 90. Please correct the summary to accurately reflect the changes made in the code.14-22: The changes in this hunk correctly reflect the PR's objective of replacing
imgaug
withalbumentations
. TheAlbumentationsAugmenter
is being used with the new configuration as expected.54-58: The changes in this hunk are also in line with the PR's objective and the summary provided. The
ImgaugAugmenter
has been replaced withAlbumentationsAugmenter
correctly.
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files ignored due to filter (3)
- environment.yml
- environment_mac.yml
- environment_no_cuda.yml
Files selected for processing (6)
- .conda/bld.bat (1 hunks)
- .conda/build.sh (1 hunks)
- .conda/meta.yaml (2 hunks)
- .conda_mac/build.sh (1 hunks)
- .conda_mac/meta.yaml (2 hunks)
- requirements.txt (1 hunks)
Files skipped from review due to trivial changes (3)
- .conda/meta.yaml
- .conda_mac/meta.yaml
- requirements.txt
Additional comments: 2
.conda/build.sh (1)
- 10-10: The addition of
--no-binary qudida,albumentations
to thepip install
command ensures that these packages are installed from source. This is a good practice when specific binary compatibility is required or when the latest source version is needed. Confirm that this change is compatible with the build environment and that all necessary build tools and dependencies are available to compile these packages from source..conda_mac/build.sh (1)
- 10-10: The addition of
--no-binary qudida,albumentations
to thepip install
command will force these packages to be compiled from source. Ensure that the build environment in the CI and any development setups have the necessary tools and dependencies to compile these packages.
@@ -7,7 +7,7 @@ set PIP_IGNORE_INSTALLED=False | |||
|
|||
@REM Install the pip dependencies. Note: Using urls to wheels might be better: | |||
@REM https://docs.conda.io/projects/conda-build/en/stable/user-guide/wheel-files.html) | |||
pip install --no-cache-dir -r .\requirements.txt | |||
pip install --no-cache-dir -r .\requirements.txt --no-binary qudida,albumentations |
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.
Consider pinning the versions of qudida
and albumentations
to ensure consistent builds and compatibility with the rest of the codebase.
#!/bin/bash
# Check if the versions of qudida and albumentations are pinned in the requirements.txt file.
rg 'qudida(==|@)' .\requirements.txt
rg 'albumentations(==|@)' .\requirements.txt
Description
This PR replaces imgaug with albumentations as our library for image augmentation. We're doing this in the hopes of getting rid of our hard dependency on a specific variant of opencv which imgaug (which is no longer maintained) depends on.
Types of changes
Does this address any currently open issues?
#648
Outside contributors checklist
Thank you for contributing to SLEAP!
❤️
Summary by CodeRabbit
New Features
imgaug
toalbumentations
for enhanced image augmentation capabilities.Bug Fixes
Refactor
albumentations
library.Tests