-
Notifications
You must be signed in to change notification settings - Fork 306
Add COCO Instance segmentation dataset #665
Add COCO Instance segmentation dataset #665
Conversation
ready for review |
|
||
try: | ||
from pycocotools import mask as coco_mask | ||
_availabel = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
available
?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I will update
There was a problem hiding this comment.
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
.
8c83a8e
to
85b92f0
Compare
85b92f0
to
b77ffba
Compare
Move from #547