Skip to content

Commit

Permalink
remove the call to np.unique since it breaks color correspondences so…
Browse files Browse the repository at this point in the history
…metimes

PiperOrigin-RevId: 464778559
  • Loading branch information
Qwlouse authored and The jax3d Authors committed Aug 2, 2022
1 parent 9a9cbaa commit d5f2bc1
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions jax3d/utils/plot_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ def maybe_convert_to_wide_form(
if segmentation.dtype.type not in int_types:
raise ValueError('Segmentation has final dimension 1 so it should be'
f'int-typed, but is {segmentation.dtype})')
_, b = np.unique(segmentation, return_inverse=True)
segmentation = b.reshape(segmentation.shape)
max_seg = np.max(segmentation) + 1
nr_segments = nr_segments if nr_segments is not None else max_seg
segmentation = np.eye(nr_segments, dtype=np.float32)[segmentation[..., 0]]
Expand Down

0 comments on commit d5f2bc1

Please sign in to comment.