Spaces:
Sleeping
Sleeping
Commit ·
ae3e58e
1
Parent(s): fdd0323
Reverted image value
Browse files36 unmodified lines3738394041424326 unmodified lines707172737475765 unmodified lines82838485868736 unmodified linesdef run(image, lang="eng"):print("Image ", image)try:print("Image info ", image.info.keys())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 linesgr.Markdown("## Theatre Programmer")with gr.Row():with gr.Column():image_in = gr.Image(type="pil", mirror_webcam=False, value="_Image.Image")lang = gr.Dropdown(choices, value="eng", label="Select language")btn = gr.Button("Run")with gr.Column():5 unmodified lineswith gr.Row():download_btn = gr.Button("Download output")btn.click(fn=run, inputs=[image_in, lang], outputs=[ocr_text, ner])download_btn.click(fn=download_output,36 unmodified lines3738394041424326 unmodified lines707172737475765 unmodified lines828384858687888990919236 unmodified linesdef run(image, lang="eng"):print("Image ", image)try: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 linesgr.Markdown("## Theatre Programmer")with gr.Row():with gr.Column():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 lineswith 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