-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add WildFire Dataset object and split strategies #47
Conversation
Codecov Report
@@ Coverage Diff @@
## master #47 +/- ##
==========================================
+ Coverage 81.39% 83.80% +2.41%
==========================================
Files 16 18 +2
Lines 602 704 +102
==========================================
+ Hits 490 590 +100
- Misses 112 114 +2
|
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.
You made a mistake in your example, it is ->
from torch.utils.data import DataLoader
from pyronear.datasets.wildfire import (WildFireDataset,
WildFireSplitter)
wildfire = WildFireDataset(metadata='wildfire.csv',
path_to_frames=path_to_frames)
ratios = {'train': 0.7, 'val': 0.15, 'test':0.15}
splitter = WildFireSplitter(ratios)
splitter.fit(wildfire)
wildfire_loader_train = DataLoader(splitter.train, batch_size=64, shuffle=True)
wildfire_loader_val = DataLoader(splitter.val, batch_size=64, shuffle=True)
wildfire_loader_test = DataLoader(splitter.test, batch_size=64, shuffle=True)
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.
Maybe my question is dumb, but I don't understand why you use "from skimage import io" and not pil to load the images. I have a problem to apply the torch vision transform afterwards (https://pytorch.org/docs/stable/torchvision/transforms.html). What do you use as a transform then ?
Thanks for your feedback! splitter = WildFireSplitter(ratios)
splitter.fit(wildfire) |
Hello,
This PR aims at:
WildFireDataset
pytorch compatible classExample:
Each dataloader will yield the image(transformed if requested) and the two targets (fire and clf_confidence)
For more example, please browse the tests
Any feedback is welcome