Siyun He commited on
Commit
92a73ad
·
1 Parent(s): a5c3152

remove refresh_interface()

Browse files
Files changed (1) hide show
  1. app.py +2 -20
app.py CHANGED
@@ -286,38 +286,20 @@ def transform_cv2(frame, transform):
286
  def refresh_interface():
287
  # Reset the image to an empty state or a default image
288
  input_img.update(value=None)
289
-
290
  # Return a message indicating the interface has been refreshed
291
  return "Interface refreshed!"
292
 
293
  def save_frame(frame):
294
  # Convert frame to RGB
295
  frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
296
-
297
  # Create a unique filename using the current timestamp
298
  filename = f"saved_frame_{datetime.now().strftime('%Y%m%d_%H%M%S')}.png"
299
-
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
307
 
308
- # def save_frame(frame):
309
- # # Convert frame to RGB
310
- # frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
311
-
312
- # # Create a unique filename using the current timestamp
313
- # filename = f"saved_frame_{datetime.now().strftime('%Y%m%d_%H%M%S')}.png"
314
-
315
- # # Save the frame to a temporary file
316
- # cv2.imwrite(filename, frame)
317
-
318
- # # Return the filename for download
319
- # return filename
320
-
321
  def webcam_input(frame, transform, lip_color):
322
  frame, face_shape, glass_shape = process_frame(frame)
323
  if transform != "none" and lip_color == "none":
 
286
  def refresh_interface():
287
  # Reset the image to an empty state or a default image
288
  input_img.update(value=None)
 
289
  # Return a message indicating the interface has been refreshed
290
  return "Interface refreshed!"
291
 
292
  def save_frame(frame):
293
  # Convert frame to RGB
294
  frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
 
295
  # Create a unique filename using the current timestamp
296
  filename = f"saved_frame_{datetime.now().strftime('%Y%m%d_%H%M%S')}.png"
 
297
  # Save the frame to a temporary file
298
  cv2.imwrite(filename, frame)
299
+ # # Refresh the interface
300
+ # refresh_interface()
 
 
301
  return filename
302
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  def webcam_input(frame, transform, lip_color):
304
  frame, face_shape, glass_shape = process_frame(frame)
305
  if transform != "none" and lip_color == "none":