January 2019
Intermediate to advanced
342 pages
9h 17m
English
During inference we call build_generator to define the model and other TensorFlow ops required for inference and then we load the defined model with the saved weights from the trained model using tf.train.Saver.restoreutility. Once the model is loaded and ready for inference for each test video we extract its corresponding video frame images pre-processed features(from CNN) and pass it to the model for inference:
def inference(self): self.test_data = self.get_test_data(self.test_text_path,self.test_feat_path) test_videos = self.test_data['video_path'].unique() self.idx2word = pd.Series(np.load(self.path_prj / "idx2word.npy").tolist()) self.n_words = len(self.idx2word) video_tf, video_mask_tf, caption_tf, probs_tf, ...
Read now
Unlock full access