Vinit710 commited on
Commit
1823132
·
verified ·
1 Parent(s): 39256e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -3,10 +3,18 @@ import numpy as np
3
  import cv2
4
  from tensorflow.keras.models import load_model
5
 
6
- # Load the trained model
 
 
 
 
 
7
  @st.cache_resource
8
  def load_ocular_model():
9
- return load_model('odir_cnn_model.h5')
 
 
 
10
 
11
  model = load_ocular_model()
12
 
 
3
  import cv2
4
  from tensorflow.keras.models import load_model
5
 
6
+
7
+ from tensorflow.keras.layers import InputLayer
8
+
9
+ # Custom object scope to handle InputLayer configuration
10
+ custom_objects = {'InputLayer': InputLayer}
11
+
12
  @st.cache_resource
13
  def load_ocular_model():
14
+ return load_model('odir_cnn_model.h5', custom_objects=custom_objects)
15
+
16
+ model = load_ocular_model()
17
+
18
 
19
  model = load_ocular_model()
20