aheedsajid commited on
Commit
a29c6ad
·
verified ·
1 Parent(s): 660d963

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -16
app.py CHANGED
@@ -1,4 +1,4 @@
1
- # -*- coding: UTF-8 -*-
2
  # !/usr/bin/env python
3
  import numpy as np
4
  import gradio as gr
@@ -14,9 +14,7 @@ from roop.utilities import normalize_output_path
14
  import os
15
  from PIL import Image
16
 
17
-
18
  def swap_face(source_file, target_file, doFaceEnhancer):
19
-
20
  source_path = "input.jpg"
21
  target_path = "target.jpg"
22
 
@@ -65,26 +63,22 @@ def swap_face(source_file, target_file, doFaceEnhancer):
65
  start()
66
  return output_path
67
 
 
 
 
68
 
69
- # Define HTML banners
70
- banner1 = gr.HTML("<h1>Welcome to the Face Swap App</h1>")
71
- banner2 = gr.HTML("<h2>Upload your source and target images below</h2>")
72
- banner3 = gr.HTML("<p>Check the box if you want to use the face enhancer feature</p>")
73
-
74
- # Define the interface with HTML banners
75
  app = gr.Interface(
76
  fn=swap_face,
77
  inputs=[
78
- banner1,
79
- banner2,
80
  gr.Image(label="Source Image"),
81
  gr.Image(label="Target Image"),
82
  gr.Checkbox(label="Face Enhancer?", info="Do face enhancer?")
83
  ],
84
- outputs="image",
85
- live=False,
86
- title="Face Swap Application",
87
- description="A simple app to swap faces between two images"
 
88
  )
89
-
90
  app.launch()
 
1
+ # -* coding:UTF-8 -*
2
  # !/usr/bin/env python
3
  import numpy as np
4
  import gradio as gr
 
14
  import os
15
  from PIL import Image
16
 
 
17
  def swap_face(source_file, target_file, doFaceEnhancer):
 
18
  source_path = "input.jpg"
19
  target_path = "target.jpg"
20
 
 
63
  start()
64
  return output_path
65
 
66
+ html1 = "<h1>Welcome to Face Swap App</h1>"
67
+ html2 = "<p>This app allows you to swap faces in images. Upload your source and target images, and optionally enable face enhancement.</p>"
68
+ html3 = "<footer>Created by Your Name</footer>"
69
 
 
 
 
 
 
 
70
  app = gr.Interface(
71
  fn=swap_face,
72
  inputs=[
73
+ gr.HTML(html1),
 
74
  gr.Image(label="Source Image"),
75
  gr.Image(label="Target Image"),
76
  gr.Checkbox(label="Face Enhancer?", info="Do face enhancer?")
77
  ],
78
+ outputs=[
79
+ gr.HTML(html2),
80
+ "image",
81
+ gr.HTML(html3)
82
+ ]
83
  )
 
84
  app.launch()