AmericanRedCross / street-view-green-view

BSD 3-Clause "New" or "Revised" License
15 stars 15 forks source link

use class segmentation for % vegetation/canopy estimation #10

Open danbjoseph opened 7 months ago

danbjoseph commented 7 months ago

The current GVI calculation doesn't seem to a good solution (at least not yet). See https://github.com/AmericanRedCross/street-view-green-view/pull/29#issuecomment-2021032055

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.

Additionally, it's likely that there are better ways to analyze than the green view index calculation from the original Treepedia. Can we download and run a transformer model to do class/semantic segmentation and calculation the % of pixels classified as a "vegetation" type category? (Noting that we want to run locally and not depend on an API/service for the analysis.)

For example https://huggingface.co/iammartian0/RoadSense_High_Definition_Street_Segmentation can segment out Nature-vegetation as a category.

Screenshot 2024-03-31 at 3 55 57 PM

objective

easiest option at this time would seem to be to borrow and build on what the creators of https://github.com/Spatial-Data-Science-and-GEO-AI-Lab/StreetView-NatureVisibility have done and...

other notes

dragonejt commented 5 months ago

I'm going to check out the iammartian0/RoadSense_High_Definition_Street_Segmentation and facebook/mask2former-swin-large-cityscapes-semantic that the StreetView-NatureVisibility project uses. Instead of using HuggingFace transformers to download the model and run it locally, I might instead look at the HuggingFace Serverless Inference API.

danbjoseph commented 5 months ago

Thanks for exploring segmentation for analysis. The initial target users are Red Cross Red Crescent National Societies and they may have limited connectivity (e.g. expensive, intermittent, and/or slow). Eventually, I want an option for a fully local workflow (e.g. parsing a local folder of images instead of using Mapillary). Also, the image sets can be quite large so I'd want to know about any potential limits of APIs - I am testing the Spatial-Data-Science-and-GEO-AI-Lab/StreetView-NatureVisibility project and for Semarang, Indonesia and it is 54,027 images.

danbjoseph commented 4 months ago

(move these notes into the first comment of this thread so that the overall description for this issue is in one place.)