add IrisLandmarkLeftAndRightFromFaceLandmarks
This commit is contained in:
parent
39309bedba
commit
7dc6638f42
|
@ -72,6 +72,18 @@ mediapipe_simple_subgraph(
|
|||
],
|
||||
)
|
||||
|
||||
mediapipe_simple_subgraph(
|
||||
name = "iris_landmark_left_and_right_from_face_landmarks_gpu",
|
||||
graph = "iris_landmark_left_and_right_from_face_landmarks_gpu.pbtxt",
|
||||
register_as = "IrisLandmarkLeftAndRightFromFaceLandmarksGpu",
|
||||
deps = [
|
||||
":iris_landmark_left_and_right_gpu",
|
||||
"//mediapipe/calculators/core:concateneate_normalized_landmark_list_calculator",
|
||||
"//mediapipe/calculators/core:split_normalized_landmark_list_calculator",
|
||||
"//mediapipe/graphs/iris_tracking/calculators:update_face_landmarks_calculator",
|
||||
],
|
||||
)
|
||||
|
||||
mediapipe_simple_subgraph(
|
||||
name = "iris_landmark_left_and_right_cpu",
|
||||
graph = "iris_landmark_left_and_right_cpu.pbtxt",
|
||||
|
@ -85,6 +97,18 @@ mediapipe_simple_subgraph(
|
|||
],
|
||||
)
|
||||
|
||||
mediapipe_simple_subgraph(
|
||||
name = "iris_landmark_left_and_right_from_face_landmarks_cpu",
|
||||
graph = "iris_landmark_left_and_right_from_face_landmarks_cpu.pbtxt",
|
||||
register_as = "IrisLandmarkLeftAndRightFromFaceLandmarksCpu",
|
||||
deps = [
|
||||
":iris_landmark_left_and_right_cpu",
|
||||
"//mediapipe/calculators/core:concateneate_normalized_landmark_list_calculator",
|
||||
"//mediapipe/calculators/core:split_normalized_landmark_list_calculator",
|
||||
"//mediapipe/graphs/iris_tracking/calculators:update_face_landmarks_calculator",
|
||||
],
|
||||
)
|
||||
|
||||
exports_files(
|
||||
srcs = [
|
||||
"iris_landmark.tflite",
|
||||
|
|
|
@ -0,0 +1,82 @@
|
|||
# Detects iris landmarks, eye contour landmarks, and corresponding rect (ROI) from face landmarks.
|
||||
|
||||
type: "IrisLandmarkLeftAndRightFromFaceLandmarksCpu"
|
||||
|
||||
# CPU image. (ImageFrame)
|
||||
input_stream: "IMAGE:input_video"
|
||||
# Face landmarks. (NormalizedLandmarkList)
|
||||
input_stream: "FACE_LANDMARKS:face_landmarks"
|
||||
|
||||
# Refined face landmarks. (NormalizedLandmarkList)
|
||||
output_stream: "UPDATED_FACE_LANDMARKS:refined_face_landmarks"
|
||||
|
||||
# 71 normalized eye contour landmarks. (NormalizedLandmarkList)
|
||||
output_stream: "LEFT_EYE_CONTOUR_LANDMARKS:left_eye_contour_landmarks"
|
||||
# 5 normalized iris landmarks. (NormalizedLandmarkList)
|
||||
output_stream: "LEFT_EYE_IRIS_LANDMARKS:left_iris_landmarks"
|
||||
# Region of interest used to do calculations for the left eye. (NormalizedRect)
|
||||
output_stream: "LEFT_EYE_ROI:left_eye_rect_from_landmarks"
|
||||
|
||||
# 71 normalized eye contour landmarks. (NormalizedLandmarkList)
|
||||
output_stream: "RIGHT_EYE_CONTOUR_LANDMARKS:right_eye_contour_landmarks"
|
||||
# 5 normalized iris landmarks. (NormalizedLandmarkList)
|
||||
output_stream: "RIGHT_EYE_IRIS_LANDMARKS:right_iris_landmarks"
|
||||
# Region of interest used to do calculations for the right eye. (NormalizedRect)
|
||||
output_stream: "RIGHT_EYE_ROI:right_eye_rect_from_landmarks"
|
||||
|
||||
|
||||
# Gets two landmarks which define left eye boundary.
|
||||
node {
|
||||
calculator: "SplitNormalizedLandmarkListCalculator"
|
||||
input_stream: "face_landmarks"
|
||||
output_stream: "left_eye_boundary_landmarks"
|
||||
node_options: {
|
||||
[type.googleapis.com/mediapipe.SplitVectorCalculatorOptions] {
|
||||
ranges: { begin: 33 end: 34 }
|
||||
ranges: { begin: 133 end: 134 }
|
||||
combine_outputs: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Gets two landmarks which define right eye boundary.
|
||||
node {
|
||||
calculator: "SplitNormalizedLandmarkListCalculator"
|
||||
input_stream: "face_landmarks"
|
||||
output_stream: "right_eye_boundary_landmarks"
|
||||
node_options: {
|
||||
[type.googleapis.com/mediapipe.SplitVectorCalculatorOptions] {
|
||||
ranges: { begin: 362 end: 363 }
|
||||
ranges: { begin: 263 end: 264 }
|
||||
combine_outputs: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Detects iris landmarks, eye contour landmarks, and corresponding rect (ROI).
|
||||
node {
|
||||
calculator: "IrisLandmarkLeftAndRightCpu"
|
||||
input_stream: "IMAGE:input_video"
|
||||
input_stream: "LEFT_EYE_BOUNDARY_LANDMARKS:left_eye_boundary_landmarks"
|
||||
input_stream: "RIGHT_EYE_BOUNDARY_LANDMARKS:right_eye_boundary_landmarks"
|
||||
output_stream: "LEFT_EYE_CONTOUR_LANDMARKS:left_eye_contour_landmarks"
|
||||
output_stream: "LEFT_EYE_IRIS_LANDMARKS:left_iris_landmarks"
|
||||
output_stream: "LEFT_EYE_ROI:left_eye_rect_from_landmarks"
|
||||
output_stream: "RIGHT_EYE_CONTOUR_LANDMARKS:right_eye_contour_landmarks"
|
||||
output_stream: "RIGHT_EYE_IRIS_LANDMARKS:right_iris_landmarks"
|
||||
output_stream: "RIGHT_EYE_ROI:right_eye_rect_from_landmarks"
|
||||
}
|
||||
|
||||
node {
|
||||
calculator: "ConcatenateNormalizedLandmarkListCalculator"
|
||||
input_stream: "left_eye_contour_landmarks"
|
||||
input_stream: "right_eye_contour_landmarks"
|
||||
output_stream: "refined_eye_landmarks"
|
||||
}
|
||||
|
||||
node {
|
||||
calculator: "UpdateFaceLandmarksCalculator"
|
||||
input_stream: "NEW_EYE_LANDMARKS:refined_eye_landmarks"
|
||||
input_stream: "FACE_LANDMARKS:face_landmarks"
|
||||
output_stream: "UPDATED_FACE_LANDMARKS:refined_face_landmarks"
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
# Detects iris landmarks, eye contour landmarks, and corresponding rect (ROI) from face landmarks.
|
||||
|
||||
type: "IrisLandmarkLeftAndRightFromFaceLandmarksGpu"
|
||||
|
||||
# GPU image. (GpuBuffer)
|
||||
input_stream: "IMAGE:input_video"
|
||||
# Face landmarks. (NormalizedLandmarkList)
|
||||
input_stream: "FACE_LANDMARKS:face_landmarks"
|
||||
|
||||
# Refined face landmarks. (NormalizedLandmarkList)
|
||||
output_stream: "UPDATED_FACE_LANDMARKS:refined_face_landmarks"
|
||||
|
||||
# 71 normalized eye contour landmarks. (NormalizedLandmarkList)
|
||||
output_stream: "LEFT_EYE_CONTOUR_LANDMARKS:left_eye_contour_landmarks"
|
||||
# 5 normalized iris landmarks. (NormalizedLandmarkList)
|
||||
output_stream: "LEFT_EYE_IRIS_LANDMARKS:left_iris_landmarks"
|
||||
# Region of interest used to do calculations for the left eye. (NormalizedRect)
|
||||
output_stream: "LEFT_EYE_ROI:left_eye_rect_from_landmarks"
|
||||
|
||||
# 71 normalized eye contour landmarks. (NormalizedLandmarkList)
|
||||
output_stream: "RIGHT_EYE_CONTOUR_LANDMARKS:right_eye_contour_landmarks"
|
||||
# 5 normalized iris landmarks. (NormalizedLandmarkList)
|
||||
output_stream: "RIGHT_EYE_IRIS_LANDMARKS:right_iris_landmarks"
|
||||
# Region of interest used to do calculations for the right eye. (NormalizedRect)
|
||||
output_stream: "RIGHT_EYE_ROI:right_eye_rect_from_landmarks"
|
||||
|
||||
# Gets two landmarks which define left eye boundary.
|
||||
node {
|
||||
calculator: "SplitNormalizedLandmarkListCalculator"
|
||||
input_stream: "face_landmarks"
|
||||
output_stream: "left_eye_boundary_landmarks"
|
||||
node_options: {
|
||||
[type.googleapis.com/mediapipe.SplitVectorCalculatorOptions] {
|
||||
ranges: { begin: 33 end: 34 }
|
||||
ranges: { begin: 133 end: 134 }
|
||||
combine_outputs: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Gets two landmarks which define right eye boundary.
|
||||
node {
|
||||
calculator: "SplitNormalizedLandmarkListCalculator"
|
||||
input_stream: "face_landmarks"
|
||||
output_stream: "right_eye_boundary_landmarks"
|
||||
node_options: {
|
||||
[type.googleapis.com/mediapipe.SplitVectorCalculatorOptions] {
|
||||
ranges: { begin: 362 end: 363 }
|
||||
ranges: { begin: 263 end: 264 }
|
||||
combine_outputs: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Detects iris landmarks, eye contour landmarks, and corresponding rect (ROI).
|
||||
node {
|
||||
calculator: "IrisLandmarkLeftAndRightGpu"
|
||||
input_stream: "IMAGE:input_image"
|
||||
input_stream: "LEFT_EYE_BOUNDARY_LANDMARKS:left_eye_boundary_landmarks"
|
||||
input_stream: "RIGHT_EYE_BOUNDARY_LANDMARKS:right_eye_boundary_landmarks"
|
||||
output_stream: "LEFT_EYE_CONTOUR_LANDMARKS:left_eye_contour_landmarks"
|
||||
output_stream: "LEFT_EYE_IRIS_LANDMARKS:left_iris_landmarks"
|
||||
output_stream: "LEFT_EYE_ROI:left_eye_rect_from_landmarks"
|
||||
output_stream: "RIGHT_EYE_CONTOUR_LANDMARKS:right_eye_contour_landmarks"
|
||||
output_stream: "RIGHT_EYE_IRIS_LANDMARKS:right_iris_landmarks"
|
||||
output_stream: "RIGHT_EYE_ROI:right_eye_rect_from_landmarks"
|
||||
}
|
||||
|
||||
node {
|
||||
calculator: "ConcatenateNormalizedLandmarkListCalculator"
|
||||
input_stream: "left_eye_contour_landmarks"
|
||||
input_stream: "right_eye_contour_landmarks"
|
||||
output_stream: "refined_eye_landmarks"
|
||||
}
|
||||
|
||||
node {
|
||||
calculator: "UpdateFaceLandmarksCalculator"
|
||||
input_stream: "NEW_EYE_LANDMARKS:refined_eye_landmarks"
|
||||
input_stream: "FACE_LANDMARKS:face_landmarks"
|
||||
output_stream: "UPDATED_FACE_LANDMARKS:refined_face_landmarks"
|
||||
}
|
Loading…
Reference in New Issue
Block a user