当前位置:   article > 正文

MTCNN RetinaFace YoloFace_loss_kps

loss_kps

MTCNN
Fast-MTCNN /mtcnn_opencv.cpp
bug:
line 174 faceBox.score = confidence_data[i];
should be : faceBox.score = 1.0f - confidence_data[i];


RetinaFace-Cpp

retinaface
RetinaFace-Cpp
retinaface_caffe
Retinaface-caffe


scrfd

scrfd

修改mmdet\__init__.py

mmcv_minimum_version = '1.1.5'
mmcv_maximum_version = '1.4.8'
  • 1
  • 2

安装mmdet

python setup.py develop
  • 1

导出onnx

python tools/scrfd2onnx.py configs/scrfd/scrfd_34g.py model.pth --shape 640 640 --input-img t2.jpg
  • 1

训练 修改 configs/scrfd/scrfd_34g.py

	total_epochs = 10*lr_mult 	#80
	checkpoint_config = dict(interval=10)	#80
	evaluation = dict(interval=10, metric='mAP')	#80
    samples_per_gpu=1, 	#8
    workers_per_gpu=1, 	#3
  • 1
  • 2
  • 3
  • 4
  • 5

修改 mmdet\models\dense_heads\scrfd_head.py

        avg_factor = sum(avg_factor)
        avg_factor = reduce_mean(avg_factor).item()
        if  avg_factor != 0:	#+++
            losses_bbox = list(map(lambda x: x / avg_factor, losses_bbox))
        losses = dict(loss_cls=losses_cls, loss_bbox=losses_bbox)
        if self.use_kps:
            if  avg_factor != 0:	#+++
                losses_kps = list(map(lambda x: x / avg_factor, losses_kps))
            losses['loss_kps'] = losses_kps
        if self.use_dfl:
            if  avg_factor != 0:	#+++
                losses_dfl = list(map(lambda x: x / avg_factor, losses_dfl))
            losses['loss_dfl'] = losses_dfl
        return losses
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
python tools/train.py configs/scrfd/scrfd_34g.py  --gpus 1
  • 1

scrfd-opencv


YoloFace

yolov5
yolov5-face
yolov7
yolov7-face
opencv Support for YOLOv7 ONNX
修改 dnn\src\layers\fast_convolution\fast_convolution.cpp

        int k = 0, nbias = K + 32;
        conv->biasBuf.resize(nbias);//reserve //20221125 opencv-4.x
  • 1
  • 2
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/342773
推荐阅读
相关标签
  

闽ICP备14008679号