Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,29 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
# Load the model
|
4 |
+
demo = gr.load("models/TDN-M/East-asian-beauty")
|
5 |
+
|
6 |
+
# Example images
|
7 |
+
examples = [
|
8 |
+
"ea1.png",
|
9 |
+
"ea2.png",
|
10 |
+
"ea3.png"
|
11 |
+
]
|
12 |
+
|
13 |
+
# Create a gallery to display example images
|
14 |
+
with gr.Row():
|
15 |
+
for example in examples:
|
16 |
+
with gr.Column():
|
17 |
+
gr.Image(value=example, shape=(512, 512)) # Adjust shape as needed
|
18 |
+
|
19 |
+
# Update the interface to include examples
|
20 |
+
demo = gr.Interface(
|
21 |
+
fn=demo.predict,
|
22 |
+
inputs=demo.input_components,
|
23 |
+
outputs=demo.output_components,
|
24 |
+
examples=examples,
|
25 |
+
title="TDN-M/East-asian-beauty",
|
26 |
+
description="Demo for TDN-M/East-asian-beauty model.",
|
27 |
+
)
|
28 |
+
|
29 |
+
demo.launch()
|