Spaces:
Sleeping
Sleeping
rmayormartins
commited on
Commit
•
e3e0609
1
Parent(s):
b1ba885
Subindo arquivos
Browse files- app.py +22 -0
- apt.txt +1 -0
- confusionmatrix.JPG +0 -0
- packages.txt +1 -0
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pytesseract
|
2 |
+
from PIL import Image
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
# Definindo a função de OCR
|
6 |
+
def extract_text_from_image(image):
|
7 |
+
text = pytesseract.image_to_string(image)
|
8 |
+
return text
|
9 |
+
|
10 |
+
# Criando a interface do Gradio
|
11 |
+
iface = gr.Interface(
|
12 |
+
fn=extract_text_from_image,
|
13 |
+
inputs="image",
|
14 |
+
outputs="text",
|
15 |
+
title="OCR-img2txt",
|
16 |
+
description="This application uses Optical Character Recognition (OCR) technology to extract text from images. It employs the Tesseract OCR engine to process images containing printed text, converting it into editable and searchable text. Ideal for digitizing documents, extracting text from photos, and converting scanned images into text formats."
|
17 |
+
)
|
18 |
+
|
19 |
+
# Executando a interface
|
20 |
+
iface.launch(debug=True)
|
21 |
+
|
22 |
+
|
apt.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
tesseract-ocr
|
confusionmatrix.JPG
ADDED
packages.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
tesseract-ocr-all
|