Code: Select all
\documentclass[xcolor=dvipsnames, compress, 9pt]{beamer}
\usepackage{pgffor}
\usepackage{subfig}
\setbeamertemplate{caption}[numbered]
\begin{document}
\foreach \xx in {0,1}{%
\begin{frame}
\begin{figure}
\includegraphics[width=5cm]{ball-\xx}
\caption{}
\end{figure}
\end{frame}}
\end{document}