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

Method __init__

yolox/data/dataloading.py:72–118  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

70 """
71
72 def __init__(self, *args, **kwargs):
73 super().__init__(*args, **kwargs)
74 self.__initialized = False
75 shuffle = False
76 batch_sampler = None
77 if len(args) > 5:
78 shuffle = args[2]
79 sampler = args[3]
80 batch_sampler = args[4]
81 elif len(args) > 4:
82 shuffle = args[2]
83 sampler = args[3]
84 if "batch_sampler" in kwargs:
85 batch_sampler = kwargs["batch_sampler"]
86 elif len(args) > 3:
87 shuffle = args[2]
88 if "sampler" in kwargs:
89 sampler = kwargs["sampler"]
90 if "batch_sampler" in kwargs:
91 batch_sampler = kwargs["batch_sampler"]
92 else:
93 if "shuffle" in kwargs:
94 shuffle = kwargs["shuffle"]
95 if "sampler" in kwargs:
96 sampler = kwargs["sampler"]
97 if "batch_sampler" in kwargs:
98 batch_sampler = kwargs["batch_sampler"]
99
100 # Use custom BatchSampler
101 if batch_sampler is None:
102 if sampler is None:
103 if shuffle:
104 sampler = torch.utils.data.sampler.RandomSampler(self.dataset)
105 # sampler = torch.utils.data.DistributedSampler(self.dataset)
106 else:
107 sampler = torch.utils.data.sampler.SequentialSampler(self.dataset)
108 batch_sampler = YoloBatchSampler(
109 sampler,
110 self.batch_size,
111 self.drop_last,
112 input_dimension=self.dataset.input_dim,
113 )
114 # batch_sampler = IterationBasedBatchSampler(batch_sampler, num_iterations =
115
116 self.batch_sampler = batch_sampler
117
118 self.__initialized = True
119
120 def close_mosaic(self):
121 self.batch_sampler.mosaic = False

Callers

nothing calls this directly

Calls 1

YoloBatchSamplerClass · 0.85

Tested by

no test coverage detected