Spaces:
Sleeping
Sleeping
sowbaranika13
commited on
Commit
•
4cc329e
1
Parent(s):
30b097d
Update app.py
Browse files
app.py
CHANGED
@@ -21,8 +21,7 @@ model_path = r"inceptionv3_class.h5"
|
|
21 |
hierarchical_models['class'] = load_model(model_path)
|
22 |
|
23 |
def load_and_preprocess_image(image, target_size=(224, 224)):
|
24 |
-
|
25 |
-
image = image.resize(target_size)
|
26 |
img_array = img_to_array(image)
|
27 |
img_array = np.expand_dims(img_array, axis=0)
|
28 |
img_array = tf.keras.applications.mobilenet_v2.preprocess_input(img_array)
|
|
|
21 |
hierarchical_models['class'] = load_model(model_path)
|
22 |
|
23 |
def load_and_preprocess_image(image, target_size=(224, 224)):
|
24 |
+
image = image.resize(target_size)
|
|
|
25 |
img_array = img_to_array(image)
|
26 |
img_array = np.expand_dims(img_array, axis=0)
|
27 |
img_array = tf.keras.applications.mobilenet_v2.preprocess_input(img_array)
|