Imported from https://github.com/dragonbook/V2V-PoseNet-pytorch