bearpaw/pytorch-pose

Prediction Output

Closed this issue · 1 comments

what is the format of the prediction output of the .mat file? i.e. what do the numbers represent?
also, where is the code that saves this file?

any help is very much appreciated, thank you.

The code to save the mat file can be found here:

def save_checkpoint(state, preds, is_best, checkpoint='checkpoint', filename='checkpoint.pth.tar', snapshot=None):
preds = to_numpy(preds)
filepath = os.path.join(checkpoint, filename)
torch.save(state, filepath)
scipy.io.savemat(os.path.join(checkpoint, 'preds.mat'), mdict={'preds' : preds})
if snapshot and state.epoch % snapshot == 0:
shutil.copyfile(filepath, os.path.join(checkpoint, 'checkpoint_{}.pth.tar'.format(state.epoch)))
if is_best:
shutil.copyfile(filepath, os.path.join(checkpoint, 'model_best.pth.tar'))
scipy.io.savemat(os.path.join(checkpoint, 'preds_best.mat'), mdict={'preds' : preds})
def save_pred(preds, checkpoint='checkpoint', filename='preds_valid.mat'):
preds = to_numpy(preds)
filepath = os.path.join(checkpoint, filename)
scipy.io.savemat(filepath, mdict={'preds' : preds})

The predictions are generated at

preds = final_preds(score_map, meta['center'], meta['scale'], [64, 64])

You can also visualize the results by turning on '-debug' mode.