MCPcopy Create free account
hub / github.com/Topdu/OpenOCR / wh_aware

Method wh_aware

tools/data/simple_dataset.py:182–194  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

180 self.wh_aware()
181
182 def wh_aware(self):
183 data_line_new = []
184 wh_ratio = []
185 for lins in self.data_lines:
186 data_line_new.append(lins)
187 lins = lins.decode('utf-8')
188 name, label, w, h = lins.strip('\n').split(self.delimiter)
189 wh_ratio.append(float(w) / float(h))
190
191 self.data_lines = data_line_new
192 self.wh_ratio = np.array(wh_ratio)
193 self.wh_ratio_sort = np.argsort(self.wh_ratio)
194 self.data_idx_order_list = list(range(len(self.data_lines)))
195
196 def resize_norm_img(self, data, imgW, imgH, padding=True):
197 img = data['image']

Callers 1

__init__Method · 0.95

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected