https://github.com/athinalange/shorescan

Python-based tool for automated shoreline detection from standard ARGUS bright and timex images.

https://github.com/athinalange/shorescan

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.7%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Python-based tool for automated shoreline detection from standard ARGUS bright and timex images.

Basic Info
  • Host: GitHub
  • Owner: AthinaLange
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Size: 74.3 MB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed 12 months ago
Metadata Files
Readme License

README.md

ShoreScan_runup

Python-based tool for image processing of output from ARGUS-style cameras, including image rectification and runup extraction from timestacks

See more documentation here


Installation

Use exif_shorescan.yml file

Download Segment-Anything and install in conda environment. Download segmentation-gym and install in conda environment.

Full install on WSL2 (Ubuntu 24.04.1)

Start from 'conda create -n shorescan -f shorescaninitialconfig.yml' conda activate shorescan

sudo apt install libimage-exiftool-perl

conda install xarray netcdf4 numpy=1.24.* plotly scikit-learn ipykernel opencv piexif

pip install utm segment-anything pyexiftool onnxruntime onnx

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

python -c "import tensorflow as tf; print(tf.config.listphysicaldevices('GPU'))" python -c "from transformers import TFSegformerForSemanticSegmentation"

cd segment-anything-main; pip install -e .

Update to segment-anything-main/segment-anything/buildsam.py line 105 pytorch version 2.6 requires: ``` statedict = torch.load(f, weights_only=False) ```

Run

User prompting: CoastCam_processing.ipynb

Requirements

  • .png/.jpg images of images to be rectified, individual or concatinated timestacks from ARGUS-style cameras. Must be dimensions of time x length(U,V) coordinates
  • config.json - definitions for all directories and variables
  • YAML folder with IO/EO/metadata
  • JSON folder with site info
  • camera_settings.json - info about pix definitions
  • site_settings.json - info for netCDF
  • products.json - info for projection grid
  • U,V .pix coordinates (supplied to ARGUS-style camera) - location given in camera_settings.json - can also be definied in code
  • DEM.tif for projection onto surface

