From 162a99988750a2a9d84341172088f49f52d4d8fa Mon Sep 17 00:00:00 2001 From: Jiuqiang Tang Date: Mon, 1 May 2023 13:12:09 -0700 Subject: [PATCH] Check the output stream tag rather than the input stream tag in face stylizer graph. PiperOrigin-RevId: 528555024 --- .../tasks/cc/vision/face_stylizer/face_stylizer_graph.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 7bb2e9c8d..029a5a86c 100644 --- a/mediapipe/tasks/cc/vision/face_stylizer/face_stylizer_graph.cc +++ b/mediapipe/tasks/cc/vision/face_stylizer/face_stylizer_graph.cc @@ -169,7 +169,7 @@ void ConfigureTensorsToImageCalculator( if (image_to_tensor_options.has_output_tensor_float_range()) { auto* mutable_range = tensors_to_image_options->mutable_input_tensor_float_range(); - // TODO: Make the float range flexiable. + // TODO: Make the float range flexible. mutable_range->set_min(0); mutable_range->set_max(1); } else if (image_to_tensor_options.has_output_tensor_uint_range()) { @@ -225,8 +225,8 @@ class FaceStylizerGraph : public core::ModelTaskGraph { public: absl::StatusOr GetConfig( SubgraphContext* sc) override { - bool output_stylized = !HasInput(sc->OriginalNode(), kStylizedImageTag); - bool output_alignment = !HasInput(sc->OriginalNode(), kFaceAlignmentTag); + bool output_stylized = HasOutput(sc->OriginalNode(), kStylizedImageTag); + bool output_alignment = HasOutput(sc->OriginalNode(), kFaceAlignmentTag); ASSIGN_OR_RETURN( const auto* model_asset_bundle_resources, CreateModelAssetBundleResources(sc)); @@ -265,7 +265,7 @@ class FaceStylizerGraph : public core::ModelTaskGraph { graph[Output(kStylizedImageTag)]; } if (output_alignment) { - output_streams.stylized_image.value() >> + output_streams.face_alignment_image.value() >> graph[Output(kFaceAlignmentTag)]; } output_streams.original_image >> graph[Output(kImageTag)];