diff options
| -rw-r--r-- | options/dataset_options.py | 8 | ||||
| -rw-r--r-- | test-mogrify-recursive.sh | 4 | ||||
| -rw-r--r-- | test-mogrify.py | 8 |
3 files changed, 17 insertions, 3 deletions
diff --git a/options/dataset_options.py b/options/dataset_options.py index 07221cb..07d9e87 100644 --- a/options/dataset_options.py +++ b/options/dataset_options.py @@ -108,6 +108,14 @@ class DatasetOptions(BaseOptions): type=float, help='axis of roll' ) + + self.parser.add_argument( + '--process-frac', + default=0.5, + type=float, + help='amount of processed image (clahe, poster, etc) to use in feeder step' + ) + ### GRAYSCALE self.parser.add_argument( diff --git a/test-mogrify-recursive.sh b/test-mogrify-recursive.sh index 7c9dc36..9d8273b 100644 --- a/test-mogrify-recursive.sh +++ b/test-mogrify-recursive.sh @@ -19,14 +19,14 @@ how_many=200 python test-mogrify.py \ --dataroot "$dataset/train/" \ --start_img "$dataset/test/frame_00003.png" \ - --experiment "${tag}_sequence_more_almost_equal" \ + --experiment "${tag}_sequence_process_less" \ --name pcfade \ --sequence \ --loadSize 256 --fineSize 256 --how_many $how_many \ --model test --which_model_netG unet_256 \ --which_direction AtoB --dataset_mode recursive \ --recursive --recursive-frac 0.0001 \ - --clahe \ + --clahe --process-frac 0.5 \ --norm batch # --sequence --sequence-frac 0.49 \ diff --git a/test-mogrify.py b/test-mogrify.py index 373051a..1159c00 100644 --- a/test-mogrify.py +++ b/test-mogrify.py @@ -166,9 +166,15 @@ if __name__ == '__main__': # im = np.asarray(image_pil).astype('uint8') #print(im.shape, im.dtype) - # src_img = im[:, :, ::-1].copy() + src_img = im[:, :, ::-1].copy() img = process_image(im) + frac_a = data_opt.process_frac + frac_b = 1.0 - frac_a + array_a = np.multiply(src_img.astype('float64'), frac_a) + array_b = np.multiply(img.astype('float64'), frac_b) + img = np.add(array_a, array_b).astype('uint8') + cv2.imwrite(tmp_path, img) os.rename(tmp_path, edges_path) |
