romi2001 commited on
Commit
e5c7622
·
verified ·
1 Parent(s): 55089df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +177 -46
app.py CHANGED
@@ -604,55 +604,150 @@ def pick_quickstarts(df, n=3):
604
  # =============================================================================
605
 
606
  CUSTOM_CSS = """
607
- @import url('https://fonts.googleapis.com/css2?family=Outfit:wght@600;700;800&family=Inter:wght@400;500;600&display=swap');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
608
 
609
- .fs-root { max-width: 1100px; margin: 0 auto; font-family: 'Inter', system-ui, sans-serif; }
610
- .fs-app-title { font-family:'Outfit', system-ui, sans-serif; font-weight:800; font-size:28px; color:#1A1410; margin-bottom:2px; }
611
- .fs-app-tag { color:#8C8388; font-size:14px; margin-bottom:6px; }
 
 
 
 
 
 
612
 
613
- .fs-placeholder { color:#9c9396; font-size:14px; padding: 30px 6px; text-align:center; border:1px dashed #ECE3E2; border-radius:16px; }
 
 
 
 
614
 
615
- .fs-profile-card { background: linear-gradient(135deg,#1c1512 0%,#2b1c22 100%); border-radius: 18px; padding: 26px 28px; margin-bottom: 22px; color:#fff; position: relative; overflow:hidden; }
616
- .fs-profile-eyebrow { color:#e8638c; font-weight:700; font-size:12px; letter-spacing:.1em; text-transform:uppercase; margin-bottom:6px; }
617
- .fs-profile-season { font-family:'Outfit', sans-serif; font-weight:800; font-size:26px; margin-bottom:6px; }
618
- .fs-profile-blurb { color:#cfc6c6; font-size:14px; max-width:600px; margin-bottom:16px; line-height:1.4; }
619
- .fs-chip-row { display:flex; gap:10px; flex-wrap:wrap; }
620
- .fs-chip { display:flex; align-items:center; gap:6px; background:rgba(255,255,255,0.08); border-radius:999px; padding:6px 12px 6px 6px; font-size:12px; color:#f1ecec; }
621
- .fs-chip-dot { width:16px; height:16px; border-radius:50%; display:inline-block; border:2px solid rgba(255,255,255,.5); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
622
 
623
- .fs-header { position:relative; background:#16110F; border-radius:18px; padding:22px 26px; margin-bottom:22px; overflow:hidden; }
624
- .fs-header-decoration { position:absolute; top:-40px; right:-30px; width:130px; height:130px; border-radius:50%; background:#3d1f29; }
625
- .fs-header-eyebrow { color:#e0507a; font-weight:800; font-size:13px; letter-spacing:.12em; text-transform:uppercase; margin-bottom:6px; position:relative; z-index:1; }
626
- .fs-header-sub { color:#b9b0b2; font-size:15px; position:relative; z-index:1; }
 
 
 
 
 
 
 
 
 
 
627
 
628
- .fs-note { background:#FBEFE9; color:#8a5a3a; border-radius:12px; padding:10px 16px; font-size:13px; margin-bottom:16px; }
629
- .fs-caption { background:#FFF6E9; border:1px solid #F0DCB8; border-radius:14px; padding:14px 18px; margin-bottom:18px; font-size:14px; color:#5a4a30; }
630
- .fs-caption-label { font-weight:700; }
 
 
 
 
 
 
631
 
632
- .fs-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap:18px; }
633
  @media (max-width: 900px) { .fs-grid { grid-template-columns: 1fr; } }
634
 
635
- .fs-look-card { background:#fff; border:1px solid #ECE3E2; border-radius:18px; padding:18px; box-shadow:0 2px 10px rgba(0,0,0,0.03); }
636
- .fs-look-head { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
637
- .fs-look-avatar { width:48px; height:48px; border-radius:50%; flex-shrink:0; border:3px solid #e8638c; display:inline-block; }
638
- .fs-look-title { font-weight:800; font-size:17px; color:#1A1410; font-family:'Outfit',sans-serif; }
639
- .fs-look-sub { color:#9c9396; font-size:13px; margin-top:2px; }
640
-
641
- .fs-component { border:1px solid #ECE3E2; border-radius:14px; overflow:hidden; margin-bottom:14px; }
642
- .fs-component:last-child { margin-bottom:0; }
643
- .fs-component-swatch { background:#F1E8DA; height:64px; display:flex; align-items:center; justify-content:center; }
644
- .fs-swatch-dot { width:34px; height:34px; border-radius:50%; display:inline-block; box-shadow:0 0 0 1px rgba(0,0,0,0.05) inset; }
645
- .fs-component-body { padding:12px 16px; background:#fff; }
646
- .fs-component-label { color:#d6336c; font-weight:800; font-size:11px; letter-spacing:.08em; text-transform:uppercase; margin-bottom:3px; }
647
- .fs-component-name { font-weight:700; color:#1A1410; font-size:14.5px; margin-bottom:10px; line-height:1.3; }
648
- .fs-shop-btn { display:inline-flex; align-items:center; gap:6px; background:#14110F; color:#fff !important; padding:9px 18px; border-radius:999px; font-size:12.5px; font-weight:700; text-decoration:none !important; transition:transform .15s ease, background .15s ease; }
649
- .fs-shop-btn:hover { background:#2a2422; transform:translateY(-1px); }
650
-
651
- .fs-colors-footer { color:#9c9396; font-size:12px; margin-top:6px; padding-top:10px; border-top:1px dashed #ECE3E2; }
652
-
653
- .fs-error { background:#FBE8E8; border:1px solid #F0BABA; border-radius:14px; padding:18px 20px; }
654
- .fs-error-title { color:#A11D33; font-weight:800; margin-bottom:4px; }
655
- .fs-error-msg { color:#7a3a3a; font-size:14px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
656
  """
