| 1 |
/* ============================================================ |
| 2 |
* |
| 3 |
* This file is a part of digiKam project |
| 4 |
* https://www.digikam.org |
| 5 |
* |
| 6 |
* Date : 2010-09-03 |
| 7 |
* Description : Face recognition benchmarker |
| 8 |
* |
| 9 |
* SPDX-FileCopyrightText: 2010-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de> |
| 10 |
* SPDX-FileCopyrightText: 2012-2026 by Gilles Caulier <caulier dot gilles at gmail dot com> |
| 11 |
* |
| 12 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 13 |
* |
| 14 |
* ============================================================ */ |
| 15 |
|
| 16 |
#pragma once |
| 17 |
|
| 18 |
// Local includes |
| 19 |
|
| 20 |
#include "facepipeline_p.h" |
| 21 |
#include "facialrecognition_wrapper.h" |
| 22 |
|
| 23 |
namespace Digikam |
| 24 |
{ |
| 25 |
|
| 26 |
class Q_DECL_HIDDEN RecognitionBenchmarker : public WorkerObject |
| 27 |
{ |
| 28 |
Q_OBJECT |
| 29 |
|
| 30 |
public: |
| 31 |
|
| 32 |
explicit RecognitionBenchmarker(FacePipeline::Private* const dd); |
| 33 |
QString result() const; |
| 34 |
|
| 35 |
public Q_SLOTS: |
| 36 |
|
| 37 |
void process(const FacePipelineExtendedPackage::Ptr& package); |
| 38 |
|
| 39 |
Q_SIGNALS: |
| 40 |
|
| 41 |
void processed(const FacePipelineExtendedPackage::Ptr& package); |
| 42 |
|
| 43 |
protected: |
| 44 |
|
| 45 |
class Q_DECL_HIDDEN Statistics |
| 46 |
{ |
| 47 |
public: |
| 48 |
|
| 49 |
Statistics() = default; |
| 50 |
|
| 51 |
public: |
| 52 |
|
| 53 |
int knownFaces = 0; |
| 54 |
int correctlyRecognized = 0; |
| 55 |
}; |
| 56 |
|
| 57 |
protected: |
| 58 |
|
| 59 |
QMap<int, Statistics> results; |
| 60 |
FacialRecognitionWrapper recognizer; |
| 61 |
|
| 62 |
FacePipeline::Private* const d = nullptr; |
| 63 |
}; |
| 64 |
|
| 65 |
} // namespace Digikam |