Spaces:
Runtime error
Runtime error
add file
Browse files
main.py
CHANGED
@@ -1,15 +1,12 @@
|
|
1 |
from fastapi import FastAPI, File, UploadFile
|
2 |
-
|
3 |
-
|
4 |
from rapidocr_onnxruntime import RapidOCR
|
5 |
-
|
|
|
6 |
# det_model_path同理
|
7 |
model = RapidOCR()
|
8 |
|
9 |
-
|
10 |
-
# 1、导入对应的包
|
11 |
-
from fastapi.middleware.cors import CORSMiddleware
|
12 |
-
|
13 |
app = FastAPI()
|
14 |
|
15 |
# 2、声明一个 源 列表;重点:要包含跨域的客户端 源
|
|
|
1 |
from fastapi import FastAPI, File, UploadFile
|
2 |
+
from PIL import Image
|
3 |
+
from fastapi.middleware.cors import CORSMiddleware
|
4 |
from rapidocr_onnxruntime import RapidOCR
|
5 |
+
import io
|
6 |
+
import numpy as np
|
7 |
# det_model_path同理
|
8 |
model = RapidOCR()
|
9 |
|
|
|
|
|
|
|
|
|
10 |
app = FastAPI()
|
11 |
|
12 |
# 2、声明一个 源 列表;重点:要包含跨域的客户端 源
|