Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
from tensorflow.keras.preprocessing.image import load_img, img_to_array
|
| 2 |
import numpy as np
|
| 3 |
-
import
|
| 4 |
import gradio as gd
|
| 5 |
from keras.models import load_model
|
| 6 |
model2 = load_model("./my_model.keras")
|
| 7 |
|
| 8 |
def predict(image):
|
| 9 |
-
image=
|
| 10 |
image=img_to_array(image)/255.0
|
| 11 |
image = np.expand_dims(image, axis=0)
|
| 12 |
prediction=model2.predict(image)
|
|
|
|
| 1 |
from tensorflow.keras.preprocessing.image import load_img, img_to_array
|
| 2 |
import numpy as np
|
| 3 |
+
import opencv
|
| 4 |
import gradio as gd
|
| 5 |
from keras.models import load_model
|
| 6 |
model2 = load_model("./my_model.keras")
|
| 7 |
|
| 8 |
def predict(image):
|
| 9 |
+
image=opencv.resize(image,(240,240))
|
| 10 |
image=img_to_array(image)/255.0
|
| 11 |
image = np.expand_dims(image, axis=0)
|
| 12 |
prediction=model2.predict(image)
|