Is mAP calculated by class or by detection?

is mAP calculated by class or by detection?

mAP is across class and for each class, it’s across the boxes.