File size: 916 Bytes
a21e652
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ffbf49e
a21e652
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
import easyocr

def perform_ocr(image):
    # Perform OCR using EasyOCR
    reader = easyocr.Reader(['en'], gpu=False)
    result = reader.readtext(image)
    ocr_text = '\n'.join([entry[1] for entry in result])
    return ocr_text
# Create an input component for uploading an image file
image_input = gr.inputs.Image()

# Create an output component to display the OCR text
text_output = gr.outputs.Textbox()

# Create the Gradio interface
iface = gr.Interface(fn=perform_ocr, inputs=image_input, outputs=text_output, title="OCR using EasyOCR", description = "OCR (Optical Character Recognition) application using EasyOCR library and Gradio for creating a simple web interface to interact with the OCR functionality. Gradio is a Python library that allows you to quickly create web interfaces for your machine learning models.Put image here and get a output.")
# Run the interface
iface.launch()