Update app.py
Browse files
app.py
CHANGED
|
@@ -5,18 +5,7 @@ from __future__ import annotations
|
|
| 5 |
import gradio as gr
|
| 6 |
import torch
|
| 7 |
|
| 8 |
-
#from app_canny import create_demo as create_demo_canny
|
| 9 |
from app_depth import create_demo as create_demo_depth
|
| 10 |
-
#from app_ip2p import create_demo as create_demo_ip2p
|
| 11 |
-
#from app_lineart import create_demo as create_demo_lineart
|
| 12 |
-
#from app_mlsd import create_demo as create_demo_mlsd
|
| 13 |
-
#from app_normal import create_demo as create_demo_normal
|
| 14 |
-
#from app_openpose import create_demo as create_demo_openpose
|
| 15 |
-
#from app_scribble import create_demo as create_demo_scribble
|
| 16 |
-
#from app_scribble_interactive import create_demo as create_demo_scribble_interactive
|
| 17 |
-
#from app_segmentation import create_demo as create_demo_segmentation
|
| 18 |
-
#from app_shuffle import create_demo as create_demo_shuffle
|
| 19 |
-
#from app_softedge import create_demo as create_demo_softedge
|
| 20 |
from model import Model
|
| 21 |
from settings import ALLOW_CHANGING_BASE_MODEL, DEFAULT_MODEL_ID, SHOW_DUPLICATE_BUTTON
|
| 22 |
|
|
@@ -35,48 +24,11 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 35 |
visible=SHOW_DUPLICATE_BUTTON,
|
| 36 |
)
|
| 37 |
|
| 38 |
-
#with gr.TabbedInterface():
|
| 39 |
-
#with gr.Tab("Canny"):
|
| 40 |
-
# create_demo_canny(model.process_canny)
|
| 41 |
-
#with gr.Tab("MLSD"):
|
| 42 |
-
# create_demo_mlsd(model.process_mlsd)
|
| 43 |
-
#with gr.Tab("Scribble"):
|
| 44 |
-
# create_demo_scribble(model.process_scribble)
|
| 45 |
-
# with gr.Tab("Scribble Interactive"):
|
| 46 |
-
# create_demo_scribble_interactive(model.process_scribble_interactive)
|
| 47 |
-
#with gr.Tab("SoftEdge"):
|
| 48 |
-
# create_demo_softedge(model.process_softedge)
|
| 49 |
-
#with gr.Tab("OpenPose"):
|
| 50 |
-
# create_demo_openpose(model.process_openpose)
|
| 51 |
-
#with gr.Tab("Segmentation"):
|
| 52 |
-
# create_demo_segmentation(model.process_segmentation)
|
| 53 |
-
#with gr.Tab("Depth"):
|
| 54 |
-
# create_demo_depth(model.process_depth)
|
| 55 |
-
#with gr.Tab("Normal map"):
|
| 56 |
-
# create_demo_normal(model.process_normal)
|
| 57 |
-
#with gr.Tab("Lineart"):
|
| 58 |
-
# create_demo_lineart(model.process_lineart)
|
| 59 |
-
#with gr.Tab("Content Shuffle"):
|
| 60 |
-
# create_demo_shuffle(model.process_shuffle)
|
| 61 |
-
#with gr.Tab("Instruct Pix2Pix"):
|
| 62 |
-
# create_demo_ip2p(model.process_ip2p)
|
| 63 |
-
|
| 64 |
interfaces = [
|
| 65 |
-
|
| 66 |
-
#gr.Interface(fn=model.process_mlsd, inputs=[], outputs=[], live=False, name="MLSD"),
|
| 67 |
-
#gr.Interface(fn=model.process_scribble, inputs=[], outputs=[], live=False, name="Scribble"),
|
| 68 |
-
# gr.Interface(fn=model.process_scribble_interactive, inputs=[], outputs=[], live=False, name="Scribble Interactive"),
|
| 69 |
-
#gr.Interface(fn=model.process_softedge, inputs=[], outputs=[], live=False, name="SoftEdge"),
|
| 70 |
-
#gr.Interface(fn=model.process_openpose, inputs=[], outputs=[], live=False, name="OpenPose"),
|
| 71 |
-
#gr.Interface(fn=model.process_segmentation, inputs=[], outputs=[], live=False, name="Segmentation"),
|
| 72 |
-
gr.Interface(fn=model.process_depth, inputs=[], outputs=[], live=False, name="Depth"),
|
| 73 |
-
#gr.Interface(fn=model.process_normal, inputs=[], outputs=[], live=False, name="Normal map"),
|
| 74 |
-
#gr.Interface(fn=model.process_lineart, inputs=[], outputs=[], live=False, name="Lineart"),
|
| 75 |
-
#gr.Interface(fn=model.process_shuffle, inputs=[], outputs=[], live=False, name="Content Shuffle"),
|
| 76 |
-
#gr.Interface(fn=model.process_ip2p, inputs=[], outputs=[], live=False, name="Instruct Pix2Pix")
|
| 77 |
]
|
| 78 |
|
| 79 |
-
gr.TabbedInterface(interface_list=interfaces,
|
| 80 |
|
| 81 |
with gr.Accordion(label="Base model", open=False):
|
| 82 |
with gr.Row():
|
|
|
|
| 5 |
import gradio as gr
|
| 6 |
import torch
|
| 7 |
|
|
|
|
| 8 |
from app_depth import create_demo as create_demo_depth
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
from model import Model
|
| 10 |
from settings import ALLOW_CHANGING_BASE_MODEL, DEFAULT_MODEL_ID, SHOW_DUPLICATE_BUTTON
|
| 11 |
|
|
|
|
| 24 |
visible=SHOW_DUPLICATE_BUTTON,
|
| 25 |
)
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
interfaces = [
|
| 28 |
+
gr.Interface(fn=model.process_depth, inputs=[], outputs=[], live=False),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
]
|
| 30 |
|
| 31 |
+
gr.TabbedInterface(interface_list=interfaces, tab_names=["Depth"])
|
| 32 |
|
| 33 |
with gr.Accordion(label="Base model", open=False):
|
| 34 |
with gr.Row():
|