Package: seg2map
Seg2Map :mag_right: :milky_way:An interactive web map app for applying Doodleverse/Zoo models to geospatial imageryOverview:Seg2Map facilitates application of Deep Learning-based image segmentation models and apply them to high-resolution (~1m or less spatial footprint) geospatial imagery, in order to make high-resolution label maps. Please see ourwikifor more information.The principle aim is to generate time-series of label maps from a time-series of imagery, in order to detect and assess land use/cover change. This project also demonstrates how to apply generic models for land-use/cover on publicly available high-resolution imagery at arbitrary locations.Imagery comes from Google Earth Engine vias2m_engine. Initially, we focus onNAIPtime-series, available for the conterminious United States since 2003. In the future,Planetscopeimagery may also be made available (for those with access, such as federal researchers).We offer a set ofSegmentation Zoomodels, especially created and curated for this project based on a publicly available datasets. These datasets have been selected because they are public, large (several hundred to several thousand labeled images), and provide broad class labels for generic land use/cover mapping needs.Installation InstructionsIn order to use seg2map you need to install Python packages in an environment. We recommend you useAnacondato install the python packages in an environment for seg2map. After you install Anaconda on your PC, open the Anaconda prompt or Terminal in Mac and Linux and use thecdcommand (change directory) to go the folder where you have downloaded the seg2map repository.Create an Anaconda environmentThis command creates an anaconda environment namedseg2mapand installspython 3.10in itYou can also usepython 3.10We will install the seg2map package and its dependencies in this environment.condacreate--nameseg2mappython=3.10-yActivate your conda environmentcondaactivateseg2mapIf you have successfully activated seg2map you should see that your terminal's command line prompt should now start with(seg2map).Install Conda Dependenciesseg2map requiresjupyterlabandgeopandasto function properly so they will be installed in theseg2mapenvironment.GeopandashasGDALas a dependency so its best to install it with conda.Make sure to install geopandas from theconda-forgechannel to ensure you get the latest version.Make sure to install both jupyterlab and geopandas from the conda forge channel to avoid dependency conflictscondainstall-cconda-forgegeopandasjupyterlab-yInstall the seg2map from PyPipipinstallseg2mapUninstall the h5py installed by pip and reinstall with conda-forgepipuninstallh5py
condainstall-cconda-forgeh5pyAll the Installation Commands:condacreate--nameseg2mappython=3.10-y
condaactivateseg2map
condainstall-cconda-forgegeopandasjupyterlab-y
pipinstallseg2map
pipuninstallh5py
condainstall-cconda-forgeh5pyHaving Installation Errors?Use the commandconda clean --allto clean old packages from your anaconda base environment. Ensure you are not in your seg2map environment or any other environment by runningconda deactivate, to deactivate any environment you're in before runningconda clean --all. It is recommended that you have Anaconda prompt (terminal for Mac and Linux) open as an administrator before you attempt to installseg2mapagain.Conda Clean Stepscondadeactivate
condaclean--allHow to Use Seg2MapSign up to use Google Earth Engine Python APIFirst, you need to request access to Google Earth Engine athttps://signup.earthengine.google.com/. It takes about 1 day for Google to approve requests.Activate your conda environmentcondaactivateseg2mapIf you have successfully activated seg2map you should see that your terminal's command line prompt should now start with(seg2map).Install the seg2map from PyPicd<locationyoudownloadedseg2map>
ex:cdC:\1_repos\seg2mapLaunch Jupyter Labmake you run this command in the seg2map directory so you can choose a notebook to use.jupyterlabFeatures1. Download Imagery from Google Earth EngineUse google earth engine to download multiple years worth of imagery.You can download multiple ROIs and years of data at lighting speeds 🌩️2. Apply Models to Imagery3. Load Segmented Imagery onto the MapGeneric workflow:Provide a web map for navigation to a location, and draw a bounding boxProvide an interface for controls (set time period, etc)Download geospatial imagery (for now, just NAIP)Provide tools to select and apply a Zoo model to create a label imageProvide tools to interact with those label images (download, mosaic, merge classes, etc)Authors@dbuscombe-usgs@2320sharonContributions:@venuswkuWe welcome collaboration! Please use ourDiscussionstab if you're interested in this project. We welcome user-contributed models! They must be trained usingSegmentation Gym, and then served and documented throughSegmentation Zoo- get in touch and we'll walk you through the process!Roadmap / progressV1Develop codes to create a web map for navigation to a location, and draw a bounding boxDevelop codes interface for controls (time period, etc)Develop codes for downloading NAIP imagery using GEEPut together a prototype jupyter notebook for web map, bounding box, and image downloadsCreate Seg2Map modelsCoast Train/ aerial / high-res. sat2 classdataset(water, other)zenodo release for 768x768 imageryzenodo pageCoast Train/ NAIP5 classdataset(water, whitewater, sediment, bare terrain, other terrain)8 classdataset(water, whitewater, sediment, bare terrain, marsh veg, terrestrial veg, ag., dev.)zenodo release of 5-class ResUNet models for 768x768 imageryzenodo pagezenodo release of 8-class ResUNet models for 768x768 imageryzenodo pagezenodo release of 5-class Segformer models for 768x768 imageryzenodo pagezenodo release of 8-class Segformer models for 768x768 imageryzenodo pageChesapeake Landcover(CCLC) / NAIP7 classdataset(water, tree canopy / forest, low vegetation / field, barren land, impervious (other), impervious (road), no data)zenodo release of 7-class ResUNet models for 512x512 imagerypagezenodo release of 7-class SegFormer models for 512x512 imagerypageEnviroAtlas/ NAIP6 class dataset (water, impervious, barren, trees, herbaceous, shrubland)zenodo release of 6-class ResUNet models for 1024 x 1024 modelszenodo pageOpenEarthMap/ aerial / high-res. sat9 classdataset(bareland, rangeland, dev., road, tree, water, ag., building, nodata)zenodo release of 9-class ResUNet models for 512x512 modelszenodo pageDeepGlobe/ aerial / high-res. sat7 classdataset(urban, ag., rangeland, forest, water, bare, unknown)zenodo release for of 7-class ResUNet models 512x512 imageryzenodo pageBarrier Islands/ orthomosaic / coastlinesSubstrate data 6 class (dev, sand, mixed, coarse, unknown, water)zenodo release of substrate models for 768x768 imageryVegetation type data 7 class (shrub/forest, shrub, none/herb., none, herb., herb./shrub, dev)zenodo release of Vegetation type  models for 768x768 imageryVegetation density data 7 class (dense, dev., moderate, moderate/dense, none, none/sparse, sparse)zenodo release of Vegetation density  models for 768x768 imageryGeomorphic setting data 7 class (beach, backshore, dune, washover, barrier interior, marsh, ridge/swale)zenodo release of Geomorphic setting  models for 768x768 imagerySupervised classification data 9 class (water, sand, herbaceous veg./low shrub, sparse/moderate, herbaceous veg/low shrub, moderate/dense, high shrub/forest, marsh/sediment, marsh/veg, marsh, high shrub/forest, development)zenodo release of Supervised classification models for 768x768 imageryAAAI/ aerial / high-res. sat2 class dataset (other, building)zenodo release for 1024x1024 imageryzenodo page2 class dataset (other, flooded building)zenodo release for 1024x1024 imageryzenodo pagexBD-hurricanes / aerial / high-res. sat, a subset of theXView2dataset4 class building dataset (other, no damage, minor damage, major damage)zenodo release for 768x768 imageryzenodo page2 class building dataset (other, building)zenodo release for 768x768 imageryzenodo pageSuperclass models8 merged datasets for 8 separate superclass models (water, sediment, veg, herb. veg., woody veg., impervious, building, agriculture)zenodo release for 768x768 imagery / waterzenodo release for 768x768 imagery / sedimentzenodo release for 768x768 imagery / vegzenodo release for 768x768 imagery / herb. veg.zenodo release for 768x768 imagery / woody veg.zenodo release for 768x768 imagery / imperviouszenodo release for 768x768 imagery / buildingzenodo release for 768x768 imagery / agricultureDevelop codes/docs for selecting modelDevelop codes/docs for applying model to make label imageryTool for mosaicing labelsTool for downloading labels in geotiff formatV2Tool for post-processing/editing labelsTool for detecting changeMakePlanetscope3m imagery available via Planet API (federal researchers only)Include additional models/datasets (TBD)DatasetsGeneral LandcoverDeepGlobepaperchallengedataZenodo model release (512x512): Buscombe, Daniel. (2023). Doodleverse/Segmentation Zoo/Seg2Map Res-UNet models for DeepGlobe/7-class segmentation of RGB 512x512 high-res. images (v1.0) [Data set]. Zenodo.https://doi.org/10.5281/zenodo.7576898EnviroAtlasEnviroAtlas datasetEnviroAtlas paperpaper using EnviroAtlasdataThis dataset was organized to accompany the 2022 paper,Resolving label uncertainty with implicit generative models. More details can be foundhereZenodo model release (512x512): Buscombe, Daniel. (2023). Doodleverse/Segmentation Zoo/Seg2Map Res-UNet models for EnviroAtlas/6-class segmentation of RGB 512x512 high-res. images (v1.0) [Data set]. Zenodo.https://doi.org/10.5281/zenodo.7576909OpenEarthMapwebsitedatapaperZenodo model release (512x512): Buscombe, Daniel. (2023). Doodleverse/Segmentation Zoo/Seg2Map Res-UNet models for OpenEarthMap/9-class segmentation of RGB 512x512 high-res. images (v1.0) [Data set]. Zenodo.https://doi.org/10.5281/zenodo.7576894Coastal LandcoverChesapeake LandcoverwebpageZenodo model release (512x512): Buscombe, Daniel. (2023). Doodleverse/Segmentation Zoo/Seg2Map Res-UNet models for Chesapeake/7-class segmentation of RGB 512x512 high-res. images (v1.0) [Data set]. Zenodo.https://doi.org/10.5281/zenodo.7576904Zenodo SegFormer model release (512x512): Buscombe, Daniel. (2023). Doodleverse/Segmentation Zoo/Seg2Map Segformer models for Chesapeake/7-class segmentation of RGB 512x512 high-res. images (v1.0) [Data set]. Zenodo.https://doi.org/10.5281/zenodo.7677506Coast TrainpaperwebsitedatapreprintZenodo model release, 2-class (768x768): Buscombe, Daniel. (2023). Doodleverse/Segmentation Zoo/Seg2Map Res-UNet models for CoastTrain water/other segmentation of RGB 768x768 orthomosaic images (v1.0) [Data set]. Zenodo.https://doi.org/10.5281/zenodo.7574784Zenodo model release, 5-class (768x768): Buscombe, Daniel. (2023). Doodleverse/Segmentation Zoo/Seg2Map Res-UNet models for CoastTrain/5-class segmentation of RGB 768x768 NAIP images (v1.0) [Data set]. Zenodo.https://doi.org/10.5281/zenodo.7566992Zenodo model release, 8-class (768x768): Buscombe, Daniel. (2023). Doodleverse/Segmentation Zoo/Seg2Map Res-UNet models for CoastTrain/8-class segmentation of RGB 768x768 NAIP images (v1.0) [Data set]. Zenodo.https://doi.org/10.5281/zenodo.7570583Zenodo SegFormer model release, 5-class (768x768): Buscombe, Daniel. (2023). Doodleverse/Segmentation Zoo/Seg2Map SegFormer models for CoastTrain/5-class segmentation of RGB 768x768 NAIP images (v1.0) [Data set]. Zenodo.https://doi.org/10.5281/zenodo.7641708Zenodo SegFormer model release, 8-class (768x768): Buscombe, Daniel. (2023). Doodleverse/Segmentation Zoo/Seg2Map SegFormer models for CoastTrain/8-class segmentation of RGB 768x768 NAIP images (v1.0) [Data set]. Zenodo.https://doi.org/10.5281/zenodo.7641724AAAI / Buildings / Flooded BuildingsdatadatapaperZenodo model release (1024x1024) building / no building: Buscombe, Daniel. (2023). Doodleverse/Segmentation Zoo/Seg2Map Res-UNet models for segmentation of buildings of RGB 1024x1024 high-res. images (v1.0) [Data set]. Zenodo.https://doi.org/10.5281/zenodo.7607895Zenodo model release (1024x1024) flooded building / no flooded building: Buscombe, Daniel. (2023). Doodleverse/Segmentation Zoo/Seg2Map Res-UNet models for segmentation of AAAI/flooded buildings in RGB 1024x1024 high-res. images (v1.0) [Data set]. Zenodo.https://doi.org/10.5281/zenodo.7622733XBD-hurricanesXview2 challengeXBD-hurricanes codeZenodo SegFormer model release (768x768) building damage: Buscombe, Daniel. (2023). Doodleverse/Segmentation Zoo/Seg2Map SegFormer models for segmentation of xBD/damaged buildings in RGB 768x768 high-res. images (v1.0) [Data set]. Zenodo.https://doi.org/10.5281/zenodo.7613175Zenodo SegFormer model release (768x768) building presence/absence: Buscombe, Daniel. (2023). Doodleverse/Segmentation Zoo/Seg2Map SegFormer models for segmentation of xBD/buildings in RGB 768x768 high-res. images (v1.0) [Data set]. Zenodo.https://doi.org/10.5281/zenodo.7613212Barrier IslandswebpagepaperZenodo Substrate model release (768x768):Zenodo Vegetation type model release (768x768):Zenodo Vegetation density model release (768x768):Zenodo Geomorphic model release (768x768):Zenodo Supervised classification model release (768x768):SuperclassesA. Water:Coast TrainChesapeakeEnviroAtlasOpenEarthMapDeepGlobeBarrier SubstrateNOAA[v2: Barrier Substrate][v2: Elwha]B. Sediment:Coast TrainNOAA[v2: Barrier Substrate (sand, mixed, coarse)][v2: Elwha]C. Bare:Chesapeake (barren land)EnviroAtlas (barren)OpenEarthMap (bareland)D. Vegetated:Coast Train (marsh veg, terrestrial veg, ag)FloodNet (tree, grass)Chesapeake (tree canopy / forest, low vegetation / field)EnviroAtlas (trees, herbaceous, shrubland)OpenEarthMap (rangeland, tree, ag)DeepGlobe (ag., rangeland, forest)NOAA (veg)[v2: Elwha][v2: Barrier Substrate]E. Impervious:FloodNet (Building-flooded, Building-non-flooded, Road-flooded, Road-non-flooded, vehicle)Chesapeake (impervious (other), impervious (road))EnviroAtlas (impervious)OpenEarthMap (dev, road, building)DeepGlobe (urban)NOAA (dev)[v2: Elwha]F. Building:OpenEarthMap (building)AAAI (building)G. Agriculture:OpenEarthMap (ag)DeepGlobe (ag)H. Woody Veg:FloodNet (tree)Chesapeake (tree canopy / forest)EnviroAtlas (trees)OpenEarthMap (tree)DeepGlobe (forest)[v2: Elwha][v2: Barrier Substrate]ReferencesNotesNLCD classesNAIP imageryClasses:Coast Train 1Coast Train 2Coast Train 3FloodNetChesapeakeEnviroAtlasOpenEarthMapDeepGlobeAAAINOAABarrier SubstrateA. WaterXXXXXXXXXXa. whitewaterXXa. poolX------------------------------------B. SedimentXXXb. sandXb. mixedXb. coarseX------------------------------------C. Bare/barrenXXXXXX---------------------------------d. marshXd. terrestrial vegXXd. agricultureXXXd. grassXd. herbaceous / low vegetation / fieldXXd. tree/forestXXXXXd. shrublandXd. rangelandXXX------------------------------------E. Impervious/urban/developedXXXXXXe. impervious (other)Xe. impervious (road)XXe. Building-floodedXe. Building-non-floodedXXXe. Road-floodedXe. Road-non-floodedXe. VehicleX------------------------------------X. OtherXXX