What's the definition of mean average precision?

When doing the object detection task, mean average precision is the common metric to evaluate the model performance. Is there a clear definition of mean average precision? Or some example code to compute MAP?

Googling “mean average precision” led me to: