Commit
·
fd2b9a9
1
Parent(s):
d9963fa
Make IPython import optional in colorizers to fix CCO model loading
Browse files- app/colorizers/eccv16.py +5 -1
- app/colorizers/util.py +5 -1
app/colorizers/eccv16.py
CHANGED
|
@@ -2,7 +2,11 @@
|
|
| 2 |
import torch
|
| 3 |
import torch.nn as nn
|
| 4 |
import numpy as np
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
from .base_color import *
|
| 8 |
|
|
|
|
| 2 |
import torch
|
| 3 |
import torch.nn as nn
|
| 4 |
import numpy as np
|
| 5 |
+
try:
|
| 6 |
+
from IPython import embed
|
| 7 |
+
except ImportError:
|
| 8 |
+
# IPython not available (only used for debugging)
|
| 9 |
+
pass
|
| 10 |
|
| 11 |
from .base_color import *
|
| 12 |
|
app/colorizers/util.py
CHANGED
|
@@ -4,7 +4,11 @@ import numpy as np
|
|
| 4 |
from skimage import color
|
| 5 |
import torch
|
| 6 |
import torch.nn.functional as F
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
def load_img(img_path):
|
| 10 |
out_np = np.asarray(Image.open(img_path))
|
|
|
|
| 4 |
from skimage import color
|
| 5 |
import torch
|
| 6 |
import torch.nn.functional as F
|
| 7 |
+
try:
|
| 8 |
+
from IPython import embed
|
| 9 |
+
except ImportError:
|
| 10 |
+
# IPython not available (only used for debugging)
|
| 11 |
+
pass
|
| 12 |
|
| 13 |
def load_img(img_path):
|
| 14 |
out_np = np.asarray(Image.open(img_path))
|