SonFox2920 commited on
Commit
3e59cdd
·
verified ·
1 Parent(s): 6d8b763

Update stoneapp.py

Browse files
Files changed (1) hide show
  1. stoneapp.py +12 -12
stoneapp.py CHANGED
@@ -157,19 +157,19 @@ def main():
157
  st.warning("No object detected with a confidence of 0.75 or higher.")
158
 
159
  with tab2:
160
- st.title('Image Classification App')
161
-
162
- uploaded_file_1 = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"], key="file_uploader_2")
163
 
164
- if uploaded_file_1 is not None:
165
- image = convert_png_to_jpg(Image.open(uploaded_file_1))
166
- img, text = st.columns(2, vertical_alignment='top')
167
- with img:
168
- st.image(image, caption='Uploaded Image')
169
- with st.spinner('Processing...'):
170
- cropped_image_pil = Image.fromarray(image)
171
- classification_result = classify_image(cropped_image_pil)
172
- with text:
 
173
  if classification_result == 'pass':
174
  st.success(f"Classification: {classification_result.upper()}")
175
  else:
 
157
  st.warning("No object detected with a confidence of 0.75 or higher.")
158
 
159
  with tab2:
160
+ st.header('Image Classification')
161
+ uploaded_file_2 = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"], key="file_uploader_2")
 
162
 
163
+ if uploaded_file_2 is not None:
164
+ image = convert_png_to_jpg(Image.open(uploaded_file_2))
165
+ col1, col2 = st.columns(2)
166
+
167
+ with col1:
168
+ st.image(image, caption='Uploaded Image', use_column_width=True)
169
+
170
+ with col2:
171
+ with st.spinner('Classifying...'):
172
+ classification_result = classify_image(image)
173
  if classification_result == 'pass':
174
  st.success(f"Classification: {classification_result.upper()}")
175
  else: