How is the landscape of a high-dimensional learning problem organized, and how many minima, saddles and maxima does it contain? Building on tools from the statistical physics of random landscapes (the Kac-Rice formula), we develop a general and tractable framework to count and characterize the critical points of empirical risk landscapes, and use it to draw complete topological phase diagrams for the phase retrieval problem.