sayedM commited on
Commit
16a3623
1 Parent(s): cff72ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -4
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 [firstName, secondName, address1, address2, nationalIdNumber, timeOfResponse, requestInfo]
 
 
 
 
 
 
 
 
52
 
53
- # Define the input and output components for Gradio
54
  image_input = gr.inputs.Image() # Adjust the shape according to your requirements
55
- output_component = gr.outputs.Label()
 
 
 
 
56
 
57
  # Launch the Gradio interface
58
- gr.Interface(fn=get_results, inputs=image_input, outputs=output_component).launch()
 
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)