Add MatrixData as a packet option for ConstantSidePacketCalculatorOptions.

PiperOrigin-RevId: 542616847
This commit is contained in:
Jiuqiang Tang 2023-06-22 11:24:00 -07:00 committed by Copybara-Service
parent ba7e0e0e50
commit 98d493f37a
3 changed files with 9 additions and 0 deletions

View File

@ -117,6 +117,7 @@ mediapipe_proto_library(
"//mediapipe/framework:calculator_proto", "//mediapipe/framework:calculator_proto",
"//mediapipe/framework/formats:classification_proto", "//mediapipe/framework/formats:classification_proto",
"//mediapipe/framework/formats:landmark_proto", "//mediapipe/framework/formats:landmark_proto",
"//mediapipe/framework/formats:matrix_data_proto",
"//mediapipe/framework/formats:time_series_header_proto", "//mediapipe/framework/formats:time_series_header_proto",
], ],
) )
@ -1168,6 +1169,7 @@ cc_library(
"//mediapipe/framework:collection_item_id", "//mediapipe/framework:collection_item_id",
"//mediapipe/framework/formats:classification_cc_proto", "//mediapipe/framework/formats:classification_cc_proto",
"//mediapipe/framework/formats:landmark_cc_proto", "//mediapipe/framework/formats:landmark_cc_proto",
"//mediapipe/framework/formats:matrix_data_cc_proto",
"//mediapipe/framework/formats:time_series_header_cc_proto", "//mediapipe/framework/formats:time_series_header_cc_proto",
"//mediapipe/framework/port:integral_types", "//mediapipe/framework/port:integral_types",
"//mediapipe/framework/port:ret_check", "//mediapipe/framework/port:ret_check",

View File

@ -19,6 +19,7 @@
#include "mediapipe/framework/collection_item_id.h" #include "mediapipe/framework/collection_item_id.h"
#include "mediapipe/framework/formats/classification.pb.h" #include "mediapipe/framework/formats/classification.pb.h"
#include "mediapipe/framework/formats/landmark.pb.h" #include "mediapipe/framework/formats/landmark.pb.h"
#include "mediapipe/framework/formats/matrix_data.pb.h"
#include "mediapipe/framework/formats/time_series_header.pb.h" #include "mediapipe/framework/formats/time_series_header.pb.h"
#include "mediapipe/framework/port/canonical_errors.h" #include "mediapipe/framework/port/canonical_errors.h"
#include "mediapipe/framework/port/integral_types.h" #include "mediapipe/framework/port/integral_types.h"
@ -85,6 +86,8 @@ class ConstantSidePacketCalculator : public CalculatorBase {
packet.Set<LandmarkList>(); packet.Set<LandmarkList>();
} else if (packet_options.has_double_value()) { } else if (packet_options.has_double_value()) {
packet.Set<double>(); packet.Set<double>();
} else if (packet_options.has_matrix_data_value()) {
packet.Set<MatrixData>();
} else if (packet_options.has_time_series_header_value()) { } else if (packet_options.has_time_series_header_value()) {
packet.Set<TimeSeriesHeader>(); packet.Set<TimeSeriesHeader>();
} else if (packet_options.has_int64_value()) { } else if (packet_options.has_int64_value()) {
@ -123,6 +126,8 @@ class ConstantSidePacketCalculator : public CalculatorBase {
MakePacket<LandmarkList>(packet_options.landmark_list_value())); MakePacket<LandmarkList>(packet_options.landmark_list_value()));
} else if (packet_options.has_double_value()) { } else if (packet_options.has_double_value()) {
packet.Set(MakePacket<double>(packet_options.double_value())); packet.Set(MakePacket<double>(packet_options.double_value()));
} else if (packet_options.has_matrix_data_value()) {
packet.Set(MakePacket<MatrixData>(packet_options.matrix_data_value()));
} else if (packet_options.has_time_series_header_value()) { } else if (packet_options.has_time_series_header_value()) {
packet.Set(MakePacket<TimeSeriesHeader>( packet.Set(MakePacket<TimeSeriesHeader>(
packet_options.time_series_header_value())); packet_options.time_series_header_value()));

View File

@ -19,6 +19,7 @@ package mediapipe;
import "mediapipe/framework/calculator.proto"; import "mediapipe/framework/calculator.proto";
import "mediapipe/framework/formats/classification.proto"; import "mediapipe/framework/formats/classification.proto";
import "mediapipe/framework/formats/landmark.proto"; import "mediapipe/framework/formats/landmark.proto";
import "mediapipe/framework/formats/matrix_data.proto";
import "mediapipe/framework/formats/time_series_header.proto"; import "mediapipe/framework/formats/time_series_header.proto";
message ConstantSidePacketCalculatorOptions { message ConstantSidePacketCalculatorOptions {
@ -38,6 +39,7 @@ message ConstantSidePacketCalculatorOptions {
ClassificationList classification_list_value = 6; ClassificationList classification_list_value = 6;
LandmarkList landmark_list_value = 7; LandmarkList landmark_list_value = 7;
TimeSeriesHeader time_series_header_value = 10; TimeSeriesHeader time_series_header_value = 10;
MatrixData matrix_data_value = 12;
} }
} }