MCPcopy Create free account
hub / github.com/FoundationVision/ByteTrack / __init__

Method __init__

yolox/data/datasets/mot.py:16–47  ·  view source on GitHub ↗

COCO dataset initialization. Annotation data are read into memory by COCO API. Args: data_dir (str): dataset root directory json_file (str): COCO json file name name (str): COCO data name (e.g. 'train2017' or 'val2017') img_size (int):

(
        self,
        data_dir=None,
        json_file="train_half.json",
        name="train",
        img_size=(608, 1088),
        preproc=None,
    )

Source from the content-addressed store, hash-verified

14 """
15
16 def __init__(
17 self,
18 data_dir=None,
19 json_file="train_half.json",
20 name="train",
21 img_size=(608, 1088),
22 preproc=None,
23 ):
24 """
25 COCO dataset initialization. Annotation data are read into memory by COCO API.
26 Args:
27 data_dir (str): dataset root directory
28 json_file (str): COCO json file name
29 name (str): COCO data name (e.g. 'train2017' or 'val2017')
30 img_size (int): target image size after pre-processing
31 preproc: data augmentation strategy
32 """
33 super().__init__(img_size)
34 if data_dir is None:
35 data_dir = os.path.join(get_yolox_datadir(), "mot")
36 self.data_dir = data_dir
37 self.json_file = json_file
38
39 self.coco = COCO(os.path.join(self.data_dir, "annotations", self.json_file))
40 self.ids = self.coco.getImgIds()
41 self.class_ids = sorted(self.coco.getCatIds())
42 cats = self.coco.loadCats(self.coco.getCatIds())
43 self._classes = tuple([c["name"] for c in cats])
44 self.annotations = self._load_coco_annotations()
45 self.name = name
46 self.img_size = img_size
47 self.preproc = preproc
48
49 def __len__(self):
50 return len(self.ids)

Callers

nothing calls this directly

Calls 2

get_yolox_datadirFunction · 0.85

Tested by

no test coverage detected