diff --git a/docs/getting_started/install.md b/docs/getting_started/install.md index 0b23787f3..e630b073a 100644 --- a/docs/getting_started/install.md +++ b/docs/getting_started/install.md @@ -569,7 +569,7 @@ next section. Option 1. Follow [the official Bazel documentation](https://docs.bazel.build/versions/master/install-windows.html) - to install Bazel 5.0.0 or higher. + to install Bazel 5.2.0 or higher. Option 2. Follow the official [Bazel documentation](https://docs.bazel.build/versions/master/install-bazelisk.html) diff --git a/mediapipe/calculators/core/constant_side_packet_calculator.cc b/mediapipe/calculators/core/constant_side_packet_calculator.cc index b2eb3ef34..54488fbfb 100644 --- a/mediapipe/calculators/core/constant_side_packet_calculator.cc +++ b/mediapipe/calculators/core/constant_side_packet_calculator.cc @@ -82,6 +82,8 @@ class ConstantSidePacketCalculator : public CalculatorBase { packet.Set(); } else if (packet_options.has_landmark_list_value()) { packet.Set(); + } else if (packet_options.has_double_value()) { + packet.Set(); } else { return absl::InvalidArgumentError( "None of supported values were specified in options."); @@ -114,6 +116,8 @@ class ConstantSidePacketCalculator : public CalculatorBase { } else if (packet_options.has_landmark_list_value()) { packet.Set( MakePacket(packet_options.landmark_list_value())); + } else if (packet_options.has_double_value()) { + packet.Set(MakePacket(packet_options.double_value())); } else { return absl::InvalidArgumentError( "None of supported values were specified in options."); diff --git a/mediapipe/calculators/core/constant_side_packet_calculator.proto b/mediapipe/calculators/core/constant_side_packet_calculator.proto index bc192ffb4..4ad497b8e 100644 --- a/mediapipe/calculators/core/constant_side_packet_calculator.proto +++ b/mediapipe/calculators/core/constant_side_packet_calculator.proto @@ -36,6 +36,7 @@ message ConstantSidePacketCalculatorOptions { uint64 uint64_value = 5; ClassificationList classification_list_value = 6; LandmarkList landmark_list_value = 7; + double double_value = 9; } } diff --git a/mediapipe/calculators/tensor/BUILD b/mediapipe/calculators/tensor/BUILD index 2529db401..e8659356b 100644 --- a/mediapipe/calculators/tensor/BUILD +++ b/mediapipe/calculators/tensor/BUILD @@ -170,13 +170,18 @@ cc_library( visibility = ["//visibility:public"], deps = [ ":inference_calculator_interface", + "@com_google_absl//absl/memory", + "@com_google_absl//absl/status", "//mediapipe/framework/deps:file_path", "//mediapipe/gpu:gl_calculator_helper", "//mediapipe/util/tflite:tflite_gpu_runner", - "@com_google_absl//absl/memory", - "@com_google_absl//absl/status", "@org_tensorflow//tensorflow/lite:framework_stable", - ], + ] + select({ + "//conditions:default": [], + "//mediapipe:android": [ + "//mediapipe/util/android/file/base", + ], + }), alwayslink = 1, ) diff --git a/mediapipe/calculators/tensorflow/BUILD b/mediapipe/calculators/tensorflow/BUILD index f7e4260cc..a57e1b202 100644 --- a/mediapipe/calculators/tensorflow/BUILD +++ b/mediapipe/calculators/tensorflow/BUILD @@ -753,7 +753,6 @@ cc_library( "//mediapipe/calculators/tensorflow:unpack_media_sequence_calculator_cc_proto", "//mediapipe/framework:calculator_framework", "//mediapipe/framework/formats:location", - "//mediapipe/framework/port:ret_check", "//mediapipe/framework/port:status", "//mediapipe/util:audio_decoder_cc_proto", "//mediapipe/util/sequence:media_sequence", diff --git a/mediapipe/calculators/tensorflow/unpack_media_sequence_calculator.cc b/mediapipe/calculators/tensorflow/unpack_media_sequence_calculator.cc index c4f7d40a9..63b5451a2 100644 --- a/mediapipe/calculators/tensorflow/unpack_media_sequence_calculator.cc +++ b/mediapipe/calculators/tensorflow/unpack_media_sequence_calculator.cc @@ -18,7 +18,6 @@ #include "mediapipe/calculators/tensorflow/unpack_media_sequence_calculator.pb.h" #include "mediapipe/framework/calculator_framework.h" #include "mediapipe/framework/formats/location.h" -#include "mediapipe/framework/port/ret_check.h" #include "mediapipe/framework/port/status.h" #include "mediapipe/util/audio_decoder.pb.h" #include "mediapipe/util/sequence/media_sequence.h" diff --git a/mediapipe/framework/tool/options_lib_template.cc b/mediapipe/framework/tool/options_lib_template.cc index 5199496d8..21a5db10f 100644 --- a/mediapipe/framework/tool/options_lib_template.cc +++ b/mediapipe/framework/tool/options_lib_template.cc @@ -30,6 +30,10 @@ mediapipe::FieldData ReadFileDescriptorSet(const std::string& pb) { *result.mutable_message_value()->mutable_type_url() = "proto2.FileDescriptorSet"; *result.mutable_message_value()->mutable_value() = pb; + + // Force linking of the generated options protobuf. + mediapipe::proto_ns::LinkMessageReflection< + MP_OPTION_TYPE_NS::MP_OPTION_TYPE_NAME>(); return result; } diff --git a/mediapipe/framework/tool/test_util.cc b/mediapipe/framework/tool/test_util.cc index 2f8953ef8..95f0f558e 100644 --- a/mediapipe/framework/tool/test_util.cc +++ b/mediapipe/framework/tool/test_util.cc @@ -243,6 +243,9 @@ std::string GetTestOutputsDir() { size_t n = confstr(_CS_DARWIN_USER_TEMP_DIR, path, sizeof(path)); if (n > 0 && n < sizeof(path)) return path; #endif // __APPLE__ +#ifdef __ANDROID__ + return "/data/local/tmp/"; +#endif // __ANDROID__ output_dir = "/tmp"; } return output_dir; diff --git a/mediapipe/python/pybind/matrix.cc b/mediapipe/python/pybind/matrix.cc index 2a3958f01..c46430329 100644 --- a/mediapipe/python/pybind/matrix.cc +++ b/mediapipe/python/pybind/matrix.cc @@ -15,6 +15,7 @@ #include "mediapipe/python/pybind/matrix.h" #include "mediapipe/framework/formats/matrix.h" +#include "pybind11/eigen.h" #include "pybind11/numpy.h" #include "pybind11/pybind11.h" diff --git a/mediapipe/util/tracking/BUILD b/mediapipe/util/tracking/BUILD index 8f4f6b949..319e99d5b 100644 --- a/mediapipe/util/tracking/BUILD +++ b/mediapipe/util/tracking/BUILD @@ -401,6 +401,7 @@ cc_library( hdrs = ["streaming_buffer.h"], deps = [ "//mediapipe/framework/port:logging", + "//mediapipe/framework/tool:type_util", "@com_google_absl//absl/container:node_hash_map", "@com_google_absl//absl/strings", "@com_google_absl//absl/types:any", diff --git a/mediapipe/util/tracking/streaming_buffer.h b/mediapipe/util/tracking/streaming_buffer.h index 2d7945222..41aadbbb5 100644 --- a/mediapipe/util/tracking/streaming_buffer.h +++ b/mediapipe/util/tracking/streaming_buffer.h @@ -25,6 +25,7 @@ #include "absl/container/node_hash_map.h" #include "absl/types/any.h" #include "mediapipe/framework/port/logging.h" +#include "mediapipe/framework/tool/type_util.h" namespace mediapipe { @@ -128,14 +129,6 @@ TaggedType TaggedPointerType(const std::string& tag); template std::unique_ptr MakeUnique(T* ptr); -template -inline size_t TypeId() { - static_assert(sizeof(char*) <= sizeof(size_t), - "ptr size too large for size_t"); - static char dummy_var; - return reinterpret_cast(&dummy_var); -} - // Note: If any of the function below are called with a tag not registered by // the constructor, the function will fail with CHECK. // Also, if any of the functions below is called with an existing tag but @@ -318,7 +311,8 @@ class StreamingBuffer { //// Implementation details. template TaggedType TaggedPointerType(const std::string& tag) { - return std::make_pair(tag, TypeId>()); + return std::make_pair(tag, + kTypeId>.hash_code()); } template @@ -330,7 +324,7 @@ template void StreamingBuffer::AddDatum(const std::string& tag, std::unique_ptr pointer) { CHECK(HasTag(tag)); - CHECK_EQ(data_config_[tag], TypeId>()); + CHECK_EQ(data_config_[tag], kTypeId>.hash_code()); auto& buffer = data_[tag]; absl::any packet(PointerType(CreatePointer(pointer.release()))); buffer.push_back(packet);