Spaces:
Sleeping
Sleeping
Daniel Cerda Escobar
commited on
Commit
·
e8270bd
1
Parent(s):
777824d
Fix model parameters
Browse files
app.py
CHANGED
|
@@ -100,15 +100,16 @@ with col2:
|
|
| 100 |
with col3:
|
| 101 |
# set SAHI parameters
|
| 102 |
st.markdown('##### Set model parameters')
|
| 103 |
-
slice_size_percentage = st.
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
|
|
|
| 109 |
)
|
| 110 |
overlap_ratio = st.slider(
|
| 111 |
-
label = 'Overlap Ratio',
|
| 112 |
min_value=0.0,
|
| 113 |
max_value=0.5,
|
| 114 |
value=0.1,
|
|
@@ -133,7 +134,7 @@ if submit:
|
|
| 133 |
with st.spinner(text="Downloading model weights ... "):
|
| 134 |
detection_model = get_model(postprocess_match_threshold)
|
| 135 |
|
| 136 |
-
slice_size = (slice_size_percentage/0.25) * 1240
|
| 137 |
image_size = 4960
|
| 138 |
|
| 139 |
with st.spinner(text="Performing prediction ... "):
|
|
|
|
| 100 |
with col3:
|
| 101 |
# set SAHI parameters
|
| 102 |
st.markdown('##### Set model parameters')
|
| 103 |
+
slice_size_percentage = st.select_slider(
|
| 104 |
+
'Image Slicing Ratio',
|
| 105 |
+
options = [
|
| 106 |
+
'25 %',
|
| 107 |
+
'50 %',
|
| 108 |
+
'75 %',
|
| 109 |
+
],
|
| 110 |
)
|
| 111 |
overlap_ratio = st.slider(
|
| 112 |
+
label = 'Slicing Overlap Ratio',
|
| 113 |
min_value=0.0,
|
| 114 |
max_value=0.5,
|
| 115 |
value=0.1,
|
|
|
|
| 134 |
with st.spinner(text="Downloading model weights ... "):
|
| 135 |
detection_model = get_model(postprocess_match_threshold)
|
| 136 |
|
| 137 |
+
slice_size = int((float(slice_size_percentage)/0.25) * 1240)
|
| 138 |
image_size = 4960
|
| 139 |
|
| 140 |
with st.spinner(text="Performing prediction ... "):
|