Skip to content

Commit

Permalink
Fix numpy warning (#1632)
Browse files Browse the repository at this point in the history
  • Loading branch information
BloodAxe committed Nov 13, 2023
1 parent 3067278 commit aa58407
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/super_gradients/training/transforms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ def _pad_image(image: np.ndarray, padding_coordinates: PaddingCoordinates, pad_v
pad_value = tuple(pad_value)

constant_values = ((pad_value, pad_value), (pad_value, pad_value), (0, 0))
# Fixes issue with numpy deprecation warning since constant_values is ragged array (Have to explicitly specify object dtype)
constant_values = np.array(constant_values, dtype=np.object_)

padding_values = (pad_h, pad_w, (0, 0))
else:
if isinstance(pad_value, numbers.Number):
Expand Down

0 comments on commit aa58407

Please sign in to comment.