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

DeepForest support for multiple annotation types (point, box, polygon). #590

Merged
merged 15 commits into from
Jul 29, 2024

Conversation

bw4sz
Copy link
Collaborator

@bw4sz bw4sz commented Dec 22, 2023

We want to prepare DeepForest to be able to ingest annotation geometries covering point, box and polygon formats. This is the first step to allow models and predictions in each and among each format. I think this is crucial for accessing every possible dataset available. This was spurred during development of the MillionTrees benchmark. Here is a roadmap

Pros:

  • More flexible
  • Better data coverage
  • Opportunities for weak annotation learning
  • More general

Cons:

  • We will need to update docs and transition the fundamental annotation holder from pandas to geopandas. This is pretty fundamental, many functions just reach for columns 'xmin', 'xmax', 'ymin' 'ymax'. For example:

https://github.com/weecology/DeepForest/blob/b87f9314e666903bb361c614e24daf53e5abad03/deepforest/predict.py#L112C16-L112C16

xmin, ymin, xmax, ymax = windows[index].getRect()

and many more. We will need to first check what geometry type we have and perform the correct transformations.

  • There will be a breaking change in data formats that will ask users to update the default csv file if they have been doing something custom and bypassing the loader. For most users we can make this a somewhat easy transition by automatically converting within functions when we see a xmin, xmax, ymin, and ymax column. Most users will not notice this.

Roadmap for merge

  • Read in shapefiles of point, box, and polygon annotations and format them as geopandas dataframes.
  • preprocess.split_raster needs to have multi-geometry logic
  • conversion utilities to move between geometry types.

Long term goals

@bw4sz
Copy link
Collaborator Author

bw4sz commented Dec 22, 2023

@henrykironde and @ethanwhite I invite thoughts on how we proceed. My plan is to work on this branch while developing MillionTrees dataset https://milliontrees.idtrees.org/ and when I feel like the kinks are worked out, trigger the PR. This would be enough for DeepForest 1.4.0.

@bw4sz bw4sz changed the title [WIP] shapefile_to_annotations can now take in points, boxes, or polygons [WIP] DeepForest support for multiple annotation types (point, box, polygon). Dec 22, 2023
@bw4sz bw4sz force-pushed the geo_type branch 2 times, most recently from e823400 to 1a15f77 Compare December 27, 2023 22:53
@bw4sz bw4sz changed the title [WIP] DeepForest support for multiple annotation types (point, box, polygon). DeepForest support for multiple annotation types (point, box, polygon). Jul 16, 2024
@bw4sz bw4sz self-assigned this Jul 26, 2024
@bw4sz
Copy link
Collaborator Author

bw4sz commented Jul 26, 2024

Add better release notes.

Add support for multiple annotation types (point, box, polygon)
@henrykironde
Copy link
Contributor

This looks good in terms of logic. There are a few changes needed, but I will handle them later as part of a general cleaning and update.

@henrykironde henrykironde merged commit 81b029f into main Jul 29, 2024
5 checks passed
@henrykironde henrykironde deleted the geo_type branch July 29, 2024 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants