torchgeo icon indicating copy to clipboard operation
torchgeo copied to clipboard

Added substation segementation dataset

Open rijuld opened this issue 1 year ago • 5 comments

rijuld avatar Oct 17 '24 15:10 rijuld

Hi @rijuld, thanks for the contribution! If you're new to creating PyTorch datasets, I highly recommend reading the following tutorials:

  • https://pytorch.org/tutorials/beginner/basics/data_tutorial.html
  • https://pytorch.org/tutorials/beginner/data_loading_tutorial.html

The only difference between datasets in torchvision and NonGeoDatasets in TorchGeo is that our __getitem__ returns a dictionary instead of a tuple. Other than that, they share all the same basic components.

Most of your issues seem to be due to the use of args. I think you just need to remove this and explicitly list all parameters in the function signature. This will also simplify your testing code. Take a look at other existing datasets, we have about 75 examples to choose from. If you find one that is similar to your dataset, it shouldn't actually require that many changes to get them working.

adamjstewart avatar Oct 22 '24 11:10 adamjstewart

Hi @adamjstewart , thanks a ton for the feedback! I will go through this tutorial.

rijuld avatar Oct 22 '24 12:10 rijuld

@microsoft-github-policy-service agree

rijuld avatar Oct 30 '24 17:10 rijuld

Can you resolve the merge conflict? The order of __all__ changed in the main branch.

adamjstewart avatar Nov 26 '24 12:11 adamjstewart

Still a lot of missing test coverage, will review in more detail after AGU.

adamjstewart avatar Dec 02 '24 23:12 adamjstewart

@adamjstewart I'm unsure about how to test the configuration file locally. Additionally, would testing the conf file cover the datamodule as well, or would I need to write separate test cases for the datamodule to ensure adequate code coverage?

rijuld avatar Jan 09 '25 15:01 rijuld

I'm unsure about how to test the configuration file locally.

You can get the test name from CI and then run it like so:

> pytest tests/trainers/test_segmentation.py::TestSemanticSegmentationTask::test_trainer[True-substation]

Additionally, would testing the conf file cover the datamodule as well

Yes

adamjstewart avatar Jan 11 '25 18:01 adamjstewart

We're preparing a 0.7.0 release in the next week or so and I would love to get this dataset in. Do you mind if I push changes directly to your branch to fix the remaining test comments?

adamjstewart avatar Mar 12 '25 11:03 adamjstewart

We're preparing a 0.7.0 release in the next week or so and I would love to get this dataset in. Do you mind if I push changes directly to your branch to fix the remaining test comments?

Sure! Feel free to push changes directly to my branch. Thanks!

rijuld avatar Mar 12 '25 12:03 rijuld