mertcobanov Goodsea commited on
Commit
e3bf2eb
1 Parent(s): 2720aa3

DepremOCR (PaddleOCR optimized inference pipeline) (#1)

Browse files

- add paddleocr optimized inference pipeline (863f1e9ca0f1fda076135c3080a3bfe5488f97b8)


Co-authored-by: Kutsal Ozkurt <Goodsea@users.noreply.huggingface.co>

Files changed (2) hide show
  1. app.py +5 -3
  2. requirements.txt +11 -2
app.py CHANGED
@@ -1,4 +1,5 @@
1
- from easyocr import Reader
 
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
- reader = Reader(["tr"])
13
 
14
 
15
  def get_text(input_img):
16
- result = reader.readtext(input_img, detail=0)
 
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