How to choose path according to the ‘STRING’ input stream?

  bazel, c++, mediapipe, protocol-buffers

I am working with a Protobuf graph.
It is currently accepting an Int input stream and gives output based on the index.
What I want is to accept a String input stream and edit the path accordingly and give the output.
Something like this:

 node {
  calculator: "SwitchContainer"
  input_stream: "SELECT:{somestring}"
  input_side_packet: "ENVIRONMENT:environment"
  output_stream: "IMAGE_GPU:output_video"
  node_options: {
    [type.googleapis.com/mediapipe.SwitchContainerOptions] {
      contained_node: {
        calculator: "FaceGeometryEffectRendererCalculator"
        node_options: {
          [type.googleapis.com/mediapipe.FaceGeometryEffectRendererCalculatorOptions] {
            effect_texture_path: "mediapipe/graphs/face_effect/{somestring}/axis.pngblob"
            effect_mesh_3d_path: "mediapipe/graphs/face_effect/{somestring}/axis.binarypb"
          }
        }
      }
    }
  }
}

Here is the switch_container.cc file.
Do I need to make changes in the calculator file?

Source: Windows Questions C++

LEAVE A COMMENT