Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -46,31 +46,15 @@ def get_results(image):
|
|
46 |
nationalIdNumber = data['nationalIdNumber']
|
47 |
timeOfResponse = data['timeOfResponse']
|
48 |
requestInfo = data['requestInfo']
|
49 |
-
|
50 |
-
# Return the values as a list
|
51 |
-
return {
|
52 |
-
"First Name": firstName,
|
53 |
-
"Second Name": secondName,
|
54 |
-
"Address 1": address1,
|
55 |
-
"Address 2": address2,
|
56 |
-
"National ID Number": nationalIdNumber,
|
57 |
-
"Time of Response": timeOfResponse,
|
58 |
-
"Request Info": requestInfo
|
59 |
-
}
|
60 |
|
61 |
# Define the input component for Gradio
|
62 |
image_input = gr.inputs.Image() # Adjust the shape according to your requirements
|
63 |
|
64 |
# Define the output components for Gradio
|
65 |
-
output_components = [
|
66 |
-
|
67 |
-
gr.outputs.Textbox(label=
|
68 |
-
gr.outputs.Textbox(label="Address 1"),
|
69 |
-
gr.outputs.Textbox(label="Address 2"),
|
70 |
-
gr.outputs.Textbox(label="National ID Number"),
|
71 |
-
gr.outputs.Textbox(label="Time of Response"),
|
72 |
-
gr.outputs.Textbox(label="Request Info"),
|
73 |
-
]
|
74 |
|
75 |
# Launch the Gradio interface
|
76 |
-
gr.Interface(fn=get_results, inputs=image_input, outputs=output_components).launch(share=False)
|
|
|
46 |
nationalIdNumber = data['nationalIdNumber']
|
47 |
timeOfResponse = data['timeOfResponse']
|
48 |
requestInfo = data['requestInfo']
|
49 |
+
return [firstName, secondName, address1, address2, nationalIdNumber, timeOfResponse, requestInfo]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
# Define the input component for Gradio
|
52 |
image_input = gr.inputs.Image() # Adjust the shape according to your requirements
|
53 |
|
54 |
# Define the output components for Gradio
|
55 |
+
output_components = []
|
56 |
+
for label in ["First Name", "Second Name", "Address 1", "Address 2", "National ID Number", "Time of Response", "Request Info"]:
|
57 |
+
output_components.append(gr.outputs.Textbox(label=label))
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
# Launch the Gradio interface
|
60 |
+
gr.Interface(fn=get_results, inputs=image_input, outputs=output_components).launch(share=False)
|