Spaces:
Running
Running
Commit
·
828ac4c
1
Parent(s):
92c1311
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,28 +8,7 @@ import time
|
|
| 8 |
import shutil
|
| 9 |
|
| 10 |
os.makedirs("./output", exist_ok=True)
|
| 11 |
-
htmlcb= """
|
| 12 |
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
| 13 |
-
<center><a href="https://codegenius.me">DeepFakeAI 2.0.1</a></center>
|
| 14 |
-
<div class="social-icons" style="padding:30px; background-color:#00506b; text-align:center;">
|
| 15 |
-
<a href="https://www.facebook.com/octaeldrith" title="facebook" style="color:#fff; line-height:30px; font-size:30px; margin:0 5px; text-decoration:none;">
|
| 16 |
-
<i class="fa fa-facebook-square" aria-hidden="true" style="line-height:30px; font-size:30px; -webkit-transition:all 200ms ease-in; -webkit-transform:scale(1); -ms-transition:all 200ms ease-in; -ms-transform:scale(1); -moz-transition:all 200ms ease-in; -moz-transform:scale(1); transition:all 200ms ease-in; transform:scale(1);"></i>
|
| 17 |
-
</a>
|
| 18 |
-
<a href="https://twitter.com/ims_eldrith" title="twitter" style="color:#fff; line-height:30px; font-size:30px; margin:0 5px; text-decoration:none;">
|
| 19 |
-
<i class="fa fa-twitter-square" aria-hidden="true" style="line-height:30px; font-size:30px; -webkit-transition:all 200ms ease-in; -webkit-transform:scale(1); -ms-transition:all 200ms ease-in; -ms-transform:scale(1); -moz-transition:all 200ms ease-in; -moz-transform:scale(1); transition:all 200ms ease-in; transform:scale(1);"></i>
|
| 20 |
-
</a>
|
| 21 |
-
<a href="https://instagram.com/ims_eldrith" title="instagram" style="color:#fff; line-height:30px; font-size:30px; margin:0 5px; text-decoration:none;">
|
| 22 |
-
<i class="fa fa-instagram" aria-hidden="true" style="line-height:30px; font-size:30px; -webkit-transition:all 200ms ease-in; -webkit-transform:scale(1); -ms-transition:all 200ms ease-in; -ms-transform:scale(1); -moz-transition:all 200ms ease-in; -moz-transform:scale(1); transition:all 200ms ease-in; transform:scale(1);"></i>
|
| 23 |
-
</a>
|
| 24 |
-
<a href="https://linkedin.com/in/ashiq-hussain" title="linkedin" style="color:#fff; line-height:30px; font-size:30px; margin:0 5px; text-decoration:none;">
|
| 25 |
-
<i class="fa fa-linkedin-square" aria-hidden="true" style="line-height:30px; font-size:30px; -webkit-transition:all 200ms ease-in; -webkit-transform:scale(1); -ms-transition:all 200ms ease-in; -ms-transform:scale(1); -moz-transition:all 200ms ease-in; -moz-transform:scale(1); transition:all 200ms ease-in; transform:scale(1);"></i>
|
| 26 |
-
</a>
|
| 27 |
-
<a href="https://www.pinterest.com/ims_eldrith" title="pinterest" style="color:#fff; line-height:30px; font-size:30px; margin:0 5px; text-decoration:none;">
|
| 28 |
-
<i class="fa fa-pinterest-p" aria-hidden="true" style="line-height:30px; font-size:30px; -webkit-transition:all 200ms ease-in; -webkit-transform:scale(1); -ms-transition:all 200ms ease-in; -ms-transform:scale(1); -moz-transition:all 200ms ease-in; -moz-transform:scale(1); transition:all 200ms ease-in; transform:scale(1);"></i>
|
| 29 |
-
</a>
|
| 30 |
-
</div>
|
| 31 |
|
| 32 |
-
"""
|
| 33 |
def run(*args):
|
| 34 |
source, target, unique_id, frame_processor_checkbox, face_swapper_model_dropdown, face_enhancer_model_dropdown, frame_enhancer_model_dropdown, face_debugger_items_checkbox, face_analyser_direction_dropdown, face_analyser_age_dropdown, face_analyser_gender_dropdown, face_mask_type_checkbox, *video_args = args
|
| 35 |
if not os.path.exists(source):
|
|
@@ -175,6 +154,29 @@ def get_css() -> str:
|
|
| 175 |
}
|
| 176 |
"""
|
| 177 |
return fixes_css + overrides_css
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
|
| 179 |
def get_theme() -> gradio.Theme:
|
| 180 |
return gradio.themes.Base(
|
|
@@ -300,8 +302,8 @@ with gr.Blocks(theme=get_theme(), css=get_css(), title="DeepFakeAI 2.0.1") as ui
|
|
| 300 |
interactive=True )
|
| 301 |
unique_id = gr.Textbox(value=str(uuid.uuid4()), visible=False)
|
| 302 |
with gr.Tab("Image: "):
|
| 303 |
-
source_image = gr.Image(type="filepath", label="SOURCE IMAGE", sources=["upload", "webcam", "clipboard"])
|
| 304 |
-
target_image = gr.Image(type="filepath", label="TARGET IMAGE", sources=["upload", "webcam", "clipboard"])
|
| 305 |
image_button = gr.Button("START")
|
| 306 |
clear_button = gr.ClearButton(value="CLEAR")
|
| 307 |
image_output = gr.Image(label="OUTPUT")
|
|
@@ -315,7 +317,7 @@ with gr.Blocks(theme=get_theme(), css=get_css(), title="DeepFakeAI 2.0.1") as ui
|
|
| 315 |
clear_button.click(fn=clear_output, inputs=unique_id)
|
| 316 |
|
| 317 |
with gr.Tab("Video: "):
|
| 318 |
-
source_image_video = gr.Image(type="filepath", label="SOURCE IMAGE", sources=["upload", "webcam", "clipboard"])
|
| 319 |
target_video = gr.Video(label="TARGET VIDEO", sources=["upload"])
|
| 320 |
with gr.Row():
|
| 321 |
skip_audio = gr.Checkbox(label="SKIP AUDIO")
|
|
|
|
| 8 |
import shutil
|
| 9 |
|
| 10 |
os.makedirs("./output", exist_ok=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
|
|
|
| 12 |
def run(*args):
|
| 13 |
source, target, unique_id, frame_processor_checkbox, face_swapper_model_dropdown, face_enhancer_model_dropdown, frame_enhancer_model_dropdown, face_debugger_items_checkbox, face_analyser_direction_dropdown, face_analyser_age_dropdown, face_analyser_gender_dropdown, face_mask_type_checkbox, *video_args = args
|
| 14 |
if not os.path.exists(source):
|
|
|
|
| 154 |
}
|
| 155 |
"""
|
| 156 |
return fixes_css + overrides_css
|
| 157 |
+
htmlcb= """
|
| 158 |
+
<div style="color:#FF0000; background-color:#000; font-size:35px; font-weight:bold; text-align:center;">
|
| 159 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
| 160 |
+
<a href="https://codegenius.me" style="color:#FF0000; -webkit-transition: color 200ms ease-in-out; transition: color 200ms ease-in-out; text-decoration: none;">DeepFakeAI 2.0.1</a>
|
| 161 |
+
</div>
|
| 162 |
+
<div class="social-icons" style="padding:30px; background-color:#000; text-align:center;">
|
| 163 |
+
<a href="https://www.facebook.com/octaeldrith" title="facebook" style="color:#FF0000; line-height:30px; font-size:30px; margin:0 5px; text-decoration:none;">
|
| 164 |
+
<i class="fa fa-facebook-square" aria-hidden="true" style="line-height:30px; font-size:30px; -webkit-transition: all 200ms ease-in-out; transition: all 200ms ease-in-out;"></i>
|
| 165 |
+
</a>
|
| 166 |
+
<a href="https://twitter.com/ims_eldrith" title="twitter" style="color:#FF0000; line-height:30px; font-size:30px; margin:0 5px; text-decoration:none;">
|
| 167 |
+
<i class="fa fa-twitter-square" aria-hidden="true" style="line-height:30px; font-size:30px; -webkit-transition: all 200ms ease-in-out; transition: all 200ms ease-in-out;"></i>
|
| 168 |
+
</a>
|
| 169 |
+
<a href="https://instagram.com/ims_eldrith" title="instagram" style="color:#FF0000; line-height:30px; font-size:30px; margin:0 5px; text-decoration:none;">
|
| 170 |
+
<i class="fa fa-instagram" aria-hidden="true" style="line-height:30px; font-size:30px; -webkit-transition: all 200ms ease-in-out; transition: all 200ms ease-in-out;"></i>
|
| 171 |
+
</a>
|
| 172 |
+
<a href="https://linkedin.com/in/ashiq-hussain" title="linkedin" style="color:#FF0000; line-height:30px; font-size:30px; margin:0 5px; text-decoration:none;">
|
| 173 |
+
<i class="fa fa-linkedin-square" aria-hidden="true" style="line-height:30px; font-size:30px; -webkit-transition: all 200ms ease-in-out; transition: all 200ms ease-in-out;"></i>
|
| 174 |
+
</a>
|
| 175 |
+
<a href="https://www.pinterest.com/ims_eldrith" title="pinterest" style="color:#FF0000; line-height:30px; font-size:30px; margin:0 5px; text-decoration:none;">
|
| 176 |
+
<i class="fa fa-pinterest-p" aria-hidden="true" style="line-height:30px; font-size:30px; -webkit-transition: all 200ms ease-in-out; transition: all 200ms ease-in-out;"></i>
|
| 177 |
+
</a>
|
| 178 |
+
</div>
|
| 179 |
+
"""
|
| 180 |
|
| 181 |
def get_theme() -> gradio.Theme:
|
| 182 |
return gradio.themes.Base(
|
|
|
|
| 302 |
interactive=True )
|
| 303 |
unique_id = gr.Textbox(value=str(uuid.uuid4()), visible=False)
|
| 304 |
with gr.Tab("Image: "):
|
| 305 |
+
source_image = gr.Image(type="filepath", label="SOURCE IMAGE",)# sources=["upload", "webcam", "clipboard"])
|
| 306 |
+
target_image = gr.Image(type="filepath", label="TARGET IMAGE",)# sources=["upload", "webcam", "clipboard"])
|
| 307 |
image_button = gr.Button("START")
|
| 308 |
clear_button = gr.ClearButton(value="CLEAR")
|
| 309 |
image_output = gr.Image(label="OUTPUT")
|
|
|
|
| 317 |
clear_button.click(fn=clear_output, inputs=unique_id)
|
| 318 |
|
| 319 |
with gr.Tab("Video: "):
|
| 320 |
+
source_image_video = gr.Image(type="filepath", label="SOURCE IMAGE",)# sources=["upload", "webcam", "clipboard"])
|
| 321 |
target_video = gr.Video(label="TARGET VIDEO", sources=["upload"])
|
| 322 |
with gr.Row():
|
| 323 |
skip_audio = gr.Checkbox(label="SKIP AUDIO")
|