ColamanAI commited on
Commit
5fcf7e1
·
verified ·
1 Parent(s): b7a53b2

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -18
app.py CHANGED
@@ -728,10 +728,10 @@ def run_model(
728
  # 验证模型是否成功加载
729
  if grounding_dino_model is None:
730
  print("❌ GroundingDINO 模型加载失败!")
731
- return predictions, processed_data, None
732
  if sam_predictor is None:
733
  print("❌ SAM 模型加载失败!")
734
- return predictions, processed_data, None
735
 
736
  print(f"✅ 所有分割模型加载成功")
737
  print(f"{'='*70}\n")
@@ -1717,12 +1717,12 @@ CUSTOM_CSS = GRADIO_CSS + """
1717
  /* 减少Accordion和后续内容的间距 */
1718
  .accordion {
1719
  margin-bottom: 10px !important;
 
1720
  }
1721
 
1722
- /* 页脚样式 */
1723
- .footer {
1724
- margin-top: 20px !important;
1725
- padding: 10px 0 !important;
1726
  }
1727
 
1728
  /* 信息提示框 */
@@ -1982,18 +1982,6 @@ with gr.Blocks(theme=theme, css=CUSTOM_CSS, title="MapAnything V2 - 3D重建与
1982
  target_dir_output, image_gallery, log_output
1983
  ]
1984
  )
1985
-
1986
- # 页脚
1987
- gr.Markdown("---") # 分隔线
1988
- gr.Markdown(
1989
- """
1990
- <div style="text-align: center; padding: 20px 0; color: #666;">
1991
- <p>MapAnything V2 - 3D重建与物体分割系统</p>
1992
- <p style="font-size: 14px;">基于 DBSCAN 聚类的多视图融合 | CPU优化的轻量级分割</p>
1993
- </div>
1994
- """,
1995
- elem_classes=["footer"]
1996
- )
1997
 
1998
  # === 事件绑定 ===
1999
 
 
728
  # 验证模型是否成功加载
729
  if grounding_dino_model is None:
730
  print("❌ GroundingDINO 模型加载失败!")
731
+ raise RuntimeError("GroundingDINO 模型加载失败,请检查网络连接或模型配置")
732
  if sam_predictor is None:
733
  print("❌ SAM 模型加载失败!")
734
+ raise RuntimeError("SAM 模型加载失败,请检查网络连接或模型配置")
735
 
736
  print(f"✅ 所有分割模型加载成功")
737
  print(f"{'='*70}\n")
 
1717
  /* 减少Accordion和后续内容的间距 */
1718
  .accordion {
1719
  margin-bottom: 10px !important;
1720
+ padding-bottom: 0 !important;
1721
  }
1722
 
1723
+ /* 示例场景区域紧凑样式 */
1724
+ .accordion > .label-wrap {
1725
+ margin-bottom: 5px !important;
 
1726
  }
1727
 
1728
  /* 信息提示框 */
 
1982
  target_dir_output, image_gallery, log_output
1983
  ]
1984
  )
 
 
 
 
 
 
 
 
 
 
 
 
1985
 
1986
  # === 事件绑定 ===
1987