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

Gvi to points #29

Merged
merged 7 commits into from
Apr 3, 2024
Merged

Gvi to points #29

merged 7 commits into from
Apr 3, 2024

Conversation

ioalexei
Copy link
Contributor

Addresses issue #8

Adds file assign_gvi_to_points.py

Input:

  1. mapillary images directory
  2. interim points file generated by create_points.py
  3. an output directory (I've been using data/processed as default)

Output:
The module will output a GeoPackage file called image_points_with_gvi.gpkg in the output directory.

Example usage:

python3 -m src.assign_gvi_to_points /data/raw/mapillary /data/interim/sample_images.gpkg /data/processed

Still to do - flesh out the info/examples for --help

assign_gvi_to_points calls get_gvi_score on the image associated with each location and adds the score as an attribute. outputs a gpkg to the specified folder.
- Add Typer code to execute from cmd
- Move get_gvi_score inside assign_gvi_to_points.py
@danbjoseph
Copy link
Member

danbjoseph commented Mar 26, 2024

I was able to run things successfully! Thanks for working on this 😄

  • Please also update pyproject.toml with the new dependencies.
  • In previous steps, instead of just the output directory, it also takes the filename and I think it will write in different geospatial file format according to the extension. Since the process might be run more than once or on multiple datasets, it would be good to be able to set the filename in the command.
  • Did you run the linting and formatting checks?

Something seems off (either with the methodology or with the code) based on a spot check of the 3 highest and 3 lowest GVI scores.

High

81.8
781053043909949
81
713345330995536
80.8
425963426515579

Low

2
422966303445031

1.2
246682028517324

1.14
935156744512812

Add new dependencies
Applied formatting checks from ruff
Use output file instead of output directory, allow user to set file name/type
@ioalexei
Copy link
Contributor Author

Updated:

  • New dependencies added to pyproject.toml
  • Formatting applied
  • Changed output directory to output file - user can enter a file path and user-defined filename/format for the output

@ioalexei
Copy link
Contributor Author

Spot checks definitely look odd. I didn't touch the GV score function but will take a look and compare to the sample from Treepedia to see if I can spot anything off.

Copy link
Contributor

@dragonejt dragonejt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the os built-in library being in pyproject.toml, the rest of my comments are nits that you can choose to implement or not. Thanks so much for your work!

pyproject.toml Outdated Show resolved Hide resolved
src/assign_gvi_to_points.py Outdated Show resolved Hide resolved
src/assign_gvi_to_points.py Show resolved Hide resolved
ioalexei added 2 commits April 2, 2024 11:06
- Add help annotations to arguments
- use tqdm for progress bar
- remove os from dependencies list
@ioalexei
Copy link
Contributor Author

ioalexei commented Apr 2, 2024

Thanks @dragonejt - should all be addressed now.

@danbjoseph danbjoseph removed request for jayqi and ayoakin April 3, 2024 19:55
@danbjoseph danbjoseph merged commit 51e2519 into AmericanRedCross:main Apr 3, 2024
1 check passed
@ioalexei ioalexei deleted the gvi_to_points branch April 4, 2024 09:36
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.

3 participants