Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -310,7 +310,7 @@ def process_image(image, mode, entry_type, quantity):
|
|
| 310 |
numbered_output = "\n".join([f"{key}: {value}" for key, value in attributes.items()])
|
| 311 |
return f"Extracted Text:\n{extracted_text}\n\nAttributes and Values:\n{numbered_output}", message
|
| 312 |
# Gradio Interface
|
| 313 |
-
def app():
|
| 314 |
return gr.TabbedInterface([
|
| 315 |
gr.Interface(
|
| 316 |
fn=process_image,
|
|
@@ -318,14 +318,15 @@ def app():
|
|
| 318 |
gr.Image(type="numpy", label="Upload Image"),
|
| 319 |
gr.Dropdown(label="Mode", choices=["Entry", "Exit"], value="Entry"),
|
| 320 |
gr.Radio(label="Entry Type", choices=["Sales", "Non-Sales"], value="Sales"),
|
| 321 |
-
gr.Number(label="Quantity", value=1, interactive=
|
|
|
|
| 322 |
outputs=[
|
| 323 |
gr.Text(label="Extracted Text"),
|
| 324 |
gr.Text(label="Result")
|
| 325 |
],
|
| 326 |
title="Image Text Extraction",
|
| 327 |
description="Upload an image and extract text using OCR."
|
| 328 |
-
)
|
| 329 |
gr.Interface(
|
| 330 |
fn=pull_data_from_salesforce,
|
| 331 |
inputs=[],
|
|
|
|
| 310 |
numbered_output = "\n".join([f"{key}: {value}" for key, value in attributes.items()])
|
| 311 |
return f"Extracted Text:\n{extracted_text}\n\nAttributes and Values:\n{numbered_output}", message
|
| 312 |
# Gradio Interface
|
| 313 |
+
def app():
|
| 314 |
return gr.TabbedInterface([
|
| 315 |
gr.Interface(
|
| 316 |
fn=process_image,
|
|
|
|
| 318 |
gr.Image(type="numpy", label="Upload Image"),
|
| 319 |
gr.Dropdown(label="Mode", choices=["Entry", "Exit"], value="Entry"),
|
| 320 |
gr.Radio(label="Entry Type", choices=["Sales", "Non-Sales"], value="Sales"),
|
| 321 |
+
gr.Number(label="Quantity", value=1, interactive=True),
|
| 322 |
+
],
|
| 323 |
outputs=[
|
| 324 |
gr.Text(label="Extracted Text"),
|
| 325 |
gr.Text(label="Result")
|
| 326 |
],
|
| 327 |
title="Image Text Extraction",
|
| 328 |
description="Upload an image and extract text using OCR."
|
| 329 |
+
),
|
| 330 |
gr.Interface(
|
| 331 |
fn=pull_data_from_salesforce,
|
| 332 |
inputs=[],
|