import gradio as gr ############################################################ This is still under progress ####################### #def formatdata(dframe): #return #https://huggingface.co/spaces/ttj/wordle-helper/blob/main/app.py #https://raw.githubusercontent.com/dwyl/english-words/master/words.txt def wordsrch(img): lang = ["en"] #ocrimg = gr.Interface.load("spaces/PaddlePaddle/PaddleOCR")(img, lang) ocrimg, dframe = gr.Interface.load("spaces/tomofi/EasyOCR")(img, lang) print(dframe) #formatdata(dframe) return ocrimg #examples = [["wordsearch2.jpg","en"]] examples = ["wordsearch2.jpg"] words = ["allude", "lest", "apples", "lore", "lorna", "brunner", "buccaneer", "northward", "decently", "plessey", "dialled", "pointing", "duce", "protestor", "fairer", "removable", "finality", "risc", "gasp", "skates", "hawk", "spoke", "insomnia", "lear", "troll"] iface = gr.Interface(fn=wordsrch, description = "Work in progress ...", # Please choose from: 'numpy', 'pil', 'filepath'. inputs=gr.inputs.Image(type='filepath', label='Input'), #"en"], #outputs=gr.outputs.Image(type='file', label='Output'), outputs=gr.outputs.Image(type='file', label='Output'), #gr.outputs.Dataframe(type="array", headers=['text' , 'confidence'])], examples = examples) iface.launch(debug=True, enable_queue=True)