Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -27,23 +27,23 @@ 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.
|
38 |
-
radius_size: sizes.Size | str = sizes.
|
39 |
-
text_size: sizes.Size | str = sizes.
|
40 |
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
41 |
-
fonts.GoogleFont("
|
42 |
"ui-sans-serif",
|
43 |
"sans-serif",
|
44 |
),
|
45 |
font_mono: fonts.Font | str | Iterable[fonts.Font | str] = (
|
46 |
-
fonts.GoogleFont("
|
47 |
"ui-monospace",
|
48 |
"monospace",
|
49 |
),
|
@@ -59,23 +59,27 @@ class MinimalMinimal(Base):
|
|
59 |
font_mono=font_mono,
|
60 |
)
|
61 |
super().set(
|
62 |
-
|
63 |
-
|
|
|
|
|
64 |
button_primary_background_fill="linear-gradient(90deg, *primary_200, *secondary_200)",
|
65 |
-
button_primary_background_fill_hover="linear-gradient(90deg, *
|
66 |
-
button_primary_text_color="white",
|
67 |
-
button_primary_background_fill_dark="linear-gradient(90deg, *
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
|
|
|
|
|
|
74 |
button_large_padding="24px",
|
75 |
)
|
76 |
|
77 |
-
|
78 |
-
|
79 |
|
80 |
# Main classification function for multi-model classification.
|
81 |
def classify(image, model_name):
|
@@ -167,7 +171,7 @@ def infer(image, candidate_labels):
|
|
167 |
return postprocess_siglip(sg1_probs, sg2_probs, labels=candidate_labels)
|
168 |
|
169 |
# Build the Gradio Interface with two tabs.
|
170 |
-
with gr.Blocks(theme=
|
171 |
gr.Markdown("# Multi-Domain & Zero-Shot Image Classification")
|
172 |
|
173 |
with gr.Tabs():
|
|
|
27 |
from sketch_126 import sketch_classification # New import
|
28 |
|
29 |
#Gradio-Theme
|
30 |
+
class MinimalModern(Base):
|
31 |
def __init__(
|
32 |
self,
|
33 |
*,
|
34 |
+
primary_hue: colors.Color | str = colors.cyan,
|
35 |
+
secondary_hue: colors.Color | str = colors.lime,
|
36 |
+
neutral_hue: colors.Color | str = colors.beige,
|
37 |
+
spacing_size: sizes.Size | str = sizes.spacing_md,
|
38 |
+
radius_size: sizes.Size | str = sizes.radius_md,
|
39 |
+
text_size: sizes.Size | str = sizes.text_lg,
|
40 |
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
41 |
+
fonts.GoogleFont("Quicksand"),
|
42 |
"ui-sans-serif",
|
43 |
"sans-serif",
|
44 |
),
|
45 |
font_mono: fonts.Font | str | Iterable[fonts.Font | str] = (
|
46 |
+
fonts.GoogleFont("IBM Plex Mono"),
|
47 |
"ui-monospace",
|
48 |
"monospace",
|
49 |
),
|
|
|
59 |
font_mono=font_mono,
|
60 |
)
|
61 |
super().set(
|
62 |
+
# Use soft, repeating gradients with light primary shades
|
63 |
+
body_background_fill="repeating-linear-gradient(45deg, *primary_100, *primary_100 10px, *primary_50 10px, *primary_50 20px)",
|
64 |
+
body_background_fill_dark="repeating-linear-gradient(45deg, *primary_200, *primary_200 10px, *primary_150 10px, *primary_150 20px)",
|
65 |
+
# Minimal gradients for primary buttons
|
66 |
button_primary_background_fill="linear-gradient(90deg, *primary_200, *secondary_200)",
|
67 |
+
button_primary_background_fill_hover="linear-gradient(90deg, *primary_150, *secondary_150)",
|
68 |
+
button_primary_text_color="white", # Contrast with the light hues
|
69 |
+
button_primary_background_fill_dark="linear-gradient(90deg, *primary_250, *secondary_250)",
|
70 |
+
# Subtle slider colors in light secondary shades
|
71 |
+
slider_color="*secondary_150",
|
72 |
+
slider_color_dark="*secondary_250",
|
73 |
+
# Minimal borders and shadows
|
74 |
+
block_title_text_weight="600",
|
75 |
+
block_border_width="2px",
|
76 |
+
block_shadow="*shadow_drop_sm",
|
77 |
+
button_primary_shadow="*shadow_drop_sm",
|
78 |
+
# Reduced padding for a cleaner look
|
79 |
button_large_padding="24px",
|
80 |
)
|
81 |
|
82 |
+
minimal_modern = MinimalModern()
|
|
|
83 |
|
84 |
# Main classification function for multi-model classification.
|
85 |
def classify(image, model_name):
|
|
|
171 |
return postprocess_siglip(sg1_probs, sg2_probs, labels=candidate_labels)
|
172 |
|
173 |
# Build the Gradio Interface with two tabs.
|
174 |
+
with gr.Blocks(theme=minimal_modern) as demo:
|
175 |
gr.Markdown("# Multi-Domain & Zero-Shot Image Classification")
|
176 |
|
177 |
with gr.Tabs():
|