summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcam <cameron@ideum.com>2016-10-22 20:17:59 -0600
committercam <cameron@ideum.com>2016-10-22 20:17:59 -0600
commitf0953ff7edbeb330c309d66f8883040606c8b359 (patch)
tree243558e966b42a9dbb565be6ff6f2313b571bedc
parenta4909f47bd2672edadfeded8f4213ea6d378baae (diff)
Added LAB colorspace
-rw-r--r--neural_style.py5
1 files changed, 4 insertions, 1 deletions
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)