Jamshaid89
commited on
Commit
·
b97e62c
1
Parent(s):
f347761
Added 2nd interface
Browse files
app.py
CHANGED
@@ -38,13 +38,32 @@ label_input = gr.inputs.Textbox(label="Enter Label")
|
|
38 |
output_image = gr.outputs.Image(type="numpy")
|
39 |
|
40 |
# Create the Gradio interface
|
41 |
-
|
42 |
fn=save_identity,
|
43 |
inputs=[image_input, label_input],
|
44 |
outputs=label_output,
|
45 |
title="Face Identification",
|
46 |
-
description="Upload an image, enter
|
47 |
)
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
# Launch the Gradio interface
|
50 |
interface.launch()
|
|
|
38 |
output_image = gr.outputs.Image(type="numpy")
|
39 |
|
40 |
# Create the Gradio interface
|
41 |
+
interface1 = gr.Interface(
|
42 |
fn=save_identity,
|
43 |
inputs=[image_input, label_input],
|
44 |
outputs=label_output,
|
45 |
title="Face Identification",
|
46 |
+
description="Upload an image, enter the person name and store the person in database",
|
47 |
)
|
48 |
|
49 |
+
|
50 |
+
# Create Gradio interfaces for image input and output
|
51 |
+
image_input2 = gr.inputs.Image(shape=(None, None))
|
52 |
+
output_image = gr.outputs.Image(type="numpy")
|
53 |
+
|
54 |
+
# Create the Gradio interface for image input and output
|
55 |
+
interface2 = gr.Interface(
|
56 |
+
fn=process_image,
|
57 |
+
inputs=image_input2,
|
58 |
+
outputs=output_image,
|
59 |
+
title="Face Identification",
|
60 |
+
description="Upload an image and get the identity of person",
|
61 |
+
)
|
62 |
+
|
63 |
+
# Create the Gradio interface with two tabs
|
64 |
+
interface = gr.Interface(title="Face identification App")
|
65 |
+
interface.add_view(interface1, "Save", "Add new person")
|
66 |
+
interface.add_view(interface2, "Predict", "Get identity of person")
|
67 |
+
|
68 |
# Launch the Gradio interface
|
69 |
interface.launch()
|