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

How to generate mask_flist.txt and how to turn my mask.png to mask.pkl? #16

Open
dengyueyun666 opened this issue Jan 28, 2019 · 3 comments

Comments

@dengyueyun666
Copy link

I want to know how to generate mask pkl file? Can you upload an example code file?
And how to generate flist.txt?
Thanks!

By the way, you pre-trained model file seems to be broken.

@abhishekdawas10
Copy link

@dengyueyun666 can you please tell how to create mask.pkl from mask.png and what is numpy.array in it??

@DongHwanJang
Copy link

DongHwanJang commented Apr 22, 2019

This code will work.

@staticmethod
def read_val_mask(path):
        """
        Read masks from val mask data
        """
        ## non-mask : 0 / mask : 1  256x256x1

        if path.endswith("pkl"):
            mask = pkl.load(open(path, 'rb'))

        else:
            mask = Image.open(path)
            mask = np.array(mask)
            mask[mask != 0] = 1

            mask = np.expand_dims(mask, axis=2)

        return mask

@avalonstrel
Copy link
Owner

The pkl is just the numpy.array of the images.

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

4 participants