File indexing completed on 2025-01-19 03:57:55

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2010-09-03
0007  * Description : Face recognition benchmarker
0008  *
0009  * SPDX-FileCopyrightText: 2010-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
0010  * SPDX-FileCopyrightText: 2012-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_RECOGNITION_BENCH_MARKER_H
0017 #define DIGIKAM_RECOGNITION_BENCH_MARKER_H
0018 
0019 // Local includes
0020 
0021 #include "facepipeline_p.h"
0022 
0023 namespace Digikam
0024 {
0025 
0026 class Q_DECL_HIDDEN RecognitionBenchmarker : public WorkerObject
0027 {
0028     Q_OBJECT
0029 
0030 public:
0031 
0032     explicit RecognitionBenchmarker(FacePipeline::Private* const dd);
0033     QString result() const;
0034 
0035 public Q_SLOTS:
0036 
0037     void process(const FacePipelineExtendedPackage::Ptr& package);
0038 
0039 Q_SIGNALS:
0040 
0041     void processed(const FacePipelineExtendedPackage::Ptr& package);
0042 
0043 protected:
0044 
0045     class Q_DECL_HIDDEN Statistics
0046     {
0047     public:
0048 
0049         Statistics();
0050 
0051     public:
0052 
0053         int knownFaces;
0054         int correctlyRecognized;
0055     };
0056 
0057 protected:
0058 
0059     QMap<int, Statistics>        results;
0060 
0061     FacePipeline::Private* const d;
0062     FacialRecognitionWrapper     recognizer;
0063 };
0064 
0065 } // namespace Digikam
0066 
0067 #endif // DIGIKAM_RECOGNITION_BENCH_MARKER_H