Siyun He commited on
Commit
8d61727
·
1 Parent(s): 3afcea0

debug change_glasses

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -23,13 +23,12 @@ directory_path = 'glasses'
23
  total_glass_num = count_files_in_directory(directory_path)
24
 
25
  # Change glasses
26
- def change_glasses(action):
27
  global num, overlay
28
- if action == 'next':
29
- num += 1
30
- if num > total_glass_num:
31
- num = 1
32
- overlay = cv2.imread(f'glasses/glass{num}.png', cv2.IMREAD_UNCHANGED)
33
  return overlay
34
 
35
  # Process frame for overlay
 
23
  total_glass_num = count_files_in_directory(directory_path)
24
 
25
  # Change glasses
26
+ def change_glasses():
27
  global num, overlay
28
+ num += 1
29
+ if num > total_glass_num:
30
+ num = 1
31
+ overlay = cv2.imread(f'glasses/glass{num}.png', cv2.IMREAD_UNCHANGED)
 
32
  return overlay
33
 
34
  # Process frame for overlay