Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Add COCO Instance segmentation dataset #665

Merged

Conversation

knorth55
Copy link
Contributor

@knorth55 knorth55 commented Jul 3, 2018

Move from #547

@knorth55 knorth55 requested a review from yuyu2172 July 3, 2018 16:04
@knorth55 knorth55 changed the title [WIP] Add COCO Instance segmentation dataset Add COCO Instance segmentation dataset Jul 4, 2018
@knorth55
Copy link
Contributor Author

knorth55 commented Jul 4, 2018

ready for review


try:
from pycocotools import mask as coco_mask
_availabel = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

available ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thank you.


self.add_getter('img', self._get_image)
self.add_getter(['mask', 'label', 'area', 'crowded'],
self._get_annotations)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can retrieve 'label', 'area', 'crowded' without loading 'mask', it is better to separate getter function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you tell me why?
self.use_crowded is set as True, crowded is loaded for every annotation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean making get_mask and get_label_area_crowded.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know mask requires crowded in some cases. However, label or area can be retrieved without loading mask.

Copy link
Member

@yuyu2172 yuyu2172 Jul 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, in _get_mask, crowded is loaded, but not returned?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Hakuyume can you give me more advice? spliting into two function is efficient for data load?

Copy link
Member

@yuyu2172 yuyu2172 Jul 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He is saying that if _get_annotation is split into two, we can access labels without loading masks using dataset.slice[:, 'slice'].
We are assuming that loading masks takes substantially longer time than loading labels.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will update

Copy link
Member

@Hakuyume Hakuyume Jul 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, in _get_mask, crowded is loaded, but not returned?

Yes, if use_crowded=False, _get_mask calls _get_label_area_crowded internally to get crowded. The crowded will be thrown away after filtering mask. If use_crowded=True, _get_mask doesn't need to call _get_label_area_crowded.

@knorth55 knorth55 force-pushed the coco-instance-segmentation-dataset branch from 85b92f0 to b77ffba Compare July 6, 2018 15:07
@yuyu2172 yuyu2172 merged commit 866144f into chainer:master Jul 9, 2018
@knorth55 knorth55 deleted the coco-instance-segmentation-dataset branch July 9, 2018 04:12
@yuyu2172 yuyu2172 mentioned this pull request Jul 9, 2018
21 tasks
@yuyu2172 yuyu2172 added this to the 0.11 milestone Sep 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants