Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,11 +3,14 @@
|
|
| 3 |
import gradio as gr
|
| 4 |
import numpy as np
|
| 5 |
import tensorflow as tf
|
|
|
|
| 6 |
from tensorflow.keras.models import load_model
|
| 7 |
-
import cv2
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
# Load class labels from your text file
|
| 13 |
train_info = []
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
import numpy as np
|
| 5 |
import tensorflow as tf
|
| 6 |
+
import tensorflow_hub as hub
|
| 7 |
from tensorflow.keras.models import load_model
|
|
|
|
| 8 |
|
| 9 |
+
# Specify the custom objects for loading the model
|
| 10 |
+
custom_objects = {'KerasLayer': hub.KerasLayer}
|
| 11 |
+
|
| 12 |
+
# Load the pre-trained model with custom objects
|
| 13 |
+
model = load_model('bird_model4.h5', custom_objects=custom_objects)
|
| 14 |
|
| 15 |
# Load class labels from your text file
|
| 16 |
train_info = []
|