linbojunzi commited on
Commit
cefd9fc
·
verified ·
1 Parent(s): 55ebd3d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -3,21 +3,24 @@ import json
3
 
4
  # 加载 JSON 数据
5
  with open("qwen2vl_50.json", "r") as file:
6
- data = json.load(file)
 
 
7
 
8
  # Streamlit 应用
9
  st.title("JSON Data Visualization")
10
 
11
  # 遍历数据并显示内容
12
- for entry in data:
13
  # 解构数据
14
- image_name, image_url, description, category = entry
15
-
16
  # 显示图像
17
- st.subheader(f"{image_name} - {category}")
18
  st.image(image_url, caption=description, use_column_width=True)
19
 
20
  # 显示文本信息
21
  st.markdown(f"**Description:** {description}")
22
- st.markdown(f"**Category:** {category}")
 
23
  st.markdown("---")
 
3
 
4
  # 加载 JSON 数据
5
  with open("qwen2vl_50.json", "r") as file:
6
+ qwen_data = json.load(file)
7
+ with open("qwen2vl_50.json", "r") as file:
8
+ gpt_data = json.load(file)
9
 
10
  # Streamlit 应用
11
  st.title("JSON Data Visualization")
12
 
13
  # 遍历数据并显示内容
14
+ for qwen,gpt in zip(qwen_data,gpt_data):
15
  # 解构数据
16
+ image_name, image_url, description, qwen_category = qwen
17
+ _, _, _, gpt_category = gpt
18
  # 显示图像
19
+ st.subheader(f"{image_name}")
20
  st.image(image_url, caption=description, use_column_width=True)
21
 
22
  # 显示文本信息
23
  st.markdown(f"**Description:** {description}")
24
+ st.markdown(f"**Qwen_Category:** {qwen_category}")
25
+ st.markdown(f"**GPT_Category:** {gpt_category}")
26
  st.markdown("---")