Пример #1
0
def _create_image_with_prefix(name, prefix):
    """Create multiple accessors for image based data."""
    msu.create_bytes_context_feature(name + "_format",
                                     IMAGE_FORMAT_KEY,
                                     prefix=prefix,
                                     module_dict=globals())
    msu.create_bytes_context_feature(name + "_colorspace",
                                     IMAGE_COLORSPACE_KEY,
                                     prefix=prefix,
                                     module_dict=globals())
    msu.create_int_context_feature(name + "_channels",
                                   IMAGE_CHANNELS_KEY,
                                   prefix=prefix,
                                   module_dict=globals())
    msu.create_int_context_feature(name + "_height",
                                   IMAGE_HEIGHT_KEY,
                                   prefix=prefix,
                                   module_dict=globals())
    msu.create_int_context_feature(name + "_width",
                                   IMAGE_WIDTH_KEY,
                                   prefix=prefix,
                                   module_dict=globals())
    msu.create_bytes_feature_list(name + "_encoded",
                                  IMAGE_ENCODED_KEY,
                                  prefix=prefix,
                                  module_dict=globals())
    msu.create_float_context_feature(name + "_frame_rate",
                                     IMAGE_FRAME_RATE_KEY,
                                     prefix=prefix,
                                     module_dict=globals())
    msu.create_bytes_list_context_feature(name + "_class_label_string",
                                          IMAGE_CLASS_LABEL_STRING_KEY,
                                          prefix=prefix,
                                          module_dict=globals())
    msu.create_int_list_context_feature(name + "_class_label_index",
                                        IMAGE_CLASS_LABEL_INDEX_KEY,
                                        prefix=prefix,
                                        module_dict=globals())
    msu.create_int_list_context_feature(name + "_object_class_index",
                                        IMAGE_OBJECT_CLASS_INDEX_KEY,
                                        prefix=prefix,
                                        module_dict=globals())
    msu.create_bytes_context_feature(name + "_data_path",
                                     IMAGE_DATA_PATH_KEY,
                                     prefix=prefix,
                                     module_dict=globals())
    msu.create_int_feature_list(name + "_timestamp",
                                IMAGE_TIMESTAMP_KEY,
                                prefix=prefix,
                                module_dict=globals())
    msu.create_bytes_list_feature_list(name + "_multi_encoded",
                                       IMAGE_MULTI_ENCODED_KEY,
                                       prefix=prefix,
                                       module_dict=globals())
Пример #2
0
                                 EXAMPLE_DATASET_NAME_KEY,
                                 module_dict=globals())
msu.create_bytes_context_feature("clip_media_id",
                                 CLIP_MEDIA_ID_KEY,
                                 module_dict=globals())
msu.create_bytes_context_feature("clip_alternative_media_id",
                                 ALTERNATIVE_CLIP_MEDIA_ID_KEY,
                                 module_dict=globals())
msu.create_bytes_context_feature("clip_encoded_media_bytes",
                                 CLIP_ENCODED_MEDIA_BYTES_KEY,
                                 module_dict=globals())
msu.create_bytes_context_feature("clip_data_path",
                                 CLIP_DATA_PATH_KEY,
                                 module_dict=globals())
msu.create_int_context_feature("clip_encoded_media_start_timestamp",
                               CLIP_ENCODED_MEDIA_START_TIMESTAMP_KEY,
                               module_dict=globals())
msu.create_int_context_feature("clip_start_timestamp",
                               CLIP_START_TIMESTAMP_KEY,
                               module_dict=globals())
msu.create_int_context_feature("clip_end_timestamp",
                               CLIP_END_TIMESTAMP_KEY,
                               module_dict=globals())
msu.create_bytes_list_context_feature("clip_label_string",
                                      CLIP_LABEL_STRING_KEY,
                                      module_dict=globals())
msu.create_int_list_context_feature("clip_label_index",
                                    CLIP_LABEL_INDEX_KEY,
                                    module_dict=globals())
msu.create_float_list_context_feature("clip_label_confidence",
                                      CLIP_LABEL_CONFIDENCE_KEY,
Пример #3
0
from __future__ import print_function

import tensorflow as tf

from mediapipe.util.sequence import media_sequence_util as msu

# run this code at the module level to procedurally define functions for test
# cases.
msu.create_bytes_context_feature("string_context",
                                 "string_feature",
                                 module_dict=msu.__dict__)
msu.create_float_context_feature("float_context",
                                 "float_feature",
                                 module_dict=msu.__dict__)
msu.create_int_context_feature("int64_context",
                               "int64_feature",
                               module_dict=msu.__dict__)
msu.create_bytes_list_context_feature("string_list_context",
                                      "string_vector_feature",
                                      module_dict=msu.__dict__)
msu.create_float_list_context_feature("float_list_context",
                                      "float_vector_feature",
                                      module_dict=msu.__dict__)
msu.create_int_list_context_feature("int64_list_context",
                                    "int64_vector_feature",
                                    module_dict=msu.__dict__)
msu.create_bytes_feature_list("string_feature_list",
                              "string_feature_list",
                              module_dict=msu.__dict__)
msu.create_float_feature_list("float_feature_list",
                              "float_feature_list",