Skip to content

Commit

Permalink
fix: de-process resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
arabian9ts committed Mar 17, 2018
1 parent 9089b69 commit e22037e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def inference(image_name):
img, w, h, _, = preprocess('./voc2007/'+image_name)
pred_confs, pred_locs = ssd.infer(images=[img])
locs, labels = ssd.ssd.detect_objects(pred_confs, pred_locs)
img = deprocess(img)
img = deprocess(img, w, h)
if len(labels) and len(locs):
for label, loc in zip(labels, locs):
loc = center2corner(loc)
Expand Down
3 changes: 2 additions & 1 deletion util/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def preprocess(path):
return img, w, h, c


def deprocess(x):
def deprocess(x, w, h):
"""
restore processed image
Expand All @@ -34,4 +34,5 @@ def deprocess(x):
# x = x[:, :, ::-1]
x *= 255.
x = np.clip(x, 0, 255).astype('uint8')
x = imresize(x, (h, w))
return x

0 comments on commit e22037e

Please sign in to comment.