當前位置: 首頁>>代碼示例>>Python>>正文


Python tfexample_decoder.TFExampleDecoder方法代碼示例

本文整理匯總了Python中tensorflow.contrib.slim.python.slim.data.tfexample_decoder.TFExampleDecoder方法的典型用法代碼示例。如果您正苦於以下問題:Python tfexample_decoder.TFExampleDecoder方法的具體用法?Python tfexample_decoder.TFExampleDecoder怎麽用?Python tfexample_decoder.TFExampleDecoder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tensorflow.contrib.slim.python.slim.data.tfexample_decoder的用法示例。


在下文中一共展示了tfexample_decoder.TFExampleDecoder方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: DecodeExample

# 需要導入模塊: from tensorflow.contrib.slim.python.slim.data import tfexample_decoder [as 別名]
# 或者: from tensorflow.contrib.slim.python.slim.data.tfexample_decoder import TFExampleDecoder [as 別名]
def DecodeExample(self, serialized_example, item_handler, image_format):
    """Decodes the given serialized example with the specified item handler.

    Args:
      serialized_example: a serialized TF example string.
      item_handler: the item handler used to decode the image.
      image_format: the image format being decoded.

    Returns:
      the decoded image found in the serialized Example.
    """
    serialized_example = array_ops.reshape(serialized_example, shape=[])
    decoder = tfexample_decoder.TFExampleDecoder(
        keys_to_features={
            'image/encoded':
                parsing_ops.FixedLenFeature(
                    (), dtypes.string, default_value=''),
            'image/format':
                parsing_ops.FixedLenFeature(
                    (), dtypes.string, default_value=image_format),
        },
        items_to_handlers={'image': item_handler})
    [tf_image] = decoder.decode(serialized_example, ['image'])
    return tf_image 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:26,代碼來源:tfexample_decoder_test.py

示例2: testDecodeExampleWithFloatTensor

# 需要導入模塊: from tensorflow.contrib.slim.python.slim.data import tfexample_decoder [as 別名]
# 或者: from tensorflow.contrib.slim.python.slim.data.tfexample_decoder import TFExampleDecoder [as 別名]
def testDecodeExampleWithFloatTensor(self):
    np_array = np.random.rand(2, 3, 1).astype('f')

    example = example_pb2.Example(features=feature_pb2.Features(feature={
        'array': self._EncodedFloatFeature(np_array),
    }))

    serialized_example = example.SerializeToString()

    with self.test_session():
      serialized_example = array_ops.reshape(serialized_example, shape=[])
      keys_to_features = {
          'array': parsing_ops.FixedLenFeature(np_array.shape, dtypes.float32)
      }
      items_to_handlers = {'array': tfexample_decoder.Tensor('array'),}
      decoder = tfexample_decoder.TFExampleDecoder(keys_to_features,
                                                   items_to_handlers)
      [tf_array] = decoder.decode(serialized_example, ['array'])
      self.assertAllEqual(tf_array.eval(), np_array) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:21,代碼來源:tfexample_decoder_test.py

示例3: testDecodeExampleWithInt64Tensor

# 需要導入模塊: from tensorflow.contrib.slim.python.slim.data import tfexample_decoder [as 別名]
# 或者: from tensorflow.contrib.slim.python.slim.data.tfexample_decoder import TFExampleDecoder [as 別名]
def testDecodeExampleWithInt64Tensor(self):
    np_array = np.random.randint(1, 10, size=(2, 3, 1))

    example = example_pb2.Example(features=feature_pb2.Features(feature={
        'array': self._EncodedInt64Feature(np_array),
    }))

    serialized_example = example.SerializeToString()

    with self.test_session():
      serialized_example = array_ops.reshape(serialized_example, shape=[])
      keys_to_features = {
          'array': parsing_ops.FixedLenFeature(np_array.shape, dtypes.int64)
      }
      items_to_handlers = {'array': tfexample_decoder.Tensor('array'),}
      decoder = tfexample_decoder.TFExampleDecoder(keys_to_features,
                                                   items_to_handlers)
      [tf_array] = decoder.decode(serialized_example, ['array'])
      self.assertAllEqual(tf_array.eval(), np_array) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:21,代碼來源:tfexample_decoder_test.py

示例4: testDecodeExampleWithVarLenTensor

# 需要導入模塊: from tensorflow.contrib.slim.python.slim.data import tfexample_decoder [as 別名]
# 或者: from tensorflow.contrib.slim.python.slim.data.tfexample_decoder import TFExampleDecoder [as 別名]
def testDecodeExampleWithVarLenTensor(self):
    np_array = np.array([[[1], [2], [3]], [[4], [5], [6]]])

    example = example_pb2.Example(features=feature_pb2.Features(feature={
        'labels': self._EncodedInt64Feature(np_array),
    }))

    serialized_example = example.SerializeToString()

    with self.test_session():
      serialized_example = array_ops.reshape(serialized_example, shape=[])
      keys_to_features = {
          'labels': parsing_ops.VarLenFeature(dtype=dtypes.int64),
      }
      items_to_handlers = {'labels': tfexample_decoder.Tensor('labels'),}
      decoder = tfexample_decoder.TFExampleDecoder(keys_to_features,
                                                   items_to_handlers)
      [tf_labels] = decoder.decode(serialized_example, ['labels'])
      labels = tf_labels.eval()
      self.assertAllEqual(labels, np_array.flatten()) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:22,代碼來源:tfexample_decoder_test.py

示例5: testDecodeExampleWithVarLenTensorToDense

# 需要導入模塊: from tensorflow.contrib.slim.python.slim.data import tfexample_decoder [as 別名]
# 或者: from tensorflow.contrib.slim.python.slim.data.tfexample_decoder import TFExampleDecoder [as 別名]
def testDecodeExampleWithVarLenTensorToDense(self):
    np_array = np.array([[1, 2, 3], [4, 5, 6]])
    example = example_pb2.Example(features=feature_pb2.Features(feature={
        'labels': self._EncodedInt64Feature(np_array),
    }))

    serialized_example = example.SerializeToString()

    with self.test_session():
      serialized_example = array_ops.reshape(serialized_example, shape=[])
      keys_to_features = {
          'labels': parsing_ops.VarLenFeature(dtype=dtypes.int64),
      }
      items_to_handlers = {
          'labels': tfexample_decoder.Tensor(
              'labels', shape=np_array.shape),
      }
      decoder = tfexample_decoder.TFExampleDecoder(keys_to_features,
                                                   items_to_handlers)
      [tf_labels] = decoder.decode(serialized_example, ['labels'])
      labels = tf_labels.eval()
      self.assertAllEqual(labels, np_array) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:24,代碼來源:tfexample_decoder_test.py

示例6: testDecodeExampleWithSparseTensor

# 需要導入模塊: from tensorflow.contrib.slim.python.slim.data import tfexample_decoder [as 別名]
# 或者: from tensorflow.contrib.slim.python.slim.data.tfexample_decoder import TFExampleDecoder [as 別名]
def testDecodeExampleWithSparseTensor(self):
    np_indices = np.array([[1], [2], [5]])
    np_values = np.array([0.1, 0.2, 0.6]).astype('f')
    example = example_pb2.Example(features=feature_pb2.Features(feature={
        'indices': self._EncodedInt64Feature(np_indices),
        'values': self._EncodedFloatFeature(np_values),
    }))

    serialized_example = example.SerializeToString()

    with self.test_session():
      serialized_example = array_ops.reshape(serialized_example, shape=[])
      keys_to_features = {
          'indices': parsing_ops.VarLenFeature(dtype=dtypes.int64),
          'values': parsing_ops.VarLenFeature(dtype=dtypes.float32),
      }
      items_to_handlers = {'labels': tfexample_decoder.SparseTensor(),}
      decoder = tfexample_decoder.TFExampleDecoder(keys_to_features,
                                                   items_to_handlers)
      [tf_labels] = decoder.decode(serialized_example, ['labels'])
      labels = tf_labels.eval()
      self.assertAllEqual(labels.indices, np_indices)
      self.assertAllEqual(labels.values, np_values)
      self.assertAllEqual(labels.dense_shape, np_values.shape) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:26,代碼來源:tfexample_decoder_test.py

示例7: testDecodeExampleWithStringTensor

# 需要導入模塊: from tensorflow.contrib.slim.python.slim.data import tfexample_decoder [as 別名]
# 或者: from tensorflow.contrib.slim.python.slim.data.tfexample_decoder import TFExampleDecoder [as 別名]
def testDecodeExampleWithStringTensor(self):
    tensor_shape = (2, 3, 1)
    np_array = np.array([[['ab'], ['cd'], ['ef']],
                         [['ghi'], ['jkl'], ['mnop']]])

    example = example_pb2.Example(features=feature_pb2.Features(feature={
        'labels': self._BytesFeature(np_array),
    }))

    serialized_example = example.SerializeToString()

    with self.test_session():
      serialized_example = array_ops.reshape(serialized_example, shape=[])
      keys_to_features = {
          'labels':
              parsing_ops.FixedLenFeature(
                  tensor_shape,
                  dtypes.string,
                  default_value=constant_op.constant(
                      '', shape=tensor_shape, dtype=dtypes.string))
      }
      items_to_handlers = {'labels': tfexample_decoder.Tensor('labels'),}
      decoder = tfexample_decoder.TFExampleDecoder(keys_to_features,
                                                   items_to_handlers)
      [tf_labels] = decoder.decode(serialized_example, ['labels'])
      labels = tf_labels.eval()

      labels = labels.astype(np_array.dtype)
      self.assertTrue(np.array_equal(np_array, labels)) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:31,代碼來源:tfexample_decoder_test.py

示例8: testDecodeExampleShapeKeyTensor

# 需要導入模塊: from tensorflow.contrib.slim.python.slim.data import tfexample_decoder [as 別名]
# 或者: from tensorflow.contrib.slim.python.slim.data.tfexample_decoder import TFExampleDecoder [as 別名]
def testDecodeExampleShapeKeyTensor(self):
    np_image = np.random.rand(2, 3, 1).astype('f')
    np_labels = np.array([[[1], [2], [3]], [[4], [5], [6]]])

    example = example_pb2.Example(features=feature_pb2.Features(feature={
        'image': self._EncodedFloatFeature(np_image),
        'image/shape': self._EncodedInt64Feature(np.array(np_image.shape)),
        'labels': self._EncodedInt64Feature(np_labels),
        'labels/shape': self._EncodedInt64Feature(np.array(np_labels.shape)),
    }))

    serialized_example = example.SerializeToString()

    with self.test_session():
      serialized_example = array_ops.reshape(serialized_example, shape=[])
      keys_to_features = {
          'image': parsing_ops.VarLenFeature(dtype=dtypes.float32),
          'image/shape': parsing_ops.VarLenFeature(dtype=dtypes.int64),
          'labels': parsing_ops.VarLenFeature(dtype=dtypes.int64),
          'labels/shape': parsing_ops.VarLenFeature(dtype=dtypes.int64),
      }
      items_to_handlers = {
          'image':
              tfexample_decoder.Tensor(
                  'image', shape_keys='image/shape'),
          'labels':
              tfexample_decoder.Tensor(
                  'labels', shape_keys='labels/shape'),
      }
      decoder = tfexample_decoder.TFExampleDecoder(keys_to_features,
                                                   items_to_handlers)
      [tf_image, tf_labels] = decoder.decode(serialized_example,
                                             ['image', 'labels'])
      self.assertAllEqual(tf_image.eval(), np_image)
      self.assertAllEqual(tf_labels.eval(), np_labels) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:37,代碼來源:tfexample_decoder_test.py

示例9: testDecodeExampleMultiShapeKeyTensor

# 需要導入模塊: from tensorflow.contrib.slim.python.slim.data import tfexample_decoder [as 別名]
# 或者: from tensorflow.contrib.slim.python.slim.data.tfexample_decoder import TFExampleDecoder [as 別名]
def testDecodeExampleMultiShapeKeyTensor(self):
    np_image = np.random.rand(2, 3, 1).astype('f')
    np_labels = np.array([[[1], [2], [3]], [[4], [5], [6]]])
    height, width, depth = np_labels.shape

    example = example_pb2.Example(features=feature_pb2.Features(feature={
        'image': self._EncodedFloatFeature(np_image),
        'image/shape': self._EncodedInt64Feature(np.array(np_image.shape)),
        'labels': self._EncodedInt64Feature(np_labels),
        'labels/height': self._EncodedInt64Feature(np.array([height])),
        'labels/width': self._EncodedInt64Feature(np.array([width])),
        'labels/depth': self._EncodedInt64Feature(np.array([depth])),
    }))

    serialized_example = example.SerializeToString()

    with self.test_session():
      serialized_example = array_ops.reshape(serialized_example, shape=[])
      keys_to_features = {
          'image': parsing_ops.VarLenFeature(dtype=dtypes.float32),
          'image/shape': parsing_ops.VarLenFeature(dtype=dtypes.int64),
          'labels': parsing_ops.VarLenFeature(dtype=dtypes.int64),
          'labels/height': parsing_ops.VarLenFeature(dtype=dtypes.int64),
          'labels/width': parsing_ops.VarLenFeature(dtype=dtypes.int64),
          'labels/depth': parsing_ops.VarLenFeature(dtype=dtypes.int64),
      }
      items_to_handlers = {
          'image':
              tfexample_decoder.Tensor(
                  'image', shape_keys='image/shape'),
          'labels':
              tfexample_decoder.Tensor(
                  'labels',
                  shape_keys=['labels/height', 'labels/width', 'labels/depth']),
      }
      decoder = tfexample_decoder.TFExampleDecoder(keys_to_features,
                                                   items_to_handlers)
      [tf_image, tf_labels] = decoder.decode(serialized_example,
                                             ['image', 'labels'])
      self.assertAllEqual(tf_image.eval(), np_image)
      self.assertAllEqual(tf_labels.eval(), np_labels) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:43,代碼來源:tfexample_decoder_test.py

示例10: testDecodeExampleWithSparseTensorWithKeyShape

# 需要導入模塊: from tensorflow.contrib.slim.python.slim.data import tfexample_decoder [as 別名]
# 或者: from tensorflow.contrib.slim.python.slim.data.tfexample_decoder import TFExampleDecoder [as 別名]
def testDecodeExampleWithSparseTensorWithKeyShape(self):
    np_indices = np.array([[1], [2], [5]])
    np_values = np.array([0.1, 0.2, 0.6]).astype('f')
    np_shape = np.array([6])
    example = example_pb2.Example(features=feature_pb2.Features(feature={
        'indices': self._EncodedInt64Feature(np_indices),
        'values': self._EncodedFloatFeature(np_values),
        'shape': self._EncodedInt64Feature(np_shape),
    }))

    serialized_example = example.SerializeToString()

    with self.test_session():
      serialized_example = array_ops.reshape(serialized_example, shape=[])
      keys_to_features = {
          'indices': parsing_ops.VarLenFeature(dtype=dtypes.int64),
          'values': parsing_ops.VarLenFeature(dtype=dtypes.float32),
          'shape': parsing_ops.VarLenFeature(dtype=dtypes.int64),
      }
      items_to_handlers = {
          'labels': tfexample_decoder.SparseTensor(shape_key='shape'),
      }
      decoder = tfexample_decoder.TFExampleDecoder(keys_to_features,
                                                   items_to_handlers)
      [tf_labels] = decoder.decode(serialized_example, ['labels'])
      labels = tf_labels.eval()
      self.assertAllEqual(labels.indices, np_indices)
      self.assertAllEqual(labels.values, np_values)
      self.assertAllEqual(labels.dense_shape, np_shape) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:31,代碼來源:tfexample_decoder_test.py

示例11: testDecodeExampleWithSparseTensorToDense

# 需要導入模塊: from tensorflow.contrib.slim.python.slim.data import tfexample_decoder [as 別名]
# 或者: from tensorflow.contrib.slim.python.slim.data.tfexample_decoder import TFExampleDecoder [as 別名]
def testDecodeExampleWithSparseTensorToDense(self):
    np_indices = np.array([1, 2, 5])
    np_values = np.array([0.1, 0.2, 0.6]).astype('f')
    np_shape = np.array([6])
    np_dense = np.array([0.0, 0.1, 0.2, 0.0, 0.0, 0.6]).astype('f')
    example = example_pb2.Example(features=feature_pb2.Features(feature={
        'indices': self._EncodedInt64Feature(np_indices),
        'values': self._EncodedFloatFeature(np_values),
    }))

    serialized_example = example.SerializeToString()

    with self.test_session():
      serialized_example = array_ops.reshape(serialized_example, shape=[])
      keys_to_features = {
          'indices': parsing_ops.VarLenFeature(dtype=dtypes.int64),
          'values': parsing_ops.VarLenFeature(dtype=dtypes.float32),
      }
      items_to_handlers = {
          'labels':
              tfexample_decoder.SparseTensor(
                  shape=np_shape, densify=True),
      }
      decoder = tfexample_decoder.TFExampleDecoder(keys_to_features,
                                                   items_to_handlers)
      [tf_labels] = decoder.decode(serialized_example, ['labels'])
      labels = tf_labels.eval()
      self.assertAllClose(labels, np_dense) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:30,代碼來源:tfexample_decoder_test.py

示例12: testDecodeExampleWithTensor

# 需要導入模塊: from tensorflow.contrib.slim.python.slim.data import tfexample_decoder [as 別名]
# 或者: from tensorflow.contrib.slim.python.slim.data.tfexample_decoder import TFExampleDecoder [as 別名]
def testDecodeExampleWithTensor(self):
    tensor_shape = (2, 3, 1)
    np_array = np.random.rand(2, 3, 1)

    example = example_pb2.Example(features=feature_pb2.Features(feature={
        'image/depth_map': self._EncodedFloatFeature(np_array),
    }))

    serialized_example = example.SerializeToString()

    with self.test_session():
      serialized_example = array_ops.reshape(serialized_example, shape=[])

      keys_to_features = {
          'image/depth_map':
              parsing_ops.FixedLenFeature(
                  tensor_shape,
                  dtypes.float32,
                  default_value=array_ops.zeros(tensor_shape))
      }

      items_to_handlers = {'depth': tfexample_decoder.Tensor('image/depth_map')}

      decoder = tfexample_decoder.TFExampleDecoder(keys_to_features,
                                                   items_to_handlers)
      [tf_depth] = decoder.decode(serialized_example, ['depth'])
      depth = tf_depth.eval()

    self.assertAllClose(np_array, depth) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:31,代碼來源:tfexample_decoder_test.py

示例13: testDecodeExampleWithItemHandlerCallback

# 需要導入模塊: from tensorflow.contrib.slim.python.slim.data import tfexample_decoder [as 別名]
# 或者: from tensorflow.contrib.slim.python.slim.data.tfexample_decoder import TFExampleDecoder [as 別名]
def testDecodeExampleWithItemHandlerCallback(self):
    np.random.seed(0)
    tensor_shape = (2, 3, 1)
    np_array = np.random.rand(2, 3, 1)

    example = example_pb2.Example(features=feature_pb2.Features(feature={
        'image/depth_map': self._EncodedFloatFeature(np_array),
    }))

    serialized_example = example.SerializeToString()

    with self.test_session():
      serialized_example = array_ops.reshape(serialized_example, shape=[])

      keys_to_features = {
          'image/depth_map':
              parsing_ops.FixedLenFeature(
                  tensor_shape,
                  dtypes.float32,
                  default_value=array_ops.zeros(tensor_shape))
      }

      def HandleDepth(keys_to_tensors):
        depth = list(keys_to_tensors.values())[0]
        depth += 1
        return depth

      items_to_handlers = {
          'depth':
              tfexample_decoder.ItemHandlerCallback('image/depth_map',
                                                    HandleDepth)
      }

      decoder = tfexample_decoder.TFExampleDecoder(keys_to_features,
                                                   items_to_handlers)
      [tf_depth] = decoder.decode(serialized_example, ['depth'])
      depth = tf_depth.eval()

    self.assertAllClose(np_array, depth - 1) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:41,代碼來源:tfexample_decoder_test.py

示例14: testDecodeExampleWithBoundingBox

# 需要導入模塊: from tensorflow.contrib.slim.python.slim.data import tfexample_decoder [as 別名]
# 或者: from tensorflow.contrib.slim.python.slim.data.tfexample_decoder import TFExampleDecoder [as 別名]
def testDecodeExampleWithBoundingBox(self):
    num_bboxes = 10
    np_ymin = np.random.rand(num_bboxes, 1)
    np_xmin = np.random.rand(num_bboxes, 1)
    np_ymax = np.random.rand(num_bboxes, 1)
    np_xmax = np.random.rand(num_bboxes, 1)
    np_bboxes = np.hstack([np_ymin, np_xmin, np_ymax, np_xmax])

    example = example_pb2.Example(features=feature_pb2.Features(feature={
        'image/object/bbox/ymin': self._EncodedFloatFeature(np_ymin),
        'image/object/bbox/xmin': self._EncodedFloatFeature(np_xmin),
        'image/object/bbox/ymax': self._EncodedFloatFeature(np_ymax),
        'image/object/bbox/xmax': self._EncodedFloatFeature(np_xmax),
    }))
    serialized_example = example.SerializeToString()

    with self.test_session():
      serialized_example = array_ops.reshape(serialized_example, shape=[])

      keys_to_features = {
          'image/object/bbox/ymin': parsing_ops.VarLenFeature(dtypes.float32),
          'image/object/bbox/xmin': parsing_ops.VarLenFeature(dtypes.float32),
          'image/object/bbox/ymax': parsing_ops.VarLenFeature(dtypes.float32),
          'image/object/bbox/xmax': parsing_ops.VarLenFeature(dtypes.float32),
      }

      items_to_handlers = {
          'object/bbox':
              tfexample_decoder.BoundingBox(['ymin', 'xmin', 'ymax', 'xmax'],
                                            'image/object/bbox/'),
      }

      decoder = tfexample_decoder.TFExampleDecoder(keys_to_features,
                                                   items_to_handlers)
      [tf_bboxes] = decoder.decode(serialized_example, ['object/bbox'])
      bboxes = tf_bboxes.eval()

    self.assertAllClose(np_bboxes, bboxes) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:40,代碼來源:tfexample_decoder_test.py

示例15: _get_split

# 需要導入模塊: from tensorflow.contrib.slim.python.slim.data import tfexample_decoder [as 別名]
# 或者: from tensorflow.contrib.slim.python.slim.data.tfexample_decoder import TFExampleDecoder [as 別名]
def _get_split(file_pattern, num_samples, num_views, image_size, vox_size):
  """Get dataset.Dataset for the given dataset file pattern and properties."""

  # A dictionary from TF-Example keys to tf.FixedLenFeature instance.
  keys_to_features = {
      'image': tf.FixedLenFeature(
          shape=[num_views, image_size, image_size, 3],
          dtype=tf.float32, default_value=None),
      'mask': tf.FixedLenFeature(
          shape=[num_views, image_size, image_size, 1],
          dtype=tf.float32, default_value=None),
      'vox': tf.FixedLenFeature(
          shape=[vox_size, vox_size, vox_size, 1],
          dtype=tf.float32, default_value=None),
  }

  items_to_handler = {
      'image': tfexample_decoder.Tensor(
          'image', shape=[num_views, image_size, image_size, 3]),
      'mask': tfexample_decoder.Tensor(
          'mask', shape=[num_views, image_size, image_size, 1]),
      'vox': tfexample_decoder.Tensor(
          'vox', shape=[vox_size, vox_size, vox_size, 1])
  }

  decoder = tfexample_decoder.TFExampleDecoder(
      keys_to_features, items_to_handler)

  return dataset.Dataset(
      data_sources=file_pattern,
      reader=tf.TFRecordReader,
      decoder=decoder,
      num_samples=num_samples,
      items_to_descriptions=_ITEMS_TO_DESCRIPTIONS) 
開發者ID:rky0930,項目名稱:yolo_v2,代碼行數:36,代碼來源:input_generator.py


注:本文中的tensorflow.contrib.slim.python.slim.data.tfexample_decoder.TFExampleDecoder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。