Open tgoelles opened 1 month ago
Hi @tgoelles! The feature you're describing was actually recently added by @oddeirikigland in #1814 and will be included in the next 0.6.0 release. While you wait, you could also install a development version to get the latest features. I'm hoping to release 0.6.0 soon, but teaching and deadlines have kept me busy.
Hi @adamjstewart.
I tried the new VectorDataset and now the bounds work for the avalanche_masks_dataset.
Now to the second part of the question. I want to train on multiple maks - images pairs. Pairs which belong together have the same timestamp.
avalanche_masks_dataset has shape files with different dates master_dataset has geotiff files also with different dates.
I thought that this is implemented, and what the time bounds are for? It seems that IntersectionDataset and RandomBatchGeoSampler do not match date pairs? So how should I deal with this and are there plans to include this?
It seems that IntersectionDataset and RandomBatchGeoSampler do not match date pairs?
As far as I know, they should. If you can provide a few sample (can be fake) images and masks that reproduce the problem you are seeing, I can try debugging this.
Here is an example: https://www.transfernow.net/dl/20240718Zfb8Iwjq
maybe it does work, but I have no idea if it works. In general it is a bit frustrating, that it feels too much like a blackbox and does not fail or at least warn when things are not working. So something like a strict and/or verbose mode would be great in addition to better documentation. I think I could contribute something to that in the future.
it feels too much like a blackbox
Welcome to deep learning 😆
maybe it does work, but I have no idea if it works.
You can quickly check by plotting the pairs that get sampled. You could also print the filename that is being loaded in torchgeo/datasets/geo.py
.
So something like a strict and/or verbose mode would be great
We need to make sure it doesn't impact speed, but we could definitely add optional verbose logging just to see what files are being loaded/written.
I thought that this is implemented, and what the time bounds are for? It seems that IntersectionDataset and RandomBatchGeoSampler do not match date pairs? So how should I deal with this and are there plans to include this?
The image and masks should match in pairs based on the date. But keep in mind that the RandomSampler gets a random area within the intersection of the image and mask file. Since you have a full TIFF file, I assume the avalanche mask is only a small portion of it, making a lot of the samples negative.
@tgoelles are you still experiencing any issues, or can we close this?
Description
Dates in filename_regex of VectorDataset have no effect. The mint bound is always 0 and the maxt to sys.maxsize. I expected the same behavior as with RasterDataset.
I thought that I could give multipel geotiff files as "image" input and multiple shape files for the masks. Then torchgeo would match the timestamps and use them to train the model.
As it seems now only RasterDataset can handle different timestamps. Does torchgeo even support multiple pairs of mask and image? It seems maybe if both are Rasterdataset maybe, but not with RasterDataset + VectorDataset.
Steps to reproduce