InFiniTE0311 commited on
Commit
7d20977
·
1 Parent(s): e1c1bc2

relode app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -5
app.py CHANGED
@@ -8,14 +8,12 @@ st.sidebar.header("使用指南")
8
  st.sidebar.write("""
9
  1. 上传一张图像。
10
  2. 使用滑块选择增强比例(1~10)。
11
- 3. 上传图像后会自动输出增强后图像。
12
- 4. 用户可在图像输出后快捷使用滑块改变增强比例,以达到合适的增强效果。
 
13
  """)
14
 
15
- # 上传图像
16
  uploaded_file = st.file_uploader("选择一张图像进行上传", type=["jpg", "jpeg", "png"])
17
-
18
- # 输入增强比例
19
  ratio = st.slider("选择增强比例", min_value=1, max_value=10, value=5)
20
 
21
  if uploaded_file is not None:
@@ -33,3 +31,28 @@ if uploaded_file is not None:
33
  else:
34
  st.warning("请填写反馈内容。")
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  st.sidebar.write("""
9
  1. 上传一张图像。
10
  2. 使用滑块选择增强比例(1~10)。
11
+ 3. 上传图像后会自动输出增强后图像。
12
+ 4. 用户可在图像输出后快捷使用滑块改变增强比例,以达到合适的增强效果。
13
+ 5. 系统给出三组增强前后图像作为示例,仅供参考。
14
  """)
15
 
 
16
  uploaded_file = st.file_uploader("选择一张图像进行上传", type=["jpg", "jpeg", "png"])
 
 
17
  ratio = st.slider("选择增强比例", min_value=1, max_value=10, value=5)
18
 
19
  if uploaded_file is not None:
 
31
  else:
32
  st.warning("请填写反馈内容。")
33
 
34
+ # image示例
35
+ with st.expander("图像增强示例", expanded=True):
36
+ col1, col2 = st.columns(2)
37
+ with col1:
38
+ st.write("未增强前图像:")
39
+ st.image("./demo/input/3.png", caption="未增强前图像 1", use_container_width=True)
40
+ with col2:
41
+ st.write("增强后图像:")
42
+ st.image("./demo/output/3_enhanced.png", caption="增强后图像 1", use_container_width=True)
43
+
44
+ col1, col2 = st.columns(2)
45
+ with col1:
46
+ st.write("未增强前图像:")
47
+ st.image("./demo/input/74.png", caption="未增强前图像 2", use_container_width=True)
48
+ with col2:
49
+ st.write("增强后图像:")
50
+ st.image("./demo/output/74_enhanced.png", caption="增强后图像 2", use_container_width=True)
51
+
52
+ col1, col2 = st.columns(2)
53
+ with col1:
54
+ st.write("未增强前图像:")
55
+ st.image("./demo/input/123.png", caption="未增强前图像 3", use_container_width=True)
56
+ with col2:
57
+ st.write("增强后图像:")
58
+ st.image("./demo/output/123_enhanced.png", caption="增强后图像 3", use_container_width=True)