From d7bc4a31d89d2dbce61d5b6074dc2ef57571e272 Mon Sep 17 00:00:00 2001 From: LJitendra05 Date: Mon, 23 Feb 2026 17:47:29 +0530 Subject: [PATCH 1/3] Fix README clone instructions referencing non-existent dev branch and incorrect repository URL --- README.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 23a9c4d..e50b4c6 100644 --- a/README.md +++ b/README.md @@ -28,13 +28,15 @@ Before installing this project, ensure you have the following requirements: ### Clone the Repository -Clone the project using the `dev` branch (this branch contains the latest development features): +Clone the project using the default `master` branch: ```bash -git clone -b dev https://github.com/your-username/coastline-extraction.git -cd coastline-extraction +git clone https://github.com/fwitmer/CoastlineExtraction.git +cd CoastlineExtraction ``` +> ⚠️ Note: The repository currently contains only the `master` branch. Earlier versions of this README referenced a non-existent `dev` branch and an incorrect repository URL (`coastline-extraction.git`), which caused cloning to fail for new users. + --- ### Environment Setup @@ -124,20 +126,22 @@ shapefile_path = get_shapefile_path(config, 0) # First shapefile ## Contributing -### Working with the Dev Branch +### Contribution Workflow + +This project currently uses the `master` branch as the primary development branch. -This project uses the `dev` branch for active development. When contributing: +When contributing: 1. **Fork the repository on GitHub** -2. **Clone your fork using the `dev` branch**: +2. **Clone your fork**: ```bash -git clone -b dev https://github.com/your-username/coastline-extraction.git -cd coastline-extraction +git clone https://github.com/your-username/CoastlineExtraction.git +cd CoastlineExtraction ``` -3. **Create a feature branch from `dev`**: +3. **Create a feature branch from `master`**: ```bash git checkout -b feature/your-feature-name From eb6a81f37021f3e03cc21cfb74db3e038c06d85d Mon Sep 17 00:00:00 2001 From: LJitendra05 Date: Sat, 7 Mar 2026 00:53:37 +0530 Subject: [PATCH 2/3] =?UTF-8?q?Fix=20project=20name=20capitalization:=20co?= =?UTF-8?q?astline-extraction=20=E2=86=92=20CoastlineExtraction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e50b4c6..78e49e4 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ git clone https://github.com/fwitmer/CoastlineExtraction.git cd CoastlineExtraction ``` -> ⚠️ Note: The repository currently contains only the `master` branch. Earlier versions of this README referenced a non-existent `dev` branch and an incorrect repository URL (`coastline-extraction.git`), which caused cloning to fail for new users. +> ⚠️ Note: The repository currently contains only the `master` branch. Earlier versions of this README referenced a non-existent `dev` branch and an incorrect repository URL (`coastlineExtraction.git`), which caused cloning to fail for new users. --- From 99657fb2c3607a144037a309125b13cbc077b9ee Mon Sep 17 00:00:00 2001 From: LJitendra05 Date: Sat, 7 Mar 2026 02:24:54 +0530 Subject: [PATCH 3/3] refactor: clean duplicate imports and improve NDWI stability --- data_preprocessing/create_masks.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/data_preprocessing/create_masks.py b/data_preprocessing/create_masks.py index 8c019e3..5494c4c 100644 --- a/data_preprocessing/create_masks.py +++ b/data_preprocessing/create_masks.py @@ -1,13 +1,16 @@ # import libraries import rasterio as rio -from rasterio import mask -from rasterio.plot import show from rasterio.mask import mask +from rasterio.plot import show from rasterio.io import MemoryFile + import shapely -from shapely.geometry import Polygon, shape, box # added box +from shapely.geometry import Polygon, shape, box import geopandas as gpd + +import sys import os + from matplotlib import pyplot as plt import numpy as np import cv2 @@ -78,8 +81,8 @@ def get_ndwi_label(image_path, points_path, ksize=100, blurring=True, out_dir="r np.seterr(divide='ignore', invalid='ignore') - ndwi = (green - nir) / (green + nir) # NDWI equation - ndwi[np.isnan(ndwi)] = 0 # Sets any NaN values in the NDWI array to 0. (Dividing by zero => NaN pixels) + ndwi = (green - nir) / (green + nir + 1e-8) # NDWI equation + # ndwi[np.isnan(ndwi)] = 0 # Sets any NaN values in the NDWI array to 0. (Dividing by zero => NaN pixels) ndwi_profile = src_raster.profile # Copies the image profile (metadata). # Apply Gaussian blur @@ -152,7 +155,7 @@ def get_ndwi_label(image_path, points_path, ksize=100, blurring=True, out_dir="r if buffer.intersects(raster_bounds_geom): out_image, out_transform = mask(dataset, shapes=[buffer], nodata=-1, crop=False) out_image = out_image[0] - out_image = (out_image * 127) + 128 + out_image = ((out_image + 1) * 127.5).astype(np.uint8) out_image = out_image.astype(np.uint8) out_image_clipped, out_transform_clipped = mask(dataset, shapes=[buffer], nodata=-1, crop=True)