Spaces:
Sleeping
Sleeping
Siyun He
commited on
Commit
·
68d70c4
1
Parent(s):
7d9595b
debug save function
Browse files
.DS_Store
CHANGED
|
Binary files a/.DS_Store and b/.DS_Store differ
|
|
|
app.py
CHANGED
|
@@ -300,7 +300,7 @@ def save_frame(frame):
|
|
| 300 |
# Save the frame to a temporary file
|
| 301 |
cv2.imwrite(filename, frame)
|
| 302 |
|
| 303 |
-
# Refresh the
|
| 304 |
refresh_interface()
|
| 305 |
|
| 306 |
return filename
|
|
@@ -342,13 +342,12 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="purple", secondary_hue="blue"))
|
|
| 342 |
glass_shape_output = gr.Textbox(label="Recommended Glass Shape")
|
| 343 |
next_button = gr.Button("Next Glasses➡️")
|
| 344 |
save_button = gr.Button("Save as a Picture📌")
|
| 345 |
-
|
| 346 |
-
|
| 347 |
input_img.stream(webcam_input, [input_img, transform, lip_color], [input_img, face_shape_output, glass_shape_output], stream_every=0.1)
|
| 348 |
with gr.Row():
|
| 349 |
next_button.click(change_glasses, [], [])
|
| 350 |
with gr.Row():
|
| 351 |
-
save_button.click(save_frame, [input_img]
|
| 352 |
|
| 353 |
if __name__ == "__main__":
|
| 354 |
demo.launch(share=True)
|
|
|
|
| 300 |
# Save the frame to a temporary file
|
| 301 |
cv2.imwrite(filename, frame)
|
| 302 |
|
| 303 |
+
# Refresh the interface
|
| 304 |
refresh_interface()
|
| 305 |
|
| 306 |
return filename
|
|
|
|
| 342 |
glass_shape_output = gr.Textbox(label="Recommended Glass Shape")
|
| 343 |
next_button = gr.Button("Next Glasses➡️")
|
| 344 |
save_button = gr.Button("Save as a Picture📌")
|
| 345 |
+
save_button.click(fn=save_frame, inputs=webcam_input, outputs=gr.Textbox(label="Save Status"))
|
|
|
|
| 346 |
input_img.stream(webcam_input, [input_img, transform, lip_color], [input_img, face_shape_output, glass_shape_output], stream_every=0.1)
|
| 347 |
with gr.Row():
|
| 348 |
next_button.click(change_glasses, [], [])
|
| 349 |
with gr.Row():
|
| 350 |
+
save_button.click(save_frame, [input_img])
|
| 351 |
|
| 352 |
if __name__ == "__main__":
|
| 353 |
demo.launch(share=True)
|