12345678910111213141516171819202122232425262728293031323334353637 |
- import numpy as np
- from os.path import join
- from nabirds.utils import _MetaInfo
- from .base import BaseAnnotations
- class NAB_Annotations(BaseAnnotations):
- name="NABirds"
- @property
- def meta(self):
- info = _MetaInfo(
- images_folder="images",
- images_file="images.txt",
- labels_file="labels.txt",
- hierarchy_file="hierarchy.txt",
- split_file="train_test_split.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.images_file, "_images"],
- [info.labels_file, "labels"],
- [info.hierarchy_file, "hierarchy"],
- [info.split_file, "_split"],
- [info.parts_file, "_part_locs"],
- [info.part_names_file, "_part_names"],
- ]
- return info
- def bounding_box(self, uuid):
- return np.array((0,0,1,1),
- dtype=self.meta.bounding_box_dtype)
|