I don’t know what kind of classification output YOLOv3 returns, but for a multi-class classification the linked sklearn.metrics.confusion_matrix should work, while for a multi-label classification you could use sklearn.metrics.multilabel_confusion_matrix 130.