diff --git a/geo2ml/data/cv.py b/geo2ml/data/cv.py index 6a7b26a..f5d2284 100644 --- a/geo2ml/data/cv.py +++ b/geo2ml/data/cv.py @@ -351,9 +351,11 @@ def shp_to_coco_results( "image_id": image_id, "category_id": getattr(row, label_col), "segmentation": None, - "score": np.round(getattr(row, "score"), 5) - if "score" in tfmd_gdf.columns - else 0.0, + "score": ( + np.round(getattr(row, "score"), 5) + if "score" in tfmd_gdf.columns + else 0.0 + ), } ann = _process_shp_to_coco( image_id, getattr(row, label_col), 0, row.geometry, rotated_bbox diff --git a/geo2ml/data/tiling.py b/geo2ml/data/tiling.py index c4ae0ae..7e72fb5 100644 --- a/geo2ml/data/tiling.py +++ b/geo2ml/data/tiling.py @@ -77,6 +77,7 @@ def tile_raster( enumerate(range(0, x, self.gridsize_x - self.overlap[0])), ) ): + if dy + self.gridsize_y > y and not allow_partial_data: continue if dx + self.gridsize_x > x and not allow_partial_data: @@ -155,9 +156,11 @@ def tile_vector( if len(tempvector) == 0: continue tempvector["geometry"] = tempvector.apply( - lambda row: fix_multipolys(row.geometry) - if row.geometry.geom_type == "MultiPolygon" - else shapely.geometry.Polygon(row.geometry.exterior), + lambda row: ( + fix_multipolys(row.geometry) + if row.geometry.geom_type == "MultiPolygon" + else shapely.geometry.Polygon(row.geometry.exterior) + ), axis=1, ) if output_format == "geojson":