From d0b9bdb1cb26c7e4f61c563f1ecc658d3236fae0 Mon Sep 17 00:00:00 2001 From: satori Date: Thu, 21 Nov 2024 20:02:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=B1=80=E8=AE=8A=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pp.py b/pp.py index 58fe3e4..be78b65 100755 --- a/pp.py +++ b/pp.py @@ -18,7 +18,7 @@ import paddle from PIL import Image, ImageFile from paddleocr import PaddleOCR -paddle.set_flags({'FLAGS_fraction_of_gpu_memory_to_use': 0.6}) # 限制显存占用为GPU的80% +paddle.set_flags({'FLAGS_fraction_of_gpu_memory_to_use': 0.4}) # 限制显存占用为GPU的80% logging.disable(logging.DEBUG) # 关闭DEBUG日志的打印 logging.disable(logging.WARNING) # 关闭WARNING日志的打印 warnings.filterwarnings("ignore") @@ -94,6 +94,7 @@ def process_ocr(model, image): return result def process_images(conn, offset=0) -> int: + global EN, CH, JP, KR, RU with conn.cursor(pymysql.cursors.SSCursor) as cursor: cursor.execute("SELECT id, content FROM web_images WHERE text='' AND article_category_top_id=22 LIMIT 100 OFFSET %s", (offset,)) for id, content in cursor.fetchall():