Spaces:
Sleeping
Sleeping
Update stoneapp.py
Browse files- 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.
|
| 161 |
-
|
| 162 |
-
uploaded_file_1 = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"], key="file_uploader_2")
|
| 163 |
|
| 164 |
-
if
|
| 165 |
-
image = convert_png_to_jpg(Image.open(
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
with
|
|
|
|
| 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:
|