Jyothirmai commited on
Commit
60e40d8
·
verified ·
1 Parent(s): d0e6a65

Update cnnrnn.py

Browse files
Files changed (1) hide show
  1. cnnrnn.py +3 -3
cnnrnn.py CHANGED
@@ -32,10 +32,10 @@ from nltk.translate.bleu_score import sentence_bleu
32
 
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
 
41
  input2 = Input(shape=(153), name='Text_Input')
@@ -93,7 +93,7 @@ def greedysearch(image):
93
  # Open the pickle file for reading
94
  train_data = pd.read_csv('Final_Train_Data.csv')
95
  y_train = train_data['Report']
96
- encoder_model, decoder_model = getModel()
97
  input_ = 'startseq'
98
  image_features = encoder_model.predict(image)
99
  result = []
 
32
 
33
 
34
 
35
+ def getModel(image):
36
  embedding_matrix_vocab = np.load('my_embedding_matrix.npy')
37
 
38
+ input1 = Input(shape=(image.shape[1]), name='Image_input')
39
  dense1 = Dense(256, kernel_initializer=tf.keras.initializers.glorot_uniform(seed = 56), name='dense_encoder')(input1)
40
 
41
  input2 = Input(shape=(153), name='Text_Input')
 
93
  # Open the pickle file for reading
94
  train_data = pd.read_csv('Final_Train_Data.csv')
95
  y_train = train_data['Report']
96
+ encoder_model, decoder_model = getModel(image)
97
  input_ = 'startseq'
98
  image_features = encoder_model.predict(image)
99
  result = []