chromium/third_party/mediapipe/src/mediapipe/calculators/tensorflow/graph_tensors_packet_generator.proto

// Copyright 2019 The MediaPipe Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto2";

package mediapipe;

import "mediapipe/framework/packet_generator.proto";

message GraphTensorsPacketGeneratorOptions {
  extend mediapipe.PacketGeneratorOptions {
    optional GraphTensorsPacketGeneratorOptions ext = 142721046;
  }

  // Names of tensor tags for each of the generated tensors.
  // Examples are: "STATE_C_0" or "STATE_M_0".
  repeated string tensor_tag = 1;

  // Must be same length as tensor_tag. Each tensor tag must be paired with the
  // number of nodes.
  // Tags must be capitalized, matching regex [A-Z0-9_]+. Examples: "STATE_C_0"
  // and "STATE_M_0". Then, those tags can be used as the MediaPipe tags of
  // tensors to initialized in TensorflowInferenceCalculator consuming
  // the packet produced by this generator. For example, a mediapipe graph
  // can include the node:
  // packet_generator {
  //   packet_generator: "GraphTensorsPacketGenerator"
  //   output_side_packet: "init_tensors"
  //   options {
  //     [mediapipe.StateTensorsPacketGeneratorOptions.ext]: {
  //      tensor_tag: "STATE_C_0"
  //       tensor_num_nodes:128
  //       tensor_tag: "STATE_M_0"
  //       tensor_num_nodes:128
  //     }
  //   }
  // }
  repeated int32 tensor_num_nodes = 2;
}