|
@@ -18,8 +18,8 @@ class FLOWERS_Annotations(BaseAnnotations, BBoxMixin):
|
|
|
split_file="tr_ID.txt",
|
|
|
bounding_boxes="bounding_boxes.txt",
|
|
|
bounding_box_dtype=np.dtype([(v, np.int32) for v in "xywh"]),
|
|
|
- # parts_file=join("parts", "part_locs.txt"),
|
|
|
- # part_names_file=join("parts", "parts.txt"),
|
|
|
+ parts_file=join("parts", "part_locs.txt"),
|
|
|
+ part_names_file=join("parts", "parts.txt"),
|
|
|
)
|
|
|
|
|
|
info.structure = [
|
|
@@ -27,21 +27,26 @@ class FLOWERS_Annotations(BaseAnnotations, BBoxMixin):
|
|
|
[info.labels_file, "labels"],
|
|
|
[info.split_file, "_split"],
|
|
|
[info.bounding_boxes, "_bounding_boxes"],
|
|
|
- # [info.parts_file, "_part_locs"],
|
|
|
- # [info.part_names_file, "_part_names"],
|
|
|
+ [info.parts_file, "_part_locs"],
|
|
|
+ [info.part_names_file, "_part_names"],
|
|
|
]
|
|
|
return info
|
|
|
|
|
|
+ def __init__(self, *args, **kwargs):
|
|
|
+ super(FLOWERS_Annotations, self).__init__(*args, **kwargs)
|
|
|
+ # set labels from [1..200] to [0..199]
|
|
|
+ self.labels -= 1
|
|
|
+
|
|
|
def _load_parts(self):
|
|
|
self.part_names = {}
|
|
|
|
|
|
# load only if present
|
|
|
if self.has_parts:
|
|
|
- super(CARS_Annotations, self)._load_parts(idx_offset=1)
|
|
|
+ super(FLOWERS_Annotations, self)._load_parts(idx_offset=0)
|
|
|
|
|
|
self._load_bounding_boxes()
|
|
|
|
|
|
def parts(self, *args, **kwargs):
|
|
|
if self.has_parts:
|
|
|
- return super(CARS_Annotations, self).parts(*args, **kwargs)
|
|
|
+ return super(FLOWERS_Annotations, self).parts(*args, **kwargs)
|
|
|
return None
|