From f0953ff7edbeb330c309d66f8883040606c8b359 Mon Sep 17 00:00:00 2001 From: cam Date: Sat, 22 Oct 2016 20:17:59 -0600 Subject: Added LAB colorspace --- neural_style.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/neural_style.py b/neural_style.py index 56916fa..fa11f56 100644 --- a/neural_style.py +++ b/neural_style.py @@ -93,7 +93,7 @@ def parse_args(): parser.add_argument('--color_convert_type', type=str, default='yuv', - choices=['yuv', 'ycrcb', 'luv'], + choices=['yuv', 'ycrcb', 'luv', 'lab'], help='Color space for conversion to original colors (default: %(default)s)') parser.add_argument('--style_mask', action='store_true', @@ -800,6 +800,9 @@ def convert_to_original_colors(content_img, stylized_img): elif args.color_convert_type == 'luv': cvt_type = cv2.COLOR_BGR2LUV inv_cvt_type = cv2.COLOR_LUV2BGR + elif args.color_convert_type == 'lab': + cvt_type = cv2.COLOR_BGR2LAB + inv_cvt_type = cv2.COLOR_LAB2BGR content_cvt = cv2.cvtColor(content_img, cvt_type) stylized_cvt = cv2.cvtColor(stylized_img, cvt_type) c1, _, _ = cv2.split(stylized_cvt) -- cgit v1.2.3-70-g09d2