Update helper/model.py
Browse files- helper/model.py +1 -2
helper/model.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
import helper.optimizer_def
|
| 2 |
from keras.models import load_model
|
| 3 |
-
from keras.preprocessing import image
|
| 4 |
import numpy as np
|
| 5 |
|
| 6 |
CONVERT_CLASS_PRED_TO_NAME = ["Common Rust", "Gray Leaf Spot", "Leaf Blight"]
|
|
@@ -10,7 +9,7 @@ def fetch_model(opt_name: str):
|
|
| 10 |
|
| 11 |
def preprocess_image(img):
|
| 12 |
img = img.resize((224, 224))
|
| 13 |
-
img_array =
|
| 14 |
img_array = np.expand_dims(img_array, axis=0)
|
| 15 |
return img_array
|
| 16 |
|
|
|
|
| 1 |
import helper.optimizer_def
|
| 2 |
from keras.models import load_model
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
|
| 5 |
CONVERT_CLASS_PRED_TO_NAME = ["Common Rust", "Gray Leaf Spot", "Leaf Blight"]
|
|
|
|
| 9 |
|
| 10 |
def preprocess_image(img):
|
| 11 |
img = img.resize((224, 224))
|
| 12 |
+
img_array = np.array(img)
|
| 13 |
img_array = np.expand_dims(img_array, axis=0)
|
| 14 |
return img_array
|
| 15 |
|