Spaces:
Running
Running
Commit
·
1763bc7
1
Parent(s):
ca1165d
Update app.py
Browse files
app.py
CHANGED
@@ -45,14 +45,20 @@ if 'image' in locals(): # Check if image variable exists
|
|
45 |
if st.button('Predict'):
|
46 |
try:
|
47 |
model = model_arc() # Initialize your model
|
48 |
-
st.info('
|
49 |
|
50 |
# Ensure image shape is correct and add batch dimension
|
51 |
img_array = preprocess(image) # This should return an array of shape (1, 256, 256, 3)
|
|
|
|
|
52 |
|
53 |
predicted_class, confidence = classify_garbage(img_array, model)
|
|
|
|
|
54 |
|
55 |
st.info('The uploaded image has been classified as "{}" with {:.2f}% confidence.'.format(predicted_class, confidence))
|
|
|
|
|
56 |
|
57 |
except Exception as e:
|
58 |
st.info('Error')
|
|
|
45 |
if st.button('Predict'):
|
46 |
try:
|
47 |
model = model_arc() # Initialize your model
|
48 |
+
st.info('Worked1')
|
49 |
|
50 |
# Ensure image shape is correct and add batch dimension
|
51 |
img_array = preprocess(image) # This should return an array of shape (1, 256, 256, 3)
|
52 |
+
|
53 |
+
st.info('Worked2')
|
54 |
|
55 |
predicted_class, confidence = classify_garbage(img_array, model)
|
56 |
+
|
57 |
+
st.info('Worked3')
|
58 |
|
59 |
st.info('The uploaded image has been classified as "{}" with {:.2f}% confidence.'.format(predicted_class, confidence))
|
60 |
+
|
61 |
+
st.info('Worked4')
|
62 |
|
63 |
except Exception as e:
|
64 |
st.info('Error')
|