April 2020
Intermediate to advanced
380 pages
9h 24m
English
Now, in the following steps, we will create functions to predict captions based on the model trained in the previous steps, and test the captioning on a sample image:
def predict_caption(img): in_text = "#START#" for i in range(max_caption_len): sequence = [word_index_map[w] for w in in_text.split() if w in word_index_map] sequence = pad_sequences([sequence], maxlen=max_caption_len, padding='post') pred = model.predict([img, ...
Read now
Unlock full access