digiKam
Loading...
Searching...
No Matches
dnnyolodetector.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam
4 * https://www.digikam.org
5 *
6 * Date : 2023-09-02
7 * Description : Derived class to perform YOLO neural network inference
8 * for object detection (including yolo versions to benchmark).
9 *
10 * SPDX-FileCopyrightText: 2023 by Quoc Hung TRAN <quochungtran1999 at gmail dot com>
11 *
12 * SPDX-License-Identifier: GPL-2.0-or-later
13 *
14 * ============================================================ */
15
16#pragma once
17
19
20namespace Digikam
21{
22
23enum class YoloVersions
24{
25 YOLOV5NANO = 0,
28};
29
30class DIGIKAM_GUI_EXPORT DNNYoloDetector: public DNNBaseDetectorModel
31{
32
33public:
34
35 explicit DNNYoloDetector(YoloVersions modelVersion = YoloVersions::YOLOV5NANO);
36 ~DNNYoloDetector() override = default;
37
38protected:
39
40 bool loadModels() override;
41
42private:
43
44 QHash<QString, QVector<QRect> > postprocess(const cv::Mat& inputImage,
45 const cv::Mat& out) const override;
46
47private:
48
49 // Disable
50 DNNYoloDetector(const DNNYoloDetector&) = delete;
51 DNNYoloDetector& operator=(const DNNYoloDetector&) = delete;
52
53private:
54
55 YoloVersions yoloVersion;
56};
57
58} // namespace Digikam
Definition dnnbasedetectormodel.h:40
Definition dnnyolodetector.h:31
~DNNYoloDetector() override=default
Definition datefolderview.cpp:34
YoloVersions
Definition dnnyolodetector.h:24
@ YOLOV5XLARGE
YOLO large neural network model.
Definition autotagsassign.h:35
@ YOLOV5NANO
YOLO nano neural network model.
Definition autotagsassign.h:34
@ RESNET50
Definition autotagsassign.h:36