MCPcopy Create free account
hub / github.com/buaacxf/VIPTR / merge_ext_data

Method merge_ext_data

dataload/dataAug.py:38–45  ·  view source on GitHub ↗
(self, data, ext_data)

Source from the content-addressed store, hash-verified

36 self.max_wh_ratio = self.image_shape[1] / self.image_shape[0]
37
38 def merge_ext_data(self, data, ext_data):
39 ori_w = round(data['image'].shape[1] / data['image'].shape[0] * self.image_shape[0])
40 ext_w = round(ext_data['image'].shape[1] / ext_data['image'].shape[0] * self.image_shape[0])
41 data['image'] = cv2.resize(data['image'], (ori_w, self.image_shape[0]))
42 ext_data['image'] = cv2.resize(ext_data['image'], (ext_w, self.image_shape[0]))
43 data['image'] = np.concatenate([data['image'], ext_data['image']], axis=1)
44 data["label"] += ext_data["label"]
45 return data
46
47 def __call__(self, data):
48 rnd_num = random.random()

Callers 1

__call__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected