Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
import tensorflow as tf
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
4 |
def classify_image(inp):
|
5 |
inp = inp.reshape((-1, 224, 224, 3))
|
6 |
prediction = model_0.predict(inp)
|
|
|
1 |
import gradio as gr
|
2 |
import tensorflow as tf
|
3 |
+
from tensorflow.keras.utils import CustomObjectScope
|
4 |
+
from tensorflow.keras.layers.experimental.preprocessing import RandomHeight
|
5 |
+
|
6 |
+
with CustomObjectScope({'RandomHeight': RandomHeight}):
|
7 |
+
model_0 = tf.keras.models.load_model('bestmodel.h5')
|
8 |
+
|
9 |
def classify_image(inp):
|
10 |
inp = inp.reshape((-1, 224, 224, 3))
|
11 |
prediction = model_0.predict(inp)
|