April 2020
Intermediate to advanced
380 pages
9h 24m
English
In the following steps, we load the training and test image datasets and perform training on them:
train_file = "./data/Flickr8k/text/Flickr_8k.trainImages.txt"test_file = "./data/Flickr8k/text/Flickr_8k.testImages.txt"
Now, we will be processing the train images list file to extract the image IDs, and leave out the file extension since it is the same in all cases, as shown in the following code snippet:
with open(train_file) as f: cap_train = f.readlines()cap_train = [x.strip() for x in cap_train]
We do the same with the ...
Read now
Unlock full access