ayanika02 commited on
Commit
4ff11e3
·
verified ·
1 Parent(s): e8c127f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -44
app.py CHANGED
@@ -1,45 +1,3 @@
1
- #!/usr/bin/env python
2
- # coding: utf-8
3
-
4
- # In[ ]:
5
-
6
-
7
- pip install tesseract pytesseract pillow
8
-
9
-
10
- # In[ ]:
11
-
12
-
13
- pip install transformers
14
-
15
-
16
- # In[ ]:
17
-
18
-
19
- pip install torch
20
-
21
-
22
- # In[ ]:
23
-
24
-
25
- pip install gradio
26
-
27
-
28
- # In[ ]:
29
-
30
-
31
- pip install streamlit
32
-
33
-
34
- # In[ ]:
35
-
36
-
37
- pip install pillow
38
-
39
-
40
- # In[10]:
41
-
42
-
43
  import pytesseract
44
  pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
45
 
@@ -48,14 +6,14 @@ pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tessera
48
 
49
 
50
  import gradio as gr
51
- import pytesseract
52
  from PIL import Image
53
  import re
54
  import os
55
  import sys
56
 
 
57
  # Set Tesseract path if needed (uncomment and modify if Tesseract is not in PATH)
58
- pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
59
 
60
  def ocr_image(image):
61
  try:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import pytesseract
2
  pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
3
 
 
6
 
7
 
8
  import gradio as gr
 
9
  from PIL import Image
10
  import re
11
  import os
12
  import sys
13
 
14
+ import pytesseract
15
  # Set Tesseract path if needed (uncomment and modify if Tesseract is not in PATH)
16
+ pytesseract.pytesseract.tesseract_cmd = "/usr/bin/tesseract"
17
 
18
  def ocr_image(image):
19
  try: