@@ -13,7 +13,7 @@ def __init__(self):
13
13
root = Tk (className = "ALCOLORIMAGENERATOR" )
14
14
root .geometry ("400x150+1510+865" )
15
15
root .resizable (0 , 0 )
16
- root .iconbitmap (os .path .join (cwd + '\\ UI\\ icons' ,
16
+ root .iconbitmap (os .path .join (cwd + '\\ UI\\ icons' ,
17
17
'alcolorimagegenerator.ico' ))
18
18
root .config (bg = "#000000" )
19
19
root .overrideredirect (1 )
@@ -48,8 +48,8 @@ def convert():
48
48
't' , cwd + '\\ AlColorImageGenerator'
49
49
'\\ model\\ colorization_release_v2.'
50
50
'caffemodel' )
51
- pts = np .load (cwd + '\\ AlColorImageGenerator\\ model\\ pts_in_hull.npy '
52
- )
51
+ pts = np .load (cwd + '\\ AlColorImageGenerator\\ model\\ pts_in_hull.'
52
+ 'npy' )
53
53
class8 = net .getLayerId ("class8_ab" )
54
54
conv8 = net .getLayerId ("conv8_313_rh" )
55
55
pts = pts .transpose ().reshape (2 , 313 , 1 , 1 )
@@ -61,7 +61,7 @@ def convert():
61
61
nimg = os .path .basename (img )
62
62
cimg = 'color_' + nimg
63
63
image = cv2 .imread (img )
64
- scaled = image .astype ("float32" )/ 255.0
64
+ scaled = image .astype ("float32" ) / 255.0
65
65
lab = cv2 .cvtColor (scaled , cv2 .COLOR_BGR2LAB )
66
66
resized = cv2 .resize (lab , (224 , 224 ))
67
67
L = cv2 .split (resized )[0 ]
@@ -74,7 +74,7 @@ def convert():
74
74
colorized = cv2 .cvtColor (colorized , cv2 .COLOR_LAB2BGR )
75
75
colorized = np .clip (colorized , 0 , 1 )
76
76
colorized = (255 * colorized ).astype ("uint8" )
77
- cimg = os .path .join (cwd + '\\ AlColorImageGenerator\\ images\\ color' ,
77
+ cimg = os .path .join (cwd + '\\ AlColorImageGenerator\\ images\\ color' ,
78
78
cimg )
79
79
cv2 .imwrite (cimg , colorized )
80
80
cv2 .imshow ("Original" , image )
@@ -86,7 +86,7 @@ def convert():
86
86
weight = 'bold' )
87
87
88
88
titleBar = Frame (root , bg = '#141414' , relief = SUNKEN , bd = 0 )
89
- icon = Image .open (os .path .join (cwd + '\\ UI\\ icons' ,
89
+ icon = Image .open (os .path .join (cwd + '\\ UI\\ icons' ,
90
90
'alcolorimagegenerator.ico' ))
91
91
icon = icon .resize ((30 , 30 ), Image .ANTIALIAS )
92
92
icon = ImageTk .PhotoImage (icon )
0 commit comments