yusyel
commited on
fix
Browse files
app.py
CHANGED
@@ -3,6 +3,8 @@ from huggingface_hub import from_pretrained_keras
|
|
3 |
from tensorflow.keras.preprocessing.image import load_img
|
4 |
from tensorflow.keras.preprocessing.image import img_to_array
|
5 |
from tensorflow.keras.preprocessing import image
|
|
|
|
|
6 |
import numpy as np
|
7 |
|
8 |
model = from_pretrained_keras("yusyel/fishv2")
|
@@ -23,7 +25,7 @@ def preprocess_image(img):
|
|
23 |
img = load_img(img, target_size=(224, 224, 3))
|
24 |
img = image.img_to_array(img)
|
25 |
img = np.expand_dims(img, axis=0)
|
26 |
-
img
|
27 |
print(img.shape)
|
28 |
return img
|
29 |
|
|
|
3 |
from tensorflow.keras.preprocessing.image import load_img
|
4 |
from tensorflow.keras.preprocessing.image import img_to_array
|
5 |
from tensorflow.keras.preprocessing import image
|
6 |
+
from tensorflow.keras.applications.mobilenet_v3 import preprocess_input
|
7 |
+
|
8 |
import numpy as np
|
9 |
|
10 |
model = from_pretrained_keras("yusyel/fishv2")
|
|
|
25 |
img = load_img(img, target_size=(224, 224, 3))
|
26 |
img = image.img_to_array(img)
|
27 |
img = np.expand_dims(img, axis=0)
|
28 |
+
img = preprocess_input(img)
|
29 |
print(img.shape)
|
30 |
return img
|
31 |
|