Make image preprocessing support RGBA image.
PiperOrigin-RevId: 513680594
This commit is contained in:
parent
c3adf19706
commit
91d53cd181
|
@ -182,11 +182,11 @@ absl::StatusOr<ImageTensorSpecs> BuildInputImageTensorSpecs(
|
||||||
"Only RGB color space is supported for now.",
|
"Only RGB color space is supported for now.",
|
||||||
MediaPipeTasksStatus::kInvalidArgumentError);
|
MediaPipeTasksStatus::kInvalidArgumentError);
|
||||||
}
|
}
|
||||||
if (batch != 1 || depth != 3) {
|
if (batch != 1 || (depth != 3 && depth != 4)) {
|
||||||
return CreateStatusWithPayload(
|
return CreateStatusWithPayload(
|
||||||
StatusCode::kInvalidArgument,
|
StatusCode::kInvalidArgument,
|
||||||
absl::StrCat("The input tensor should have dimensions 1 x height x "
|
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, "."),
|
batch, " x ", height, " x ", width, " x ", depth, "."),
|
||||||
MediaPipeTasksStatus::kInvalidInputTensorDimensionsError);
|
MediaPipeTasksStatus::kInvalidInputTensorDimensionsError);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user