benner3000 commited on
Commit
ec4c855
·
verified ·
1 Parent(s): e1c4115

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -52
app.py CHANGED
@@ -14,40 +14,8 @@ from roop.utilities import normalize_output_path
14
  import os
15
  from PIL import Image
16
 
17
- # Loader HTML and CSS
18
- loader_html = """
19
- <div id="loader" style="
20
- position: fixed;
21
- top: 0;
22
- left: 0;
23
- width: 100%;
24
- height: 100%;
25
- background: rgba(255, 255, 255, 0.9);
26
- display: flex;
27
- justify-content: center;
28
- align-items: center;
29
- z-index: 1000;
30
- ">
31
- <div class="spinner" style="
32
- width: 50px;
33
- height: 50px;
34
- border: 4px solid #f3f3f3;
35
- border-top: 4px solid #3498db;
36
- border-radius: 50%;
37
- animation: spin 1s linear infinite;
38
- "></div>
39
- </div>
40
-
41
- <style>
42
- @keyframes spin {
43
- 0% { transform: rotate(0deg); }
44
- 100% { transform: rotate(360deg); }
45
- }
46
- </style>
47
- """
48
-
49
  article_text = """
50
- <div style="text-align: center; font-size: 1 rem;">
51
  <p>Leer zelf Generative AI-tools te bouwen en te begrijpen!</p>
52
  <a href="https://www.glossybranding.com/masterclass">Schrijf je in voor de AI Masterclass</a>
53
  </div>
@@ -55,13 +23,7 @@ article_text = """
55
 
56
 
57
  def swap_face(source_file, target_file,doFaceEnhancer):
58
- # Show the loader
59
- display_loader = """
60
- <script>
61
- document.getElementById('loader').style.display = 'flex';
62
- </script>
63
- """
64
-
65
  source_path = "input.jpg"
66
  target_path = "target.jpg"
67
 
@@ -108,15 +70,7 @@ def swap_face(source_file, target_file,doFaceEnhancer):
108
  return
109
 
110
  start()
111
-
112
- # Hide the loader
113
- hide_loader = """
114
- <script>
115
- document.getElementById('loader').style.display = 'none';
116
- </script>
117
- """
118
-
119
- return output_path, hide_loader
120
 
121
 
122
  app = gr.Interface(
@@ -125,10 +79,10 @@ app = gr.Interface(
125
  gr.Image(),
126
  gr.Checkbox(label="face_enhancer?",
127
  info="do face enhancer?")],
128
- outputs=["image", "html"], # Add "html" as a second output
129
- article=article_text,
130
  allow_flagging="never"
131
  )
132
  app.launch(
133
- show_api=False, preprocess_html=loader_html
134
  )
 
14
  import os
15
  from PIL import Image
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  article_text = """
18
+ <div style="text-align: center;">
19
  <p>Leer zelf Generative AI-tools te bouwen en te begrijpen!</p>
20
  <a href="https://www.glossybranding.com/masterclass">Schrijf je in voor de AI Masterclass</a>
21
  </div>
 
23
 
24
 
25
  def swap_face(source_file, target_file,doFaceEnhancer):
26
+
 
 
 
 
 
 
27
  source_path = "input.jpg"
28
  target_path = "target.jpg"
29
 
 
70
  return
71
 
72
  start()
73
+ return output_path
 
 
 
 
 
 
 
 
74
 
75
 
76
  app = gr.Interface(
 
79
  gr.Image(),
80
  gr.Checkbox(label="face_enhancer?",
81
  info="do face enhancer?")],
82
+ outputs="image",
83
+ article=article_text,
84
  allow_flagging="never"
85
  )
86
  app.launch(
87
+ show_api=False
88
  )