40 lines
1.0 KiB
Plaintext
40 lines
1.0 KiB
Plaintext
# MediaPipe graph that performs hand detection on desktop with TensorFlow Lite
|
|
# on CPU.
|
|
# Used in the example in
|
|
# mediapipe/examples/desktop/hand_tracking:hand_detection_cpu.
|
|
|
|
# CPU image. (ImageFrame)
|
|
input_stream: "input_video"
|
|
|
|
# CPU image. (ImageFrame)
|
|
output_stream: "output_video"
|
|
|
|
# Detects palms.
|
|
node {
|
|
calculator: "PalmDetectionCpu"
|
|
input_stream: "IMAGE:input_video"
|
|
output_stream: "DETECTIONS:output_detections"
|
|
}
|
|
|
|
# Converts the detections to drawing primitives for annotation overlay.
|
|
node {
|
|
calculator: "DetectionsToRenderDataCalculator"
|
|
input_stream: "DETECTIONS:output_detections"
|
|
output_stream: "RENDER_DATA:render_data"
|
|
node_options: {
|
|
[type.googleapis.com/mediapipe.DetectionsToRenderDataCalculatorOptions] {
|
|
thickness: 4.0
|
|
color { r: 0 g: 255 b: 0 }
|
|
}
|
|
}
|
|
}
|
|
|
|
# Draws annotations and overlays them on top of the original image coming into
|
|
# the graph.
|
|
node {
|
|
calculator: "AnnotationOverlayCalculator"
|
|
input_stream: "IMAGE:input_video"
|
|
input_stream: "render_data"
|
|
output_stream: "IMAGE:output_video"
|
|
}
|