Daniel Cerda Escobar commited on
Commit
ee620ac
Β·
1 Parent(s): 986adf5

Update Space"

Browse files
Files changed (2) hide show
  1. app.py +9 -9
  2. utils.py +2 -2
app.py CHANGED
@@ -64,7 +64,7 @@ with col1:
64
  with st.expander('How to use it'):
65
  st.markdown(
66
  '''
67
- 1) Upload your P&ID or select example diagrams πŸ“¬
68
  2) Set confidence threshold πŸ“ˆ
69
  3) Press to perform inference πŸš€
70
  4) Visualize model predictions πŸ”Ž
@@ -75,14 +75,14 @@ st.write('##')
75
 
76
  col1, col2, col3 = st.columns(3, gap='large')
77
  with col1:
78
- st.markdown('##### Input File')
79
  # set input image by upload
80
- uploaded_file = st.file_uploader("Upload your diagram", type="pdf")
81
- if uploaded_file:
82
- temp_dir = tempfile.mkdtemp()
83
- path = os.path.join(temp_dir, uploaded_file.name)
84
- with open(path, "wb") as f:
85
- f.write(uploaded_file.getvalue())
86
  # set input images from examples
87
  def radio_func(option):
88
  option_to_id = {
@@ -92,7 +92,7 @@ with col1:
92
  }
93
  return option_to_id[option]
94
  radio = st.radio(
95
- 'Or select from the following examples',
96
  options = ['factory_pid.png', 'plant_pid.png', 'processing_pid.png'],
97
  format_func = radio_func,
98
  )
 
64
  with st.expander('How to use it'):
65
  st.markdown(
66
  '''
67
+ 1) Select any example diagram πŸ“¬
68
  2) Set confidence threshold πŸ“ˆ
69
  3) Press to perform inference πŸš€
70
  4) Visualize model predictions πŸ”Ž
 
75
 
76
  col1, col2, col3 = st.columns(3, gap='large')
77
  with col1:
78
+ #st.markdown('##### Input File')
79
  # set input image by upload
80
+ #uploaded_file = st.file_uploader("Upload your diagram", type="pdf")
81
+ #if uploaded_file:
82
+ # temp_dir = tempfile.mkdtemp()
83
+ # path = os.path.join(temp_dir, uploaded_file.name)
84
+ # with open(path, "wb") as f:
85
+ # f.write(uploaded_file.getvalue())
86
  # set input images from examples
87
  def radio_func(option):
88
  option_to_id = {
 
92
  }
93
  return option_to_id[option]
94
  radio = st.radio(
95
+ 'Select from the following examples',
96
  options = ['factory_pid.png', 'plant_pid.png', 'processing_pid.png'],
97
  format_func = radio_func,
98
  )
utils.py CHANGED
@@ -13,8 +13,8 @@ def sahi_yolov8m_inference(
13
  detection_model,
14
  slice_height=512,
15
  slice_width=512,
16
- overlap_height_ratio=0.2,
17
- overlap_width_ratio=0.2,
18
  image_size=640,
19
  postprocess_match_threshold=0.5,
20
  ):
 
13
  detection_model,
14
  slice_height=512,
15
  slice_width=512,
16
+ overlap_height_ratio=0.1,
17
+ overlap_width_ratio=0.1,
18
  image_size=640,
19
  postprocess_match_threshold=0.5,
20
  ):