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

Why can reading obj ['segmentation '] generate rle and rles? Rles is iterative, and rle is not iterative. #52

Open
liudadan opened this issue Jan 2, 2023 · 0 comments

Comments

@liudadan
Copy link

liudadan commented Jan 2, 2023

Why can reading obj ['segmentation '] generate rle and rles? Rles is iterative, and rle is not iterative.
def get_mask(self, anno, img_info):
m = np.zeros((img_info['height'], img_info['width']))

    for obj in anno:
        if obj['iscrowd']:
            rle = pycocotools.mask.frPyObjects(
                obj['segmentation'], img_info['height'], img_info['width'])
            m += pycocotools.mask.decode(rle)
        elif obj['num_keypoints'] == 0:
            rles = pycocotools.mask.frPyObjects(
                obj['segmentation'], img_info['height'], img_info['width'])
            for rle in rles:
                m += pycocotools.mask.decode(rle)

    return m < 0.5
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

1 participant