From 501d62f9ce25af3f01994f6316ecfe925cf72773 Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Wed, 19 Jun 2024 16:52:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96ucloud=E5=8F=96=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=BA=E7=A9=BA=E6=97=B6=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- photo_review/photo_review.py | 2 ++ visual_model_test/visual_model_test.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/photo_review/photo_review.py b/photo_review/photo_review.py index 51428ac..1b0e0d2 100644 --- a/photo_review/photo_review.py +++ b/photo_review/photo_review.py @@ -38,6 +38,8 @@ def information_extraction(ie, phrecs): if pic_path: docs.append({"doc": pic_path}) doc_phrecs.append(phrec) + if not docs: + return result ie_results = ie(docs) now = get_default_datetime() diff --git a/visual_model_test/visual_model_test.py b/visual_model_test/visual_model_test.py index 39b0729..80c0e59 100644 --- a/visual_model_test/visual_model_test.py +++ b/visual_model_test/visual_model_test.py @@ -13,8 +13,8 @@ from ucloud import ucloud def write_visual_result(image, layout=None, result=None): - img = re.split(r'[\\/]', image)[-1] - img = img.split("?")[0] + img = image.split("?")[0] + img = re.split(r'[\\/]', img)[-1] img_name = "" img_type = "jpg" last_dot_index = img.rfind(".")