digiKam
|
Classes | |
class | Private |
Public Types | |
enum | FilterMode { ScanAll , SkipAlreadyScanned , ReadUnconfirmedFaces , ReadFacesForTraining , ReadConfirmedFaces } |
enum | WriteMode { NormalWrite , OverwriteUnconfirmed } |
Public Slots | |
FaceTagsIface | addManually (const ItemInfo &info, const DImg &image, const TagRegion &assignedRegion) |
FaceTagsIface | confirm (const ItemInfo &info, const FaceTagsIface &face, const DImg &image, int assignedTagId=0, const TagRegion &assignedRegion=TagRegion()) |
FaceTagsIface | confirm (const ItemInfo &info, const FaceTagsIface &face, int assignedTagId=0, const TagRegion &assignedRegion=TagRegion()) |
FaceTagsIface | editRegion (const ItemInfo &info, const DImg &image, const FaceTagsIface &databaseFace, const TagRegion &newRegion) |
FaceTagsIface | editTag (const ItemInfo &info, const FaceTagsIface &databaseFace, int newTagId) |
bool | process (const ItemInfo &info) |
bool | process (const ItemInfo &info, const DImg &image) |
void | process (const QList< ItemInfo > &infos) |
void | remove (const ItemInfo &info, const FaceTagsIface &face) |
void | setAccuracyAndModel (double accuracy, bool yolo) |
void | train (const ItemInfo &info, const QList< FaceTagsIface > &faces) |
void | train (const ItemInfo &info, const QList< FaceTagsIface > &faces, const DImg &image) |
Signals | |
void | finished () |
Emitted when the last package has finished processing. More... | |
void | processed (const FacePipelinePackage &package) |
Emitted when one package has finished processing. More... | |
void | processing (const FacePipelinePackage &package) |
Emitted when one package begins processing. More... | |
void | progressValueChanged (float progress) |
void | scheduled () |
Emitted when processing is scheduled. More... | |
void | skipped (const QList< ItemInfo > &skippedInfos) |
Emitted when one or several packages were skipped, usually because they have already been scanned. More... | |
void | started (const QString &message) |
Emitted when processing has started. More... | |
Public Member Functions | |
QString | benchmarkResult () const |
void | cancel () |
void | construct () |
FacePipeline () | |
bool | hasFinished () const |
void | plugDatabaseEditor () |
void | plugDatabaseFilter (FilterMode mode) |
void | plugDatabaseWriter (WriteMode mode) |
void | plugDetectionBenchmarker () |
void | plugFaceDetector () |
void | plugFacePreviewLoader () |
void | plugFaceRecognizer () |
void | plugParallelFaceDetectors () |
void | plugRecognitionBenchmarker () |
void | plugRerecognizingDatabaseFilter () |
void | plugRetrainingDatabaseFilter () |
void | plugTrainer () |
QThread::Priority | priority () const |
void | setPriority (QThread::Priority priority) |
void | shutDown () |
~FacePipeline () override | |
Friends | |
class | Private |
|
explicit |
|
override |
References Digikam::FacePipeline::Private::databaseFilter, Digikam::FacePipeline::Private::databaseWriter, Digikam::FacePipeline::Private::detectionBenchmarker, Digikam::FacePipeline::Private::detectionWorker, Digikam::FacePipeline::Private::parallelDetectors, Digikam::FacePipeline::Private::previewThread, Digikam::FacePipeline::Private::recognitionBenchmarker, Digikam::FacePipeline::Private::recognitionWorker, shutDown(), Digikam::FacePipeline::Private::thumbnailLoadThreads, and Digikam::FacePipeline::Private::trainerWorker.
|
slot |
Add an entry manually.
References Digikam::FacePipelineFaceTagsIface::assignedRegion, Digikam::FacePipelineFaceTagsIface::assignedTagId, Digikam::FacePipelineFaceTagsIface::ForEditing, Digikam::ItemInfo::id(), Digikam::FacePipelineFaceTagsIface::roles, and Digikam::FaceTagsEditor::unconfirmedEntry().
Referenced by Digikam::FaceGroup::slotAddItemFinished().
QString Digikam::FacePipeline::benchmarkResult | ( | ) | const |
void Digikam::FacePipeline::cancel | ( | ) |
|
slot |
|
slot |
Confirm the face. Pass the original face, and additionally tag id or region if they changed. Returns the confirmed face entry immediately purely for convenience, it is not yet in the database (connect to signal processed() to react when the processing finished). If a trainer is plugged, the face will be trained.
Referenced by Digikam::DigikamItemView::confirmFaces(), and Digikam::FaceGroup::slotAssigned().
void Digikam::FacePipeline::construct | ( | ) |
References Digikam::FacePipeline::Private::applyPriority(), Digikam::FacePipeline::Private::databaseWriter, Digikam::FacePipeline::Private::detectionBenchmarker, Digikam::FacePipeline::Private::detectionWorker, Digikam::FacePipeline::Private::parallelDetectors, Digikam::FacePipeline::Private::pipeline, Digikam::FacePipeline::Private::previewThread, process(), processed(), Digikam::FacePipeline::Private::recognitionBenchmarker, Digikam::FacePipeline::Private::recognitionWorker, and Digikam::FacePipeline::Private::trainerWorker.
Referenced by Digikam::DigikamItemView::DigikamItemView(), and Digikam::FaceGroup::FaceGroup().
|
slot |
Change the given face's region to newRegion. Does not care for training atm.
References Digikam::FacePipelineFaceTagsIface::assignedRegion, Digikam::FacePipelineFaceTagsIface::assignedTagId, Digikam::FacePipelineFaceTagsIface::ForEditing, Digikam::FacePipelineFaceTagsIface::roles, and Digikam::FaceTagsIface::setRegion().
Referenced by Digikam::FaceGroup::applyItemGeometryChanges().
|
slot |
Changes the given face's tagId to newTagId. Used to Reject Facial Recognition suggestions, since the tag needs to be converted from Unconfirmed to Unknown.
References Digikam::FacePipelineFaceTagsIface::assignedRegion, Digikam::FacePipelineFaceTagsIface::assignedTagId, Digikam::FacePipelineFaceTagsIface::ForEditing, and Digikam::FacePipelineFaceTagsIface::roles.
Referenced by Digikam::DigikamItemView::ignoreFaces(), Digikam::DigikamItemView::rejectFaces(), Digikam::FaceGroup::slotIgnored(), and Digikam::DigikamItemView::unknownFaces().
|
signal |
Emitted when the last package has finished processing.
bool Digikam::FacePipeline::hasFinished | ( | ) | const |
References Digikam::FacePipeline::Private::hasFinished().
Referenced by Digikam::FacePipeline::Private::checkFinished().
void Digikam::FacePipeline::plugDatabaseEditor | ( | ) |
References NormalWrite, and plugDatabaseWriter().
Referenced by Digikam::DigikamItemView::DigikamItemView(), and Digikam::FaceGroup::FaceGroup().
void Digikam::FacePipeline::plugDatabaseFilter | ( | FilterMode | mode | ) |
You can plug these four different steps in the working pipeline. 1) Call any of the four plug...() methods. See below for supported combinations. 2) Call construct() to set up the pipeline.
PlugParallel: You can call this instead of the simple plugging method. Depending on the number of processor cores of the machine and the memory cost, more than one element may be plugged and process parallelly for this part of the pipeline.
Supported combinations: (Database Filter ->) (Preview Loader ->) Detector -> Recognizer (-> DatabaseWriter) (Database Filter ->) (Preview Loader ->) Detector (-> DatabaseWriter) (Database Filter ->) (Preview Loader ->) Recognizer (-> DatabaseWriter) DatabaseEditor Trainer DatabaseEditor -> Trainer
References Digikam::FacePipeline::Private::databaseFilter.
Referenced by plugRerecognizingDatabaseFilter(), and plugRetrainingDatabaseFilter().
void Digikam::FacePipeline::plugDatabaseWriter | ( | WriteMode | mode | ) |
References Digikam::FacePipeline::Private::databaseWriter.
Referenced by plugDatabaseEditor().
void Digikam::FacePipeline::plugDetectionBenchmarker | ( | ) |
void Digikam::FacePipeline::plugFaceDetector | ( | ) |
References Digikam::FacePipeline::Private::detectionWorker, and setAccuracyAndModel().
Referenced by plugParallelFaceDetectors().
void Digikam::FacePipeline::plugFacePreviewLoader | ( | ) |
References Digikam::FacePipeline::Private::previewThread.
void Digikam::FacePipeline::plugFaceRecognizer | ( | ) |
void Digikam::FacePipeline::plugParallelFaceDetectors | ( | ) |
void Digikam::FacePipeline::plugRecognitionBenchmarker | ( | ) |
void Digikam::FacePipeline::plugRerecognizingDatabaseFilter | ( | ) |
void Digikam::FacePipeline::plugRetrainingDatabaseFilter | ( | ) |
void Digikam::FacePipeline::plugTrainer | ( | ) |
References Digikam::FacePipeline::Private::trainerWorker.
Referenced by Digikam::DigikamItemView::DigikamItemView(), and Digikam::FaceGroup::FaceGroup().
QThread::Priority Digikam::FacePipeline::priority | ( | ) | const |
|
slot |
Processes the given image info. If a filter is installed, returns false if the info is skipped, or true if it is processed. If no preview loader is plugged, you must provide a DImg for detection or recognition. Any of the signals below will only be emitted if true is returned.
References Digikam::ItemInfo::filePath().
Referenced by construct().
Batch processing. If a filter is installed, the skipped() signal will inform about skipped infos. Filtering is done in a thread, returns immediately. Some of the signals below will be emitted in any case.
References Digikam::FacePipeline::Private::processBatch().
|
signal |
Emitted when one package has finished processing.
Referenced by construct().
|
signal |
Emitted when one package begins processing.
|
signal |
|
slot |
Remove the given face.
References Digikam::FacePipelineFaceTagsIface::ForEditing.
Referenced by Digikam::DigikamItemView::removeFaces(), and Digikam::FaceGroup::slotRejected().
|
signal |
Emitted when processing is scheduled.
|
slot |
References Digikam::FacePipeline::Private::accuracyAndModel(), and value.
Referenced by plugFaceDetector(), and plugParallelFaceDetectors().
void Digikam::FacePipeline::setPriority | ( | QThread::Priority | priority | ) |
Set the priority of the threads used by this pipeline. The default setting is QThread::LowPriority.
References Digikam::FacePipeline::Private::applyPriority(), priority(), and Digikam::FacePipeline::Private::priority.
void Digikam::FacePipeline::shutDown | ( | ) |
Cancels and waits for the pipeline to finish
References cancel(), and Digikam::FacePipeline::Private::wait().
Referenced by ~FacePipeline().
Emitted when one or several packages were skipped, usually because they have already been scanned.
|
signal |
Emitted when processing has started.
Referenced by Digikam::FacePipeline::Private::start(), and Digikam::FacePipeline::Private::stop().
|
slot |
Train the given faces.
|
slot |
References Digikam::FacePipelineFaceTagsIface::ForTraining.
|
friend |