개정판 8db9755c
issue #1366: fix
Change-Id: I8afbd3f79fef1692495ad84148aecd1990805eba
DTI_PID/WebServer/symbol_recognition/test_doftech_all_images.py | ||
---|---|---|
48 | 48 |
return [self.class_info, self.start_h, self.start_w, self.end_h - self.start_h, self.end_w - self.start_w, self.iou] |
49 | 49 | |
50 | 50 |
def get_symbol(imgs, name=None, root_path=None, trained_model1=None, trained_model2=None): |
51 |
global colors |
|
51 |
global colors, DOFTECH_CLASSES
|
|
52 | 52 | |
53 | 53 |
parser = argparse.ArgumentParser("You Only Look Once: Unified, Real-Time Object Detection") |
54 | 54 |
parser.add_argument("--image_size", type=int, default=448, help="The common width and height for all images") |
... | ... | |
156 | 156 | |
157 | 157 | |
158 | 158 |
def detection_object(patchs, model, save_root, opc, opt): |
159 |
global DOFTECH_CLASSES |
|
160 |
|
|
159 | 161 |
symbol_list = [] |
160 | 162 |
for idx in range(len(patchs)): |
161 | 163 |
pil_image = patchs[idx] |
... | ... | |
229 | 231 | |
230 | 232 |
def merge_fn(total_img, total_symbole_list, save_root): |
231 | 233 |
""" total_img:path -> img file """ |
234 |
global DOFTECH_CLASSES |
|
235 |
|
|
232 | 236 |
print("=========> MERGE RESULT") |
233 | 237 | |
234 | 238 |
if type(total_img) is str: |
... | ... | |
239 | 243 |
temp_king_img = temp_king_img[:,:,::-1].copy() |
240 | 244 | |
241 | 245 |
count_result = [0 for item in DOFTECH_CLASSES] |
242 |
|
|
246 | ||
243 | 247 |
for idx_out in range(len(total_symbole_list)): |
244 | 248 |
for idx in range(len(total_symbole_list[idx_out])): |
245 | 249 |
color = colors[DOFTECH_CLASSES.index(total_symbole_list[idx_out][idx].class_info)] |
내보내기 Unified diff