brxerq commited on
Commit
373f965
·
verified ·
1 Parent(s): 4056102

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
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
- # Load the pre-trained model
10
- model = load_model('bird_model4.h5')
 
 
 
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 = []