lorenmt / reco

The implementation of "Bootstrapping Semantic Segmentation with Regional Contrast" [ICLR 2022].
https://shikun.io/projects/regional-contrast
Other
162 stars 25 forks source link

Questions about image enhancement #19

Closed wuyunxiangwyx closed 2 years ago

wuyunxiangwyx commented 2 years ago

of line 71, 72 in build_data.py, why label need multiply 255,
for example if label mask is [[0, 2, 2, 3, 1], [0, 2, 2, 2, 1], [255, 3, 3, 255]], class is [0, 1, 2, 3], 255 denotes ignore class. """ label = (transforms_f.to_tensor(label) * 255).long() label[label == 255] = -1 # invalid pixels are re-mapped to index -1 """

lorenmt commented 2 years ago

Hello,

The transform_f function will automatically renomalise data to the range of 0 - 1. You can verify this by loading a random label image from the dataset folder, and call transform_f.