Sahar7888 commited on
Commit
07bb533
·
verified ·
1 Parent(s): c8ad4de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -2,9 +2,11 @@ from PIL import Image
2
  import pytesseract
3
  import gradio as gr
4
  from io import BytesIO
 
 
 
 
5
 
6
- # Set the tesseract command to its path
7
- # pytesseract.pytesseract.tesseract_cmd = '/usr/bin/tesseract' # Change this if the path is different
8
  # OCR processing function
9
  def extract_text_from_image(image):
10
  try:
 
2
  import pytesseract
3
  import gradio as gr
4
  from io import BytesIO
5
+ import os
6
+ ## install PyTesseract
7
+ os.system('sudo apt-get install tesseract-ocr')
8
+ os.system('pip install -q pytesseract')
9
 
 
 
10
  # OCR processing function
11
  def extract_text_from_image(image):
12
  try: