import gradio as gr | |
import pytesseract | |
#pytesseract.pytesseract.tesseract_cmd = r'/usr/bin/tesseract' | |
def process_recipe(i,j): | |
text = pytesseract.image_to_string(Image.open(image)) | |
return text | |
iface = gr.Interface( | |
fn=process_recipe, | |
inputs=[ | |
gr.components.Image(type="filepath", label="Recipe Image"), | |
gr.components.Radio(choices=["Double","Triple", "Half", "Third"], label="Action") | |
], | |
outputs="text", | |
title="Recipe Modifier", | |
description="Upload an image of a recipe and choose how to modify the measurements.", | |
) | |
if __name__ == "__main__": | |
iface.launch() | |