首页 > 解决方案 > Can I retrain OpenCV DNN face detector using my own face dataset and .pb .pbtxt files provided by OpenCV?

问题描述

I want to fine tune existing OpenCV DNN face detector to a face images database that I own. I have opencv_face_detector.pbtxt and opencv_face_detector_uint8.pb tensorflow files provided by OpenCV. I wonder if based on this files is there any way to fit the model to my data? So far, I haven't also managed to find any tensorflow training script for this model in OpenCV git repository and I only know, that given model is and SSD with resnet-10 as a backbone. I am also not sure, reading the information on the internet, if I can resume training from .pb file. Are you aware of availability of any scripts defining the model, that could be used for training? Would pbtxt and pb files be enough to continue training on new data?

Also, I noticed that there is a git containing caffe version of this model https://github.com/weiliu89/caffe/tree/ssd. Although I never worked with caffe before, would it be possible/easier to use existing weight (caffe .pg and .pbtxt files are also available in OpenCV's github) and fit the model to my dataset?

标签: pythonopencvtensorflowcaffeface-detection

解决方案


我在 opencv 中看不到这样做的方法,但我认为您可以将模型加载到 tensorflow 中并使用model.fit()进行重新训练。

关于迁移学习的通常建议适用。您可能想冻结大部分早期层,只重新训练最后一两个层。也建议使用缓慢的学习率。


推荐阅读