Jyothirmai commited on
Commit
0954cd7
1 Parent(s): 835929e

Update cnn-rnn.py

Browse files
Files changed (1) hide show
  1. cnn-rnn.py +2 -3
cnn-rnn.py CHANGED
@@ -33,6 +33,8 @@ from nltk.translate.bleu_score import sentence_bleu
33
 
34
 
35
  def getModel():
 
 
36
  input1 = Input(shape=(2048), name='Image_input')
37
  dense1 = Dense(256, kernel_initializer=tf.keras.initializers.glorot_uniform(seed = 56), name='dense_encoder')(input1)
38
 
@@ -89,9 +91,6 @@ def getModel():
89
 
90
  def greedysearch(image):
91
  # Open the pickle file for reading
92
- with open('/content/Image_features_ecoder_decoder.pickle', 'rb') as f:
93
- Xnet_features = pickle.load(f)
94
-
95
  encoder_model, decoder_model = getModel()
96
  input_ = 'startseq'
97
  image_features = encoder_model.predict(image)
 
33
 
34
 
35
  def getModel():
36
+ embedding_matrix_vocab = np.load('my_embedding_matrix.npy')
37
+
38
  input1 = Input(shape=(2048), name='Image_input')
39
  dense1 = Dense(256, kernel_initializer=tf.keras.initializers.glorot_uniform(seed = 56), name='dense_encoder')(input1)
40
 
 
91
 
92
  def greedysearch(image):
93
  # Open the pickle file for reading
 
 
 
94
  encoder_model, decoder_model = getModel()
95
  input_ = 'startseq'
96
  image_features = encoder_model.predict(image)