ocr-img2txt / app.py
rmayormartins's picture
Subindo arquivos
e3e0609
raw
history blame
751 Bytes
import pytesseract
from PIL import Image
import gradio as gr
# Definindo a função de OCR
def extract_text_from_image(image):
text = pytesseract.image_to_string(image)
return text
# Criando a interface do Gradio
iface = gr.Interface(
fn=extract_text_from_image,
inputs="image",
outputs="text",
title="OCR-img2txt",
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."
)
# Executando a interface
iface.launch(debug=True)