Szczotar93
commited on
Commit
•
3a17896
1
Parent(s):
40786c4
Update handler.py
Browse files- handler.py +5 -3
handler.py
CHANGED
@@ -4,9 +4,11 @@ import torch
|
|
4 |
from subprocess import run
|
5 |
|
6 |
# install tesseract-ocr and pytesseract
|
7 |
-
run("apt install -y tesseract-ocr", shell=True, check=True)
|
8 |
-
run("pip install pytesseract", shell=True, check=True)
|
9 |
-
|
|
|
|
|
10 |
# helper function to unnormalize bboxes for drawing onto the image
|
11 |
def unnormalize_box(bbox, width, height):
|
12 |
return [
|
|
|
4 |
from subprocess import run
|
5 |
|
6 |
# install tesseract-ocr and pytesseract
|
7 |
+
# run("apt install -y tesseract-ocr", shell=True, check=True)
|
8 |
+
# run("pip install pytesseract", shell=True, check=True)
|
9 |
+
os.system('apt-get update -y')
|
10 |
+
os.system('apt-get install tesseract-ocr-pol-eng -y')
|
11 |
+
os.system('pip install -q pytesseract')
|
12 |
# helper function to unnormalize bboxes for drawing onto the image
|
13 |
def unnormalize_box(bbox, width, height):
|
14 |
return [
|