|
@@ -67,7 +67,7 @@ class INAT19_Annotations(BaseAnnotations):
|
|
|
|
|
|
def _load_split(self):
|
|
|
self.train_split = np.ones(len(self.uuids), dtype=bool)
|
|
|
- val_uuids = [im["id"] for im in self._val_content["images"]]
|
|
|
+ val_uuids = [str(im["id"]) for im in self._val_content["images"]]
|
|
|
for v_uuid in val_uuids:
|
|
|
self.train_split[self.uuid_to_idx[v_uuid]] = False
|
|
|
|
|
@@ -75,11 +75,11 @@ class INAT19_Annotations(BaseAnnotations):
|
|
|
|
|
|
def _load_labels(self):
|
|
|
self.labels = np.zeros(len(self.uuids), dtype=np.int32)
|
|
|
- labs = {annot["image_id"]: annot["category_id"] for annot in self._content["annotations"]}
|
|
|
+ labs = {str(annot["image_id"]): annot["category_id"] for annot in self._content["annotations"]}
|
|
|
for uuid in self.uuids:
|
|
|
self.labels[self.uuid_to_idx[uuid]] = labs[uuid]
|
|
|
|
|
|
def _load_uuids(self):
|
|
|
- uuid_fnames = [(im["id"], im["file_name"]) for im in self._content["images"]]
|
|
|
+ uuid_fnames = [(str(im["id"]), im["file_name"]) for im in self._content["images"]]
|
|
|
self.uuids, self.images = map(np.array, zip(*uuid_fnames))
|
|
|
self.uuid_to_idx = {uuid: i for i, uuid in enumerate(self.uuids)}
|