|
mask = seg_mask[:,:,0]>0.5 |
The line:
mask = seg_mask[:, :, 0] > 0.5
is clear and effective. For semantic segmentation outputs, this correctly binarizes the soft mask. You might optionally consider using:
mask = seg_mask[..., 0] > 0.5
to make the dimensionality indexing more flexible in case of 2D or 3D inputs.
Tensorflow_PersonLab/plot.py
Line 114 in e49c118
The line:
mask = seg_mask[:, :, 0] > 0.5is clear and effective. For semantic segmentation outputs, this correctly binarizes the soft mask. You might optionally consider using:
mask = seg_mask[..., 0] > 0.5to make the dimensionality indexing more flexible in case of 2D or 3D inputs.