|
@@ -86,11 +86,11 @@ class IdcView(views.MethodView):
|
|
|
for idx, (ocr_res, _) in enumerate(rec):
|
|
|
words = [it[1][0].replace(" ", "") for it in ocr_res]
|
|
|
if which == "face":
|
|
|
- if not words[0].startswith("姓名"):
|
|
|
+ if not words or not words[0].startswith("姓名"):
|
|
|
continue
|
|
|
info, msg, sta = get_face_info(words)
|
|
|
else:
|
|
|
- if not words[0].startswith("中华"):
|
|
|
+ if not words or not words[0].startswith("中华"):
|
|
|
continue
|
|
|
info, msg, sta = get_icon_info(words)
|
|
|
if sta:
|
|
@@ -126,11 +126,11 @@ class IdcHtmlView(views.MethodView):
|
|
|
for idx, (ocr_res, _) in enumerate(rec):
|
|
|
words = [it[1][0].replace(" ", "") for it in ocr_res]
|
|
|
if which == "face":
|
|
|
- if not words[0].startswith("姓名"):
|
|
|
+ if not words or not words[0].startswith("姓名"):
|
|
|
continue
|
|
|
info, msg, sta = get_face_info(words)
|
|
|
else:
|
|
|
- if not words[0].startswith("中华"):
|
|
|
+ if not words or not words[0].startswith("中华"):
|
|
|
continue
|
|
|
info, msg, sta = get_icon_info(words)
|
|
|
if sta:
|