digiKam
Loading...
Searching...
No Matches
dnnfacedetectoryolo.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 YOLO neural network inference
7 * for face detection. Credit: Ayoosh Kathuria (for Yolov3 blog post),
8 * sthanhng (for example of face detection with Yolov3).
9 * More information with Yolov3:
10 * https://towardsdatascience.com/yolo-v3-object-detection-53fb7d3bfe6b
11 * sthanhng github on face detection with Yolov3:
12 * https://github.com/sthanhng/yoloface
13 *
14 * SPDX-FileCopyrightText: 2019 by Thanh Trung Dinh <dinhthanhtrung1996 at gmail dot com>
15 * SPDX-FileCopyrightText: 2020-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
16 *
17 * SPDX-License-Identifier: GPL-2.0-or-later
18 *
19 * ============================================================ */
20
21#pragma once
22
23// Local includes
24
25#include "dnnfacedetectorbase.h"
26
27namespace Digikam
28{
29
30class DIGIKAM_EXPORT DNNFaceDetectorYOLO: public DNNFaceDetectorBase
31{
32
33public:
34
35 explicit DNNFaceDetectorYOLO();
36 ~DNNFaceDetectorYOLO() override = default;
37
38 bool loadModels();
39
40 void detectFaces(const cv::Mat& inputImage,
41 const cv::Size& paddedSize,
42 std::vector<cv::Rect>& detectedBboxes) override;
43
44private:
45
46 std::vector<cv::String> getOutputsNames() const;
47
48 void postprocess(const std::vector<cv::Mat>& outs,
49 const cv::Size& paddedSize,
50 std::vector<cv::Rect>& detectedBboxes) const;
51
52private:
53
54 // Disable
56 DNNFaceDetectorYOLO& operator=(const DNNFaceDetectorYOLO&) = delete;
57};
58
59} // namespace Digikam
Definition dnnfacedetectorbase.h:37
Definition dnnfacedetectoryolo.h:31
~DNNFaceDetectorYOLO() override=default
Definition datefolderview.cpp:34