Spaces:
Sleeping
Sleeping
Siyun He
commited on
Commit
·
8d61727
1
Parent(s):
3afcea0
debug change_glasses
Browse files
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(
|
27 |
global num, overlay
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
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
|