Yiming-M commited on
Commit
0547181
·
1 Parent(s): dde77f8

2025-08-01 09:51 🚀

Browse files
Files changed (1) hide show
  1. app.py +38 -3
app.py CHANGED
@@ -486,11 +486,46 @@ def predict(image: Image.Image, variant_dataset_metric: str):
486
  # Build Gradio Interface using Blocks for a two-column layout
487
  # -----------------------------
488
  css = """
 
 
 
489
  /* 基础样式 - 保持功能性 */
490
  .gradio-container {
491
  max-width: 1600px;
492
  margin: 0 auto;
493
  padding: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
494
  }
495
 
496
  /* 简单的分割线样式 */
@@ -542,7 +577,7 @@ with gr.Blocks(css=css, theme=gr.themes.Soft(), title="ZIP Crowd Counting") as d
542
  """)
543
 
544
  # 添加信息面板
545
- with gr.Accordion("ℹ️ About ZIP", open=False):
546
  gr.Markdown("""
547
  **ZIP (Zero-Inflated Poisson)** is a framework designed for crowd counting, a task where the goal is to estimate how many people are present in an image. It was introduced in the paper [ZIP: Scalable Crowd Counting via Zero-Inflated Poisson Modeling](https://arxiv.org/abs/2506.19955).
548
  ZIP is based on a simple idea: not all empty areas in an image mean the same thing. Some regions are empty because there are truly no people there (like walls or sky), while others are places where people could appear but just happen not to in this particular image. ZIP separates these two cases using two prediction heads:
@@ -692,7 +727,7 @@ with gr.Blocks(css=css, theme=gr.themes.Soft(), title="ZIP Crowd Counting") as d
692
  )
693
 
694
  # 添加使用说明
695
- with gr.Accordion("📖 How to Use", open=False):
696
  gr.Markdown("""
697
  ### Step-by-step Guide:
698
 
@@ -717,7 +752,7 @@ with gr.Blocks(css=css, theme=gr.themes.Soft(), title="ZIP Crowd Counting") as d
717
  """)
718
 
719
  # 添加技术信息
720
- with gr.Accordion("🔬 Technical Details", open=False):
721
  gr.Markdown("""
722
  ### Model Variants:
723
  - **ZIP-B**: Base model with best performance
 
486
  # Build Gradio Interface using Blocks for a two-column layout
487
  # -----------------------------
488
  css = """
489
+ /* 导入科技感字体 */
490
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Fira+Code:wght@300;400;500;600&display=swap');
491
+
492
  /* 基础样式 - 保持功能性 */
493
  .gradio-container {
494
  max-width: 1600px;
495
  margin: 0 auto;
496
  padding: 20px;
497
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
498
+ }
499
+
500
+ /* 标题使用科技感字体 */
501
+ .gr-markdown h1 {
502
+ font-family: 'JetBrains Mono', 'Fira Code', monospace;
503
+ font-weight: 700;
504
+ text-align: center;
505
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
506
+ -webkit-background-clip: text;
507
+ -webkit-text-fill-color: transparent;
508
+ letter-spacing: -0.02em;
509
+ }
510
+
511
+ .gr-markdown h2, .gr-markdown h3 {
512
+ font-family: 'Inter', sans-serif;
513
+ font-weight: 600;
514
+ letter-spacing: -0.01em;
515
+ }
516
+
517
+ /* 代码和技术文本使用等宽字体 */
518
+ .gr-textbox[label*="Status"],
519
+ .gr-textbox[label*="Count"],
520
+ code, pre {
521
+ font-family: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace;
522
+ }
523
+
524
+ /* 按钮使用现代字体 */
525
+ .gr-button {
526
+ font-family: 'Inter', sans-serif;
527
+ font-weight: 600;
528
+ letter-spacing: 0.01em;
529
  }
530
 
531
  /* 简单的分割线样式 */
 
577
  """)
578
 
579
  # 添加信息面板
580
+ with gr.Accordion("ℹ️ About ZIP", open=True):
581
  gr.Markdown("""
582
  **ZIP (Zero-Inflated Poisson)** is a framework designed for crowd counting, a task where the goal is to estimate how many people are present in an image. It was introduced in the paper [ZIP: Scalable Crowd Counting via Zero-Inflated Poisson Modeling](https://arxiv.org/abs/2506.19955).
583
  ZIP is based on a simple idea: not all empty areas in an image mean the same thing. Some regions are empty because there are truly no people there (like walls or sky), while others are places where people could appear but just happen not to in this particular image. ZIP separates these two cases using two prediction heads:
 
727
  )
728
 
729
  # 添加使用说明
730
+ with gr.Accordion("📖 How to Use", open=True):
731
  gr.Markdown("""
732
  ### Step-by-step Guide:
733
 
 
752
  """)
753
 
754
  # 添加技术信息
755
+ with gr.Accordion("🔬 Technical Details", open=True):
756
  gr.Markdown("""
757
  ### Model Variants:
758
  - **ZIP-B**: Base model with best performance