nishantguvvada commited on
Commit
d2ff190
·
1 Parent(s): bc96fd4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -41,10 +41,10 @@ def load_decoder_model():
41
  decoder_model=tf.keras.models.load_model('./decoder_pred_model.h5')
42
  return decoder_model
43
 
44
- @st.cache_resource()
45
- def load_encoder_model():
46
- encoder=tf.keras.models.load_model('./encoder_model.h5')
47
- return encoder
48
 
49
 
50
  FEATURE_EXTRACTOR = tf.keras.applications.inception_resnet_v2.InceptionResNetV2(include_top=False, weights="imagenet")
@@ -96,7 +96,7 @@ def predict_caption(file):
96
  resize = tf.image.resize(image, (IMG_HEIGHT, IMG_WIDTH))
97
  img = resize/255
98
 
99
- encoder = load_encoder_model()
100
  features = encoder(tf.expand_dims(img, axis=0))
101
  dec_input = tf.expand_dims([word_to_index("<start>")], 1)
102
  result = []
 
41
  decoder_model=tf.keras.models.load_model('./decoder_pred_model.h5')
42
  return decoder_model
43
 
44
+ # @st.cache_resource()
45
+ # def load_encoder_model():
46
+ # encoder=tf.keras.models.load_model('./encoder_model.h5')
47
+ # return encoder
48
 
49
 
50
  FEATURE_EXTRACTOR = tf.keras.applications.inception_resnet_v2.InceptionResNetV2(include_top=False, weights="imagenet")
 
96
  resize = tf.image.resize(image, (IMG_HEIGHT, IMG_WIDTH))
97
  img = resize/255
98
 
99
+ # encoder = load_encoder_model()
100
  features = encoder(tf.expand_dims(img, axis=0))
101
  dec_input = tf.expand_dims([word_to_index("<start>")], 1)
102
  result = []