camerasettings.json: { "SITEID": { # Each site (e.g., "CACO03", "CACO04") is a key "CHANNELID": { # Each channel (e.g., "c1", "c2") under the site "reverseflag": bool, # Indicates if pix coordinates should be reversed (false: offshore to onshore) "coordinatefiles": { # Maps time ranges to file paths "STARTTIME|ENDTIME": "filepath" # Time range (ISO 8601 format) mapped to a file } } } }

sitesettings.json: { "SITEID": { // Each site (e.g., "CACO03", "SITEB") is a key containing site-specific information "siteName": "Full site name", // Descriptive name of the site "shortName": "Short identifier", // Abbreviated site name "siteInfo": { // Metadata related to the site "siteLocation": "Geographical location of the site", "dataOrigin": "Organization responsible for the data", "camMake": "Camera manufacturer", "camModel": "Camera model", "camLens": "Lens specifications", "timezone": "Local timezone", "utmZone": "UTM coordinate zone", "verticalDatum": "Vertical reference system", "verticalDatumdescription": "Description of the vertical datum", "references": "Citation or source reference for the data", "contributors": "Names of individuals who contributed to data collection", "metadatalink": "URL to metadata and dataset information" }, "sampling": { // Sampling configuration for data collection "samplefrequency": Number, // Sampling frequency (e.g., 2, 5) "collectionunit": "Unit of frequency (Hz, seconds, etc.)", "sampleperiodlength": Number, // Duration of each sampling period "sampleperiodunit": "Unit for sample period (s, min, etc.)", "freqLimits": [ // Frequency range limits (if applicable) Upper SS limit, SS/IG transition limit, Lower IG limit ] } } }

products.json { "type": "Grid", "frameRate": 2, "lat": origin latitude, "lon": origin longitude, "east": utm eastings (priority over lat/lon), "north": utm northings (priority over lat/lon), "zone": utm zone, "angle": shorenormal angle from north, "xlim": [0, 200], "ylim": [ -100, 300], "dx": cross-shore spacing in meters, "dy": along-shore spacing in meters, "x": null, "y": null, "z": null, "tide": 0, "lim_flag": 0 }

config.json: { "imageDir": "/path/to/images", "jsonDir": "/path/to/json/folder", "yamlDir": "/path/to/yaml/folder", "grayscaleDir": "/path/to/grayscale", "runupDir": "/path/to/runup/files", "videoDir": "/path/to/movie/folder", "mergedrectifiedDir": "/path/to/merged/and/rectified/images", "pixsaveDir":"/path/to/folder/to/save/pix", "netcdfDir": "/path/to/netcdf", "shorelineDir": "/path/to/shoreline", "twlDir": "/path/to/twlforecast", "camerasettingsPath": "/path/to/camerasettings.json", "sitesettingsPath": "/path/to/sitesettings.json", "productsPath": "/path/to/products/dictionary/CACO03products.json", "demPath": "/path/to/dem.tif", "segformerWeightsDir": "/path/to/segformer/weights", "segformerModel": "SegFormerMadeiraDuckequalfinetuneWaiakanefullmodel.h5", "segformerCodeDir": "/path/to/segformer/code", "segmentAnythingDir": "/path/to/segment-anything-main/", "segmentAnythingModel": "samvith4b8939.pth", "splittiff": false, "runupval": 0.0, "rundownval": -1.5, "thresholds": { "snap" : 20, "timex" : 15, "bright" : 35, "dark" : 20, "var" : 30 }, "flims": [0.004, 0.04, 0.35], "twlregion": "TWL regionid as int", "siteid": "TWL siteid as int" }

Example Folder Structure

ShoreScan/ ├── CoastCamprocessing.ipynb # Main script ├── config.json # Configuration file with paths and parameters │── CODES
│ ├── ImageHandler.py # Class to process images │ ├── RunUpTimeseriesFunctions
CHI.py # Code to compute runup statistics │ ├── segimagesinfolder.py # Script to segment timestacks │ ├── segformer.py # segformer definition │ ├── utilsexif.py # utils functions
│ ├── utilssegformer.py # utils functions
│ ├── utils
CIRN.py # utils functions
│ ├── utilsrunup.py # utils functions
│ ├── segment-anything-main # segment anything folder │── DATA
│ ├── DATA/ │ ├── DEM/ │ ├── something DEM # Elevation for runup projection │ ├── images/
│ ├── *.tiff # Raw .tiff images from camera │ ├── *.jpg # ARGUS image products │ ├── *.png # Split transects │ ├── CACO03
c1timestack20240920.pix # c1 U,V coordinates for camera │ ├── CACO03c2timestack20240920.pix # c2 U,V coordinates for camera │ ├── JSON/
│ ├── CACO03EXIF
c1.json # c1 site info - for exif │ ├── CACO03EXIFc1.json # c2 site info - for exif │ ├── camerasettings.json # Info for .pix locations │ ├── sitesettings.json # Info for netCDF │ ├── CACO03products.json # Info for products (grid info)
│ ├── segmentationgym/ │ ├── config/ │ ├── SegFormerMadeiraDuckequal.json # segfomer model │ ├── SegFormerMadeiraDuckequalfinetuneWaiakane.json # segformer model │ ├── weights/
│ ├── SegFormer
MadeiraDuckequalfullmodel.h5 # segformer model weights │ ├── SegFormerMadeiraDuckequalfinetuneWaiakanefullmodel.h5 # segformer model weights
│ ├── YAML/
│ ├── CACO03
c120240801IO.yaml # c1 IO yaml │ ├── CACO03c220240801IO.yaml # c2 IO yaml │ ├── CACO03c120241023EO.yaml # c1 EO yaml │ ├── CACO03c220241023EO.yaml # c2 EO yaml │ ├── CACO03c120241023metadata.yaml # c1 metadata yaml │ ├── CACO03c220241023_metadata.yaml # c2 metadata yaml │── README.md # Project documentation

Owner

  • Name: Athina Lange
  • Login: AthinaLange
  • Kind: user

GitHub Events

Total
  • Watch event: 3
  • Member event: 1
  • Push event: 108
  • Create event: 3
  • Commit comment event: 1
Last Year
  • Watch event: 3
  • Member event: 1
  • Push event: 108
  • Create event: 3
  • Commit comment event: 1

Dependencies

ShoreScan/segment-anything-main/demo/package.json npm
  • @babel/core ^7.18.13 development
  • @babel/preset-env ^7.18.10 development
  • @babel/preset-react ^7.18.6 development
  • @babel/preset-typescript ^7.18.6 development
  • @pmmmwh/react-refresh-webpack-plugin ^0.5.7 development
  • @testing-library/react ^13.3.0 development
  • @types/node ^18.7.13 development
  • @types/react ^18.0.17 development
  • @types/react-dom ^18.0.6 development
  • @types/underscore ^1.11.4 development
  • @typescript-eslint/eslint-plugin ^5.35.1 development
  • @typescript-eslint/parser ^5.35.1 development
  • babel-loader ^8.2.5 development
  • copy-webpack-plugin ^11.0.0 development
  • css-loader ^6.7.1 development
  • dotenv ^16.0.2 development
  • dotenv-webpack ^8.0.1 development
  • eslint ^8.22.0 development
  • eslint-plugin-react ^7.31.0 development
  • file-loader ^6.2.0 development
  • fork-ts-checker-webpack-plugin ^7.2.13 development
  • friendly-errors-webpack-plugin ^1.7.0 development
  • html-webpack-plugin ^5.5.0 development
  • image-webpack-loader ^8.1.0 development
  • postcss-loader ^7.0.1 development
  • postcss-preset-env ^7.8.0 development
  • process ^0.11.10 development
  • rimraf ^3.0.2 development
  • sass ^1.54.5 development
  • sass-loader ^13.0.2 development
  • style-loader ^3.3.1 development
  • tailwindcss ^3.1.8 development
  • ts-loader ^9.3.1 development
  • typescript ^4.8.2 development
  • webpack ^5.74.0 development
  • webpack-cli ^4.10.0 development
  • webpack-dev-server ^4.10.0 development
  • webpack-dotenv-plugin ^2.1.0 development
  • webpack-merge ^5.8.0 development
  • npyjs ^0.4.0
  • onnxruntime-web ^1.14.0
  • react ^18.2.0
  • react-dom ^18.2.0
  • react-refresh ^0.14.0
  • underscore ^1.13.6
ShoreScan/segment-anything-main/setup.py pypi