In [1]:
projectDir = paths.concat(os.getenv('HOME'),'pose-hg-train')
paths.dofile(projectDir .. '/src/ref.lua')


Out[1]:
Saving everything to: /home/alejandro/pose-hg-train/exp/mpii/default	
Out[1]:
Input is a tensor with dimensions: 3 x 256 x 256	
Output is a table	
	 Entry 1 is a tensor with dimensions: 16 x 64 x 64	
	 Entry 2 is a tensor with dimensions: 16 x 64 x 64	
	 Entry 3 is a tensor with dimensions: 16 x 64 x 64	
	 Entry 4 is a tensor with dimensions: 16 x 64 x 64	
	 Entry 5 is a tensor with dimensions: 16 x 64 x 64	
	 Entry 6 is a tensor with dimensions: 16 x 64 x 64	
	 Entry 7 is a tensor with dimensions: 16 x 64 x 64	
	 Entry 8 is a tensor with dimensions: 16 x 64 x 64	

Generate an example training sample


In [4]:
local set = 'train'
local tmpIdx = opt.idxRef[set][torch.random(dataset:size(set))]
print(tmpIdx)
inp,hms = heatmapVisualization(set,tmpIdx)
itorch.image(inp)
itorch.image(hms)


Out[4]:
20048	

Check out some predictions


In [14]:
idxs, preds, hms, inp = loadPreds('mpii/default/preds', true, false)

In [21]:
local tmpIdx = torch.random(idxs:size(1))
local img = dataset:loadImage(idxs[tmpIdx]) -- Load original image
drawSkeleton(img, preds[tmpIdx]:narrow(2,1,2):clone(), preds[tmpIdx]:narrow(2,5,1):clone():view(-1))

print("Predicted pose:"); sys.sleep(.01)
itorch.image(img); sys.sleep(.01)

if hms then
    -- Prepare heatmap visualization
    local hmImg = heatmapVisualization(nil,idxs[tmpIdx],hms[tmpIdx])
    print("Heatmaps: (red - ground truth, blue - predicted)"); sys.sleep(.01)
    itorch.image(hmImg)
end


Out[21]:
Predicted pose:	
Out[21]:
Heatmaps: (red - ground truth, blue - predicted)