Spaces:
Sleeping
Sleeping
Update api.py
Browse files
api.py
CHANGED
|
@@ -135,7 +135,7 @@ loaded_scaler = joblib.load('scaler.joblib')
|
|
| 135 |
# Load the saved label encoder
|
| 136 |
loaded_label_encoder = joblib.load('label_encoder.joblib')
|
| 137 |
|
| 138 |
-
|
| 139 |
|
| 140 |
|
| 141 |
|
|
@@ -186,7 +186,7 @@ def predict_crop_disease(input_data):
|
|
| 186 |
|
| 187 |
print(input_scaled.reshape(1,-1).shape)
|
| 188 |
# Make predictions
|
| 189 |
-
prediction =
|
| 190 |
|
| 191 |
# Inverse transform the prediction (if needed, depending on your model)
|
| 192 |
#predicted_label = loaded_label_encoder.inverse_transform(prediction)
|
|
|
|
| 135 |
# Load the saved label encoder
|
| 136 |
loaded_label_encoder = joblib.load('label_encoder.joblib')
|
| 137 |
|
| 138 |
+
Geomodel = tf.keras.models.load_model('keras_model.h5')
|
| 139 |
|
| 140 |
|
| 141 |
|
|
|
|
| 186 |
|
| 187 |
print(input_scaled.reshape(1,-1).shape)
|
| 188 |
# Make predictions
|
| 189 |
+
prediction = Geomodel.predict(input_scaled)
|
| 190 |
|
| 191 |
# Inverse transform the prediction (if needed, depending on your model)
|
| 192 |
#predicted_label = loaded_label_encoder.inverse_transform(prediction)
|