-
Notifications
You must be signed in to change notification settings - Fork 378
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
PASTIS dataset #315
PASTIS dataset #315
Conversation
05d6508
to
d813bc7
Compare
be05e0b
to
891ac5c
Compare
891ac5c
to
ebb4252
Compare
ebb4252
to
028d2e1
Compare
Co-authored-by: Isaac Corley <22203655+isaaccorley@users.noreply.github.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
@isaaccorley do you have a reason here? My thought was that the |
What would we name the instance mask then? Efficiency reasons mostly. Instead of always loading Tx1xHxW mask you are also loading a TxNxHxW mask, where N is number of instances in the sample. I'm not married to the separation though so feel free to change it however. |
Key names should be decided on based on what Kornia uses. If I remember correctly, they don't yet have great support for instance segmentation? As for speed, I would love to see a benchmark to see if it actually matters on an average system. If it does make a difference, then I would rather have a parameter to control which is used instead of two classes. |
And if it doesn't make a difference you want two classes? |
If it makes a difference I want one class controlled by parameter. If it doesn't make a difference I want one class that loads both. So either way, a single class. |
The only case where we have different datasets for different tasks is COWC, but it's actually a separate download and is referred to as COWC Counting or COWC Detection in the literature. In this case, there's a single PASTIS dataset, and it can be used for multiple tasks. That's why I think it makes more sense to have 1 dataset. |
It's obviously going to be slower, but is it slower than the GPU? |
GPUs change, I think it is better to have them separated! |
Okay I like this much better actually |
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.
Can you add example plots to the PR description? I think the current image is just from the paper.
torchgeo/datasets/pastis.py
Outdated
Returns: | ||
the instance segmentation mask, box, and label for each instance | ||
""" | ||
mask_array = np.load(self.files[index]["semantic"])[0].astype(np.uint8) |
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.
Wonder if we could somehow call _load_semantic_targets
to avoid code duplication here
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 but let's stop here :)
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
codecov shouldn't be failing, not sure what's going on |
This is due to codecov/codecov-action#903 and codecov/feedback#126. Solution is to re-run the minimum tests until codecov does report correctly. |
Is this the plot for semantic seg? Can you share the plot for instance seg too? |
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.
Still curious whether loading all labels (as opposed to the user choosing between semantic/instance) slows down I/O times enough to actually impact training time (vs. the time spent on an "average" GPU). But I think this PR is probably good enough. Happy to nitpick for eternity, but don't let my perfectionism get in the way of your research 😄
* 3 Sentinel-1 Ascending bands | ||
* 3 Sentinel-1 Descending bands |
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 make ascending/descending lowercase
dataset folds to include | ||
bands: load Sentinel-1 ascending path data (s1a), Sentinel-1 descending path | ||
data (s1d), or Sentinel-2 data (s2) | ||
mode: load semantic (semantic) or instance (instance) annotations |
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 "task" be a better parameter name? Also might change this to:
mode: load semantic (semantic) or instance (instance) annotations | |
mode: load "semantic" or "instance" segmentation annotations |
fig, axs = plt.subplots(1, num_panels, figsize=(num_panels * 4, 4)) | ||
axs[0].imshow(images[0] / 5000) | ||
axs[1].imshow(images[1] / 5000) | ||
axs[2].imshow(mask, vmin=0, vmax=19, cmap=self._cmap, interpolation="none") |
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.
Wonder if we should use a different cmap for instance segmentation so that each field is a different color
This PR adds the PASTIS dataset (original and PASTIS-R versions) for time-series semantic/instance segmentation of agricultural parcels of 18 crop type categories in Sentinel-1 and Sentinel-2 imagery.