(array_seg_t, cmap=None)
| 114 | return array_seg_t |
| 115 | |
| 116 | def decode_seg(array_seg_t, cmap=None): |
| 117 | # we will decode the semseg map with a fixed color map |
| 118 | if cmap is None: |
| 119 | cmap = color_map() |
| 120 | seg_t = array_seg_t.astype(np.uint8) |
| 121 | array_semseg = np.zeros((seg_t.shape[0], seg_t.shape[1]), dtype=np.uint8) |
| 122 | for i, color in enumerate(cmap): |
| 123 | equal = np.all(seg_t == color, axis=-1) |
| 124 | array_semseg[equal] = i |
| 125 | return array_semseg |
nothing calls this directly
no test coverage detected