Skip to content

Instantly share code, notes, and snippets.

@geografif
geografif / build_unet.py
Created February 7, 2023 19:02 — forked from ad-1/build_unet.py
Semantic Segmentation of MBRSC Aerial Imagery of Dubai using a TensorFlow U-Net model in Python. https://towardsdatascience.com/semantic-segmentation-of-aerial-imagery-using-u-net-in-python-552705238514
# =====================================================
# define U-Net model architecture
def build_unet(img_shape):
# input layer shape is equal to patch image size
inputs = Input(shape=img_shape)
# rescale images from (0, 255) to (0, 1)
rescale = Rescaling(scale=1. / 255, input_shape=(img_height, img_width, img_channels))(inputs)
previous_block_activation = rescale # Set aside residual
@geografif
geografif / MKtrend.R
Created May 14, 2022 15:44 — forked from hakimabdi/MKtrend.R
This function performs a Mann-Kendall trend test with associated p-values on a time seris of gridded satellite data
#############################################################################################
# title : Perform a Mann-Kendall trend test of satellite image time series
# purpose : Mann-Kendall test of monotonic trend and associated statistical significance
# author : Abdulhakim Abdi (@HakimAbdi)
# input : Raster stack/brick comprising a time series of observations
# output : Raster object of monotoic trend (Kendall's tau), significance or both (i.e. brick)
# data : Test data: https://www.dropbox.com/sh/bz0fxvtm27mf4w8/AADE8kOPKnx1c84QxJDSAoyAa?dl=0
# notes : Depending on the time series, it is might be useful prewhiten the data to remove serial correlation
# : prior to extracting the trend. See blog post on www.hakimabdi.com for more information.
#############################################################################################