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	

In [14]:
local set = 'train'
local tmpIdx = opt.idxRef[set][torch.random(dataset:size(set))]
inp,hms = loadData(set,{tmpIdx})

-- Prepare heatmap visualization
local hmImg
local nOut,res = hms[1][1]:size(1),hms[1][1]:size(3)
-- Repeat input image, and darken it to overlay heatmaps
tmpInp = image.scale(inp[1],res):mul(.3)
tmpInp[1][1][1] = 1
hmImg = tmpInp:repeatTensor(nOut,1,1,1)
-- Copy ground truth heatmaps to red channel
hmImg:sub(1,-1,1,1):add(hms[1][1]:mul(.7))
-- Rescale so it is a little easier to see
hmImg = image.scale(hmImg:view(nOut*3,res,res),256):view(nOut,3,256,256)

itorch.image(inp[1])
itorch.image(hmImg)