Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,22 +27,26 @@ 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.radius_md,
|
| 39 |
text_size: sizes.Size | str = sizes.text_lg,
|
| 40 |
-
font: fonts.Font
|
|
|
|
|
|
|
| 41 |
fonts.GoogleFont("Quicksand"),
|
| 42 |
"ui-sans-serif",
|
| 43 |
"sans-serif",
|
| 44 |
),
|
| 45 |
-
font_mono: fonts.Font
|
|
|
|
|
|
|
| 46 |
fonts.GoogleFont("IBM Plex Mono"),
|
| 47 |
"ui-monospace",
|
| 48 |
"monospace",
|
|
@@ -58,28 +62,8 @@ class MinimalModern(Base):
|
|
| 58 |
font=font,
|
| 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 |
-
|
| 83 |
|
| 84 |
# Main classification function for multi-model classification.
|
| 85 |
def classify(image, model_name):
|
|
@@ -171,7 +155,7 @@ def infer(image, candidate_labels):
|
|
| 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=
|
| 175 |
gr.Markdown("# Multi-Domain & Zero-Shot Image Classification")
|
| 176 |
|
| 177 |
with gr.Tabs():
|
|
|
|
| 27 |
from sketch_126 import sketch_classification # New import
|
| 28 |
|
| 29 |
#Gradio-Theme
|
| 30 |
+
class Seafoam(Base):
|
| 31 |
def __init__(
|
| 32 |
self,
|
| 33 |
*,
|
| 34 |
+
primary_hue: colors.Color | str = colors.emerald,
|
| 35 |
+
secondary_hue: colors.Color | str = colors.blue,
|
| 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_md,
|
| 39 |
text_size: sizes.Size | str = sizes.text_lg,
|
| 40 |
+
font: fonts.Font
|
| 41 |
+
| str
|
| 42 |
+
| Iterable[fonts.Font | str] = (
|
| 43 |
fonts.GoogleFont("Quicksand"),
|
| 44 |
"ui-sans-serif",
|
| 45 |
"sans-serif",
|
| 46 |
),
|
| 47 |
+
font_mono: fonts.Font
|
| 48 |
+
| str
|
| 49 |
+
| Iterable[fonts.Font | str] = (
|
| 50 |
fonts.GoogleFont("IBM Plex Mono"),
|
| 51 |
"ui-monospace",
|
| 52 |
"monospace",
|
|
|
|
| 62 |
font=font,
|
| 63 |
font_mono=font_mono,
|
| 64 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
+
seafoam = Seafoam()
|
| 67 |
|
| 68 |
# Main classification function for multi-model classification.
|
| 69 |
def classify(image, model_name):
|
|
|
|
| 155 |
return postprocess_siglip(sg1_probs, sg2_probs, labels=candidate_labels)
|
| 156 |
|
| 157 |
# Build the Gradio Interface with two tabs.
|
| 158 |
+
with gr.Blocks(theme=seafoam) as demo:
|
| 159 |
gr.Markdown("# Multi-Domain & Zero-Shot Image Classification")
|
| 160 |
|
| 161 |
with gr.Tabs():
|