本文整理匯總了Python中object_detection.builders.dataset_builder.read_dataset方法的典型用法代碼示例。如果您正苦於以下問題:Python dataset_builder.read_dataset方法的具體用法?Python dataset_builder.read_dataset怎麽用?Python dataset_builder.read_dataset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類object_detection.builders.dataset_builder
的用法示例。
在下文中一共展示了dataset_builder.read_dataset方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _get_dataset_next
# 需要導入模塊: from object_detection.builders import dataset_builder [as 別名]
# 或者: from object_detection.builders.dataset_builder import read_dataset [as 別名]
def _get_dataset_next(self, files, config, batch_size):
def decode_func(value):
return [tf.string_to_number(value, out_type=tf.int32)]
dataset = dataset_builder.read_dataset(tf.data.TextLineDataset, files,
config)
dataset = dataset.map(decode_func)
dataset = dataset.batch(batch_size)
return dataset.make_one_shot_iterator().get_next()
示例2: _get_dataset_next
# 需要導入模塊: from object_detection.builders import dataset_builder [as 別名]
# 或者: from object_detection.builders.dataset_builder import read_dataset [as 別名]
def _get_dataset_next(self, files, config, batch_size):
def decode_func(value):
return [tf.string_to_number(value, out_type=tf.int32)]
dataset = dataset_builder.read_dataset(
tf.data.TextLineDataset, files, config)
dataset = dataset.map(decode_func)
dataset = dataset.batch(batch_size)
return dataset.make_one_shot_iterator().get_next()
示例3: _get_dataset_next
# 需要導入模塊: from object_detection.builders import dataset_builder [as 別名]
# 或者: from object_detection.builders.dataset_builder import read_dataset [as 別名]
def _get_dataset_next(self, files, config, batch_size, num_batches_skip=0):
def decode_func(value):
return [tf.string_to_number(value, out_type=tf.int32)]
dataset = dataset_builder.read_dataset(tf.data.TextLineDataset, files,
config)
dataset = dataset.map(decode_func)
dataset = dataset.batch(batch_size)
if num_batches_skip > 0:
dataset = dataset.skip(num_batches_skip)
return get_iterator_next_for_testing(dataset, self.is_tf2())