-
Notifications
You must be signed in to change notification settings - Fork 212
Enable tests for examples #123
Enable tests for examples #123
Conversation
|
||
# 2. Create an ImageEmbedder with swav trained on imagenet. | ||
# Check out SWAV: https://pytorch-lightning-bolts.readthedocs.io/en/latest/self_supervised_models.html#swav | ||
embedder = ImageEmbedder(backbone="swav-imagenet", embedding_dim=128) | ||
|
||
# 3. Generate an embedding from an image path. | ||
embeddings = embedder.predict('data/hymenoptera_data/predict/153783656_85f9c3ac70.jpg') | ||
embeddings = embedder.predict(["data/hymenoptera_data/predict/153783656_85f9c3ac70.jpg"]) |
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.
Should predict()
accept str
in addition to List[str]
?
Codecov Report
@@ Coverage Diff @@
## master #123 +/- ##
==========================================
- Coverage 87.39% 86.89% -0.51%
==========================================
Files 49 49
Lines 1579 1579
==========================================
- Hits 1380 1372 -8
- Misses 199 207 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -53,13 +53,20 @@ def run_test(filepath): | |||
"step,file", | |||
[ | |||
("finetuning", "image_classification.py"), | |||
# ("finetuning", "object_detection.py"), # TODO: takes too long. |
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.
would GPU help?
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.
Yes, I assume it would help. I cannot even run fintuning/translation.py
locally (CPU, 16GB) due to the OOM error.
from flash.tabular import TabularClassifier, TabularData | ||
|
||
# 1. Download the data | ||
download_data("https://pl-flash-data.s3.amazonaws.com/titanic.zip", 'data/') | ||
download_data("https://pl-flash-data.s3.amazonaws.com/titanic.zip", "data/") |
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.
lets cache the data folder
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.
It should be caching data/
directory already as I fixed it in #107.
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.
LGTM !
What does this PR do?
This PR:
"
instead of mix use with'
in examples for consistency.)Before submitting
PR review
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 🙃