(self, image_sequence_names)
return iterator
load a batch of test images for inference
load a batch of test images for inference
load a batch of test images for inference
def load_test_batch(self, image_sequence_names):
        """load a batch of test images for inference"""
        def _parse_test_img(img_path):
            with tf.device('/cpu:0'):
                img_buffer = tf.read_file(img_path)
                image_decoded = tf.image.decode_jpeg(img_buffer)
            return image_decoded

        image_dataset = tf.data.Dataset.from_tensor_slices(image_sequence_names).map(
            _parse_test_img).batch(self.batch_size).prefetch(self.batch_size*4)
        iterator = image_dataset.make_initializable_iterator()
        return iterator
def load_test_batch ( self , image_sequence_names ) : def _parse_test_img ( img_path ) : with tf . device ( '/cpu:0' ) : img_buffer = tf . read_file ( img_path ) image_decoded = tf . image . decode_jpeg ( img_buffer ) return image_decoded image_dataset = tf . data . Dataset . from_tensor_slices ( image_sequence_names ) . map ( _parse_test_img ) . batch ( self . batch_size ) . prefetch ( self . batch_size * 4 ) iterator = image_dataset . make_initializable_iterator ( ) return iterator