Spaces:
Runtime error
Runtime error
ParisNeo
commited on
Commit
·
3de913e
1
Parent(s):
8359120
fixed some bugs
Browse files
app.py
CHANGED
@@ -106,7 +106,7 @@ class UI():
|
|
106 |
self.gallery = gr.Gallery(
|
107 |
label="Uploaded Images", show_label=True, height=300, elem_id="gallery"
|
108 |
).style(grid=[2], height="auto")
|
109 |
-
self.btn_clear = gr.Button("Clear")
|
110 |
|
111 |
self.add_file = gr.Files(label="Files",file_types=["image"])
|
112 |
self.add_file.change(self.add_files, self.add_file, self.gallery)
|
@@ -115,7 +115,7 @@ class UI():
|
|
115 |
self.status = gr.Label(label="Status")
|
116 |
self.txtFace_name2.change(self.set_face_name, inputs=self.txtFace_name2, outputs=self.status, show_progress=False)
|
117 |
self.btn_start.click(self.record_from_files, inputs=self.gallery, outputs=self.status, show_progress=True)
|
118 |
-
self.btn_clear.click(self.clear_galery,[],[])
|
119 |
with gr.TabItem('Known Faces List'):
|
120 |
with gr.Blocks():
|
121 |
with gr.Row():
|
@@ -148,7 +148,7 @@ class UI():
|
|
148 |
demo.queue().launch()
|
149 |
|
150 |
def clear_galery(self):
|
151 |
-
self.gallery.update(value=[])
|
152 |
|
153 |
def start_webcam(self):
|
154 |
self.webcam_process=not self.webcam_process
|
|
|
106 |
self.gallery = gr.Gallery(
|
107 |
label="Uploaded Images", show_label=True, height=300, elem_id="gallery"
|
108 |
).style(grid=[2], height="auto")
|
109 |
+
self.btn_clear = gr.Button("Clear Gallery")
|
110 |
|
111 |
self.add_file = gr.Files(label="Files",file_types=["image"])
|
112 |
self.add_file.change(self.add_files, self.add_file, self.gallery)
|
|
|
115 |
self.status = gr.Label(label="Status")
|
116 |
self.txtFace_name2.change(self.set_face_name, inputs=self.txtFace_name2, outputs=self.status, show_progress=False)
|
117 |
self.btn_start.click(self.record_from_files, inputs=self.gallery, outputs=self.status, show_progress=True)
|
118 |
+
self.btn_clear.click(self.clear_galery,[],[self.gallery, self.add_file])
|
119 |
with gr.TabItem('Known Faces List'):
|
120 |
with gr.Blocks():
|
121 |
with gr.Row():
|
|
|
148 |
demo.queue().launch()
|
149 |
|
150 |
def clear_galery(self):
|
151 |
+
return self.gallery.update(value=[]), self.add_file.update(value=[])
|
152 |
|
153 |
def start_webcam(self):
|
154 |
self.webcam_process=not self.webcam_process
|