Skip to content
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

Geosampler prechipping #4

Merged
merged 33 commits into from
Sep 24, 2024
Merged

Conversation

sfalkena
Copy link
Collaborator

I think it makes sense to be able to interact with the chips of each sampler. Therefore, I want to propose changing the creation of the chips in the __init__ of each sampler, and to keep track of the chips using a GeoDataFrame. This leads to the following benefits:

  • It is possible to save the chips to file and to visualize them either in GIS software, or while developing.
  • It allows to filter the chips using other geometry, to remove chips that are not of interest. This could be particularly useful during inference to limit the number of chips. Example: When I want to infer a building detection model, I can now instantiate a gridsampler, filter my chips using a shapefile of urban areas and only infer on the intersection of my chips with the urban areas. See the function filter_chips.
  • It allows to split the samples. Right now I have created a function to split the samples to spread them across multiple workers. See the function set_worker_split.

An abstract method needs to be implemented for every sampler:

    @abc.abstractmethod    
    def get_chips(self) -> GeoDataFrame:

@sfalkena
Copy link
Collaborator Author

See mirrored PR to TorchGeo: microsoft#2300

@sfalkena sfalkena marked this pull request as ready for review September 17, 2024 14:07
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Sep 18, 2024
@sfalkena sfalkena changed the base branch from main to vers_working_branch September 23, 2024 09:44
@sfalkena sfalkena changed the base branch from vers_working_branch to main September 24, 2024 07:06
@sfalkena sfalkena changed the base branch from main to vers_working_branch September 24, 2024 07:18
@sfalkena sfalkena merged commit 7046e89 into vers_working_branch Sep 24, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies documentation Improvements or additions to documentation samplers testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants