From c7771138cf2361f6184220424fa751ab90f60672 Mon Sep 17 00:00:00 2001 From: Junrou Nishida Date: Sat, 29 Jul 2023 22:39:46 +0900 Subject: [PATCH] feat: implement FaceDetector (#974) * feat: implement FaceDetectorOptions * feat: implement FaceDetector * build: include FaceDetector * build: include blaze_face_short_range.tflite --- .../blaze_face_short_range.bytes.meta | 7 + .../Scripts/Protobuf/Tasks/Vision.meta | 8 + .../Protobuf/Tasks/Vision/FaceDetector.meta | 8 + .../Tasks/Vision/FaceDetector/Proto.meta | 8 + .../Proto/FaceDetectorGraphOptions.cs.meta | 11 + .../Scripts/Tasks/Vision/FaceDetector.meta | 8 + .../Tasks/Vision/FaceDetector/FaceDetector.cs | 189 ++++++++++++++++++ .../Vision/FaceDetector/FaceDetector.cs.meta | 11 + .../FaceDetector/FaceDetectorOptions.cs | 66 ++++++ .../FaceDetector/FaceDetectorOptions.cs.meta | 11 + mediapipe_api/BUILD | 8 + .../tasks/cc/vision/face_detector/proto/BUILD | 29 +++ third_party/mediapipe_model_path.diff | 17 ++ third_party/mediapipe_visibility.diff | 14 ++ 14 files changed, 395 insertions(+) create mode 100644 Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/blaze_face_short_range.bytes.meta create mode 100644 Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision.meta create mode 100644 Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision/FaceDetector.meta create mode 100644 Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision/FaceDetector/Proto.meta create mode 100644 Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision/FaceDetector/Proto/FaceDetectorGraphOptions.cs.meta create mode 100644 Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector.meta create mode 100644 Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetector.cs create mode 100644 Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetector.cs.meta create mode 100644 Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetectorOptions.cs create mode 100644 Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetectorOptions.cs.meta create mode 100644 mediapipe_api/tasks/cc/vision/face_detector/proto/BUILD diff --git a/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/blaze_face_short_range.bytes.meta b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/blaze_face_short_range.bytes.meta new file mode 100644 index 000000000..730e847c7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/PackageResources/MediaPipe/blaze_face_short_range.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fdfebe6026114fa01969b02a8846f91a +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision.meta new file mode 100644 index 000000000..2855e7a98 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 474e765f79527bbc697ea16f848134a6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision/FaceDetector.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision/FaceDetector.meta new file mode 100644 index 000000000..d0b6d6849 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision/FaceDetector.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0351dc0a3270422d6ae6123f299a2d18 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision/FaceDetector/Proto.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision/FaceDetector/Proto.meta new file mode 100644 index 000000000..cdcbe3796 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision/FaceDetector/Proto.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d084e794e13419bb49c5f334813f5b75 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision/FaceDetector/Proto/FaceDetectorGraphOptions.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision/FaceDetector/Proto/FaceDetectorGraphOptions.cs.meta new file mode 100644 index 000000000..062547945 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Protobuf/Tasks/Vision/FaceDetector/Proto/FaceDetectorGraphOptions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3c7e03ce8e0c88dd1bef8e467cced3c9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector.meta new file mode 100644 index 000000000..ff5e73a44 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 382942ff0853b9ad3b85e9a23a6dd42f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetector.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetector.cs new file mode 100644 index 000000000..ddd0bd58b --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetector.cs @@ -0,0 +1,189 @@ +// Copyright (c) 2023 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +using System.Collections.Generic; + +using FaceDetectionResult = Mediapipe.Tasks.Components.Containers.DetectionResult; + +namespace Mediapipe.Tasks.Vision.FaceDetector +{ + public sealed class FaceDetector : Core.BaseVisionTaskApi + { + private const string _DETECTIONS_OUT_STREAM_NAME = "detections"; + private const string _DETECTIONS_TAG = "DETECTIONS"; + private const string _NORM_RECT_STREAM_NAME = "norm_rect_in"; + private const string _NORM_RECT_TAG = "NORM_RECT"; + private const string _IMAGE_IN_STREAM_NAME = "image_in"; + private const string _IMAGE_OUT_STREAM_NAME = "image_out"; + private const string _IMAGE_TAG = "IMAGE"; + private const string _TASK_GRAPH_NAME = "mediapipe.tasks.vision.face_detector.FaceDetectorGraph"; + + private const int _MICRO_SECONDS_PER_MILLISECOND = 1000; + +#pragma warning disable IDE0052 // Remove unread private members + /// + /// keep reference to prevent GC from collecting the callback instance. + /// + private readonly Tasks.Core.TaskRunner.PacketsCallback _packetCallback; +#pragma warning restore IDE0052 + + private FaceDetector( + CalculatorGraphConfig graphConfig, + Core.RunningMode runningMode, + Tasks.Core.TaskRunner.PacketsCallback packetCallback) : base(graphConfig, runningMode, packetCallback) + { + _packetCallback = packetCallback; + } + + public static FaceDetector CreateFromModelPath(string modelPath) + { + var baseOptions = new Tasks.Core.BaseOptions(modelAssetPath: modelPath); + var options = new FaceDetectorOptions(baseOptions, runningMode: Core.RunningMode.IMAGE); + return CreateFromOptions(options); + } + + public static FaceDetector CreateFromOptions(FaceDetectorOptions options) + { + var taskInfo = new Tasks.Core.TaskInfo( + taskGraph: _TASK_GRAPH_NAME, + inputStreams: new List { + string.Join(":", _IMAGE_TAG, _IMAGE_IN_STREAM_NAME), + string.Join(":", _NORM_RECT_TAG, _NORM_RECT_STREAM_NAME), + }, + outputStreams: new List { + string.Join(":", _DETECTIONS_TAG, _DETECTIONS_OUT_STREAM_NAME), + string.Join(":", _IMAGE_TAG, _IMAGE_OUT_STREAM_NAME), + }, + taskOptions: options); + + return new FaceDetector( + taskInfo.GenerateGraphConfig(options.runningMode == Core.RunningMode.LIVE_STREAM), + options.runningMode, + BuildPacketsCallback(options.resultCallback)); + } + + /// + /// Performs face detection on the provided MediaPipe Image. + /// + /// Only use this method when the is created with the image running mode. + /// + /// + /// A face detection result object that contains a list of face detections, + /// each detection has a bounding box that is expressed in the unrotated input + /// frame of reference coordinates system, i.e. in `[0,image_width) x [0, + /// image_height)`, which are the dimensions of the underlying image data. + /// + public FaceDetectionResult Detect(Image image, Core.ImageProcessingOptions? imageProcessingOptions = null) + { + var normalizedRect = ConvertToNormalizedRect(imageProcessingOptions, image, roiAllowed: false); + + var packetMap = new PacketMap(); + packetMap.Emplace(_IMAGE_IN_STREAM_NAME, new ImagePacket(image)); + packetMap.Emplace(_NORM_RECT_STREAM_NAME, new NormalizedRectPacket(normalizedRect)); + var outputPackets = ProcessImageData(packetMap); + + var outDetectionsPacket = outputPackets.At>(_DETECTIONS_OUT_STREAM_NAME); + if (outDetectionsPacket.IsEmpty()) + { + return new FaceDetectionResult(new List()); + } + return FaceDetectionResult.CreateFrom(outDetectionsPacket.Get()); + } + + /// + /// Performs face detection on the provided video frames. + /// + /// Only use this method when the FaceDetector is created with the video + /// running mode. It's required to provide the video frame's timestamp (in + /// milliseconds) along with the video frame. The input timestamps should be + /// monotonically increasing for adjacent calls of this method. + /// + /// + /// A face detection result object that contains a list of face detections, + /// each detection has a bounding box that is expressed in the unrotated input + /// frame of reference coordinates system, i.e. in `[0,image_width) x [0, + /// image_height)`, which are the dimensions of the underlying image data. + /// + public FaceDetectionResult DetectForVideo(Image image, int timestampMs, Core.ImageProcessingOptions? imageProcessingOptions = null) + { + var normalizedRect = ConvertToNormalizedRect(imageProcessingOptions, image, roiAllowed: false); + + var packetMap = new PacketMap(); + var timestamp = new Timestamp(timestampMs * _MICRO_SECONDS_PER_MILLISECOND); + packetMap.Emplace(_IMAGE_IN_STREAM_NAME, new ImagePacket(image, timestamp)); + packetMap.Emplace(_NORM_RECT_STREAM_NAME, new NormalizedRectPacket(normalizedRect).At(timestamp)); + var outputPackets = ProcessVideoData(packetMap); + + var outDetectionsPacket = outputPackets.At>(_DETECTIONS_OUT_STREAM_NAME); + if (outDetectionsPacket.IsEmpty()) + { + return new FaceDetectionResult(new List()); + } + return FaceDetectionResult.CreateFrom(outDetectionsPacket.Get()); + } + + /// + /// Sends live image data (an Image with a unique timestamp) to perform face detection. + /// + /// Only use this method when the FaceDetector is created with the live stream + /// running mode. The input timestamps should be monotonically increasing for + /// adjacent calls of this method. This method will return immediately after the + /// input image is accepted. The results will be available via the + /// provided in the . + /// The method is designed to process live stream data such as camera + /// input. To lower the overall latency, face detector may drop the input + /// images if needed. In other words, it's not guaranteed to have output per + /// input image. + public void DetectAsync(Image image, int timestampMs, Core.ImageProcessingOptions? imageProcessingOptions = null) + { + var normalizedRect = ConvertToNormalizedRect(imageProcessingOptions, image, roiAllowed: false); + + var packetMap = new PacketMap(); + var timestamp = new Timestamp(timestampMs * _MICRO_SECONDS_PER_MILLISECOND); + packetMap.Emplace(_IMAGE_IN_STREAM_NAME, new ImagePacket(image, timestamp)); + packetMap.Emplace(_NORM_RECT_STREAM_NAME, new NormalizedRectPacket(normalizedRect).At(timestamp)); + + SendLiveStreamData(packetMap); + } + + private static Tasks.Core.TaskRunner.PacketsCallback BuildPacketsCallback(FaceDetectorOptions.ResultCallback resultCallback) + { + if (resultCallback == null) + { + return null; + } + + return (PacketMap outputPackets) => + { + var outImagePacket = outputPackets.At(_IMAGE_OUT_STREAM_NAME); + var outDetectionsPacket = outputPackets.At>(_DETECTIONS_OUT_STREAM_NAME); + if (outImagePacket == null || outDetectionsPacket == null) + { + return; + } + + if (outImagePacket.IsEmpty()) + { + return; + } + var image = outImagePacket.Get(); + var timestamp = outImagePacket.Timestamp().Microseconds() / _MICRO_SECONDS_PER_MILLISECOND; + + if (outDetectionsPacket.IsEmpty()) + { + resultCallback( + new FaceDetectionResult(new List()), + image, + (int)timestamp); + return; + } + + var detectionProtoList = outDetectionsPacket.Get(); + resultCallback(FaceDetectionResult.CreateFrom(detectionProtoList), image, (int)timestamp); + }; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetector.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetector.cs.meta new file mode 100644 index 000000000..684519de8 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e2f6292275f21a23896392fc3147fe6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetectorOptions.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetectorOptions.cs new file mode 100644 index 000000000..bac7339f7 --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetectorOptions.cs @@ -0,0 +1,66 @@ +// Copyright (c) 2023 homuler +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +namespace Mediapipe.Tasks.Vision.FaceDetector +{ + public sealed class FaceDetectorOptions : Tasks.Core.ITaskOptions + { + /// + /// face detection result object that contains a list of face detections, + /// each detection has a bounding box that is expressed in the unrotated + /// input frame of reference coordinates system, + /// i.e. in `[0,image_width) x [0,image_height)`, which are the dimensions + /// of the underlying image data. + /// + /// + /// The input image that the face detector runs on. + /// + /// + /// The input timestamp in milliseconds. + /// + public delegate void ResultCallback(Components.Containers.DetectionResult detectionResult, Image image, int timestampMs); + + public Tasks.Core.BaseOptions baseOptions { get; } + public Core.RunningMode runningMode { get; } + public float minDetectionConfidence { get; } = 0.5f; + public float minSuppressionThreshold { get; } = 0.3f; + public ResultCallback resultCallback { get; } + + public FaceDetectorOptions( + Tasks.Core.BaseOptions baseOptions, + Core.RunningMode runningMode = Core.RunningMode.IMAGE, + float minDetectionConfidence = 0.5f, + float minSuppressionThreshold = 0.3f, + ResultCallback resultCallback = null) + { + this.baseOptions = baseOptions; + this.runningMode = runningMode; + this.minDetectionConfidence = minDetectionConfidence; + this.minSuppressionThreshold = minSuppressionThreshold; + this.resultCallback = resultCallback; + } + + internal Proto.FaceDetectorGraphOptions ToProto() + { + var baseOptionsProto = baseOptions.ToProto(); + baseOptionsProto.UseStreamMode = runningMode != Core.RunningMode.IMAGE; + + return new Proto.FaceDetectorGraphOptions + { + BaseOptions = baseOptionsProto, + MinDetectionConfidence = minDetectionConfidence, + MinSuppressionThreshold = minSuppressionThreshold, + }; + } + + CalculatorOptions Tasks.Core.ITaskOptions.ToCalculatorOptions() + { + var options = new CalculatorOptions(); + options.SetExtension(Proto.FaceDetectorGraphOptions.Extensions.Ext, ToProto()); + return options; + } + } +} diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetectorOptions.cs.meta b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetectorOptions.cs.meta new file mode 100644 index 000000000..b9ebf9e7e --- /dev/null +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceDetector/FaceDetectorOptions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: be7185077f5cc5dcea67ee4ae2d34c07 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/mediapipe_api/BUILD b/mediapipe_api/BUILD index fd3726b9e..c89f4af6f 100644 --- a/mediapipe_api/BUILD +++ b/mediapipe_api/BUILD @@ -9,6 +9,7 @@ load("@bazel_skylib//lib:selects.bzl", "selects") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_list_flag") load("@rules_pkg//:pkg.bzl", "pkg_zip") load("@build_bazel_apple_support//rules:universal_binary.bzl", "universal_binary") +load("@com_google_mediapipe//mediapipe/framework/tool:mediapipe_files.bzl", "mediapipe_files") bool_flag( name = "macos_universal", @@ -308,6 +309,7 @@ cc_library( name = "face_detection_calculators", deps = [ "@com_google_mediapipe//mediapipe/framework/tool:switch_mux_calculator", + "@com_google_mediapipe//mediapipe/tasks/cc/vision/face_detector:face_detector", ] + select({ "@com_google_mediapipe//mediapipe/gpu:disable_gpu": [ "@com_google_mediapipe//mediapipe/graphs/face_detection:desktop_live_calculators", @@ -426,6 +428,10 @@ pkg_zip( ], ) +mediapipe_files(srcs = [ + "blaze_face_short_range.tflite", +]) + pkg_asset( name = "mediapipe_assets", srcs = select({ @@ -465,6 +471,7 @@ pkg_asset( filegroup( name = "face_detection_assets", srcs = [ + ":blaze_face_short_range.tflite", "@com_google_mediapipe//mediapipe/modules/face_detection:face_detection_full_range_sparse.tflite", "@com_google_mediapipe//mediapipe/modules/face_detection:face_detection_full_range.tflite", "@com_google_mediapipe//mediapipe/modules/face_detection:face_detection_short_range.tflite", @@ -557,6 +564,7 @@ pkg_zip( "//mediapipe_api/modules/face_geometry/protos:proto_srcs", "//mediapipe_api/modules/holistic_landmark/calculators:proto_srcs", "//mediapipe_api/tasks/cc/core/proto:proto_srcs", + "//mediapipe_api/tasks/cc/vision/face_detector/proto:proto_srcs", "//mediapipe_api/util:proto_srcs", "//mediapipe_api/util/tracking:proto_srcs", ], diff --git a/mediapipe_api/tasks/cc/vision/face_detector/proto/BUILD b/mediapipe_api/tasks/cc/vision/face_detector/proto/BUILD new file mode 100644 index 000000000..21dd5180a --- /dev/null +++ b/mediapipe_api/tasks/cc/vision/face_detector/proto/BUILD @@ -0,0 +1,29 @@ +# Copyright (c) 2021 homuler +# +# Use of this source code is governed by an MIT-style +# license that can be found in the LICENSE file or at +# https://opensource.org/licenses/MIT. + +load("@rules_pkg//pkg:mappings.bzl", "pkg_files") +load("//mediapipe_api:csharp_proto_src.bzl", "csharp_proto_src") + +package(default_visibility = ["//visibility:public"]) + +pkg_files( + name = "proto_srcs", + srcs = [ + ":face_detector_graph_options_cs", + ], + prefix = "Tasks/Vision/FaceDetector/Proto", +) + +csharp_proto_src( + name = "face_detector_graph_options_cs", + proto_src = "mediapipe/tasks/cc/vision/face_detector/proto/face_detector_graph_options.proto", + deps = [ + "@com_google_mediapipe//mediapipe/tasks/cc/core/proto:protos_src", + "@com_google_mediapipe//mediapipe/tasks/cc/vision/face_detector/proto:protos_src", + "@com_google_mediapipe//mediapipe/calculators/tensor:protos_src", + "@com_google_mediapipe//mediapipe/framework:protos_src", + ], +) diff --git a/third_party/mediapipe_model_path.diff b/third_party/mediapipe_model_path.diff index b8e7fa824..f78635bb8 100644 --- a/third_party/mediapipe_model_path.diff +++ b/third_party/mediapipe_model_path.diff @@ -487,3 +487,20 @@ index 00000000..946be0d4 + +} // namespace internal +} // namespace mediapipe +diff --git a/third_party/external_files.bzl b/third_party/external_files.bzl +index 652a2947..c8e1a1ea 100644 +--- a/third_party/external_files.bzl ++++ b/third_party/external_files.bzl +@@ -370,6 +370,12 @@ def external_files(): + urls = ["https://storage.googleapis.com/mediapipe-assets/face_detection_short_range.tflite?generation=1677044301978921"], + ) + ++ http_file( ++ name = "com_google_mediapipe_blaze_face_short_range_tflite", ++ sha256 = "b4578f35940bf5a1a655214a1cce5cab13eba73c1297cd78e1a04c2380b0152f", ++ urls = ["https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/1/blaze_face_short_range.tflite?generation=1682480001338381"], ++ ) ++ + http_file( + name = "com_google_mediapipe_face_geometry_expected_out_pbtxt", + sha256 = "4a4ed08055a5bc9281472dd60180d11f0cdc9a15fa1788d87a58af3d06b2c6e4", diff --git a/third_party/mediapipe_visibility.diff b/third_party/mediapipe_visibility.diff index 4429a3d9a..5cbe7b340 100644 --- a/third_party/mediapipe_visibility.diff +++ b/third_party/mediapipe_visibility.diff @@ -360,6 +360,20 @@ index 72de1be8..bd6e9781 100644 + srcs = glob(["*.proto"]), + visibility = ["//visibility:public"], +) +diff --git a/mediapipe/tasks/cc/vision/face_detector/proto/BUILD b/mediapipe/tasks/cc/vision/face_detector/proto/BUILD +index bdfe65ee..c795ee7e 100644 +--- a/mediapipe/tasks/cc/vision/face_detector/proto/BUILD ++++ b/mediapipe/tasks/cc/vision/face_detector/proto/BUILD +@@ -30,3 +30,9 @@ mediapipe_proto_library( + "//mediapipe/tasks/cc/core/proto:base_options_proto", + ], + ) ++ ++filegroup( ++ name = "protos_src", ++ srcs = glob(["*.proto"]), ++ visibility = ["//visibility:public"], ++) diff --git a/mediapipe/util/BUILD b/mediapipe/util/BUILD index b9fe8b0c..695987ad 100644 --- a/mediapipe/util/BUILD