pragnakalp
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -58,9 +58,9 @@ Keras OCR
|
|
58 |
def ocr_with_keras(img):
|
59 |
print(zero.device)
|
60 |
output_text = ''
|
61 |
-
pipeline=keras_ocr.pipeline.Pipeline()
|
62 |
images=[keras_ocr.tools.read(img)]
|
63 |
-
predictions=pipeline.recognize(images)
|
64 |
first=predictions[0]
|
65 |
for text,box in first:
|
66 |
output_text += ' '+ text
|
|
|
58 |
def ocr_with_keras(img):
|
59 |
print(zero.device)
|
60 |
output_text = ''
|
61 |
+
pipeline=keras_ocr.pipeline.Pipeline().to(device)
|
62 |
images=[keras_ocr.tools.read(img)]
|
63 |
+
predictions=pipeline.recognize(images).to(device)
|
64 |
first=predictions[0]
|
65 |
for text,box in first:
|
66 |
output_text += ' '+ text
|