prithivMLmods commited on
Commit
dae1075
·
verified ·
1 Parent(s): c1e2d8a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -23
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 MinimalMinimal(Base):
31
  def __init__(
32
  self,
33
  *,
34
- primary_hue: colors.Color | str = colors.sky,
35
- secondary_hue: colors.Color | str = colors.lavender,
36
- neutral_hue: colors.Color | str = colors.indigo,
37
- spacing_size: sizes.Size | str = sizes.spacing_sm,
38
- radius_size: sizes.Size | str = sizes.radius_sm,
39
- text_size: sizes.Size | str = sizes.text_md,
40
  font: fonts.Font | str | Iterable[fonts.Font | str] = (
41
- fonts.GoogleFont("Inter"),
42
  "ui-sans-serif",
43
  "sans-serif",
44
  ),
45
  font_mono: fonts.Font | str | Iterable[fonts.Font | str] = (
46
- fonts.GoogleFont("Fira Code"),
47
  "ui-monospace",
48
  "monospace",
49
  ),
@@ -59,23 +59,27 @@ class MinimalMinimal(Base):
59
  font_mono=font_mono,
60
  )
61
  super().set(
62
- body_background_fill="linear-gradient(135deg, *primary_100, *secondary_100)",
63
- body_background_fill_dark="linear-gradient(135deg, *primary_700, *secondary_700)",
 
 
64
  button_primary_background_fill="linear-gradient(90deg, *primary_200, *secondary_200)",
65
- button_primary_background_fill_hover="linear-gradient(90deg, *primary_100, *secondary_100)",
66
- button_primary_text_color="white",
67
- button_primary_background_fill_dark="linear-gradient(90deg, *primary_500, *secondary_500)",
68
- slider_color="*secondary_200",
69
- slider_color_dark="*secondary_500",
70
- block_title_text_weight="400",
71
- block_border_width="1px",
72
- block_shadow="none",
73
- button_primary_shadow="none",
 
 
 
74
  button_large_padding="24px",
75
  )
76
 
77
- minimal_minimal = MinimalMinimal()
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=minimal_minimal) as demo:
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():