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

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2010-09-03
0007  * Description : Integrated, multithread face detection / recognition
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_DETECTION_WORKER_H
0017 #define DIGIKAM_DETECTION_WORKER_H
0018 
0019 // Local includes
0020 
0021 #include "facepipeline_p.h"
0022 #include "faceitemretriever.h"
0023 
0024 namespace Digikam
0025 {
0026 
0027 class Q_DECL_HIDDEN DetectionWorker : public WorkerObject
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032 
0033     explicit DetectionWorker(FacePipeline::Private* const dd);
0034     ~DetectionWorker() override;
0035 
0036     QImage scaleForDetection(const DImg& image) const;
0037 
0038 public Q_SLOTS:
0039 
0040     void process(const FacePipelineExtendedPackage::Ptr& package);
0041     void setAccuracyAndModel(double value, bool yolo);
0042 
0043 Q_SIGNALS:
0044 
0045     void processed(const FacePipelineExtendedPackage::Ptr& package);
0046 
0047 protected:
0048 
0049     FaceDetector                 detector;
0050     FacePipeline::Private* const d;
0051 
0052 private:
0053 
0054     // Disable
0055     DetectionWorker(const DetectionWorker&)            = delete;
0056     DetectionWorker& operator=(const DetectionWorker&) = delete;
0057 };
0058 
0059 } // namespace Digikam
0060 
0061 #endif // DIGIKAM_DETECTION_WORKER_H