-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into classifier_model
- Loading branch information
Showing
51 changed files
with
2,862 additions
and
2,740 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{ | ||
"title": "CoastSeg: An Accessible and Extendable Hub for Satellite-Derived Shoreline (SDS) Detection and Mapping", | ||
"description": "CoastSeg is an interactive browser-based program that aims to broaden the adoption of satellite-derived shoreline (SDS) detection workflows among coastal scientists and coastal resource management practitioners. SDS is a sub-field of coastal sciences that aims to detect and post-process a time-series of shoreline locations from publicly available satellite imagery.", | ||
"creators": [ | ||
{ | ||
"name": "Fitzpatrick, Sharon", | ||
"orcid": "0000-0001-6513-9132", | ||
"affiliation": "Contracted to U.S. Geological Survey Pacific Coastal and Marine Science Center, Santa Cruz, California, United States" | ||
}, | ||
{ | ||
"name": "Buscombe, Daniel", | ||
"orcid": "0000-0001-6217-5584", | ||
"affiliation": "Contracted to U.S. Geological Survey Pacific Coastal and Marine Science Center, Santa Cruz, California, United States" | ||
}, | ||
{ | ||
"name": "Warrick, Jonathan A.", | ||
"orcid": "0000-0002-0205-3814", | ||
"affiliation": "U.S. Geological Survey Pacific Coastal and Marine Science Center, Santa Cruz, California, United States" | ||
}, | ||
{ | ||
"name": "Lundine, Mark A.", | ||
"orcid": "0000-0002-2878-1713", | ||
"affiliation": "U.S. Geological Survey Pacific Coastal and Marine Science Center, Santa Cruz, California, United States" | ||
}, | ||
{ | ||
"name": "Vos, Kilian", | ||
"orcid": "0000-0002-9518-1582", | ||
"affiliation": "New South Wales Department of Planning and Environment, Sydney, Australia" | ||
} | ||
], | ||
"contributors": [ | ||
{ | ||
"name": "Doran, K.S.", | ||
"orcid": "0000-0001-8050-5727", | ||
"affiliation": "U.S. Geological Survey St. Petersburg Coastal and Marine Science Center, St. Petersburg, FL 33701, United States" | ||
}, | ||
{ | ||
"name": "Janda, Catherine", | ||
"orcid": "0009-0004-5153-3680", | ||
"affiliation": "U.S. Geological Survey Pacific Coastal and Marine Science Center, Santa Cruz, California, United States" | ||
}, | ||
{ | ||
"name": "Gibbs, Ann", | ||
"orcid": "0000-0002-0883-3774", | ||
"affiliation": "U.S. Geological Survey Pacific Coastal and Marine Science Center, Santa Cruz, California, United States" | ||
}, | ||
{ | ||
"name": "Weber, Kathryn M.", | ||
"orcid": "0000-0002-5498-7117", | ||
"affiliation": "U.S. Geological Survey Woods Hole Coastal and Marine Science Center, Woods Hole, MA 02543, United States" | ||
}, | ||
{ | ||
"name": "O'Neill, Andrea", | ||
"orcid": "0000-0003-1656-4372", | ||
"affiliation": "U.S. Geological Survey Pacific Coastal and Marine Science Center, Santa Cruz, California, United States" | ||
}, | ||
{ | ||
"name": "Heslin, Julia L.", | ||
"orcid": "0000-0002-6895-800X", | ||
"affiliation": "U.S. Geological Survey Woods Hole Coastal and Marine Science Center, Woods Hole, MA 02543, United States" | ||
}, | ||
{ | ||
"name": "Burgess, Joseph", | ||
"affiliation": "U.S. Geological Survey St. Petersburg Coastal and Marine Science Center, St. Petersburg, FL 33701, United States" | ||
}, | ||
{ | ||
"name": "Floris R. Calkoen", | ||
"orcid": "0000-0002-7155-6247", | ||
"affiliation": "Deltares | Delft, Netherlands" | ||
}, | ||
{ | ||
"name": "Himmelstoss, Emily A.", | ||
"orcid": "0000-0002-1760-5474", | ||
"affiliation": "U.S. Geological Survey Woods Hole Coastal and Marine Science Center, Woods Hole, MA 02543, United States" | ||
}, | ||
{ | ||
"name": "Bishop-Taylor, Robbi", | ||
"orcid": "0000-0002-1533-2599", | ||
"affiliation": "Geoscience Australia" | ||
}, | ||
{ | ||
"name": "Lazarus, Eli D.", | ||
"orcid": "0000-0003-2404-9661", | ||
"affiliation": "University of Southampton" | ||
}, | ||
{ | ||
"name": "Ku, Venus", | ||
"orcid": "0000-0002-7454-8277" | ||
}, | ||
{ | ||
"name": "Goldstein, Evan B.", | ||
"orcid": "0000-0001-9358-1016", | ||
"affiliation": "Sediment-Science" | ||
} | ||
], | ||
"license": { | ||
"id": "GPL-3.0-only" | ||
}, | ||
"keywords": [ | ||
"CoastSeg", | ||
"Satellite-Derived Shoreline", | ||
"SDS", | ||
"Coastal Mapping", | ||
"Remote Sensing" | ||
], | ||
"access_right": "open", | ||
"communities": [ | ||
{ | ||
"identifier": "coastal-science" | ||
} | ||
], | ||
"upload_type": "software", | ||
"language": "eng" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import os | ||
from coastseg import coastseg_logs | ||
from coastseg import zoo_model | ||
from coastseg.tide_correction import compute_tidal_corrections | ||
from coastseg import file_utilities | ||
|
||
# The Zoo Model is a machine learning model that can be used to extract shorelines from satellite imagery. | ||
# This script will only run a single ROI at a time. If you want to run multiple ROIs, you will need to run this script multiple times. | ||
|
||
# Extract Shoreline Settings | ||
settings ={ | ||
'min_length_sl': 100, # minimum length (m) of shoreline perimeter to be valid | ||
'max_dist_ref':500, # maximum distance (m) from reference shoreline to search for valid shorelines. This detrmines the width of the buffer around the reference shoreline | ||
'cloud_thresh': 0.5, # threshold on maximum cloud cover (0-1). If the cloud cover is above this threshold, no shorelines will be extracted from that image | ||
'dist_clouds': 100, # distance(m) around clouds where shoreline will not be mapped | ||
'min_beach_area': 50, # minimum area (m^2) for an object to be labelled as a beach | ||
'sand_color': 'default', # 'default', 'latest', 'dark' (for grey/black sand beaches) or 'bright' (for white sand beaches) | ||
"apply_cloud_mask": True, # apply cloud mask to the imagery. If False, the cloud mask will not be applied. | ||
} | ||
|
||
|
||
# The model can be run using the following settings: | ||
model_setting = { | ||
"sample_direc": None, # directory of jpgs ex. C:/Users/username/CoastSeg/data/ID_lla12_datetime11-07-23__08_14_11/jpg_files/preprocessed/RGB/", | ||
"use_GPU": "0", # 0 or 1 0 means no GPU | ||
"implementation": "BEST", # BEST or ENSEMBLE | ||
"model_type": "global_segformer_RGB_4class_14037041", # model name from the zoo | ||
"otsu": False, # Otsu Thresholding | ||
"tta": False, # Test Time Augmentation | ||
"use_local_model": True, # Use local model (not one from zeneodo) | ||
"local_model_path": r"C:\development\doodleverse\coastseg\CoastSeg\src\coastseg\downloaded_models\non_validation_model", # path to the local model | ||
} | ||
|
||
# Available models can run input "RGB" # or "MNDWI" or "NDWI" | ||
img_type = "RGB" # make sure the model name is compatible with the image type | ||
# percentage of no data allowed in the image eg. 0.75 means 75% of the image can be no data | ||
percent_no_data = 0.75 | ||
|
||
# 1. Set the User configuration Settings | ||
# --------------------------- | ||
# a. ENTER THE NAME OF THE SESSION TO SAVE THE MODEL PREDICTIONS TO | ||
model_session_name = "sample_session_demo1" | ||
# b. ENTER THE DIRECTORY WHERE THE INPUT IMAGES ARE STORED | ||
# - Example of the directory where the input images are stored ( this should be the /data folder in the CoastSeg directory) | ||
sample_directory = r"C:\development\doodleverse\coastseg\CoastSeg\data\ID_wra5_datetime03-04-24__03_43_01\jpg_files\preprocessed\RGB" | ||
|
||
|
||
# 2. Save the settings to the model instance | ||
# ----------------- | ||
# Create an instance of the zoo model to run the model predictions | ||
zoo_model_instance = zoo_model.Zoo_Model() | ||
# Set the model settings to read the input images from the sample directory | ||
model_setting["sample_direc"] = sample_directory | ||
model_setting["img_type"] = img_type | ||
|
||
# save settings to the zoo model instance | ||
settings.update(model_setting) | ||
# save the settings to the model instance | ||
zoo_model_instance.set_settings(**settings) | ||
|
||
|
||
# OPTIONAL: If you have a transects and shoreline file, you can extract shorelines from the zoo model outputs | ||
transects_path = "" # path to the transects geojson file (optional, default will be loaded if not provided) | ||
shoreline_path = "" # path to the shoreline geojson file (optional, default will be loaded if not provided) | ||
shoreline_extraction_area_path= "" # path to the shoreline extraction area geojson file (optional) | ||
|
||
# 3. Run the model and extract shorelines | ||
# ------------------------------------- | ||
zoo_model_instance.run_model_and_extract_shorelines( | ||
model_setting["sample_direc"], | ||
session_name=model_session_name, | ||
shoreline_path=shoreline_path, | ||
transects_path=transects_path, | ||
shoreline_extraction_area_path = shoreline_extraction_area_path | ||
) | ||
|
||
# 4. OPTIONAL: Run Tide Correction | ||
# ------------------------------------------ | ||
# Tide Correction (optional) | ||
# Before running this snippet, you must download the tide model to the CoastSeg/tide_model folder | ||
# Tutorial: https://github.com/Doodleverse/CoastSeg/wiki/09.-How-to-Download-and-clip-Tide-Model | ||
# You will need to uncomment the line below to run the tide correction | ||
|
||
beach_slope = 0.02 # Slope of the beach (m) | ||
reference_elevation = 0 # Elevation of the beach Mean Sea Level (M.S.L) (m) | ||
|
||
# UNCOMMENT THESE LINES TO RUN THE TIDE CORRECTION | ||
# roi_id = file_utilities.get_ROI_ID_from_session(session_name) # read ROI ID from the config.json file found in the extracted shoreline session directory | ||
# compute_tidal_corrections( | ||
# session_name, [roi_id], beach_slope, reference_elevation | ||
# ) |
Oops, something went wrong.