Face Recognition Rank-1

Hi,
I am working with face generation and the dataset have a image target and use a model to generate a new image, and I try to implement metrics Rank-1 to verify the generated image. I have a question about how to calculate this metrics the number of classes is 500.