Skip to content

Commit

Permalink
run newer black
Browse files Browse the repository at this point in the history
  • Loading branch information
mayrajeo committed Feb 19, 2024
1 parent b3fa957 commit abd26cd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 5 additions & 3 deletions geo2ml/data/cv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions geo2ml/data/tiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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":
Expand Down

0 comments on commit abd26cd

Please sign in to comment.