made style_weights NN argument optional

This commit is contained in:
singinwhale 2022-11-08 10:20:37 +01:00
parent 3bfe5ec9d1
commit f16119ca84
1 changed files with 7 additions and 4 deletions

View File

@ -67,7 +67,6 @@ FStyleTransferSceneViewExtension::FStyleTransferSceneViewExtension(const FAutoRe
else if (TensorName == "style_params") StyleParamsInputTensorIndex = i;
}
check(ContentInputTensorIndex != INDEX_NONE);
check(StyleWeightsInputTensorIndex != INDEX_NONE);
check(StyleParamsInputTensorIndex != INDEX_NONE);
}
@ -381,10 +380,14 @@ FScreenPassTexture FStyleTransferSceneViewExtension::PostProcessPassAfterTonemap
const FViewInfo& ViewInfo = static_cast<const FViewInfo&>(View);
const FNeuralTensor& StyleTransferContentInputTensor = StyleTransferNetwork->GetInputTensorForContext(*InferenceContext, ContentInputTensorIndex);
if (StyleWeightsInputTensorIndex != INDEX_NONE)
{
const FNeuralTensor& StyleTransferStyleWeightsInputTensor = StyleTransferNetwork->GetInputTensorForContext(*InferenceContext, StyleWeightsInputTensorIndex);
check(GScreenShadowMaskTexture);
::TextureToTensorGrayscale(GraphBuilder, GScreenShadowMaskTexture, StyleTransferStyleWeightsInputTensor);
}
::TextureToTensorRGB(GraphBuilder, SceneColor.Texture, StyleTransferContentInputTensor);