From e8bdbbc412c43dab22695e3aa891c792591f027e Mon Sep 17 00:00:00 2001 From: PRAGMA <17136956+imPRAGMA@users.noreply.github.com> Date: Fri, 29 Nov 2019 16:26:23 +0000 Subject: [PATCH] v1.0.6 - Axe the color space inheritance It can cause issues as some values were being guessed depending on the input clip's colorspace so it's best to leave it up to the user to convert instead. --- setup.py | 2 +- vsgan/__init__.py | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index ed5acdb..6aeaa7c 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name="vsgan", - version="1.0.6-post1", + version="1.0.7", author="PRAGMA", author_email="pragma.exe@gmail.com", description="VapourSynth GAN Implementation using RRDBNet, based on ESRGAN's implementation", diff --git a/vsgan/__init__.py b/vsgan/__init__.py index c683567..20fb22d 100644 --- a/vsgan/__init__.py +++ b/vsgan/__init__.py @@ -63,12 +63,13 @@ def run(self, clip, chunk=False): core.std.StackVertical([results[0], results[1]]), core.std.StackVertical([results[2], results[3]]) ]) if chunk else results[0] - # Convert back to the original color space - if original_format.color_family != buffer.format.color_family: - if original_format.color_family == vs.ColorFamily.RGB: - buffer = mvsfunc.ToRGB(buffer) - if original_format.color_family == vs.ColorFamily.YUV: - buffer = mvsfunc.ToYUV(buffer, css=original_format.name[3:6]) + + # VSGAN used to convert back to the original color space which resulted + # in a LOT of guessing, which was in-accurate and may not be efficient + # depending on what the user is doing after running VSGAN, so in all + # versions after 1.0.6-post1 we return it in the colorspace the GAN + # provides which is always RGB24. + # return the new frame return buffer