In [1]:
projectDir = paths.concat(os.getenv('HOME'),'pose-hg-train')
paths.dofile(projectDir .. '/src/ref.lua')
Out[1]:
Out[1]:
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]:
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]:
Out[21]: