Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -93,12 +93,12 @@ def main():
|
|
93 |
|
94 |
left_column, right_column = st.columns(2)
|
95 |
left_column.image(image_file, caption="Uploaded image", use_column_width=True)
|
96 |
-
|
97 |
|
98 |
|
99 |
pred_button = st.button("Predict")
|
100 |
|
101 |
-
model = load_model()
|
102 |
# label = ['Zebra', 'Horse']
|
103 |
# label = np.array(label).reshape(1, -1)
|
104 |
# ohe= OneHotEncoder()
|
@@ -106,7 +106,7 @@ def main():
|
|
106 |
|
107 |
if pred_button:
|
108 |
|
109 |
-
outputs = model.predict(
|
110 |
#_, y_hat = outputs.max(1)
|
111 |
# predicted_idx = str(y_hat.item())
|
112 |
# right_column.title("Prediction")
|
|
|
93 |
|
94 |
left_column, right_column = st.columns(2)
|
95 |
left_column.image(image_file, caption="Uploaded image", use_column_width=True)
|
96 |
+
image_pred = image_transformation(image=Image.open(image_file))
|
97 |
|
98 |
|
99 |
pred_button = st.button("Predict")
|
100 |
|
101 |
+
#model = load_model()
|
102 |
# label = ['Zebra', 'Horse']
|
103 |
# label = np.array(label).reshape(1, -1)
|
104 |
# ohe= OneHotEncoder()
|
|
|
106 |
|
107 |
if pred_button:
|
108 |
|
109 |
+
outputs = model.predict(image_pred)
|
110 |
#_, y_hat = outputs.max(1)
|
111 |
# predicted_idx = str(y_hat.item())
|
112 |
# right_column.title("Prediction")
|