From 36c097e26e1c986719379225361358396ae26261 Mon Sep 17 00:00:00 2001 From: Manuel Wagner Date: Wed, 23 Nov 2022 18:55:24 +0100 Subject: [PATCH] run style prediction for all configured styles --- Config/DefaultGame.ini | 10 ++++++++++ .../StyleTransfer/Private/StyleTransferSubsystem.cpp | 3 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Config/DefaultGame.ini b/Config/DefaultGame.ini index 45f237cd..2c053931 100644 --- a/Config/DefaultGame.ini +++ b/Config/DefaultGame.ini @@ -224,6 +224,16 @@ LoadingScreenControlBusMix=/Game/Audio/Modulation/ControlBusMixes/CBM_LoadingScr [/Script/StyleTransfer.StyleTransferSettings] StyleTransferNetwork=/StyleTransfer/rstnet-960-32-3_transfer.rstnet-960-32-3_transfer StylePredictionNetwork=/StyleTransfer/rstnet-960-32-3_predictor.rstnet-960-32-3_predictor ++StyleTextures=/StyleTransfer/Styles/002af7d2cf8317f84d629a0b12cdb4dc10899f1d.002af7d2cf8317f84d629a0b12cdb4dc10899f1d ++StyleTextures=/StyleTransfer/Styles/00059bb14dffa5cb836f35e2f207f39946d25ff6.00059bb14dffa5cb836f35e2f207f39946d25ff6 ++StyleTextures=/StyleTransfer/Styles/0011fc013403f895146b783b2dd338d639883ec8.0011fc013403f895146b783b2dd338d639883ec8 ++StyleTextures=/StyleTransfer/Styles/00217cb856d9d97865cd3c59669155d3b5c5c0cd.00217cb856d9d97865cd3c59669155d3b5c5c0cd ++StyleTextures=/StyleTransfer/Styles/00218b41b034d31c8129a328879680c0771cd95d.00218b41b034d31c8129a328879680c0771cd95d ++StyleTextures=/StyleTransfer/Styles/00230bf26630ee75ed5dfc8861047e1f13fbf38a.00230bf26630ee75ed5dfc8861047e1f13fbf38a ++StyleTextures=/StyleTransfer/Styles/T_StyleImage.T_StyleImage +StyleTextures=/StyleTransfer/Styles/T_StyleImage1.T_StyleImage1 ++StyleTextures=/StyleTransfer/Styles/T_StyleImage2.T_StyleImage2 ++StyleTextures=/StyleTransfer/Styles/T_StyleImage3.T_StyleImage3 ++StyleTextures=/StyleTransfer/Styles/T_StyleImage4.T_StyleImage4 InterpolationCurve=(EditorCurveData=(Keys=((InterpMode=RCIM_Cubic,TangentMode=RCTM_User),(InterpMode=RCIM_Cubic,TangentMode=RCTM_User,Time=2.241476,Value=1.000000),(InterpMode=RCIM_Cubic,TangentMode=RCTM_User,Time=3.908512,Value=1.000000),(InterpMode=RCIM_Cubic,TangentMode=RCTM_User,Time=5.831762),(Time=7.971708)),DefaultValue=340282346638528859811704183484516925440.000000,PreInfinityExtrap=RCCE_Constant,PostInfinityExtrap=RCCE_Constant),ExternalCurve=None) diff --git a/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferSubsystem.cpp b/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferSubsystem.cpp index bb4b1f31..d0b819a2 100644 --- a/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferSubsystem.cpp +++ b/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferSubsystem.cpp @@ -80,7 +80,7 @@ void UStyleTransferSubsystem::StartStylizingViewport(FViewportClient* ViewportCl checkf(*StyleTransferInferenceContext != INDEX_NONE, TEXT("Could not create inference context for StyleTransferNetwork")); } - for (uint32 i = 0; i < FMath::Min(2u, uint32(StyleTransferSettings->StyleTextures.Num())); ++i) + for (uint32 i = 0; i < uint32(StyleTransferSettings->StyleTextures.Num()); ++i) { UE_LOG(LogStyleTransfer, Log, TEXT("Creating Inference Context for Style %i"), i); const int32& StylePredictionInferenceContext = StylePredictionInferenceContexts.Emplace_GetRef(StylePredictionNetwork->CreateInferenceContext()); @@ -92,7 +92,6 @@ void UStyleTransferSubsystem::StartStylizingViewport(FViewportClient* ViewportCl FTextureCompilingManager::Get().FinishCompilation({StyleTexture}); #endif UpdateStyle(StyleTexture, i, StylePredictionInferenceContext); - //UpdateStyle(StyleTexture, i, StylePredictionInferenceContext); } //UpdateStyle(FPaths::GetPath("C:\\projects\\realtime-style-transfer\\temp\\style_params_tensor.bin")); UE_LOG(LogStyleTransfer, Log, TEXT("Creating FStyleTransferSceneViewExtension"));