The Jupyter notebook in this repository is a simple example of segmenting a high spatial resolution image using PyShepSeg.
It will take an input image like this:
And generate segments around similar objects at a scale determined by the user. This example uses a 10000 pixels minimum size.
The library can also efficiently calculate per segment statistics, such as the mean of each segment:
There is also a simple example showing how to use KMeans to cluster the segments into a predefined number of classes.
Following clustering, the resulting attribues can be joined to the vector file of the segments for visualization and additional spatial analysis.
For a similar example using GeoPandas see segment-cluster