Project import generated by Copybara.
GitOrigin-RevId: 373e3ac1e5839befd95bf7d73ceff3c5f1171969
This commit is contained in:
@@ -71,6 +71,7 @@ mediapipe_simple_subgraph(
|
||||
register_as = "SelfieSegmentationCpuImage",
|
||||
deps = [
|
||||
":selfie_segmentation_cpu",
|
||||
"//mediapipe/calculators/core:flow_limiter_calculator",
|
||||
"//mediapipe/calculators/image:image_transformation_calculator",
|
||||
"//mediapipe/calculators/util:from_image_calculator",
|
||||
"//mediapipe/calculators/util:to_image_calculator",
|
||||
@@ -83,6 +84,7 @@ mediapipe_simple_subgraph(
|
||||
register_as = "SelfieSegmentationGpuImage",
|
||||
deps = [
|
||||
":selfie_segmentation_gpu",
|
||||
"//mediapipe/calculators/core:flow_limiter_calculator",
|
||||
"//mediapipe/calculators/image:image_transformation_calculator",
|
||||
"//mediapipe/calculators/util:from_image_calculator",
|
||||
"//mediapipe/calculators/util:to_image_calculator",
|
||||
|
||||
@@ -5,8 +5,8 @@ type: "SelfieSegmentationCpuImage"
|
||||
# Input image. (Image)
|
||||
input_stream: "IMAGE:image"
|
||||
|
||||
# The original input image. (Image)
|
||||
output_stream: "IMAGE:image"
|
||||
# The throttled input image. (Image)
|
||||
output_stream: "IMAGE:throttled_image"
|
||||
|
||||
# An integer 0 or 1. Use 0 to select a general-purpose model (operating on a
|
||||
# 256x256 tensor), and 1 to select a model (operating on a 256x144 tensor) more
|
||||
@@ -16,10 +16,27 @@ input_side_packet: "MODEL_SELECTION:model_selection"
|
||||
# Segmentation mask. (Image)
|
||||
output_stream: "SEGMENTATION_MASK:segmentation_mask"
|
||||
|
||||
node {
|
||||
calculator: "FlowLimiterCalculator"
|
||||
input_stream: "image"
|
||||
input_stream: "FINISHED:segmentation_mask"
|
||||
input_stream_info: {
|
||||
tag_index: "FINISHED"
|
||||
back_edge: true
|
||||
}
|
||||
output_stream: "throttled_image"
|
||||
options: {
|
||||
[mediapipe.FlowLimiterCalculatorOptions.ext] {
|
||||
max_in_flight: 1
|
||||
max_in_queue: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Converts Image to ImageFrame for SelfieSegmentationCpu to consume.
|
||||
node {
|
||||
calculator: "FromImageCalculator"
|
||||
input_stream: "IMAGE:image"
|
||||
input_stream: "IMAGE:throttled_image"
|
||||
output_stream: "IMAGE_CPU:raw_image_frame"
|
||||
output_stream: "SOURCE_ON_GPU:is_gpu_image"
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ type: "SelfieSegmentationGpuImage"
|
||||
# Input image. (Image)
|
||||
input_stream: "IMAGE:image"
|
||||
|
||||
# The original input image. (Image)
|
||||
output_stream: "IMAGE:image"
|
||||
# The throttled input image. (Image)
|
||||
output_stream: "IMAGE:throttled_image"
|
||||
|
||||
# An integer 0 or 1. Use 0 to select a general-purpose model (operating on a
|
||||
# 256x256 tensor), and 1 to select a model (operating on a 256x144 tensor) more
|
||||
@@ -16,10 +16,27 @@ input_side_packet: "MODEL_SELECTION:model_selection"
|
||||
# Segmentation mask. (Image)
|
||||
output_stream: "SEGMENTATION_MASK:segmentation_mask"
|
||||
|
||||
node {
|
||||
calculator: "FlowLimiterCalculator"
|
||||
input_stream: "image"
|
||||
input_stream: "FINISHED:segmentation_mask"
|
||||
input_stream_info: {
|
||||
tag_index: "FINISHED"
|
||||
back_edge: true
|
||||
}
|
||||
output_stream: "throttled_image"
|
||||
options: {
|
||||
[mediapipe.FlowLimiterCalculatorOptions.ext] {
|
||||
max_in_flight: 1
|
||||
max_in_queue: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Converts Image to ImageFrame for SelfieSegmentationGpu to consume.
|
||||
node {
|
||||
calculator: "FromImageCalculator"
|
||||
input_stream: "IMAGE:image"
|
||||
input_stream: "IMAGE:throttled_image"
|
||||
output_stream: "IMAGE_GPU:raw_gpu_buffer"
|
||||
output_stream: "SOURCE_ON_GPU:is_gpu_image"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user