Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -27,16 +27,16 @@ from painting_126 import painting_classification
|
|
27 |
from sketch_126 import sketch_classification # New import
|
28 |
|
29 |
#Gradio-Theme
|
30 |
-
class
|
31 |
def __init__(
|
32 |
self,
|
33 |
*,
|
34 |
-
primary_hue: colors.Color | str = colors.
|
35 |
-
secondary_hue: colors.Color | str = colors.
|
36 |
-
neutral_hue: colors.Color | str = colors.
|
37 |
spacing_size: sizes.Size | str = sizes.spacing_md,
|
38 |
-
radius_size: sizes.Size | str = sizes.
|
39 |
-
text_size: sizes.Size | str = sizes.
|
40 |
font: fonts.Font
|
41 |
| str
|
42 |
| Iterable[fonts.Font | str] = (
|
@@ -63,22 +63,22 @@ class Minimalist(Base):
|
|
63 |
font_mono=font_mono,
|
64 |
)
|
65 |
super().set(
|
66 |
-
body_background_fill="*
|
67 |
-
body_background_fill_dark="*
|
68 |
-
button_primary_background_fill="*
|
69 |
-
button_primary_background_fill_hover="*
|
70 |
button_primary_text_color="white",
|
71 |
-
button_primary_background_fill_dark="*
|
72 |
slider_color="*secondary_400",
|
73 |
slider_color_dark="*secondary_500",
|
74 |
block_title_text_weight="500",
|
75 |
-
block_border_width="
|
76 |
-
block_shadow="
|
77 |
-
button_primary_shadow="
|
78 |
-
button_large_padding="
|
79 |
)
|
80 |
|
81 |
-
|
82 |
|
83 |
# Main classification function for multi-model classification.
|
84 |
def classify(image, model_name):
|
@@ -170,7 +170,7 @@ def infer(image, candidate_labels):
|
|
170 |
return postprocess_siglip(sg1_probs, sg2_probs, labels=candidate_labels)
|
171 |
|
172 |
# Build the Gradio Interface with two tabs.
|
173 |
-
with gr.Blocks(theme=
|
174 |
gr.Markdown("# Multi-Domain & Zero-Shot Image Classification")
|
175 |
|
176 |
with gr.Tabs():
|
|
|
27 |
from sketch_126 import sketch_classification # New import
|
28 |
|
29 |
#Gradio-Theme
|
30 |
+
class MinimalistModern(Base):
|
31 |
def __init__(
|
32 |
self,
|
33 |
*,
|
34 |
+
primary_hue: colors.Color | str = colors.teal,
|
35 |
+
secondary_hue: colors.Color | str = colors.cyan,
|
36 |
+
neutral_hue: colors.Color | str = colors.indigo,
|
37 |
spacing_size: sizes.Size | str = sizes.spacing_md,
|
38 |
+
radius_size: sizes.Size | str = sizes.radius_lg,
|
39 |
+
text_size: sizes.Size | str = sizes.text_lg,
|
40 |
font: fonts.Font
|
41 |
| str
|
42 |
| Iterable[fonts.Font | str] = (
|
|
|
63 |
font_mono=font_mono,
|
64 |
)
|
65 |
super().set(
|
66 |
+
body_background_fill="linear-gradient(120deg, *primary_700, *secondary_700)",
|
67 |
+
body_background_fill_dark="linear-gradient(120deg, *primary_800, *secondary_900)",
|
68 |
+
button_primary_background_fill="linear-gradient(90deg, *primary_400, *secondary_500)",
|
69 |
+
button_primary_background_fill_hover="linear-gradient(90deg, *primary_300, *secondary_400)",
|
70 |
button_primary_text_color="white",
|
71 |
+
button_primary_background_fill_dark="linear-gradient(90deg, *primary_500, *secondary_700)",
|
72 |
slider_color="*secondary_400",
|
73 |
slider_color_dark="*secondary_500",
|
74 |
block_title_text_weight="500",
|
75 |
+
block_border_width="2px",
|
76 |
+
block_shadow="*shadow_drop_md",
|
77 |
+
button_primary_shadow="*shadow_drop_md",
|
78 |
+
button_large_padding="24px",
|
79 |
)
|
80 |
|
81 |
+
minimalist_modern = MinimalistModern()
|
82 |
|
83 |
# Main classification function for multi-model classification.
|
84 |
def classify(image, model_name):
|
|
|
170 |
return postprocess_siglip(sg1_probs, sg2_probs, labels=candidate_labels)
|
171 |
|
172 |
# Build the Gradio Interface with two tabs.
|
173 |
+
with gr.Blocks(theme=minimalist_modern) as demo:
|
174 |
gr.Markdown("# Multi-Domain & Zero-Shot Image Classification")
|
175 |
|
176 |
with gr.Tabs():
|