Spaces:
Running
Running
victorisgeek
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -7,10 +7,10 @@ import threading
|
|
7 |
# Initialize Refacer
|
8 |
def initialize_refacer():
|
9 |
global refacer
|
10 |
-
print("💊Initializing Refacer
|
11 |
start_time = time.time()
|
12 |
refacer = Refacer(force_cpu=False, colab_performance=False)
|
13 |
-
print(f"💚Refacer initialized in {time.time() - start_time:.2f} seconds
|
14 |
|
15 |
# Ngrok connection
|
16 |
def connect(token, port, options):
|
@@ -65,14 +65,14 @@ with gr.Blocks(theme='HaleyCH/HaleyCH_Theme') as demo:
|
|
65 |
with gr.Column(scale=10):
|
66 |
gr.Markdown("# 🧸Refacer")
|
67 |
with gr.Row():
|
68 |
-
video = gr.Video(label="👑Original video
|
69 |
-
video2 = gr.Video(label="💎Refaced video
|
70 |
|
71 |
for i in range(num_faces):
|
72 |
with gr.Tab(f"Face #{i + 1}"):
|
73 |
with gr.Row():
|
74 |
-
origin.append(gr.Image(label="🧲Face to replace
|
75 |
-
destination.append(gr.Image(label="📥Destination face
|
76 |
with gr.Row():
|
77 |
thresholds.append(gr.Slider(label="Threshold", minimum=0.0, maximum=1.0, value=0.2))
|
78 |
|
|
|
7 |
# Initialize Refacer
|
8 |
def initialize_refacer():
|
9 |
global refacer
|
10 |
+
print("💊Initializing Refacer...")
|
11 |
start_time = time.time()
|
12 |
refacer = Refacer(force_cpu=False, colab_performance=False)
|
13 |
+
print(f"💚Refacer initialized in {time.time() - start_time:.2f} seconds")
|
14 |
|
15 |
# Ngrok connection
|
16 |
def connect(token, port, options):
|
|
|
65 |
with gr.Column(scale=10):
|
66 |
gr.Markdown("# 🧸Refacer")
|
67 |
with gr.Row():
|
68 |
+
video = gr.Video(label="👑Original video", format="mp4")
|
69 |
+
video2 = gr.Video(label="💎Refaced video", interactive=False, format="mp4")
|
70 |
|
71 |
for i in range(num_faces):
|
72 |
with gr.Tab(f"Face #{i + 1}"):
|
73 |
with gr.Row():
|
74 |
+
origin.append(gr.Image(label="🧲Face to replace"))
|
75 |
+
destination.append(gr.Image(label="📥Destination face"))
|
76 |
with gr.Row():
|
77 |
thresholds.append(gr.Slider(label="Threshold", minimum=0.0, maximum=1.0, value=0.2))
|
78 |
|