victorisgeek commited on
Commit
c4757ef
β€’
1 Parent(s): 68117be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
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):
@@ -63,21 +63,21 @@ dropdown, js = create_theme_dropdown()
63
  with gr.Blocks(theme='finlaymacklon/boxy_violet') as demo:
64
  with gr.Row(equal_height=True):
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
 
79
  with gr.Row():
80
- button = gr.Button("πŸ’«Reface", variant="primary")
81
 
82
  button.click(fn=run, inputs=[video] + origin + destination + thresholds, outputs=[video2])
83
 
 
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):
 
63
  with gr.Blocks(theme='finlaymacklon/boxy_violet') as demo:
64
  with gr.Row(equal_height=True):
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
 
79
  with gr.Row():
80
+ button = gr.Button("πŸ’½RefaceπŸ’½", variant="primary")
81
 
82
  button.click(fn=run, inputs=[video] + origin + destination + thresholds, outputs=[video2])
83