Spaces:
Sleeping
Sleeping
Commit ·
ae3e58e
1
Parent(s): fdd0323
Reverted image value
Browse files36 unmodified lines373839404041424326 unmodified lines70717273737475765 unmodified lines828384858687888990919236 unmodified linesdef run(image, lang="eng"): print("Image ", image) try: print("Image info ", image.info.keys()) print("Image name ", image.name) except Exception as e: print(f"Could not print image filename: {e}") result = pytesseract.image_to_string(image, lang=None if lang == [] else lang)26 unmodified lines gr.Markdown("## Theatre Programmer") with gr.Row(): with gr.Column(): image_in = gr.Image(type="pil", mirror_webcam=False, value="_Image.Image") image_in = gr.Image(type="pil", mirror_webcam=False) lang = gr.Dropdown(choices, value="eng", label="Select language") btn = gr.Button("Run") with gr.Column():5 unmodified lines with gr.Row(): download_btn = gr.Button("Download output")
try: print("Image name ", image_in.name) except Exception as e: print(f"Could not print image filename: {e}")
btn.click(fn=run, inputs=[image_in, lang], outputs=[ocr_text, ner]) download_btn.click( fn=download_output,app.py+7-2