Skip to content

Commit

Permalink
demos/vis-outputs: Add aligned example images, fix image.load usage, …
Browse files Browse the repository at this point in the history
…and output where the images are being saved to

Thanks @pppoe! cmusatyalab#107
  • Loading branch information
bamos committed Mar 10, 2016
1 parent 18575f7 commit d4ee384
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions demos/vis-outputs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ cmd:text('Visualize OpenFace outputs.')
cmd:text()
cmd:text('Options:')

cmd:option('-imgPath', 'images/examples-aligned/examples/lennon-1.png',
cmd:option('-imgPath', 'images/examples-aligned/lennon-1.png',
'Path to aligned image.')
cmd:option('-filterOutput',
'images/examples-aligned/examples/lennon-1',
'images/examples-aligned/lennon-1',
'Output directory.')
cmd:option('-model', './models/openface/nn4.small2.v1.t7', 'Path to model.')
cmd:option('-imgDim', 96, 'Image dimension. nn1=224, nn4=96')
Expand All @@ -53,11 +53,13 @@ net:evaluate()
print(net)

local img = torch.Tensor(1, 3, opt.imgDim, opt.imgDim)
img[1] = image.load(opt.imgPath, opt.imgDim)
img[1] = image.scale(img[1], opt.imgDim, opt.imgDim)
local img_orig = image.load(opt.imgPath, 3)
img[1] = image.scale(img_orig, opt.imgDim, opt.imgDim)
net:forward(img)

f, err = io.open(opt.filterOutput .. '/preview.html', 'w')
local fName = opt.filterOutput .. '/preview.html'
print("Outputting filter preview to '" .. fName .. "'")
f, err = io.open(fName, 'w')
if err then
print("Error: Unable to open preview.html");
os.exit(-1)
Expand Down
Binary file added images/examples-aligned/adams.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/examples-aligned/carell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/examples-aligned/clapton-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/examples-aligned/clapton-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/examples-aligned/lennon-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/examples-aligned/lennon-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d4ee384

Please sign in to comment.