-
Notifications
You must be signed in to change notification settings - Fork 212
Enhancement/1314 allow sizing show sample #1381
Enhancement/1314 allow sizing show sample #1381
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1381 +/- ##
==========================================
- Coverage 92.93% 92.93% -0.01%
==========================================
Files 286 286
Lines 12837 12844 +7
==========================================
+ Hits 11930 11936 +6
- Misses 907 908 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
It looks like the code is passing all the tests, but Azure pipelines are failing. I think I need help on this one. |
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.
Hi, @Nico995 - Thanks for the fix, this looks good to me! Apologies for the delay in the review, and I appreciate the ping. 😃
I have a one-inline suggestion for you to take a look at, other than that - can you also share the output figure it shows after this PR (and before this PR)? Also, once done, we can also add doc-strings about the arguments limit_nb_samples, figsize
that we have added in this PR (they will appear here: https://lightning-flash.readthedocs.io/en/latest/api/generated/flash.core.data.data_module.DataModule.html?highlight=show%20batch#flash.core.data.data_module.DataModule.show_train_batch). Let us know if you would like to pick this up, maybe in a separate PR.
Removed redundant axs.ravel() Co-authored-by: Kushashwa Ravi Shrimali <kushashwaravishrimali@gmail.com>
Hi @krshrimali, thanks for your suggestion, it made perfect sense. I will gladly fix the documentation. As you suggested, I'll open a new separate PR. Should I open an Issue first, or should I just open the PR? (maybe referencing this one) |
Thank you so much, doc-strings for the arguments will be great! Yep, you can add them in a separate PR. Also, would you like to share a sample output image with us? :) Feel free to create a PR directly, thanks for your interest and contributions. 🎉 |
…m:Nico995/lightning-flash into enhancement/1314_allow_sizing_show_sample
Hi, while producing some sample images I noticed that I missed a line, now everything should work correctly. Classificationimport torch
import flash
import matplotlib.pyplot as plt
from flash.core.data.utils import download_data
from flash.image import ImageClassificationData, ImageClassifier
download_data("https://pl-flash-data.s3.amazonaws.com/hymenoptera_data.zip", "./data")
datamodule = ImageClassificationData.from_folders(
train_folder="data/hymenoptera_data/train/",
val_folder="data/hymenoptera_data/val/",
batch_size=8,
transform_kwargs={"image_size": (196, 196), "mean": (0.485, 0.456, 0.406), "std": (0.229, 0.224, 0.225)},
)
datamodule.show_train_batch()
plt.show()
datamodule.show_train_batch(figsize=(16, 16))
plt.show() Produces Semantic Segmentationfrom flash.image import SemanticSegmentationData
download_data(
"https://github.com/ongchinkiat/LyftPerceptionChallenge/releases/download/v0.1/carla-capture-20180513A.zip",
"./data",
)
datamodule = SemanticSegmentationData.from_folders(
train_folder="data/CameraRGB",
train_target_folder="data/CameraSeg",
val_split=0.1,
transform_kwargs=dict(image_size=(256, 256)),
num_classes=21,
batch_size=8,
)
datamodule.show_train_batch()
plt.show()
datamodule.show_train_batch(figsize=(16, 3))
plt.show() produces |
Thanks, @Nico995 - this looks great to me! Nice work! |
What does this PR do?
Fixes #1314
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 🙃