How to use the mediapipe.util.sequence.media_sequence.get_example_id_default_parser function in mediapipe

To help you get started, we’ve selected a few mediapipe examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github google / mediapipe / mediapipe / examples / desktop / media_sequence / charades_dataset.py View on Github external
def parse_fn(sequence_example):
      """Parses a Charades example."""
      context_features = {
          ms.get_example_id_key(): ms.get_example_id_default_parser(),
          ms.get_segment_start_index_key(): (
              ms.get_segment_start_index_default_parser()),
          ms.get_segment_end_index_key(): (
              ms.get_segment_end_index_default_parser()),
          ms.get_segment_label_index_key(): (
              ms.get_segment_label_index_default_parser()),
          ms.get_segment_label_string_key(): (
              ms.get_segment_label_string_default_parser()),
          ms.get_segment_start_timestamp_key(): (
              ms.get_segment_start_timestamp_default_parser()),
          ms.get_segment_end_timestamp_key(): (
              ms.get_segment_end_timestamp_default_parser()),
          ms.get_image_frame_rate_key(): (
              ms.get_image_frame_rate_default_parser()),
      }
github google / mediapipe / mediapipe / examples / desktop / media_sequence / demo_dataset.py View on Github external
def parse_fn(sequence_example):
      """Parses a clip classification example."""
      context_features = {
          ms.get_example_id_key():
              ms.get_example_id_default_parser(),
          ms.get_clip_label_index_key():
              ms.get_clip_label_index_default_parser(),
          ms.get_clip_label_string_key():
              ms.get_clip_label_string_default_parser()
      }
      sequence_features = {
          ms.get_image_encoded_key(): ms.get_image_encoded_default_parser(),
      }
      parsed_context, parsed_sequence = tf.io.parse_single_sequence_example(
          sequence_example, context_features, sequence_features)
      example_id = parsed_context[ms.get_example_id_key()]
      classification_target = tf.one_hot(
          tf.sparse_tensor_to_dense(
              parsed_context[ms.get_clip_label_index_key()]), NUM_CLASSES)
      images = tf.map_fn(
          tf.image.decode_jpeg,

mediapipe

MediaPipe is the simplest way for researchers and developers to build world-class ML solutions and applications for mobile, edge, cloud and the web.

Apache-2.0
Latest version published 12 days ago

Package Health Score

91 / 100
Full package analysis