Commit 0be76098 authored by wuzekai's avatar wuzekai

Update ocr.py

parent a53d60db
Pipeline #572 canceled with stages
......@@ -33,4 +33,16 @@ def ocr_inference():
uuid_str = str(uuid.uuid4())
filename = f"{uuid_str}.jpg"
image_path = os.path.join(upload_dir, filename)
file.save(image_path)
\ No newline at end of file
file.save(image_path)
try:
# 调用 OCR 模型并捕获 stdout
command = [
"python",
"tools/infer/predict_system.py",
"--image_dir", image_path,
"--det_model_dir", det_model_dir,
"--rec_model_dir", rec_model_dir,
"--cls_model_dir", cls_model_dir,
"--draw_img_save_dir", result_dir,
]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment