Ii commited on
Commit
5ac550f
·
verified ·
1 Parent(s): b017463

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -44,8 +44,14 @@ def run(*vars):
44
  'threshold': thresholds[k]
45
  })
46
 
47
- # Process the video and get refaced video as memory buffer
48
- video_buffer = refacer.reface(video_path, faces, output_memory=True)
 
 
 
 
 
 
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)