Skip to content

πŸ“„ Awesome OCR multiple programing languages toolkits based on ONNX Runtime, OpenVINO, MNN, PaddlePaddle, TensorRT and PyTorch.

Fix uvicorn error

SWHLeb3db42f06d4
diff --git a/ocrweb/rapidocr_web/api.py b/ocrweb/rapidocr_web/api.py
index 59b7906..f5582f3 100644
--- a/ocrweb/rapidocr_web/api.py
+++ b/ocrweb/rapidocr_web/api.py
@@ -3,6 +3,7 @@
# @Contact: [email protected]
import argparse
import json
+from pathlib import Path
import cv2
import numpy as np
@@ -54,7 +55,8 @@ def main():
parser.add_argument('-p', '--port', type=int, default=9003,
help='IP port')
args = parser.parse_args()
- uvicorn.run(app, host=args.ip, port=args.port, reload=True)
+ uvicorn.run(f"{Path(__file__).stem}:app",
+ host=args.ip, port=args.port, reload=True)
if __name__ == '__main__':