Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -26,28 +26,28 @@ from multisource_121 import multisource_classification
|
|
26 |
from painting_126 import painting_classification
|
27 |
from sketch_126 import sketch_classification # New import
|
28 |
|
29 |
-
#
|
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] = (
|
43 |
-
fonts.GoogleFont("
|
44 |
"ui-sans-serif",
|
45 |
"sans-serif",
|
46 |
),
|
47 |
font_mono: fonts.Font
|
48 |
| str
|
49 |
| Iterable[fonts.Font | str] = (
|
50 |
-
fonts.GoogleFont("
|
51 |
"ui-monospace",
|
52 |
"monospace",
|
53 |
),
|
@@ -63,22 +63,22 @@ class Seafoam(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="*
|
73 |
-
slider_color_dark="*
|
74 |
-
block_title_text_weight="
|
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():
|
|
|
26 |
from painting_126 import painting_classification
|
27 |
from sketch_126 import sketch_classification # New import
|
28 |
|
29 |
+
#Gradio-Theme
|
30 |
+
class Minimalist(Base):
|
31 |
def __init__(
|
32 |
self,
|
33 |
*,
|
34 |
+
primary_hue: colors.Color | str = colors.gray,
|
35 |
+
secondary_hue: colors.Color | str = colors.slate,
|
36 |
+
neutral_hue: colors.Color | str = colors.gray,
|
37 |
spacing_size: sizes.Size | str = sizes.spacing_md,
|
38 |
+
radius_size: sizes.Size | str = sizes.radius_sm,
|
39 |
+
text_size: sizes.Size | str = sizes.text_md,
|
40 |
font: fonts.Font
|
41 |
| str
|
42 |
| Iterable[fonts.Font | str] = (
|
43 |
+
fonts.GoogleFont("Inter"),
|
44 |
"ui-sans-serif",
|
45 |
"sans-serif",
|
46 |
),
|
47 |
font_mono: fonts.Font
|
48 |
| str
|
49 |
| Iterable[fonts.Font | str] = (
|
50 |
+
fonts.GoogleFont("Fira Code"),
|
51 |
"ui-monospace",
|
52 |
"monospace",
|
53 |
),
|
|
|
63 |
font_mono=font_mono,
|
64 |
)
|
65 |
super().set(
|
66 |
+
body_background_fill="*neutral_50",
|
67 |
+
body_background_fill_dark="*neutral_900",
|
68 |
+
button_primary_background_fill="*primary_500",
|
69 |
+
button_primary_background_fill_hover="*primary_400",
|
70 |
button_primary_text_color="white",
|
71 |
+
button_primary_background_fill_dark="*primary_700",
|
72 |
+
slider_color="*secondary_400",
|
73 |
+
slider_color_dark="*secondary_500",
|
74 |
+
block_title_text_weight="500",
|
75 |
+
block_border_width="1px",
|
76 |
+
block_shadow="none",
|
77 |
+
button_primary_shadow="none",
|
78 |
+
button_large_padding="16px",
|
79 |
)
|
80 |
|
81 |
+
minimalist = Minimalist()
|
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) as demo:
|
174 |
gr.Markdown("# Multi-Domain & Zero-Shot Image Classification")
|
175 |
|
176 |
with gr.Tabs():
|