Skip to content

Commit

Permalink
Layout check.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkeroo committed Jun 24, 2024
1 parent 6054727 commit 36701a7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ml/postprocessing/utils/xfeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
def local_maximum_filter(x: np.ndarray, kernel_size: int) -> np.ndarray:
# Ensure input is a 4D array (e.g., batch, channels, height, width)
if len(x.shape) != 4:
raise ValueError("Input array must be 4-dimensional")
raise ValueError("Input array must be 4-dimensional.")

if x.shape[0] != 1 and x.shape[1] != 1:
raise ValueError("Batch size and number of channels must be 1.")

_, _, height, width = x.shape

Expand Down

0 comments on commit 36701a7

Please sign in to comment.