Spaces:
Runtime error
Runtime error
Update run.py
Browse files
run.py
CHANGED
|
@@ -4,3 +4,25 @@ from roop import core
|
|
| 4 |
|
| 5 |
if __name__ == '__main__':
|
| 6 |
core.run()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
if __name__ == '__main__':
|
| 6 |
core.run()
|
| 7 |
+
import gradio as gr
|
| 8 |
+
import cv2
|
| 9 |
+
import numpy as np
|
| 10 |
+
|
| 11 |
+
def face_swap(target_video, swap_image):
|
| 12 |
+
# Your face swap logic here
|
| 13 |
+
result_video_path = "path/to/result/video.mp4"
|
| 14 |
+
return result_video_path
|
| 15 |
+
|
| 16 |
+
iface = gr.Interface(
|
| 17 |
+
fn=face_swap,
|
| 18 |
+
inputs=[
|
| 19 |
+
gr.Video(label="Target Video", max_size=500*1024*1024), # 500 MB limit
|
| 20 |
+
gr.Image(label="Swap Image", type="filepath", max_size=100*1024*1024) # 100 MB limit
|
| 21 |
+
],
|
| 22 |
+
outputs=gr.Video(label="Result Video"),
|
| 23 |
+
title="Face Swap",
|
| 24 |
+
description="Upload a target video and a swap image to perform a face swap.",
|
| 25 |
+
enable_api=True
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
iface.launch(share=True)
|