From 45e5034ce60426c73cbe3fc0142f2e064f0a3840 Mon Sep 17 00:00:00 2001 From: nehalmamgain <36276997+nehalmamgain@users.noreply.github.com> Date: Wed, 27 Apr 2022 10:37:20 +0900 Subject: [PATCH] schema: add ParallelDomainFrameMetadata for Parallel Domain datasets. (#87) * schema: add ParallelDomainSampleMetadata for Parallel Domain datasets - add protobuf schema for ParallelDomainSampleMetadata - modify dgp.contribs.pd.metadata to hold sample-level message * Merge branch 'master' into feat/nehal/add-generic-metadata --- dgp/contribs/pd/metadata.proto | 13 +- dgp/contribs/pd/metadata_pb2.py | 226 +++++++++++++++++++++++++------- 2 files changed, 190 insertions(+), 49 deletions(-) diff --git a/dgp/contribs/pd/metadata.proto b/dgp/contribs/pd/metadata.proto index 1b2153c0..3f658318 100644 --- a/dgp/contribs/pd/metadata.proto +++ b/dgp/contribs/pd/metadata.proto @@ -1,5 +1,5 @@ // Copyright 2020 Parallel Domain. All rights reserved. -// Definitions for Parallel Domain Scene-level Metadata +// Definitions for Parallel Domain Scene-level and Sample-level Metadata syntax = "proto3"; @@ -24,6 +24,12 @@ enum RegionType MICHIGAN = 2; } +// Sample-level metadata to encode attribute information in key-value pairs. +message ParallelDomainSampleMetadata { + map attributes = 1; +} + +// Scene-level metadata. message ParallelDomainSceneMetadata { // Location name in PD location library // The location name string will be of the form xx_yy, @@ -72,5 +78,8 @@ message ParallelDomainSceneMetadata { // Batch ID and version for delivery tracking uint32 batch_id = 7; uint32 version = 8; + + // Additional metadata + map attributes = 14; } -// Next ID: 14 +// Next ID: 15 diff --git a/dgp/contribs/pd/metadata_pb2.py b/dgp/contribs/pd/metadata_pb2.py index d8e2dd34..0597fd05 100644 --- a/dgp/contribs/pd/metadata_pb2.py +++ b/dgp/contribs/pd/metadata_pb2.py @@ -1,7 +1,8 @@ -# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: dgp/contribs/pd/metadata.proto -"""Generated protocol buffer code.""" + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -19,8 +20,7 @@ package='dgp.proto', syntax='proto3', serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x1e\x64gp/contribs/pd/metadata.proto\x12\tdgp.proto\"\xd5\x02\n\x1bParallelDomainSceneMetadata\x12\x10\n\x08location\x18\x01 \x01(\t\x12*\n\x0bregion_type\x18\t \x01(\x0e\x32\x15.dgp.proto.RegionType\x12(\n\nscene_type\x18\n \x01(\x0e\x32\x14.dgp.proto.SceneType\x12\x13\n\x0btime_of_day\x18\x02 \x01(\t\x12\x15\n\rsun_elevation\x18\x0b \x01(\x02\x12\x13\n\x0bsun_azimuth\x18\x0c \x01(\x02\x12\x13\n\x0b\x63loud_cover\x18\r \x01(\x02\x12\x15\n\rfog_intensity\x18\x03 \x01(\x02\x12\x16\n\x0erain_intensity\x18\x04 \x01(\x02\x12\x0f\n\x07wetness\x18\x05 \x01(\x02\x12\x15\n\rstreet_lights\x18\x06 \x01(\x02\x12\x10\n\x08\x62\x61tch_id\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\r*F\n\tSceneType\x12\x13\n\x0fSYNTHETIC_SCENE\x10\x00\x12\t\n\x05URBAN\x10\x01\x12\x0c\n\x08SUBURBAN\x10\x02\x12\x0b\n\x07HIGHWAY\x10\x03*I\n\nRegionType\x12\x14\n\x10SYNTHETIC_REGION\x10\x00\x12\x17\n\x13NORTHERN_CALIFORNIA\x10\x01\x12\x0c\n\x08MICHIGAN\x10\x02\x62\x06proto3' + serialized_pb=_b('\n\x1e\x64gp/contribs/pd/metadata.proto\x12\tdgp.proto\"\x9e\x01\n\x1cParallelDomainSampleMetadata\x12K\n\nattributes\x18\x01 \x03(\x0b\x32\x37.dgp.proto.ParallelDomainSampleMetadata.AttributesEntry\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd4\x03\n\x1bParallelDomainSceneMetadata\x12\x10\n\x08location\x18\x01 \x01(\t\x12*\n\x0bregion_type\x18\t \x01(\x0e\x32\x15.dgp.proto.RegionType\x12(\n\nscene_type\x18\n \x01(\x0e\x32\x14.dgp.proto.SceneType\x12\x13\n\x0btime_of_day\x18\x02 \x01(\t\x12\x15\n\rsun_elevation\x18\x0b \x01(\x02\x12\x13\n\x0bsun_azimuth\x18\x0c \x01(\x02\x12\x13\n\x0b\x63loud_cover\x18\r \x01(\x02\x12\x15\n\rfog_intensity\x18\x03 \x01(\x02\x12\x16\n\x0erain_intensity\x18\x04 \x01(\x02\x12\x0f\n\x07wetness\x18\x05 \x01(\x02\x12\x15\n\rstreet_lights\x18\x06 \x01(\x02\x12\x10\n\x08\x62\x61tch_id\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\r\x12J\n\nattributes\x18\x0e \x03(\x0b\x32\x36.dgp.proto.ParallelDomainSceneMetadata.AttributesEntry\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01*F\n\tSceneType\x12\x13\n\x0fSYNTHETIC_SCENE\x10\x00\x12\t\n\x05URBAN\x10\x01\x12\x0c\n\x08SUBURBAN\x10\x02\x12\x0b\n\x07HIGHWAY\x10\x03*I\n\nRegionType\x12\x14\n\x10SYNTHETIC_REGION\x10\x00\x12\x17\n\x13NORTHERN_CALIFORNIA\x10\x01\x12\x0c\n\x08MICHIGAN\x10\x02\x62\x06proto3') ) _SCENETYPE = _descriptor.EnumDescriptor( @@ -28,33 +28,28 @@ full_name='dgp.proto.SceneType', filename=None, file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='SYNTHETIC_SCENE', index=0, number=0, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='URBAN', index=1, number=1, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='SUBURBAN', index=2, number=2, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='HIGHWAY', index=3, number=3, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), ], containing_type=None, serialized_options=None, - serialized_start=389, - serialized_end=459, + serialized_start=677, + serialized_end=747, ) _sym_db.RegisterEnumDescriptor(_SCENETYPE) @@ -64,28 +59,24 @@ full_name='dgp.proto.RegionType', filename=None, file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='SYNTHETIC_REGION', index=0, number=0, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='NORTHERN_CALIFORNIA', index=1, number=1, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='MICHIGAN', index=2, number=2, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), ], containing_type=None, serialized_options=None, - serialized_start=461, - serialized_end=534, + serialized_start=749, + serialized_end=822, ) _sym_db.RegisterEnumDescriptor(_REGIONTYPE) @@ -100,109 +91,220 @@ +_PARALLELDOMAINSAMPLEMETADATA_ATTRIBUTESENTRY = _descriptor.Descriptor( + name='AttributesEntry', + full_name='dgp.proto.ParallelDomainSampleMetadata.AttributesEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='dgp.proto.ParallelDomainSampleMetadata.AttributesEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='dgp.proto.ParallelDomainSampleMetadata.AttributesEntry.value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=155, + serialized_end=204, +) + +_PARALLELDOMAINSAMPLEMETADATA = _descriptor.Descriptor( + name='ParallelDomainSampleMetadata', + full_name='dgp.proto.ParallelDomainSampleMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='attributes', full_name='dgp.proto.ParallelDomainSampleMetadata.attributes', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_PARALLELDOMAINSAMPLEMETADATA_ATTRIBUTESENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=46, + serialized_end=204, +) + + +_PARALLELDOMAINSCENEMETADATA_ATTRIBUTESENTRY = _descriptor.Descriptor( + name='AttributesEntry', + full_name='dgp.proto.ParallelDomainSceneMetadata.AttributesEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='dgp.proto.ParallelDomainSceneMetadata.AttributesEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='dgp.proto.ParallelDomainSceneMetadata.AttributesEntry.value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=155, + serialized_end=204, +) + _PARALLELDOMAINSCENEMETADATA = _descriptor.Descriptor( name='ParallelDomainSceneMetadata', full_name='dgp.proto.ParallelDomainSceneMetadata', filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='location', full_name='dgp.proto.ParallelDomainSceneMetadata.location', index=0, number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='region_type', full_name='dgp.proto.ParallelDomainSceneMetadata.region_type', index=1, number=9, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='scene_type', full_name='dgp.proto.ParallelDomainSceneMetadata.scene_type', index=2, number=10, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='time_of_day', full_name='dgp.proto.ParallelDomainSceneMetadata.time_of_day', index=3, number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='sun_elevation', full_name='dgp.proto.ParallelDomainSceneMetadata.sun_elevation', index=4, number=11, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='sun_azimuth', full_name='dgp.proto.ParallelDomainSceneMetadata.sun_azimuth', index=5, number=12, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cloud_cover', full_name='dgp.proto.ParallelDomainSceneMetadata.cloud_cover', index=6, number=13, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='fog_intensity', full_name='dgp.proto.ParallelDomainSceneMetadata.fog_intensity', index=7, number=3, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rain_intensity', full_name='dgp.proto.ParallelDomainSceneMetadata.rain_intensity', index=8, number=4, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='wetness', full_name='dgp.proto.ParallelDomainSceneMetadata.wetness', index=9, number=5, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='street_lights', full_name='dgp.proto.ParallelDomainSceneMetadata.street_lights', index=10, number=6, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='batch_id', full_name='dgp.proto.ParallelDomainSceneMetadata.batch_id', index=11, number=7, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='version', full_name='dgp.proto.ParallelDomainSceneMetadata.version', index=12, number=8, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='attributes', full_name='dgp.proto.ParallelDomainSceneMetadata.attributes', index=13, + number=14, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], - nested_types=[], + nested_types=[_PARALLELDOMAINSCENEMETADATA_ATTRIBUTESENTRY, ], enum_types=[ ], serialized_options=None, @@ -211,23 +313,53 @@ extension_ranges=[], oneofs=[ ], - serialized_start=46, - serialized_end=387, + serialized_start=207, + serialized_end=675, ) +_PARALLELDOMAINSAMPLEMETADATA_ATTRIBUTESENTRY.containing_type = _PARALLELDOMAINSAMPLEMETADATA +_PARALLELDOMAINSAMPLEMETADATA.fields_by_name['attributes'].message_type = _PARALLELDOMAINSAMPLEMETADATA_ATTRIBUTESENTRY +_PARALLELDOMAINSCENEMETADATA_ATTRIBUTESENTRY.containing_type = _PARALLELDOMAINSCENEMETADATA _PARALLELDOMAINSCENEMETADATA.fields_by_name['region_type'].enum_type = _REGIONTYPE _PARALLELDOMAINSCENEMETADATA.fields_by_name['scene_type'].enum_type = _SCENETYPE +_PARALLELDOMAINSCENEMETADATA.fields_by_name['attributes'].message_type = _PARALLELDOMAINSCENEMETADATA_ATTRIBUTESENTRY +DESCRIPTOR.message_types_by_name['ParallelDomainSampleMetadata'] = _PARALLELDOMAINSAMPLEMETADATA DESCRIPTOR.message_types_by_name['ParallelDomainSceneMetadata'] = _PARALLELDOMAINSCENEMETADATA DESCRIPTOR.enum_types_by_name['SceneType'] = _SCENETYPE DESCRIPTOR.enum_types_by_name['RegionType'] = _REGIONTYPE _sym_db.RegisterFileDescriptor(DESCRIPTOR) -ParallelDomainSceneMetadata = _reflection.GeneratedProtocolMessageType('ParallelDomainSceneMetadata', (_message.Message,), { - 'DESCRIPTOR' : _PARALLELDOMAINSCENEMETADATA, - '__module__' : 'dgp.contribs.pd.metadata_pb2' +ParallelDomainSampleMetadata = _reflection.GeneratedProtocolMessageType('ParallelDomainSampleMetadata', (_message.Message,), dict( + + AttributesEntry = _reflection.GeneratedProtocolMessageType('AttributesEntry', (_message.Message,), dict( + DESCRIPTOR = _PARALLELDOMAINSAMPLEMETADATA_ATTRIBUTESENTRY, + __module__ = 'dgp.contribs.pd.metadata_pb2' + # @@protoc_insertion_point(class_scope:dgp.proto.ParallelDomainSampleMetadata.AttributesEntry) + )) + , + DESCRIPTOR = _PARALLELDOMAINSAMPLEMETADATA, + __module__ = 'dgp.contribs.pd.metadata_pb2' + # @@protoc_insertion_point(class_scope:dgp.proto.ParallelDomainSampleMetadata) + )) +_sym_db.RegisterMessage(ParallelDomainSampleMetadata) +_sym_db.RegisterMessage(ParallelDomainSampleMetadata.AttributesEntry) + +ParallelDomainSceneMetadata = _reflection.GeneratedProtocolMessageType('ParallelDomainSceneMetadata', (_message.Message,), dict( + + AttributesEntry = _reflection.GeneratedProtocolMessageType('AttributesEntry', (_message.Message,), dict( + DESCRIPTOR = _PARALLELDOMAINSCENEMETADATA_ATTRIBUTESENTRY, + __module__ = 'dgp.contribs.pd.metadata_pb2' + # @@protoc_insertion_point(class_scope:dgp.proto.ParallelDomainSceneMetadata.AttributesEntry) + )) + , + DESCRIPTOR = _PARALLELDOMAINSCENEMETADATA, + __module__ = 'dgp.contribs.pd.metadata_pb2' # @@protoc_insertion_point(class_scope:dgp.proto.ParallelDomainSceneMetadata) - }) + )) _sym_db.RegisterMessage(ParallelDomainSceneMetadata) +_sym_db.RegisterMessage(ParallelDomainSceneMetadata.AttributesEntry) +_PARALLELDOMAINSAMPLEMETADATA_ATTRIBUTESENTRY._options = None +_PARALLELDOMAINSCENEMETADATA_ATTRIBUTESENTRY._options = None # @@protoc_insertion_point(module_scope)