in siammot/data/image_dataset.py [0:0]
def __init__(self,
dataset: COCO,
image_dir,
transforms=None,
frames_per_image=1,
amodal=False,
skip_empty=True,
min_object_area=0,
use_crowd=False,
include_bg=False,
):
"""
:param dataset: the ingested dataset with COCO-format
:param transforms: image transformation
:param frames_per_image: how many image copies are generated from a single image
:param amodal: whether to use amodal ground truth (no image boundary clipping)
:param include_bg: whether to include the full background images during training
"""
self.dataset = dataset
self.image_dir = image_dir
self.transforms = transforms
self.frames_per_image = frames_per_image
self._skip_empty = skip_empty
self._min_object_area = min_object_area
self._use_crowd = use_crowd
self._amodal = amodal
self._include_bg = include_bg
self._det_classes = [c['name'] for c in self.dataset.loadCats(self.dataset.getCatIds())]
# These are tha mapping table of COCO labels
self.json_category_id_to_contiguous_id = {
v: i+1 for i, v in enumerate(self.dataset.getCatIds())
}
self._labels, self._im_aspect_ratios, self._items, self._ids \
= self._dataset_preprocess()
self.id_to_img_map = {k: v for k, v in enumerate(self._ids)}