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 index 5eb5618b3..460fde4e0 100644 --- 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 @@ -38,6 +38,16 @@ private FaceDetector( _packetCallback = packetCallback; } + /// + /// Creates an object from a TensorFlow Lite model and the default . + /// + /// Note that the created instance is in image mode, + /// for detecting faces on single image inputs. + /// + /// Path to the model. + /// + /// object that's created from the model and the default . + /// public static FaceDetector CreateFromModelPath(string modelPath) { var baseOptions = new Tasks.Core.BaseOptions(modelAssetPath: modelPath); @@ -45,6 +55,13 @@ public static FaceDetector CreateFromModelPath(string modelPath) return CreateFromOptions(options); } + /// + /// Creates the object from . + /// + /// Options for the face detector task. + /// + /// object that's created from . + /// public static FaceDetector CreateFromOptions(FaceDetectorOptions options) { var taskInfo = new Tasks.Core.TaskInfo( 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 index c1d1ddacc..34afd8b32 100644 --- 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 @@ -6,6 +6,9 @@ namespace Mediapipe.Tasks.Vision.FaceDetector { + /// + /// Options for the face detector task. + /// public sealed class FaceDetectorOptions : Tasks.Core.ITaskOptions { /// @@ -23,11 +26,44 @@ public sealed class FaceDetectorOptions : Tasks.Core.ITaskOptions /// public delegate void ResultCallback(Components.Containers.DetectionResult detectionResult, Image image, int timestampMs); + /// + /// Base options for the face detector task. + /// public Tasks.Core.BaseOptions baseOptions { get; } + /// + /// The running mode of the task. Default to the image mode. + /// Face detector task has three running modes: + /// + /// + /// The image mode for detecting faces on single image inputs. + /// + /// + /// The video mode for detecting faces on the decoded frames of a video. + /// + /// + /// + /// The live stream mode or detecting faces on the live stream of input data, such as from camera. + /// + /// + /// + /// public Core.RunningMode runningMode { get; } + /// + /// The minimum confidence score for the face detection to be considered successful. + /// public float minDetectionConfidence { get; } + /// + /// The minimum non-maximum-suppression threshold for face detection to be considered overlapped. + /// public float minSuppressionThreshold { get; } + /// + /// The maximum number of faces that can be detected by the face detector. + /// public int numFaces { get; } + /// + /// The user-defined result callback for processing live stream data. + /// The result callback should only be specified when the running mode is set to the live stream mode. + /// public ResultCallback resultCallback { get; } public FaceDetectorOptions( diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceLandmarker/FaceLandmarkerOptions.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceLandmarker/FaceLandmarkerOptions.cs index 19f71eda8..efbf4bbe8 100644 --- a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceLandmarker/FaceLandmarkerOptions.cs +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceLandmarker/FaceLandmarkerOptions.cs @@ -6,6 +6,9 @@ namespace Mediapipe.Tasks.Vision.FaceLandmarker { + /// + /// Options for the face landmarker task. + /// public sealed class FaceLandmarkerOptions : Tasks.Core.ITaskOptions { /// @@ -19,14 +22,60 @@ public sealed class FaceLandmarkerOptions : Tasks.Core.ITaskOptions /// public delegate void ResultCallback(FaceLandmarkerResult faceLandmarksResult, Image image, int timestampMs); + /// + /// Base options for the hand landmarker task. + /// public Tasks.Core.BaseOptions baseOptions { get; } + /// + /// The running mode of the task. Default to the image mode. + /// FaceLandmarker has three running modes: + /// + /// + /// The image mode for detecting face landmarks on single image inputs. + /// + /// + /// The video mode for detecting face landmarks on the decoded frames of a video. + /// + /// + /// + /// The live stream mode or detecting face landmarks on the live stream of input data, such as from camera. + /// In this mode, the below must be specified to receive the detection results asynchronously. + /// + /// + /// + /// public Core.RunningMode runningMode { get; } + /// + /// The maximum number of faces that can be detected by the face detector. + /// public int numFaces { get; } + /// + /// The minimum confidence score for the face detection to be considered successful. + /// public float minFaceDetectionConfidence { get; } + /// + /// The minimum confidence score of face presence score in the face landmark detection. + /// public float minFacePresenceConfidence { get; } + /// + /// The minimum confidence score for the face tracking to be considered successful. + /// public float minTrackingConfidence { get; } + /// + /// Whether FaceLandmarker outputs face blendshapes classification. + /// Face blendshapes are used for rendering the 3D face model. + /// public bool outputFaceBlendshapes { get; } + /// + /// Whether FaceLandmarker outputs facial transformation_matrix. + /// Facial transformation matrix is used to transform the face landmarks in canonical face to the detected face, + /// so that users can apply face effects on the detected landmarks. + /// public bool outputFaceTransformationMatrixes { get; } + /// + /// The user-defined result callback for processing live stream data. + /// The result callback should only be specified when the running mode is set to the live stream mode. + /// public ResultCallback resultCallback { get; } public FaceLandmarkerOptions( diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceLandmarker/FaceLandmarkerResult.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceLandmarker/FaceLandmarkerResult.cs index b6f8a1300..733899f5a 100644 --- a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceLandmarker/FaceLandmarkerResult.cs +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/FaceLandmarker/FaceLandmarkerResult.cs @@ -11,10 +11,22 @@ namespace Mediapipe.Tasks.Vision.FaceLandmarker { + /// + /// The face landmarks result from FaceLandmarker, where each vector element represents a single face detected in the image. + /// public readonly struct FaceLandmarkerResult { + /// + /// Detected face landmarks in normalized image coordinates. + /// public readonly IReadOnlyList faceLandmarks; + /// + /// Optional face blendshapes results. + /// public readonly IReadOnlyList faceBlendshapes; + /// + /// Optional facial transformation matrix. + /// public readonly IReadOnlyList facialTransformationMatrixes; internal FaceLandmarkerResult(IReadOnlyList faceLandmarks, diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/HandLandmarker/HandLandmarker.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/HandLandmarker/HandLandmarker.cs index d667701ec..adf3f66ce 100644 --- a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/HandLandmarker/HandLandmarker.cs +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Tasks/Vision/HandLandmarker/HandLandmarker.cs @@ -60,7 +60,7 @@ public static HandLandmarker CreateFromModelPath(string modelPath) /// /// Creates the object from . /// - /// Options for the face landmarker task. + /// Options for the hand landmarker task. /// /// object that's created from . /// diff --git a/mediapipe_api/tasks/cc/vision/face_landmarker/proto/BUILD b/mediapipe_api/tasks/cc/vision/face_landmarker/proto/BUILD index 2d29b7fa6..7581d7f52 100644 --- a/mediapipe_api/tasks/cc/vision/face_landmarker/proto/BUILD +++ b/mediapipe_api/tasks/cc/vision/face_landmarker/proto/BUILD @@ -12,15 +12,15 @@ package(default_visibility = ["//visibility:public"]) pkg_files( name = "proto_srcs", srcs = [ - ":face_blendshapes_graph_options", - ":face_landmarker_graph_options", - ":face_landmarks_detector_graph_options", + ":face_blendshapes_graph_options_cs", + ":face_landmarker_graph_options_cs", + ":face_landmarks_detector_graph_options_cs", ], prefix = "Tasks/Vision/FaceLandmarker/Proto", ) csharp_proto_src( - name = "face_blendshapes_graph_options", + name = "face_blendshapes_graph_options_cs", proto_src = "mediapipe/tasks/cc/vision/face_landmarker/proto/face_blendshapes_graph_options.proto", deps = [ "@com_google_mediapipe//mediapipe/tasks/cc/core/proto:protos_src", @@ -31,7 +31,7 @@ csharp_proto_src( ) csharp_proto_src( - name = "face_landmarker_graph_options", + name = "face_landmarker_graph_options_cs", proto_src = "mediapipe/tasks/cc/vision/face_landmarker/proto/face_landmarker_graph_options.proto", deps = [ "@com_google_mediapipe//mediapipe/tasks/cc/core/proto:protos_src", @@ -45,7 +45,7 @@ csharp_proto_src( ) csharp_proto_src( - name = "face_landmarks_detector_graph_options", + name = "face_landmarks_detector_graph_options_cs", proto_src = "mediapipe/tasks/cc/vision/face_landmarker/proto/face_landmarks_detector_graph_options.proto", deps = [ "@com_google_mediapipe//mediapipe/tasks/cc/core/proto:protos_src",