Metadata-Version: 2.4
Name: scet-toolkit
Version: 0.2.0
Summary: Shoreline Change Estimation Toolkit: extract shorelines from segmented imagery and compute change rates via OpenDSAS
Author: Boyuan Lu
License: Copyright (c) 2018 The Python Packaging Authority
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/lubyant/ShorelineCalculator
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: GIS
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENCE.txt
Requires-Dist: numpy
Requires-Dist: opencv-python-headless
Requires-Dist: rasterio
Requires-Dist: geopandas
Requires-Dist: shapely
Requires-Dist: pyproj
Requires-Dist: pandas
Requires-Dist: scipy
Requires-Dist: scikit-learn
Requires-Dist: matplotlib
Requires-Dist: pillow
Requires-Dist: opendsas
Requires-Dist: tqdm
Requires-Dist: ftfy
Requires-Dist: regex
Provides-Extra: dl
Requires-Dist: torch==1.12.1; extra == "dl"
Requires-Dist: torchvision==0.13.1; extra == "dl"
Requires-Dist: torchaudio==0.12.1; extra == "dl"
Requires-Dist: mmengine; extra == "dl"
Requires-Dist: mmcv-lite==2.0.0rc4; extra == "dl"
Requires-Dist: mmsegmentation>=1.0.0; extra == "dl"
Requires-Dist: GDAL; extra == "dl"
Dynamic: license-file

# SCET (Shoreline Change Estimation Toolkit)

A pure-Python toolkit for extracting shorelines from segmented raster imagery
and computing shoreline change rates. Transect casting, shoreline/transect
intersection, and change-rate calculation are delegated to the
[OpenDSAS](https://github.com/lubyant/OpenDSAS) CLI (`dsas`), a fast,
cross-platform reimplementation of USGS DSAS.

## Installation

```bash
pip install scet-toolkit
```

This installs `scet-toolkit`'s dependencies including `opendsas`, which
provides the `dsas` CLI used for transect/intersection/rate calculations.

For the optional deep-learning-based segmentation step (`scet.simple_mmseg`,
used by `SCET.method1`/`method2`), install the `dl` extra:

```bash
pip install "scet-toolkit[dl]"
```

`torch`/`torchvision`/`torchaudio` are CUDA-build-sensitive; if the plain pip
install doesn't pick the right wheel for your platform, install them from
https://pytorch.org first, matching your CUDA version, then re-run. `mmcv-lite`
(no compiled CUDA ops, unlike `mmcv`) is used instead of `mmcv` since this
project's segmentation config doesn't need them and `mmcv-lite` installs via
plain pip with no CUDA toolchain required.

## Usage

```python
from scet import SCET, Config

config = Config(checkpoint_file="path/to/checkpoint.pth")
scet = SCET(config)
scet.method1(input_naip_zipfiles_folder="...", output_folder="...")
```

Or drive the shoreline pipeline directly, given a folder of already-segmented,
dated raster images (filenames ending in a 4-digit year, e.g. `1_2001.tif`):

```python
from scet.options import Options
from scet.pipeline import generate_result_from_folder

generate_result_from_folder("images/", "output/", Options())
```

This writes `shoreline.shp`, `baseline.shp`, `transect.shp`, and
`intersection.shp` to the output folder.

## Development

```bash
conda create -n my_env python==3.9
conda activate my_env
bash build.sh  # pip install -e ".[dl]"
```
