From fca728d22612c008286926fcdba4974e7b37d614 Mon Sep 17 00:00:00 2001 From: Jiuqiang Tang Date: Mon, 1 May 2023 14:57:56 -0700 Subject: [PATCH] Set face alignment image width and hight to 256. PiperOrigin-RevId: 528583074 --- .../tasks/cc/vision/face_stylizer/face_stylizer_graph.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mediapipe/tasks/cc/vision/face_stylizer/face_stylizer_graph.cc b/mediapipe/tasks/cc/vision/face_stylizer/face_stylizer_graph.cc index 029a5a86c..7c4e6f138 100644 --- a/mediapipe/tasks/cc/vision/face_stylizer/face_stylizer_graph.cc +++ b/mediapipe/tasks/cc/vision/face_stylizer/face_stylizer_graph.cc @@ -81,6 +81,7 @@ constexpr char kOutputSizeTag[] = "OUTPUT_SIZE"; constexpr char kSizeTag[] = "SIZE"; constexpr char kStylizedImageTag[] = "STYLIZED_IMAGE"; constexpr char kTensorsTag[] = "TENSORS"; +constexpr int kFaceAlignmentOutputSize = 256; // Struct holding the different output streams produced by the face stylizer // graph. @@ -345,6 +346,9 @@ class FaceStylizerGraph : public core::ModelTaskGraph { image_to_tensor.GetOptions(); image_to_tensor_options.mutable_output_tensor_float_range()->set_min(-1); image_to_tensor_options.mutable_output_tensor_float_range()->set_max(1); + image_to_tensor_options.set_output_tensor_width(kFaceAlignmentOutputSize); + image_to_tensor_options.set_output_tensor_height( + kFaceAlignmentOutputSize); image_to_tensor_options.set_keep_aspect_ratio(true); image_to_tensor_options.set_border_mode( mediapipe::ImageToTensorCalculatorOptions::BORDER_ZERO);