def area_filter_gdf(pred_gdf, min_area=2000):
    """Clean polygon geodataframe so outputs greater than or equal to minimum threshold
    Args:
        pred_gdf (geopandas.GeoDataFrame): Geodataframe with polygon geometries in geometry column
        min_area (int): Area in metres squared below which polygons will be dropped. Defaults to 5000.
    Returns:
        geopandas.GeoDataFrame: Geodataframe of just polygons above minimum size
    """
    if pred_gdf.crs.to_string() == "EPSG:4326":
        print("prediction image not in projected crs, cannot filter by area")
        return pred_gdf
    else:
        pred_gdf["area"] = pred_gdf["geometry"].area
        pred_gdf = pred_gdf[pred_gdf["area"] >= min_area]
        return pred_gdf