  Visual localization allows autonomous robots to relocalize when losing track
of their pose by matching their current observation with past ones. However,
ambiguous scenes pose a challenge for such systems, as repetitive structures
can be viewed from many distinct, equally likely camera poses, which means it
is not sufficient to produce a single best pose hypothesis. In this work, we
propose a probabilistic framework that for a given image predicts the
arbitrarily shaped posterior distribution of its camera pose. We do this via a
novel formulation of camera pose regression using variational inference, which
allows sampling from the predicted distribution. Our method outperforms
existing methods on localization in ambiguous scenes. Code and data will be
released at https://github.com/efreidun/vapor.
