Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ user_embeddings = {}
|
|
13 |
|
14 |
# Preprocess the image
|
15 |
def preprocess_image(image):
|
16 |
-
image = cv2.resize(image, (200, 200)) #
|
17 |
image = tf.keras.applications.resnet50.preprocess_input(image)
|
18 |
return np.expand_dims(image, axis=0)
|
19 |
|
@@ -45,7 +45,7 @@ def recognize_user(image):
|
|
45 |
# Gradio interface for registering users
|
46 |
register_interface = gr.Interface(
|
47 |
fn=register_user,
|
48 |
-
inputs=[gr.Image(
|
49 |
outputs="text",
|
50 |
live=True
|
51 |
)
|
@@ -53,7 +53,7 @@ register_interface = gr.Interface(
|
|
53 |
# Gradio interface for recognizing users
|
54 |
recognize_interface = gr.Interface(
|
55 |
fn=recognize_user,
|
56 |
-
inputs=gr.Image(
|
57 |
outputs="text",
|
58 |
live=True
|
59 |
)
|
|
|
13 |
|
14 |
# Preprocess the image
|
15 |
def preprocess_image(image):
|
16 |
+
image = cv2.resize(image, (200, 200)) # Resize image to 200x200
|
17 |
image = tf.keras.applications.resnet50.preprocess_input(image)
|
18 |
return np.expand_dims(image, axis=0)
|
19 |
|
|
|
45 |
# Gradio interface for registering users
|
46 |
register_interface = gr.Interface(
|
47 |
fn=register_user,
|
48 |
+
inputs=[gr.Image(), gr.Textbox(label="User ID")],
|
49 |
outputs="text",
|
50 |
live=True
|
51 |
)
|
|
|
53 |
# Gradio interface for recognizing users
|
54 |
recognize_interface = gr.Interface(
|
55 |
fn=recognize_user,
|
56 |
+
inputs=gr.Image(),
|
57 |
outputs="text",
|
58 |
live=True
|
59 |
)
|