Spaces:
Runtime error
Runtime error
ParisNeo
commited on
Commit
·
a34ba46
1
Parent(s):
3de913e
bugfix
Browse files
app.py
CHANGED
@@ -74,7 +74,7 @@ class UI():
|
|
74 |
with gr.Column():
|
75 |
self.rt_webcam = gr.Image(label="Input Image", source="webcam", streaming=True)
|
76 |
self.start_streaming = gr.Button("Start webcam")
|
77 |
-
self.start_streaming.click(self.start_webcam, [], [])
|
78 |
|
79 |
with gr.Column():
|
80 |
self.rt_rec_img = gr.Image(label="Output Image")
|
@@ -152,6 +152,7 @@ class UI():
|
|
152 |
|
153 |
def start_webcam(self):
|
154 |
self.webcam_process=not self.webcam_process
|
|
|
155 |
|
156 |
|
157 |
def add_files(self, files):
|
@@ -250,6 +251,8 @@ class UI():
|
|
250 |
|
251 |
if self.is_recording and image is not None:
|
252 |
if self.i < self.nb_images:
|
|
|
|
|
253 |
# Process the image to extract faces and draw the masks on the face in the image
|
254 |
fa.process(image)
|
255 |
if fa.nb_faces>0:
|
@@ -338,6 +341,7 @@ class UI():
|
|
338 |
if not self.webcam_process:
|
339 |
return None
|
340 |
|
|
|
341 |
# Process the image to extract faces and draw the masks on the face in the image
|
342 |
fa.process(image)
|
343 |
|
|
|
74 |
with gr.Column():
|
75 |
self.rt_webcam = gr.Image(label="Input Image", source="webcam", streaming=True)
|
76 |
self.start_streaming = gr.Button("Start webcam")
|
77 |
+
self.start_streaming.click(self.start_webcam, [], [self.start_streaming])
|
78 |
|
79 |
with gr.Column():
|
80 |
self.rt_rec_img = gr.Image(label="Output Image")
|
|
|
152 |
|
153 |
def start_webcam(self):
|
154 |
self.webcam_process=not self.webcam_process
|
155 |
+
return self.start_streaming.update(value="Stop webcam") if self.webcam_process else self.start_streaming.update(value="Start webcam")
|
156 |
|
157 |
|
158 |
def add_files(self, files):
|
|
|
251 |
|
252 |
if self.is_recording and image is not None:
|
253 |
if self.i < self.nb_images:
|
254 |
+
fa.image_size=(640, 480, 3)
|
255 |
+
|
256 |
# Process the image to extract faces and draw the masks on the face in the image
|
257 |
fa.process(image)
|
258 |
if fa.nb_faces>0:
|
|
|
341 |
if not self.webcam_process:
|
342 |
return None
|
343 |
|
344 |
+
fa.image_size=(640, 480, 3)
|
345 |
# Process the image to extract faces and draw the masks on the face in the image
|
346 |
fa.process(image)
|
347 |
|