Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About ade20k_loader #27

Closed
Eniac-Xie opened this issue Sep 19, 2017 · 2 comments
Closed

About ade20k_loader #27

Eniac-Xie opened this issue Sep 19, 2017 · 2 comments

Comments

@Eniac-Xie
Copy link

Eniac-Xie commented Sep 19, 2017

Hi, thank you for your code!

I want to use the ptsemseg/loader/ade20k_loader.py, in the function:

    def encode_segmap(self, mask):
        # Refer : http://groups.csail.mit.edu/vision/datasets/ADE20K/code/loadAde20K.m
        mask = mask.astype(int)
        label_mask = np.zeros((mask.shape[0], mask.shape[1]))
        label_mask = ( mask[:,:,0] / 10.0 ) * 256 + mask[:,:,1]
        return np.array(label_mask, dtype=np.uint8)

the label_mask is with elements that larger than 256, so why do you use dtype=np.uint8 (which means mask[:,:,0] / 10.0 ) * 256 will be discarded).

@meetps
Copy link
Owner

meetps commented Sep 23, 2017

n_classes is only 150, so I think the max value label_mask can take is 150 (inside uint8 range).

Can you point to a specific instance from the ADE20K dataset where this doesn't work?

@meetps meetps closed this as completed Jan 7, 2018
@jxlijunhao
Copy link

@meetshah1995 @Eniac-Xie I have same problem and confused by this encode utils, for exampe, the images in the trainning set a/abbey/ADE_train_00000971.jpg

using above functions and np.unique(mask), the results will gave:
[ 0 39 56 101 116 255]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants