prithivMLmods commited on
Commit
44f8775
·
verified ·
1 Parent(s): 4d6ef0a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -23
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
- # 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.blue,
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",
53
  ),
@@ -63,22 +63,22 @@ class Seafoam(Base):
63
  font_mono=font_mono,
64
  )
65
  super().set(
66
- body_background_fill="repeating-linear-gradient(45deg, *primary_200, *primary_200 10px, *primary_50 10px, *primary_50 20px)",
67
- body_background_fill_dark="repeating-linear-gradient(45deg, *primary_800, *primary_800 10px, *primary_900 10px, *primary_900 20px)",
68
- button_primary_background_fill="linear-gradient(90deg, *primary_300, *secondary_400)",
69
- button_primary_background_fill_hover="linear-gradient(90deg, *primary_200, *secondary_300)",
70
  button_primary_text_color="white",
71
- button_primary_background_fill_dark="linear-gradient(90deg, *primary_600, *secondary_800)",
72
- slider_color="*secondary_300",
73
- slider_color_dark="*secondary_600",
74
- block_title_text_weight="600",
75
- block_border_width="3px",
76
- block_shadow="*shadow_drop_lg",
77
- button_primary_shadow="*shadow_drop_lg",
78
- button_large_padding="32px",
79
  )
80
 
81
- seafoam = Seafoam()
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=seafoam) as demo:
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():