Spaces:
Sleeping
Sleeping
| 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) | |