app.py
CHANGED
|
@@ -2,9 +2,11 @@ import gradio as gr
|
|
| 2 |
import tensorflow as tf
|
| 3 |
import numpy as np
|
| 4 |
from PIL import Image
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
# Load the model
|
| 7 |
-
model = tf.keras.models.load_model("birdie.h5")
|
| 8 |
|
| 9 |
# Define the prediction function
|
| 10 |
def predict_bird(image):
|
|
|
|
| 2 |
import tensorflow as tf
|
| 3 |
import numpy as np
|
| 4 |
from PIL import Image
|
| 5 |
+
import tensorflow_hub as hub
|
| 6 |
+
|
| 7 |
+
# Load the model with custom objects
|
| 8 |
+
model = tf.keras.models.load_model("birdie.h5", custom_objects={'KerasLayer': hub.KerasLayer})
|
| 9 |
|
|
|
|
|
|
|
| 10 |
|
| 11 |
# Define the prediction function
|
| 12 |
def predict_bird(image):
|