Skip to content

Commit 1f5336e

Browse files
committedOct 9, 2018
Notebook
1 parent 0ffe686 commit 1f5336e

File tree

3 files changed

+188
-32
lines changed

3 files changed

+188
-32
lines changed
 

‎Pipfile

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ click = "*"
2020
[dev-packages]
2121
ipython = "*"
2222
yapf = "*"
23+
jupyterlab = "*"
2324

2425
[requires]
2526
python_version = "3.5"

‎demo_notebook.ipynb

+183-28
Large diffs are not rendered by default.

‎image/normalization.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
class NormalizeImageDict(object):
77
"""
8-
8+
99
Normalizes Tensor images in dictionary
10-
10+
1111
Args:
1212
image_keys (list): dict. keys of the images to be normalized
1313
normalizeRange (bool): if True the image is divided by 255.0s
14-
14+
1515
"""
1616

1717
def __init__(self, image_keys, normalizeRange=True):
@@ -34,7 +34,7 @@ def normalize_image(image, forward=True, mean=[0.485, 0.456, 0.406], std=[0.229,
3434
if image.is_cuda:
3535
mean = mean.cuda()
3636
std = std.cuda()
37-
if isinstance(image, torch.autograd.variable.Variable):
37+
if isinstance(image, Variable):
3838
mean = Variable(mean, requires_grad=False)
3939
std = Variable(std, requires_grad=False)
4040
if forward:

0 commit comments

Comments
 (0)