File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ def _bytes_feature_list(values):
6666
6767processed_capts , img_capts = [], []
6868for idx in range (len (caption_data ['images' ])):
69- img_capt = caption_data ['annotations ' ][idx ]['caption' ]
69+ img_capt = caption_data ['images ' ][idx ]['caption' ]
7070 img_capts .append (img_capt )
7171 processed_capts .append (tl .nlp .process_sentence (img_capt , start_word = "<S>" , end_word = "</S>" ))
7272print ("Original Captions: %s" % img_capts )
@@ -80,7 +80,7 @@ def _bytes_feature_list(values):
8080for idx in range (len (caption_data ['images' ])):
8181 # get data
8282 img_name = caption_data ['images' ][idx ]['file_name' ]
83- img_capt = '<S> ' + caption_data ['annotations ' ][idx ]['caption' ] + ' </S>'
83+ img_capt = '<S> ' + caption_data ['images ' ][idx ]['caption' ] + ' </S>'
8484 img_capt_ids = [vocab .word_to_id (word ) for word in img_capt .split (' ' )]
8585 print ("%s : %s : %s" % (img_name , img_capt , img_capt_ids ))
8686 img = Image .open (IMG_DIR + img_name )
You can’t perform that action at this time.
0 commit comments