Skip to content

Commit

Permalink
Update post_process.py
Browse files Browse the repository at this point in the history
Added necessary args indicators
  • Loading branch information
haidarjomaa authored Jan 23, 2024
1 parent b07936e commit f4ff536
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions data_processing/post_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from skimage.segmentation import watershed
from skimage.measure import label
from PIL import Image,ImageDraw

import pandas as pd
from shapely.geometry import shape
from shapely.wkt import dumps
Expand All @@ -23,10 +22,10 @@ def post_process(self, pred, thresh=0.5, thresh_b=0.6, mina=100, mina_b=50):
Args:
pred (numpy.ndarray): Prediction mask with shape (height, width, channels).
thresh (float): Threshold for considering pixels as part of the final segmentation.
thresh_b (float): Threshold for considering pixels as borders between objects.
mina (int): Minimum area threshold for retaining segmented regions.
mina_b (int): Minimum area threshold for retaining basins.
thresh (float, default=0.5): Threshold for considering pixels as part of the final segmentation.
thresh_b (float, default=0.6): Threshold for considering pixels as borders between objects.
mina (int, default=100): Minimum area threshold for retaining segmented regions.
mina_b (int, default=50): Minimum area threshold for retaining basins.
Returns:
numpy.ndarray: Refined segmentation mask.
Expand Down Expand Up @@ -147,8 +146,8 @@ def instance_mask_to_gdf(instance_mask, transform=None, crs=None):
Args:
instance_mask (numpy.ndarray): Input instance mask with shape (H, W), where each instance is labeled by a unique id/number.
transform (affine.Affine or None): Geospatial transform of the raster. Default is None.
crs (str or None): CRS of the raster. Default is None.
transform (affine.Affine, Optional): Geospatial transform of the raster. Default is None.
crs (str, Optional): CRS of the raster. Default is None.
Returns:
geopandas.GeoDataFrame: GeoDataFrame of the shapes projected to the specified CRS using the transform.
Expand Down

0 comments on commit f4ff536

Please sign in to comment.