Skip to content

Commit

Permalink
fix checking logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bw4sz committed Dec 5, 2023
1 parent 52bc353 commit 3a01d21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deepforest/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ def split_raster(annotations_file,
raise (IOError("If passing an numpy_image, please also specify a image_name"
" to match the column in the annotation.csv file"))

# Confirm that raster is H x W x C, if not, convert
if numpy_image.shape[0] < numpy_image.shape[1]:
# Confirm that raster is H x W x C, if not, convert, assuming image is wider/taller than channels
if numpy_image.shape[0] < numpy_image.shape[-1]:
warnings.warn(
"Input rasterio had shape {}, assuming channels first. Converting to channels last".format(
numpy_image.shape), UserWarning)
Expand Down

0 comments on commit 3a01d21

Please sign in to comment.