#ifndef MEDIAPIPE_FRAMEWORK_API2_STREAM_LANDMARKS_TO_TENSOR_H_ #define MEDIAPIPE_FRAMEWORK_API2_STREAM_LANDMARKS_TO_TENSOR_H_ #include #include #include "absl/types/span.h" #include "mediapipe/calculators/tensor/landmarks_to_tensor_calculator.pb.h" #include "mediapipe/framework/api2/builder.h" #include "mediapipe/framework/formats/landmark.pb.h" #include "mediapipe/framework/formats/tensor.h" namespace mediapipe::api2::builder { // Updates @graph to convert @landmarks to a Tensor. Values and their order are // defined by @attributes. If @flatten is true resulting tensor will be 1D, // otherwise tensor will be 2D with (n_landmarks, n_attributes) shape. Stream> ConvertLandmarksToTensor( Stream landmarks, absl::Span attributes, bool flatten, Graph& graph); // Updates @graph to convert @normalized_landmarks to a Tensor. Values and their // order are defined by @attributes. X, Y and Z values are scaled using // @image_size. If @flatten is true resulting tensor will be 1D, otherwise // tensor will be 2D with (n_landmarks, n_attributes) shape. Stream> ConvertNormalizedLandmarksToTensor( Stream normalized_landmarks, Stream> image_size, absl::Span attributes, bool flatten, Graph& graph); } // namespace mediapipe::api2::builder #endif // MEDIAPIPE_FRAMEWORK_API2_STREAM_LANDMARKS_TO_TENSOR_H_