Ii
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -44,8 +44,14 @@ def run(*vars):
|
|
44 |
'threshold': thresholds[k]
|
45 |
})
|
46 |
|
47 |
-
#
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
# Rewind the buffer to the beginning
|
51 |
video_buffer.seek(0)
|
|
|
44 |
'threshold': thresholds[k]
|
45 |
})
|
46 |
|
47 |
+
# Call refacer to process video and get refaced video path
|
48 |
+
refaced_video_path = refacer.reface(video_path, faces)
|
49 |
+
print(f"Refaced video can be found at {refaced_video_path}")
|
50 |
+
|
51 |
+
# Convert the output video to memory buffer
|
52 |
+
video_buffer = io.BytesIO()
|
53 |
+
with open(refaced_video_path, "rb") as f:
|
54 |
+
video_buffer.write(f.read())
|
55 |
|
56 |
# Rewind the buffer to the beginning
|
57 |
video_buffer.seek(0)
|