Skip to content

Commit

Permalink
new test data
Browse files Browse the repository at this point in the history
  • Loading branch information
bw4sz committed Mar 1, 2024
1 parent 310a637 commit affd330
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions deepforest/data/australia.cpg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ISO-8859-1
Binary file added deepforest/data/australia.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions deepforest/data/australia.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJCS["WGS_1984_UTM_Zone_53S",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",10000000.0],PARAMETER["Central_Meridian",135.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
Binary file added deepforest/data/australia.shp
Binary file not shown.
Binary file added deepforest/data/australia.shx
Binary file not shown.
Binary file added deepforest/data/australia.tif
Binary file not shown.
2 changes: 1 addition & 1 deletion deepforest/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def select_annotations(annotations, window):
return clipped_annotations

# For points, keep all annotations.
if selected_annotations.iloc[0].geometry.type == "Point":
if selected_annotations.iloc[0].geometry.geom_type == "Point":
return selected_annotations
else:
# Only keep clipped boxes if they are more than 50% of the original size.
Expand Down
4 changes: 4 additions & 0 deletions deepforest/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,10 @@ def geo_to_image_coordinates(gdf, image_bounds, image_resolution):
Returns:
gdf: a geopandas dataframe with the transformed to image origin. CRS is removed
"""

if len(image_bounds) != 4:
raise ValueError("image_bounds must be a tuple of (left, bottom, right, top)")

transformed_gdf = gdf.copy(deep=True)
# unpack image bounds
left, bottom, right, top = image_bounds
Expand Down

0 comments on commit affd330

Please sign in to comment.