Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Propagate collate_fn to InputTransform in ImageEmbedder #1217

Merged
merged 13 commits into from
Mar 28, 2022

Conversation

krshrimali
Copy link
Contributor

@krshrimali krshrimali commented Mar 5, 2022

What does this PR do?

Looks like collate_fn was never propagated before. The reason it worked before: pretraining_transform was never called, hence the inputs were always tensors and not a list of tensors (so no need to collate).

Fixes #1218.

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests? [not needed for typos/docs]
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

flash/image/embedding/losses/vissl_losses.py Show resolved Hide resolved
flash/image/embedding/model.py Outdated Show resolved Hide resolved
flash/image/embedding/vissl/adapter.py Outdated Show resolved Hide resolved
flash/image/embedding/vissl/transforms/utilities.py Outdated Show resolved Hide resolved
tests/image/embedding/test_model.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 5, 2022

Codecov Report

Merging #1217 (9654ff9) into master (6da53fe) will increase coverage by 0.11%.
The diff coverage is 97.18%.

@@            Coverage Diff             @@
##           master    #1217      +/-   ##
==========================================
+ Coverage   91.06%   91.18%   +0.11%     
==========================================
  Files         286      286              
  Lines       12764    12790      +26     
==========================================
+ Hits        11623    11662      +39     
+ Misses       1141     1128      -13     
Flag Coverage Δ
unittests 91.18% <97.18%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
flash/image/embedding/vissl/transforms/__init__.py 100.00% <ø> (ø)
flash/core/adapter.py 97.14% <85.71%> (-1.27%) ⬇️
...lash/image/embedding/vissl/transforms/multicrop.py 98.11% <97.61%> (+1.14%) ⬆️
flash/core/data/io/input_transform.py 70.95% <100.00%> (ø)
flash/image/embedding/heads/vissl_heads.py 100.00% <100.00%> (ø)
flash/image/embedding/losses/vissl_losses.py 100.00% <100.00%> (ø)
flash/image/embedding/model.py 92.15% <100.00%> (+0.92%) ⬆️
...ash/image/embedding/transforms/vissl_transforms.py 100.00% <100.00%> (ø)
flash/image/embedding/vissl/hooks.py 98.21% <100.00%> (ø)
flash/text/question_answering/model.py 91.89% <0.00%> (-0.68%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6da53fe...9654ff9. Read the comment docs.

@Borda Borda added the bug / fix Something isn't working label Mar 8, 2022
@ethanwharris ethanwharris added this to the 0.7.x milestone Mar 15, 2022
@mergify mergify bot removed the has conflicts label Mar 28, 2022
Copy link
Collaborator

@ethanwharris ethanwharris left a comment

Choose a reason for hiding this comment

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

Awesome, LGTM 😃

@ethanwharris ethanwharris enabled auto-merge (squash) March 28, 2022 10:52
@ethanwharris ethanwharris merged commit 536dbfc into master Mar 28, 2022
@ethanwharris ethanwharris deleted the fix/ImageEmbedder/InputTransform/collate-fn branch March 28, 2022 12:05
ethanwharris added a commit that referenced this pull request Mar 30, 2022
Co-authored-by: Ethan Harris <ethanwharris@gmail.com>
ethanwharris added a commit that referenced this pull request Mar 30, 2022
Co-authored-by: Ethan Harris <ethanwharris@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug / fix Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Collate Functions are not called during prediction in ImageEmbedder
3 participants