RetinaFace (Single-stage Dense Face Localisation in the Wild, 2019) implemented (ResNet50, MobileNetV2 trained on single GPU) in Tensorflow 2.0+. This is an unofficial implementation. With Colab.
# classification loss (crossentropy)
# 1. compute max conf across batch for hard negative mining
loss_class = tf.where(mask_neg,
1 - class_pred[:, 0][..., tf.newaxis], 0)
請問,這裏的 分類損失 為什麽是這樣的計算的?要是檢測的目標不僅僅是人臉,而是多個目標(比如,人臉和行人等)是否要做相應的修改?