657
 
658
 
@@ -780,13 +875,49 @@ def build_demo(df, model, processor, faiss_index, device):
780
  return gr.update(visible=is_photo), gr.update(visible=not is_photo)
781
 
782
  theme = gr.themes.Soft(
783
- primary_hue=gr.themes.colors.pink,
784
- secondary_hue=gr.themes.colors.rose,
785
- neutral_hue=gr.themes.colors.gray,
 
 
786
  ).set(
787
- button_primary_background_fill="#14110F",
788
- button_primary_background_fill_hover="#2a2422",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
789
  button_primary_text_color="#FFFFFF",
 
 
 
 
 
790
  )
791
 
792
  with gr.Blocks(css=CUSTOM_CSS, theme=theme, title="Personal Style Matcher") as demo:
 
604
  # =============================================================================
605
 
606
  CUSTOM_CSS = """
607
+ @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@200;300;400;500;600;700&family=Inter:wght@400;500;600&display=swap');
608
+
609
+ .fs-root {
610
+ --cream: #FDFBF7;
611
+ --white: #FFFFFF;
612
+ --charcoal: #1A1A1A;
613
+ --charcoal-soft: #3A3A3A;
614
+ --text-muted: #948D80;
615
+ --hairline: #EEEEEE;
616
+ --rose: #C48793;
617
+ --rose-soft: #F6ECEE;
618
+ --sage: #9CAF88;
619
+ --sage-soft: #EFF3EA;
620
+ --gold: #C9A876;
621
+ --gold-soft: #F8F1E4;
622
+ max-width: 1120px;
623
+ margin: 0 auto;
624
+ font-family: 'Inter', system-ui, sans-serif;
625
+ color: var(--charcoal-soft);
626
+ }
627
 
628
+ .fs-app-title {
629
+ font-family: 'Montserrat', system-ui, sans-serif;
630
+ font-weight: 600;
631
+ font-size: 30px;
632
+ letter-spacing: 0.02em;
633
+ color: var(--charcoal);
634
+ margin-bottom: 4px;
635
+ }
636
+ .fs-app-tag { color: var(--text-muted); font-size: 14px; letter-spacing: 0.01em; margin-bottom: 6px; }
637
 
638
+ .fs-placeholder {
639
+ color: var(--text-muted); font-size: 14px; padding: 48px 24px; text-align: center;
640
+ border: 1px solid var(--hairline); border-radius: 25px; background: var(--white);
641
+ letter-spacing: 0.01em;
642
+ }
643
 
644
+ .fs-profile-card {
645
+ background: linear-gradient(135deg, var(--rose-soft) 0%, var(--sage-soft) 100%);
646
+ border: 1px solid var(--hairline); border-radius: 25px; padding: 32px 34px;
647
+ margin-bottom: 24px; position: relative; overflow: hidden;
648
+ box-shadow: 0px 10px 30px rgba(0,0,0,0.05);
649
+ }
650
+ .fs-profile-eyebrow {
651
+ color: var(--rose); font-weight: 600; font-size: 12px; letter-spacing: .16em;
652
+ text-transform: uppercase; margin-bottom: 10px;
653
+ }
654
+ .fs-profile-season {
655
+ font-family: 'Montserrat', sans-serif; font-weight: 300; font-size: 30px;
656
+ letter-spacing: 0.01em; color: var(--charcoal); margin-bottom: 10px;
657
+ }
658
+ .fs-profile-blurb { color: var(--charcoal-soft); font-size: 14.5px; max-width: 620px; margin-bottom: 20px; line-height: 1.6; }
659
+ .fs-chip-row { display: flex; gap: 10px; flex-wrap: wrap; }
660
+ .fs-chip {
661
+ display: flex; align-items: center; gap: 8px; background: var(--white);
662
+ border: 1px solid var(--hairline); border-radius: 999px; padding: 7px 14px 7px 7px;
663
+ font-size: 12px; color: var(--charcoal-soft); letter-spacing: 0.02em;
664
+ box-shadow: 0px 4px 10px rgba(0,0,0,0.03);
665
+ }
666
+ .fs-chip-dot { width: 18px; height: 18px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px var(--white), 0 1px 4px rgba(0,0,0,.15); }
667
 
668
+ .fs-header {
669
+ position: relative; background: var(--white); border: 1px solid var(--hairline);
670
+ border-radius: 25px; padding: 30px 34px; margin-bottom: 24px; overflow: hidden;
671
+ box-shadow: 0px 10px 30px rgba(0,0,0,0.04);
672
+ }
673
+ .fs-header-decoration {
674
+ position: absolute; top: -50px; right: -40px; width: 160px; height: 160px;
675
+ border-radius: 50%; background: radial-gradient(circle, var(--gold-soft) 0%, transparent 70%);
676
+ }
677
+ .fs-header-eyebrow {
678
+ color: var(--rose); font-weight: 600; font-size: 13px; letter-spacing: .18em;
679
+ text-transform: uppercase; margin-bottom: 8px; position: relative; z-index: 1;
680
+ }
681
+ .fs-header-sub { font-size: 15.5px; color: var(--text-muted); letter-spacing: 0.01em; position: relative; z-index: 1; }
682
 
683
+ .fs-note {
684
+ background: var(--gold-soft); color: #7a5c34; border: 1px solid #EADFC4; border-radius: 14px;
685
+ padding: 12px 18px; font-size: 13px; margin-bottom: 18px; letter-spacing: 0.01em;
686
+ }
687
+ .fs-caption {
688
+ background: var(--sage-soft); border: 1px solid var(--hairline); border-radius: 18px;
689
+ padding: 16px 20px; margin-bottom: 20px; font-size: 14px; color: var(--charcoal-soft);
690
+ }
691
+ .fs-caption-label { font-weight: 600; color: var(--charcoal); }
692
 
693
+ .fs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
694
  @media (max-width: 900px) { .fs-grid { grid-template-columns: 1fr; } }
695
 
696
+ .fs-look-card {
697
+ background: var(--white); border: 1px solid var(--hairline); border-radius: 25px;
698
+ padding: 22px; box-shadow: 0px 10px 30px rgba(0,0,0,0.05);
699
+ }
700
+ .fs-look-head {
701
+ display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
702
+ padding-bottom: 18px; border-bottom: 1px solid var(--hairline);
703
+ }
704
+ .fs-look-avatar {
705
+ width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0;
706
+ border: 2px solid var(--gold); box-shadow: 0 4px 10px rgba(0,0,0,0.08);
707
+ display: inline-block;
708
+ }
709
+ .fs-look-title {
710
+ font-family: 'Montserrat', sans-serif; font-weight: 300; font-size: 22px;
711
+ letter-spacing: 0.01em; color: var(--charcoal);
712
+ }
713
+ .fs-look-sub { color: var(--text-muted); font-size: 13px; margin-top: 3px; letter-spacing: 0.01em; }
714
+
715
+ .fs-component {
716
+ border: 1px solid var(--hairline); border-radius: 18px; overflow: hidden; margin-bottom: 14px;
717
+ transition: box-shadow .2s ease;
718
+ }
719
+ .fs-component:hover { box-shadow: 0px 6px 18px rgba(0,0,0,0.05); }
720
+ .fs-component:last-child { margin-bottom: 0; }
721
+ .fs-component-swatch { background: var(--cream); height: 68px; display: flex; align-items: center; justify-content: center; }
722
+ .fs-swatch-dot {
723
+ width: 36px; height: 36px; border-radius: 50%; display: inline-block;
724
+ box-shadow: 0 0 0 3px var(--white), 0 3px 8px rgba(0,0,0,0.12);
725
+ }
726
+ .fs-component-body { padding: 14px 16px; background: var(--white); border-top: 1px solid var(--hairline); }
727
+ .fs-component-label {
728
+ color: var(--rose); font-weight: 600; font-size: 11px; letter-spacing: .12em;
729
+ text-transform: uppercase; margin-bottom: 4px;
730
+ }
731
+ .fs-component-name {
732
+ font-weight: 500; color: var(--charcoal); font-size: 14.5px; margin-bottom: 12px;
733
+ line-height: 1.35; letter-spacing: 0.01em;
734
+ }
735
+ .fs-shop-btn {
736
+ display: inline-flex; align-items: center; gap: 6px; background: var(--charcoal);
737
+ color: #fff !important; padding: 9px 20px; border-radius: 999px; font-size: 11.5px;
738
+ font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
739
+ text-decoration: none !important; transition: transform .2s ease, background-color .2s ease;
740
+ }
741
+ .fs-shop-btn:hover { background: #333333; transform: scale(1.05); }
742
+
743
+ .fs-colors-footer {
744
+ color: var(--text-muted); font-size: 12px; margin-top: 8px; padding-top: 14px;
745
+ border-top: 1px solid var(--hairline); letter-spacing: 0.01em;
746
+ }
747
+
748
+ .fs-error { background: #FBEEEE; border: 1px solid #F0D6D6; border-radius: 18px; padding: 20px 22px; }
749
+ .fs-error-title { color: #9A4A4A; font-weight: 600; margin-bottom: 4px; letter-spacing: 0.01em; }
750
+ .fs-error-msg { color: #7a5c5c; font-size: 14px; }
751
  """
