File size: 503 Bytes
b866726
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
import pandas as pd
import cv2
import easyocr
#import google.generativeai as genai

reader= easyocr.Reader(['en'],gpu=False)

def ocr(image):
    results=reader.readtext(image)
    results=pd.DataFrame(results,columns=['bbox','text','conf'])
    return results.text

title = "SafeSpoon"
description = "Upload an image of ingredients"
inputs = gr.Image()
outputs = gr.Label()
interface = gr.Interface(fn=ocr, inputs=inputs, outputs=outputs,title=title,)
interface.launch(share=True)