4419c003 by 周伟奇

fix bug

1 parent b3e0d9bc
......@@ -102,7 +102,7 @@ class Command(BaseCommand, LoggerMixin):
id_card_dict.pop('base64_img')
except Exception as e:
continue
all_res.append(license_data)
all_res.extend(license_data)
def license2_process(self, ocr_data, all_res, classify, img_path):
pid, _, _, _, _, _ = consts.LICENSE_CLASSIFY_MAPPING.get(classify)
......@@ -238,6 +238,7 @@ class Command(BaseCommand, LoggerMixin):
self.license1_process(ocr_data, all_res, classify)
elif classify in consts.LICENSE_CLASSIFY_SET_2:
self.license2_process(ocr_data, all_res, classify, img_path)
break
else:
self.folder_log.warn('{0} [ocr failed] [img_path={1}]'.format(self.log_base, img_path))
......@@ -300,9 +301,9 @@ class Command(BaseCommand, LoggerMixin):
all_res = []
for img_path in img_path_list:
self.ocr_process(img_path, classify, all_res, seperate_dir)
if len(all_res) > 0:
self.res_process(all_res, excel_path, classify)
return all_res
# if len(all_res) > 0:
self.res_process(all_res, excel_path, classify)
return all_res
def pdf_process(self, name, path, classify, img_output_dir, wb_output_dir, pdf_output_dir, seperate_dir):
if os.path.exists(path):
......@@ -365,7 +366,7 @@ class Command(BaseCommand, LoggerMixin):
if classify in self.ltgt_classify_mapping:
rebuild_res = self.ltgt_process([path], self.ltgt_classify_mapping[classify], excel_path, path)
else:
rebuild_res = self.images_process([img_save_path], classify, excel_path, seperate_path)
rebuild_res = self.images_process([path], classify, excel_path, seperate_path)
shutil.move(path, img_save_path)
return rebuild_res
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!