修改路径

This commit is contained in:
William Jin 2024-09-26 15:37:57 +08:00
parent 4e42b668d4
commit 13b8cff9d9

View File

@ -169,7 +169,7 @@ def download_pdf(curl_command, pdf_filename):
def run_ocr(image): def run_ocr(image):
# 保存上传的图片到指定路径 # 保存上传的图片到指定路径
image_path = os.path.expanduser("/home/tmfc/got-ocr/img.png") image_path = os.path.expanduser("/home/tmfc/apps/got-ocr/img.png")
image.save(image_path) image.save(image_path)
# 激活 Conda 环境 # 激活 Conda 环境
@ -177,8 +177,8 @@ def run_ocr(image):
# 调用 OCR 命令 # 调用 OCR 命令
ocr_command = [ ocr_command = [
"python3", "/home/tmfc/got-ocr/GOT/demo/run_ocr_2.0_crop.py", "python3", "/home/tmfc/apps/got-ocr/GOT/demo/run_ocr_2.0_crop.py",
"--model-name", "/home/tmfc/got-ocr/models/", "--model-name", "/home/tmfc/apps/got-ocr/models/",
"--image-file", image_path "--image-file", image_path
] ]