SWHL commited on
Commit
9b5cb05
1 Parent(s): 2f50b2e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -7,8 +7,6 @@ from PIL import Image
7
 
8
  from rapid_layout import RapidLayout, VisLayout
9
 
10
- layout_engine = RapidLayout()
11
-
12
  st.markdown(
13
  "<h1 style='text-align: center;'><a href='https://github.com/RapidAI/RapidLayout' style='text-decoration: none'>Rapid Layout</a></h1>",
14
  unsafe_allow_html=True,
@@ -66,9 +64,12 @@ model_types = {
66
  "toc",
67
  ],
68
  }
69
- option = st.selectbox("选择版面分析模型:", model_types.keys())
70
  st.write("支持检测类型:")
71
- st.code(model_types[option], language="python")
 
 
 
72
 
73
  st.write("请上传图像:")
74
  img_suffix = ["png", "jpg", "jpeg"]
 
7
 
8
  from rapid_layout import RapidLayout, VisLayout
9
 
 
 
10
  st.markdown(
11
  "<h1 style='text-align: center;'><a href='https://github.com/RapidAI/RapidLayout' style='text-decoration: none'>Rapid Layout</a></h1>",
12
  unsafe_allow_html=True,
 
64
  "toc",
65
  ],
66
  }
67
+ select_model = st.selectbox("选择版面分析模型:", model_types.keys())
68
  st.write("支持检测类型:")
69
+ st.code(model_types[select_model], language="python")
70
+
71
+ with st.spinner(f"Downloading {select_model} model..."):
72
+ layout_engine = RapidLayout(model_type=select_model)
73
 
74
  st.write("请上传图像:")
75
  img_suffix = ["png", "jpg", "jpeg"]