digiKam
Loading...
Searching...
No Matches
aesthetic_detector.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 28/08/2021
7 * Description : Image Quality Parser - Aesthetic detection based on deep learning
8 *
9 * SPDX-FileCopyrightText: 2021-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 * SPDX-FileCopyrightText: 2021-2022 by Phuoc Khanh Le <phuockhanhnk94 at gmail dot com>
11 *
12 * SPDX-License-Identifier: GPL-2.0-or-later
13 *
14 * ============================================================ */
15
16#pragma once
17
18// Qt includes
19
20#include <QMutex>
21
22// Local includes
23
24#include "abstract_detector.h"
25
26namespace Digikam
27{
28
30{
31 Q_OBJECT
32
33public:
34
35 explicit AestheticDetector();
37
38 float detect(const cv::Mat& image) const override;
39
40private:
41
42 cv::Mat preprocess(const cv::Mat& image) const;
43 float postProcess(const cv::Mat& modelOutput) const;
44
45 // Disable
46 explicit AestheticDetector(QObject*);
47
48public:
49
50 static bool s_loadModel();
51 static void s_unloadModel();
52 static bool s_isEmptyModel();
53
54private:
55
56 static cv::dnn::Net s_model;
57 static QMutex s_modelMutex;
58};
59
60} // namespace Digikam
Definition abstract_detector.h:31
Definition aesthetic_detector.h:30
float detect(const cv::Mat &image) const override
Definition aesthetic_detector.cpp:42
static bool s_isEmptyModel()
Definition aesthetic_detector.cpp:217
static void s_unloadModel()
Definition aesthetic_detector.cpp:196
~AestheticDetector()
Definition aesthetic_detector.cpp:38
AestheticDetector()
Definition aesthetic_detector.cpp:33
static bool s_loadModel()
Definition aesthetic_detector.cpp:132
Definition datefolderview.cpp:34