Commit a53d60db authored by wuzekai's avatar wuzekai

Update ocr.py

parent 167e59c2
Pipeline #571 canceled with stages
......@@ -28,3 +28,9 @@ def ocr_inference():
file = request.files["file"]
if file.filename == "":
return jsonify({"error": "No selected file"}), 400
# 生成唯一文件名
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
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