Spaces:
Runtime error
Runtime error
add paddleocr optimized inference pipeline
Browse files- app.py +5 -3
- requirements.txt +11 -2
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
-
from
|
|
|
2 |
import gradio as gr
|
3 |
import openai
|
4 |
import ast
|
@@ -9,11 +10,12 @@ import utils
|
|
9 |
|
10 |
|
11 |
openai.api_key = os.getenv("API_KEY")
|
12 |
-
|
13 |
|
14 |
|
15 |
def get_text(input_img):
|
16 |
-
result =
|
|
|
17 |
return " ".join(result)
|
18 |
|
19 |
|
|
|
1 |
+
from deprem_ocr.ocr import DepremOCR
|
2 |
+
import numpy as np
|
3 |
import gradio as gr
|
4 |
import openai
|
5 |
import ast
|
|
|
10 |
|
11 |
|
12 |
openai.api_key = os.getenv("API_KEY")
|
13 |
+
depremOCR = DepremOCR()
|
14 |
|
15 |
|
16 |
def get_text(input_img):
|
17 |
+
result = depremOCR.apply_ocr(np.array(input_img))
|
18 |
+
print(result)
|
19 |
return " ".join(result)
|
20 |
|
21 |
|
requirements.txt
CHANGED
@@ -1,5 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
openai
|
2 |
Pillow
|
3 |
-
easyocr
|
4 |
gradio
|
5 |
-
deta
|
|
|
1 |
+
paddlepaddle
|
2 |
+
opencv-python
|
3 |
+
Pillow
|
4 |
+
numpy==1.23.3
|
5 |
+
pandas
|
6 |
+
imutils
|
7 |
+
Cython
|
8 |
+
imgaug
|
9 |
+
pyclipper
|
10 |
+
deprem_ocr
|
11 |
openai
|
12 |
Pillow
|
|
|
13 |
gradio
|
14 |
+
deta
|