mediapipe: When building Pose for Python GPU, " Unable to find the type for stream "segmentation_mask"." would happen.

I’m trying to build gpu version for python on ubuntu 20.04, but can’t run the pose sample with gpu. The error is below: RuntimeError: ; Unable to find the type for stream "segmentation_mask". It may be set to AnyType or something else that isn't determinable, or the type may be defined but not registered. Before that, I’ve built GPU version of hands with success, so I built pose in the similar way.

node {
  calculator: "ColorConvertCalculator"
  input_stream: "RGB_IN:image"
  output_stream: "RGBA_OUT:image_rgba"
}

node {
  calculator: "ImageFrameToGpuBufferCalculator"
  input_stream: "image_rgba"
  output_stream: "image_gpu"
}

I guess somthing wrong exists in some calculator related to segmentation_mask. Anyone can help?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18

Most upvoted comments

I solved this problem on my Jeston Nano, Ubuntu 18.04. The holistic process now works with 15 fps (3 fps with CPU only in my practice). Modify https://github.com/google/mediapipe/blob/master/mediapipe/modules/pose_landmark/pose_landmark_gpu.pbtxt:

change

# Converts the incoming segmentation mask represented as an Image into the
# corresponding GpuBuffer type.
node: {
  calculator: "FromImageCalculator"
  input_stream: "IMAGE:filtered_segmentation_mask"
  output_stream: "IMAGE_GPU:segmentation_mask"
}

to

# Converts the incoming segmentation mask represented as an Image into the
# corresponding GpuBuffer type.
node: {
  calculator: "FromImageCalculator"
  input_stream: "IMAGE:filtered_segmentation_mask"
  output_stream: "IMAGE_CPU:segmentation_mask"
}