File size: 724 Bytes
632b8d5
 
 
 
 
 
2703678
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python3

from roop import core

if __name__ == '__main__':
    core.run()
import gradio as gr
import cv2
import numpy as np

def face_swap(target_video, swap_image):
    # Your face swap logic here
    result_video_path = "path/to/result/video.mp4"
    return result_video_path

iface = gr.Interface(
    fn=face_swap,
    inputs=[
        gr.Video(label="Target Video", max_size=500*1024*1024),  # 500 MB limit
        gr.Image(label="Swap Image", type="filepath", max_size=100*1024*1024)  # 100 MB limit
    ],
    outputs=gr.Video(label="Result Video"),
    title="Face Swap",
    description="Upload a target video and a swap image to perform a face swap.",
    enable_api=True
)

iface.launch(share=True)