|
@@ -20,14 +20,17 @@ class INAT19_Annotations(BaseAnnotations):
|
|
|
# train_content="train2019.json",
|
|
|
|
|
|
# fake bounding boxes: the whole image
|
|
|
- parts_file=join("parts", "part_locs.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"),
|
|
|
)
|
|
|
|
|
|
info.structure = [
|
|
|
[info.content, "_content"],
|
|
|
[info.val_content, "_val_content"],
|
|
|
[info.parts_file, "_part_locs"],
|
|
|
+ [info.part_names_file, "_part_names"],
|
|
|
]
|
|
|
return info
|
|
|
|
|
@@ -58,9 +61,7 @@ class INAT19_Annotations(BaseAnnotations):
|
|
|
|
|
|
# load only if present
|
|
|
if self.has_parts:
|
|
|
- super(INAT19_Annotations, self)._load_parts()
|
|
|
- # set part idxs from 1-idxs to 0-idxs
|
|
|
- self.part_locs[..., 0] -= 1
|
|
|
+ super(INAT19_Annotations, self)._load_parts(idx_offset=1)
|
|
|
|
|
|
self._load_bounding_boxes()
|
|
|
|