86 lines
2.4 KiB
Plaintext
86 lines
2.4 KiB
Plaintext
# MediaPipe pose landmarks rendering subgraph.
|
|
|
|
type: "PoseRendererCpu"
|
|
|
|
# CPU image. (ImageFrame)
|
|
input_stream: "IMAGE:input_image"
|
|
# Pose landmarks. (NormalizedLandmarkList)
|
|
input_stream: "LANDMARKS:pose_landmarks"
|
|
# Segmentation mask. (ImageFrame in ImageFormat::VEC32F1)
|
|
input_stream: "SEGMENTATION_MASK:segmentation_mask"
|
|
# Region of interest calculated based on landmarks. (NormalizedRect)
|
|
input_stream: "ROI:roi"
|
|
# Detected pose. (Detection)
|
|
input_stream: "DETECTION:detection"
|
|
|
|
# CPU image with rendered data. (ImageFrame)
|
|
output_stream: "IMAGE:output_image"
|
|
|
|
node {
|
|
calculator: "ImagePropertiesCalculator"
|
|
input_stream: "IMAGE:input_image"
|
|
output_stream: "SIZE:image_size"
|
|
}
|
|
|
|
# Converts detections to drawing primitives for annotation overlay.
|
|
node {
|
|
calculator: "DetectionsToRenderDataCalculator"
|
|
input_stream: "DETECTION:detection"
|
|
output_stream: "RENDER_DATA:detection_render_data"
|
|
node_options: {
|
|
[type.googleapis.com/mediapipe.DetectionsToRenderDataCalculatorOptions] {
|
|
thickness: 4.0
|
|
color { r: 0 g: 255 b: 0 }
|
|
}
|
|
}
|
|
}
|
|
|
|
# Computes render data for landmarks.
|
|
node {
|
|
calculator: "PoseLandmarksToRenderData"
|
|
input_stream: "LANDMARKS:pose_landmarks"
|
|
input_stream: "ROI:roi"
|
|
input_stream: "IMAGE_SIZE:image_size"
|
|
output_stream: "RENDER_DATA:landmarks_render_data"
|
|
}
|
|
|
|
# Converts normalized rects to drawing primitives for annotation overlay.
|
|
node {
|
|
calculator: "RectToRenderDataCalculator"
|
|
input_stream: "NORM_RECT:roi"
|
|
output_stream: "RENDER_DATA:roi_render_data"
|
|
node_options: {
|
|
[type.googleapis.com/mediapipe.RectToRenderDataCalculatorOptions] {
|
|
filled: false
|
|
color { r: 255 g: 0 b: 0 }
|
|
thickness: 4.0
|
|
}
|
|
}
|
|
}
|
|
|
|
# Colors the segmentation mask with the color specified in the option.
|
|
node {
|
|
calculator: "RecolorCalculator"
|
|
input_stream: "IMAGE:input_image"
|
|
input_stream: "MASK:segmentation_mask"
|
|
output_stream: "IMAGE:segmented_image"
|
|
node_options: {
|
|
[type.googleapis.com/mediapipe.RecolorCalculatorOptions] {
|
|
color { r: 0 g: 0 b: 255 }
|
|
mask_channel: RED
|
|
invert_mask: true
|
|
adjust_with_luminance: false
|
|
}
|
|
}
|
|
}
|
|
|
|
# Draws annotations and overlays them on top of the input images.
|
|
node {
|
|
calculator: "AnnotationOverlayCalculator"
|
|
input_stream: "IMAGE:segmented_image"
|
|
input_stream: "detection_render_data"
|
|
input_stream: "VECTOR:landmarks_render_data"
|
|
input_stream: "roi_render_data"
|
|
output_stream: "IMAGE:output_image"
|
|
}
|