Check the output stream tag rather than the input stream tag in face stylizer graph.

PiperOrigin-RevId: 528555024
This commit is contained in:
Jiuqiang Tang 2023-05-01 13:12:09 -07:00 committed by Copybara-Service
parent 5526e96b21
commit 162a999887

View File

@ -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<CalculatorGraphConfig> 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<FaceStylizerGraphOptions>(sc));
@ -265,7 +265,7 @@ class FaceStylizerGraph : public core::ModelTaskGraph {
graph[Output<Image>(kStylizedImageTag)];
}
if (output_alignment) {
output_streams.stylized_image.value() >>
output_streams.face_alignment_image.value() >>
graph[Output<Image>(kFaceAlignmentTag)];
}
output_streams.original_image >> graph[Output<Image>(kImageTag)];