Skip to content

Commit

Permalink
Don't convert u8 segmentation images to u16 (#1376)
Browse files Browse the repository at this point in the history
* Don't convert u8 segmentation images to u16

* lints
  • Loading branch information
jleibs authored and emilk committed Mar 2, 2023
1 parent 66863e9 commit c81eb90
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rerun_py/rerun_sdk/rerun/log/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ def log_segmentation_image(
if not bindings.is_enabled():
return

image = np.array(image, dtype=np.uint16, copy=False)
image = np.array(image, copy=False)
if image.dtype not in (np.dtype("uint8"), np.dtype("uint16")):
image = np.require(image, np.uint16)
non_empty_dims = [d for d in image.shape if d != 1]
num_non_empty_dims = len(non_empty_dims)

Expand Down

0 comments on commit c81eb90

Please sign in to comment.