Spaces:
Runtime error
Runtime error
ParisNeo commited on
Commit ·
f827ad3
1
Parent(s): deb2f26
upgraded
Browse files
app.py
CHANGED
|
@@ -110,12 +110,19 @@ class UI():
|
|
| 110 |
with gr.Blocks():
|
| 111 |
with gr.Row():
|
| 112 |
with gr.Column():
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
with gr.Row():
|
| 120 |
with gr.Accordion(label="Options", open=False):
|
| 121 |
self.sld_threshold = gr.Slider(1e-2,10,4e-1,step=1e-2,label="Recognition threshold")
|
|
@@ -168,7 +175,7 @@ class UI():
|
|
| 168 |
self.known_faces.append(finger_print)
|
| 169 |
self.known_faces_names.append(file.stem)
|
| 170 |
if hasattr(self, "faces_list"):
|
| 171 |
-
self.faces_list.update([self.
|
| 172 |
|
| 173 |
def set_face_name(self, face_name):
|
| 174 |
self.face_name=face_name
|
|
|
|
| 110 |
with gr.Blocks():
|
| 111 |
with gr.Row():
|
| 112 |
with gr.Column():
|
| 113 |
+
if len(self.known_faces_names)>0:
|
| 114 |
+
self.faces_list = gr.Dataframe(
|
| 115 |
+
headers=["Face Name"],
|
| 116 |
+
datatype=["str"],
|
| 117 |
+
label="Faces",
|
| 118 |
+
value=[[n] for n in self.known_faces_names]
|
| 119 |
+
)
|
| 120 |
+
else:
|
| 121 |
+
self.faces_list = gr.Dataframe(
|
| 122 |
+
headers=["Face Name"],
|
| 123 |
+
datatype=["str"],
|
| 124 |
+
label="Faces"
|
| 125 |
+
)
|
| 126 |
with gr.Row():
|
| 127 |
with gr.Accordion(label="Options", open=False):
|
| 128 |
self.sld_threshold = gr.Slider(1e-2,10,4e-1,step=1e-2,label="Recognition threshold")
|
|
|
|
| 175 |
self.known_faces.append(finger_print)
|
| 176 |
self.known_faces_names.append(file.stem)
|
| 177 |
if hasattr(self, "faces_list"):
|
| 178 |
+
self.faces_list.update([[n] for n in self.known_faces_names])
|
| 179 |
|
| 180 |
def set_face_name(self, face_name):
|
| 181 |
self.face_name=face_name
|