JarvisLabs commited on
Commit
da73f82
1 Parent(s): 3cafa7f

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +5 -2
  2. cloth_ip_adapter.py +0 -0
  3. faceswap_tab.py +26 -0
app.py CHANGED
@@ -2,11 +2,12 @@ import gradio as gr
2
  from gen_tab import create_gen_tab
3
  from train_tab import create_train_tab
4
  from virtualtryon_tab import create_virtualtryon_tab
5
- #from faceswap_tab import create_faceswap_tab
6
-
7
  from dotenv import load_dotenv, find_dotenv
8
  import os
9
 
 
10
  _ = load_dotenv(find_dotenv())
11
  with gr.Blocks(theme=gr.themes.Soft(
12
  radius_size=gr.themes.sizes.radius_none,
@@ -16,6 +17,8 @@ with gr.Blocks(theme=gr.themes.Soft(
16
  with gr.Tabs() as tabs:
17
  create_gen_tab()
18
  create_virtualtryon_tab()
 
 
19
  create_train_tab()
20
 
21
 
 
2
  from gen_tab import create_gen_tab
3
  from train_tab import create_train_tab
4
  from virtualtryon_tab import create_virtualtryon_tab
5
+ from faceswap_tab import create_faceswap_tab
6
+ from ipadapter_tab import create_ipadaptor_tab
7
  from dotenv import load_dotenv, find_dotenv
8
  import os
9
 
10
+
11
  _ = load_dotenv(find_dotenv())
12
  with gr.Blocks(theme=gr.themes.Soft(
13
  radius_size=gr.themes.sizes.radius_none,
 
17
  with gr.Tabs() as tabs:
18
  create_gen_tab()
19
  create_virtualtryon_tab()
20
+ create_faceswap_tab()
21
+ create_ipadaptor_tab()
22
  create_train_tab()
23
 
24
 
cloth_ip_adapter.py ADDED
File without changes
faceswap_tab.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from src.fal_api import fal_faceswap_api
3
+
4
+ def create_faceswap_tab():
5
+ with gr.TabItem("Face Swap",id="face_swap"):
6
+ with gr.Row():
7
+ with gr.Column():
8
+ fs_base_inp = gr.Image(label="Base Image")
9
+ with gr.Column():
10
+ face_image = gr.Image(label="Face Image")
11
+ with gr.Row():
12
+ face_btn = gr.Button("Process")
13
+
14
+ with gr.Row():
15
+ face_out = gr.Image(label="Output",type="filepath")
16
+
17
+ with gr.Row():
18
+ examples = gr.Examples(
19
+ examples=[
20
+ [ "Test_images/person_2.jpg", "Test_images/person_1.jpg"],
21
+ ],
22
+ inputs=[ fs_base_inp,face_image]
23
+ )
24
+
25
+ face_btn.click(fal_faceswap_api,inputs=[fs_base_inp,face_image],outputs=face_out)
26
+