From ef9f1307ebc9a0f5a7c4f9bcbfdeea572367834a Mon Sep 17 00:00:00 2001 From: James Betker Date: Fri, 10 Jul 2020 22:25:53 -0600 Subject: [PATCH] Sometimes don't use compression artifacts --- codes/data/LQGT_dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/data/LQGT_dataset.py b/codes/data/LQGT_dataset.py index 99fed582..b17b21a4 100644 --- a/codes/data/LQGT_dataset.py +++ b/codes/data/LQGT_dataset.py @@ -191,7 +191,7 @@ class LQGTDataset(data.Dataset): # LQ needs to go to a PIL image to perform the compression-artifact transformation. img_LQ = (img_LQ * 255).astype(np.uint8) img_LQ = Image.fromarray(img_LQ) - if self.opt['use_compression_artifacts']: + if self.opt['use_compression_artifacts'] and random.random() > .25: qf = random.randrange(10, 70) corruption_buffer = BytesIO() img_LQ.save(corruption_buffer, "JPEG", quality=qf, optimice=True)