Multiclass F1 scores classwise

Need to track f1 scores of each label class separately for semantic segmentation. How do I do it?