diff --git a/mediapipe/tasks/cc/vision/utils/image_tensor_specs.cc b/mediapipe/tasks/cc/vision/utils/image_tensor_specs.cc index 6b67047c5..4d3d2cb96 100644 --- a/mediapipe/tasks/cc/vision/utils/image_tensor_specs.cc +++ b/mediapipe/tasks/cc/vision/utils/image_tensor_specs.cc @@ -182,11 +182,11 @@ absl::StatusOr BuildInputImageTensorSpecs( "Only RGB color space is supported for now.", MediaPipeTasksStatus::kInvalidArgumentError); } - if (batch != 1 || depth != 3) { + if (batch != 1 || (depth != 3 && depth != 4)) { return CreateStatusWithPayload( StatusCode::kInvalidArgument, absl::StrCat("The input tensor should have dimensions 1 x height x " - "width x 3. Got ", + "width x depth, where depth = 3 or 4. Got ", batch, " x ", height, " x ", width, " x ", depth, "."), MediaPipeTasksStatus::kInvalidInputTensorDimensionsError); }