Spaces:
Sleeping
Sleeping
Commit
·
ae3e58e
1
Parent(s):
fdd0323
Reverted image value
Browse files
app.py
CHANGED
|
@@ -37,7 +37,7 @@ def get_named_entities(ocr_text: str):
|
|
| 37 |
def run(image, lang="eng"):
|
| 38 |
print("Image ", image)
|
| 39 |
try:
|
| 40 |
-
print("Image
|
| 41 |
except Exception as e:
|
| 42 |
print(f"Could not print image filename: {e}")
|
| 43 |
result = pytesseract.image_to_string(image, lang=None if lang == [] else lang)
|
|
@@ -70,7 +70,7 @@ with gr.Blocks() as demo:
|
|
| 70 |
gr.Markdown("## Theatre Programmer")
|
| 71 |
with gr.Row():
|
| 72 |
with gr.Column():
|
| 73 |
-
image_in = gr.Image(type="pil", mirror_webcam=False
|
| 74 |
lang = gr.Dropdown(choices, value="eng", label="Select language")
|
| 75 |
btn = gr.Button("Run")
|
| 76 |
with gr.Column():
|
|
@@ -82,6 +82,11 @@ with gr.Blocks() as demo:
|
|
| 82 |
with gr.Row():
|
| 83 |
download_btn = gr.Button("Download output")
|
| 84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
btn.click(fn=run, inputs=[image_in, lang], outputs=[ocr_text, ner])
|
| 86 |
download_btn.click(
|
| 87 |
fn=download_output,
|
|
|
|
| 37 |
def run(image, lang="eng"):
|
| 38 |
print("Image ", image)
|
| 39 |
try:
|
| 40 |
+
print("Image name ", image.name)
|
| 41 |
except Exception as e:
|
| 42 |
print(f"Could not print image filename: {e}")
|
| 43 |
result = pytesseract.image_to_string(image, lang=None if lang == [] else lang)
|
|
|
|
| 70 |
gr.Markdown("## Theatre Programmer")
|
| 71 |
with gr.Row():
|
| 72 |
with gr.Column():
|
| 73 |
+
image_in = gr.Image(type="pil", mirror_webcam=False)
|
| 74 |
lang = gr.Dropdown(choices, value="eng", label="Select language")
|
| 75 |
btn = gr.Button("Run")
|
| 76 |
with gr.Column():
|
|
|
|
| 82 |
with gr.Row():
|
| 83 |
download_btn = gr.Button("Download output")
|
| 84 |
|
| 85 |
+
try:
|
| 86 |
+
print("Image name ", image_in.name)
|
| 87 |
+
except Exception as e:
|
| 88 |
+
print(f"Could not print image filename: {e}")
|
| 89 |
+
|
| 90 |
btn.click(fn=run, inputs=[image_in, lang], outputs=[ocr_text, ner])
|
| 91 |
download_btn.click(
|
| 92 |
fn=download_output,
|