Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ import matplotlib.pyplot as plt
|
|
13 |
# pylab.rcParams['figure.figsize'] = (10.0, 8.0) # this controls figure size in the notebook
|
14 |
|
15 |
import io
|
16 |
-
import
|
17 |
|
18 |
|
19 |
|
@@ -81,17 +81,17 @@ def attend():
|
|
81 |
def run_face_recognition():
|
82 |
bytes_data=None
|
83 |
|
84 |
-
img_file_buffer=
|
85 |
if img_file_buffer is not None:
|
86 |
test_image = Image.open(img_file_buffer)
|
87 |
-
|
88 |
-
|
89 |
image = np.asarray(test_image)
|
90 |
gray = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
|
91 |
|
92 |
-
|
93 |
if bytes_data is None:
|
94 |
-
|
95 |
|
96 |
|
97 |
|
|
|
13 |
# pylab.rcParams['figure.figsize'] = (10.0, 8.0) # this controls figure size in the notebook
|
14 |
|
15 |
import io
|
16 |
+
import gradio as gr
|
17 |
|
18 |
|
19 |
|
|
|
81 |
def run_face_recognition():
|
82 |
bytes_data=None
|
83 |
|
84 |
+
img_file_buffer=gr.camera_input("Take a picture")
|
85 |
if img_file_buffer is not None:
|
86 |
test_image = Image.open(img_file_buffer)
|
87 |
+
gr.image(test_image, use_column_width=True)
|
88 |
+
gr.write(type(test_image))
|
89 |
image = np.asarray(test_image)
|
90 |
gray = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
|
91 |
|
92 |
+
gr.image(cv2.cvtColor(gray))
|
93 |
if bytes_data is None:
|
94 |
+
gr.stop()
|
95 |
|
96 |
|
97 |
|