ankurhanda / sunrgbd-meta-data

train test labels for sunrgbd
170 stars 31 forks source link

Range of seglabel in SUNRGBD2Dseg.mat is [0, 37] #9

Closed guy4261 closed 4 years ago

guy4261 commented 4 years ago

Hello,

In the SUNRGBDtoolbox.zip, under Metadata, there's a file containing all the segmentations. The values are in [0, 37] (aka both are included) - so there is one extra class for "no-class". But is it 0 or 37? Did you find this out?

Thanks!

ankurhanda commented 4 years ago

37 is bag as shown in the gray area here https://github.com/ankurhanda/sunrgbd-meta-data

guy4261 commented 4 years ago

Thanks! In seg37list.mat there really are 37 class names. But if I download the SUNRGBDtoolbox.zip from their website, in SUNRGBDtoolbox/Metadata/SUNRGBD2Dseg.mat which also has 37 classes, on the 2nd array I already find both 0 and 37 in the array. See the code below.

Does that mean that 0 is the class for "nothing" or "no-class"?

import h5py
import numpy as np

h = h5py.File("SUNRGBDtoolbox/Metadata/SUNRGBD2Dseg.mat")
met_0 = []
met_37 = []
for i, ref in enumerate(h['SUNRGBD2Dseg']['seglabel']):

    mat = np.asarray(h[ref[0]])
    if 0 in mat:
        met_0.append(i)
    if 37 in mat:
        met_37.append(i)
    if met_0 and met_37:
        break
guy4261 commented 4 years ago

The corresponding image is SUNRGBD/kv2/kinect2data/000003_2014-05-26_14-24-42_260595134347_rgbf000040-resize/image/0000040.jpg.

ankurhanda commented 4 years ago

I treated zero as 'ignore' class which I guess in your terminology is "no-class"? I didn't compute the loss on pixels with class label 0.

guy4261 commented 4 years ago

Very well, I will ignore those 0s as well. Thanks!