752
 
753
 
 
875
  return gr.update(visible=is_photo), gr.update(visible=not is_photo)
876
 
877
  theme = gr.themes.Soft(
878
+ primary_hue=gr.themes.colors.rose,
879
+ secondary_hue=gr.themes.colors.green,
880
+ neutral_hue=gr.themes.colors.stone,
881
+ font=gr.themes.GoogleFont("Inter"),
882
+ font_mono=gr.themes.GoogleFont("Inter"),
883
  ).set(
884
+ # Page + panel backgrounds — soft off-white / cream, no harsh whites or greys
885
+ body_background_fill="#FDFBF7",
886
+ body_background_fill_dark="#FDFBF7",
887
+ block_background_fill="#FFFFFF",
888
+ block_background_fill_dark="#FFFFFF",
889
+ block_border_color="#EEEEEE",
890
+ block_border_color_dark="#EEEEEE",
891
+ block_radius="20px",
892
+ container_radius="20px",
893
+ block_shadow="0px 10px 30px rgba(0,0,0,0.04)",
894
+ block_label_text_color="#948D80",
895
+ block_label_text_color_dark="#948D80",
896
+ block_label_text_weight="500",
897
+ block_title_text_color="#1A1A1A",
898
+ block_title_text_color_dark="#1A1A1A",
899
+ panel_background_fill="#FFFFFF",
900
+ panel_background_fill_dark="#FFFFFF",
901
+ # Inputs (dropdowns, image upload, textboxes) — rounded, cream, soft pastel
902
+ input_background_fill="#FDFBF7",
903
+ input_background_fill_dark="#FDFBF7",
904
+ input_border_color="#EAE6DD",
905
+ input_border_color_dark="#EAE6DD",
906
+ input_border_color_focus="#C48793",
907
+ input_radius="14px",
908
+ checkbox_border_radius="8px",
909
+ checkbox_background_color="#FDFBF7",
910
+ checkbox_background_color_selected="#C48793",
911
+ checkbox_border_color_selected="#C48793",
912
+ # Buttons — solid charcoal pill, smooth hover lift
913
+ button_primary_background_fill="#1A1A1A",
914
+ button_primary_background_fill_hover="#333333",
915
  button_primary_text_color="#FFFFFF",
916
+ button_primary_border_color="#1A1A1A",
917
+ button_large_radius="999px",
918
+ button_medium_radius="999px",
919
+ button_small_radius="999px",
920
+ button_transition="all 0.2s ease",
921
  )
922
 
923
  with gr.Blocks(css=CUSTOM_CSS, theme=theme, title="Personal Style Matcher") as demo: