Ejemplo n.º 1
0
def _get_feature_label_keys():
    """Extracts and returns the dataset feature and label keys."""
    feature_spec = (scannet_specs.scene_feature_spec(
        with_annotations=True).get_serialized_info())
    feature_dict = tfds.core.utils.flatten_nest_dict(feature_spec)
    feature_keys = []
    label_keys = []
    for key in sorted(feature_dict):
        if 'labels' in key:
            label_keys.append(key)
        else:
            feature_keys.append(key)
    return feature_keys, label_keys
Ejemplo n.º 2
0
 def decode_fn(value):
   tensors = example_parser.decode_serialized_example(
       serialized_example=value,
       features=scannet_specs.scene_feature_spec(with_annotations=True))
   tensor_dict = tfds.core.utils.flatten_nest_dict(tensors)
   return tensor_dict