|
@@ -7,11 +7,12 @@ from ..image import ImageWrapper
|
|
|
|
|
|
class AnnotationsReadMixin(BaseMixin):
|
|
|
|
|
|
- def __init__(self, uuids, annotations, mode="RGB"):
|
|
|
+ def __init__(self, uuids, annotations, part_rescale_size=None, mode="RGB"):
|
|
|
super(AnnotationsReadMixin, self).__init__()
|
|
|
self.uuids = uuids
|
|
|
self._annot = annotations
|
|
|
self.mode = mode
|
|
|
+ self.part_rescale_size = part_rescale_size
|
|
|
|
|
|
def __len__(self):
|
|
|
return len(self.uuids)
|
|
@@ -20,14 +21,14 @@ class AnnotationsReadMixin(BaseMixin):
|
|
|
return getattr(self._annot, method)(self.uuids[i])
|
|
|
|
|
|
def get_example(self, i):
|
|
|
- res = super(AnnotationsReadMixin, self).get_example(i)
|
|
|
- # if the super class returns something, then the class inheritance is wrong
|
|
|
- assert res is None, "AnnotationsReadMixin should be the last class in the hierarchy!"
|
|
|
+ # res = super(AnnotationsReadMixin, self).get_example(i)
|
|
|
+ # # if the super class returns something, then the class inheritance is wrong
|
|
|
+ # assert res is None, "AnnotationsReadMixin should be the last class in the hierarchy!"
|
|
|
|
|
|
methods = ["image", "parts", "label"]
|
|
|
im_path, parts, label = [self._get(m, i) for m in methods]
|
|
|
|
|
|
- return ImageWrapper(im_path, int(label), parts, mode=self.mode)
|
|
|
+ return ImageWrapper(im_path, int(label), parts, mode=self.mode, part_rescale_size=self.part_rescale_size)
|
|
|
|
|
|
@property
|
|
|
def labels(self):
|