Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -48,11 +48,23 @@ def get_results(image):
|
|
48 |
requestInfo = data['requestInfo']
|
49 |
|
50 |
# Return the values as a list
|
51 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
-
# Define the input
|
54 |
image_input = gr.inputs.Image() # Adjust the shape according to your requirements
|
55 |
-
|
|
|
|
|
|
|
|
|
56 |
|
57 |
# Launch the Gradio interface
|
58 |
-
gr.Interface(fn=get_results, inputs=image_input, outputs=
|
|
|
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 |
+
for label in ["First Name", "Second Name", "Address 1", "Address 2", "National ID Number", "Time of Response", "Request Info"]:
|
67 |
+
output_components.append(gr.outputs.TextboxOutput(label=label))
|
68 |
|
69 |
# Launch the Gradio interface
|
70 |
+
gr.Interface(fn=get_results, inputs=image_input, outputs=output_components).launch(share=True)
|