digiKam
dnnfacedetectorssd.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam
4  *
5  * Date : 2019-08-08
6  * Description : Derived class to perform SSD neural network inference
7  * for face detection
8  *
9  * Copyright (C) 2019 by Thanh Trung Dinh <dinhthanhtrung1996 at gmail dot com>
10  * Copyright (C) 2020-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_FACESENGINE_DNN_FACE_DETECTOR_SSD_H
26 #define DIGIKAM_FACESENGINE_DNN_FACE_DETECTOR_SSD_H
27 
28 // Local includes
29 
30 #include "dnnfacedetectorbase.h"
31 
32 namespace Digikam
33 {
34 
36 {
37 
38 public:
39 
40  explicit DNNFaceDetectorSSD();
41  ~DNNFaceDetectorSSD() override;
42 
43  bool loadModels();
44 
45  void detectFaces(const cv::Mat& inputImage,
46  const cv::Size& paddedSize,
47  std::vector<cv::Rect>& detectedBboxes) override;
48 
49 private:
50 
51  void postprocess(cv::Mat detectionMat,
52  const cv::Size& paddedSize,
53  std::vector<cv::Rect>& detectedBboxes) const;
54 
55 private:
56 
57  // Disable
58  DNNFaceDetectorSSD(const DNNFaceDetectorSSD&) = delete;
59  DNNFaceDetectorSSD& operator=(const DNNFaceDetectorSSD&) = delete;
60 };
61 
62 } // namespace Digikam
63 
64 #endif // DIGIKAM_FACESENGINE_DNN_FACE_DETECTOR_SSD_H
Definition: dnnfacedetectorbase.h:44
Definition: dnnfacedetectorssd.h:36
~DNNFaceDetectorSSD() override
Definition: dnnfacedetectorssd.cpp:49
void detectFaces(const cv::Mat &inputImage, const cv::Size &paddedSize, std::vector< cv::Rect > &detectedBboxes) override
Definition: dnnfacedetectorssd.cpp:108
bool loadModels()
Definition: dnnfacedetectorssd.cpp:53
DNNFaceDetectorSSD()
Definition: dnnfacedetectorssd.cpp:43
Definition: datefolderview.cpp:43