Daniel Cerda Escobar commited on
Commit
83d3f47
·
1 Parent(s): 72fe07e

Update app file

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -34,27 +34,28 @@ with col2:
34
 
35
  st.write('##')
36
 
37
- col1, col2, col3, col4, col5 = st.columns([5, 5, 5, 5, 5])
38
  with col1:
39
- st.markdown(f"##### Input File")
40
  # set input image by upload
41
  image_file = st.file_uploader("Upload your diagram", type=["pdf"])
42
  # set input images from examples
43
- def slider_func(option):
44
  option_to_id = {
45
- 'factory_pid.png' : str(1),
46
- 'plant_pid.png' : str(2),
47
- 'processing_pid.png' : str(3),
48
  }
49
  return option_to_id[option]
50
  st.write('##')
51
- slider = st.select_slider(
52
  'Or select from example diagrams',
53
  options = ['factory_pid.png', 'plant_pid.png', 'processing_pid.png'],
54
- format_func = slider_func,
55
- value = 'processing_pid.png',
56
  )
57
  with col3:
 
58
  # visualize input image
59
  if image_file is not None:
60
  image = Image.open(image_file)
 
34
 
35
  st.write('##')
36
 
37
+ col1, col2, col3, col4, col5 = st.columns([8, 2, 8, 2, 8])
38
  with col1:
39
+ st.markdown('##### Input File')
40
  # set input image by upload
41
  image_file = st.file_uploader("Upload your diagram", type=["pdf"])
42
  # set input images from examples
43
+ def radio_func(option):
44
  option_to_id = {
45
+ 'factory_pid.png' : 'Factory P&ID',
46
+ 'plant_pid.png' : 'Plant P&ID',
47
+ 'processing_pid.png' : 'Processing P&ID',
48
  }
49
  return option_to_id[option]
50
  st.write('##')
51
+ slider = st.radio(
52
  'Or select from example diagrams',
53
  options = ['factory_pid.png', 'plant_pid.png', 'processing_pid.png'],
54
+ format_func = radio_func,
55
+ value = 'factory_pid.png',
56
  )
57
  with col3:
58
+ st.markdown('##### Preview')
59
  # visualize input image
60
  if image_file is not None:
61
  image = Image.open(image_file)