Spaces:
Runtime error
Runtime error
chore: add descriptions
Browse files
app.py
CHANGED
@@ -29,28 +29,42 @@ def predict(image: Image.Image) -> list[dict[str, float]]:
|
|
29 |
|
30 |
def construct_ui():
|
31 |
with gr.Blocks() as ui:
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
with gr.
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
submit_btn.click(
|
56 |
predict, inputs=[input_image], outputs=[result_salt, result_cafe]
|
|
|
29 |
|
30 |
def construct_ui():
|
31 |
with gr.Blocks() as ui:
|
32 |
+
gr.Markdown(
|
33 |
+
"""
|
34 |
+
|
35 |
+
# Waifu Aesthetics
|
36 |
+
|
37 |
+
Original model repos:
|
38 |
+
|
39 |
+
- https://huggingface.co/saltacc/beit-bestimage-salt
|
40 |
+
- https://huggingface.co/cafeai/cafe_aesthetic
|
41 |
+
|
42 |
+
"""
|
43 |
+
)
|
44 |
+
|
45 |
+
with gr.Column():
|
46 |
+
with gr.Row():
|
47 |
+
with gr.Column():
|
48 |
+
input_image = gr.Image(
|
49 |
+
label="Input Image",
|
50 |
+
type="pil",
|
51 |
+
source="upload",
|
52 |
+
interactive=True,
|
53 |
+
)
|
54 |
+
|
55 |
+
submit_btn = gr.Button(
|
56 |
+
value="Submit",
|
57 |
+
variant="primary",
|
58 |
+
)
|
59 |
+
|
60 |
+
with gr.Column():
|
61 |
+
result_salt = gr.Label(
|
62 |
+
label=MODEL_SALT_BESTIMAGE,
|
63 |
+
)
|
64 |
+
|
65 |
+
result_cafe = gr.Label(
|
66 |
+
label=MODEL_CAFE_AESTHETIC,
|
67 |
+
)
|
68 |
|
69 |
submit_btn.click(
|
70 |
predict, inputs=[input_image], outputs=[result_salt, result_cafe]
|