Update cnnrnn.py
Browse files
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=(
|
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 = []
|