harit-pc
commited on
Commit
·
31fe2b5
1
Parent(s):
5adb07a
Update main app file
Browse files
app.py
CHANGED
|
@@ -100,12 +100,15 @@ def main():
|
|
| 100 |
html_content = f.read()
|
| 101 |
|
| 102 |
st.markdown(html_content, unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
with st.container():
|
| 105 |
col1, col2, col3 = st.columns(3)
|
| 106 |
|
| 107 |
with col1:
|
| 108 |
-
option = st.selectbox('Segmentation mode', ('Click'))
|
| 109 |
|
| 110 |
with col2:
|
| 111 |
st.write("Show or Hide Mask")
|
|
@@ -118,9 +121,9 @@ def main():
|
|
| 118 |
st.write("Upload Image")
|
| 119 |
st.file_uploader(label='Upload image',type=['png','jpg','tif'], key='uploaded_image', on_change=image_preprocess_callback, args=(SAM_MODEL,), label_visibility="hidden")
|
| 120 |
|
| 121 |
-
result_image = None
|
| 122 |
canvas_input, canvas_output = st.columns(2)
|
| 123 |
if 'image' in st.session_state:
|
|
|
|
| 124 |
with canvas_input:
|
| 125 |
st.write("Select Interest Area/Objects")
|
| 126 |
if st.session_state.image is not None:
|
|
@@ -132,8 +135,8 @@ def main():
|
|
| 132 |
st.write("Result")
|
| 133 |
st.image(result_image)
|
| 134 |
|
| 135 |
-
else:
|
| 136 |
-
print(f'embedding is empty - {option} - {show_mask} - {radius_width}')
|
| 137 |
# if 'image' in st.session_state:
|
| 138 |
# if st.session_state.image is None:
|
| 139 |
# st.session_state.clear()
|
|
|
|
| 100 |
html_content = f.read()
|
| 101 |
|
| 102 |
st.markdown(html_content, unsafe_allow_html=True)
|
| 103 |
+
st.markdown('### Model Architecture')
|
| 104 |
+
st.image('figures/medsam.png', caption="Segment Anything - MedSAM", width=600)
|
| 105 |
+
st.markdown('### Demo')
|
| 106 |
|
| 107 |
with st.container():
|
| 108 |
col1, col2, col3 = st.columns(3)
|
| 109 |
|
| 110 |
with col1:
|
| 111 |
+
option = st.selectbox('Segmentation mode', ('Click', 'Box'))
|
| 112 |
|
| 113 |
with col2:
|
| 114 |
st.write("Show or Hide Mask")
|
|
|
|
| 121 |
st.write("Upload Image")
|
| 122 |
st.file_uploader(label='Upload image',type=['png','jpg','tif'], key='uploaded_image', on_change=image_preprocess_callback, args=(SAM_MODEL,), label_visibility="hidden")
|
| 123 |
|
|
|
|
| 124 |
canvas_input, canvas_output = st.columns(2)
|
| 125 |
if 'image' in st.session_state:
|
| 126 |
+
result_image = None
|
| 127 |
with canvas_input:
|
| 128 |
st.write("Select Interest Area/Objects")
|
| 129 |
if st.session_state.image is not None:
|
|
|
|
| 135 |
st.write("Result")
|
| 136 |
st.image(result_image)
|
| 137 |
|
| 138 |
+
# else:
|
| 139 |
+
# print(f'embedding is empty - {option} - {show_mask} - {radius_width}')
|
| 140 |
# if 'image' in st.session_state:
|
| 141 |
# if st.session_state.image is None:
|
| 142 |
# st.session_state.clear()
|