| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Classes | Public Types | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Digikam::MLPipelineFoundation Class Referenceabstract
Inheritance diagram for Digikam::MLPipelineFoundation:

## Classes
struct | _MLPipelinePerformanceProfile

## Public Types
enum | MLPipelineNotification { notifySkipped , notifyProcessed }
typedef struct Digikam::MLPipelineFoundation::_MLPipelinePerformanceProfile | MLPipelinePerformanceProfile
typedef SharedQueue< MLPipelinePackageFoundation * > | MLPipelineQueue
enum | MLPipelineStage { Finder , Loader , Extractor , Classifier , Trainer , Writer , None }

## Signals
void | finished ()
| Emitted when the last package has finished processing.
void | processed (const MLPipelinePackageNotify::Ptr &package)
| Emitted when one package has finished processing.
void | processing (const MLPipelinePackageNotify::Ptr &package)
| Emitted when one package begins processing.
void | progressValueChanged (float progress)
void | scheduled ()
| Emitted when processing is scheduled.
void | signalAddMoreWorkers ()
void | signalUpdateItemCount (const qlonglong itemCount)
void | skipped (const MLPipelinePackageNotify::Ptr &package)
| Emitted when one or several packages were skipped, usually because they have already been scanned.
void | started (const QString &message)
| Emitted when processing has started.

## Public Member Functions
virtual void | cancel ()
bool | hasFinished () const
virtual bool | start ()

## Protected Member Functions
virtual void | addMoreWorkers ()=0
bool | addWorker (const MLPipelineStage &stage)
bool | checkMoreWorkers (int totalItemCount, int currentItemCount, bool useFullCpu)
virtual bool | classifier ()=0
void | clearAllQueues ()
virtual MLPipelinePackageFoundation * | dequeue (MLPipelineQueue *thisQueue)
void | emitSignalUpdateItemCount (const qlonglong itemCount)
| Helper methods to perform signal emitting through the MLPIPELINE_FINDER_END mocro with the moc processor.
virtual bool | enqueue (MLPipelineQueue *thisQueue, MLPipelinePackageFoundation *package)
virtual bool | extractor ()=0
virtual bool | finder ()=0
virtual bool | loader ()=0
virtual void | notify (MLPipelineNotification notification, const QString &_name, const QString &_path, const QString &_displayData, int _processed, const DImg &_thumbnail)
virtual void | notify (MLPipelineNotification notification, const QString &_name, const QString &_path, const QString &_displayData, int _processed, const QIcon &_thumbnail)
virtual void | notify (MLPipelineNotification notification, const QString &_name, const QString &_path, const QString &_displayData, int _processed, const QImage &_thumbnail)
void | pipelinePerformanceEnd (const MLPipelineStage &stage, int totalItemCount, QElapsedTimer &timer)
void | pipelinePerformanceEnd (const MLPipelineStage &stage, QElapsedTimer &timer)
void | pipelinePerformanceStart (const MLPipelineStage &stage, QElapsedTimer &timer)
| Methods to profile the Pipeline performance.
MLPipelinePackageFoundation * | queueEndSignal () const
| Queue helper functions.
void | showPipelinePerformance () const
void | stageEnd (MLPipelineStage thisStage, MLPipelineStage nextStage)
void | stageStart (QThread::Priority threadPriority, MLPipelineStage thisStage, MLPipelineStage nextStage, MLPipelineQueue *&thisQueue, MLPipelineQueue *&nextQueue)
virtual bool | trainer ()=0
void | waitForStart ()
virtual bool | writer ()=0

## Protected Attributes
bool | cancelled = false
QAtomicInteger< int > | itemsProcessed = 0
quint64 | maxBufferSize = 2147483648
| 2 GB default
QIcon | missingIcon = QIcon::fromTheme(QLatin1String("image-missing"))
QMutex | mutex
QMap< MLPipelineStage, MLPipelinePerformanceProfile > | performanceProfileList
QElapsedTimer | pipelineTimer
QMap< MLPipelineStage, MLPipelineQueue * > | queues
QThreadPool * | threadPool = nullptr
QMutex | threadStageMutex
const int | throttledQueueDepth = 1
QAtomicInteger< int > | totalItemCount = 0
quint64 | usedBufferSize = 0
QList< QFutureWatcher< bool > * > | watchList

## Member Enumeration Documentation

## ◆ MLPipelineStage

enum Digikam::MLPipelineFoundation::MLPipelineStage

Enumerator
Finder | Finder stage finds the data for the pipeline.
Loader | Loader stage loads and prepares the data for extraction.
Extractor | Extractor stage pulls the features from the data.
Classifier | Classifier stage adds a label (face, autotag, etc) to an extracted object.
Trainer | Classifier stage adds a label (face, autotag, etc) to an extracted object.
Writer | Writer stage saves the data to the DB.
None | Empty stage.

## Member Function Documentation

## ◆ addMoreWorkers()

virtual void Digikam::MLPipelineFoundation::addMoreWorkers | ( |  | ) |
| protected pure virtual

Implemented in Digikam::AIToolsPipeline.

## ◆ cancel()

void Digikam::MLPipelineFoundation::cancel | ( |  | ) |
| virtual

Note
  worker threads can be in 1 of 3 states when cancel is called
  1. waiting for a new package
  2. processing a package
  3. waiting to push a package

handle all 3 cases so the worker thread sees the cancel signal

## ◆ classifier()

virtual bool Digikam::MLPipelineFoundation::classifier | ( |  | ) |
| protected pure virtual

Implemented in Digikam::AIToolsPipeline, Digikam::AutotagsPipelineObject, Digikam::FacePipelineDetectRecognize, Digikam::FacePipelineEdit, Digikam::FacePipelineRecognize, Digikam::FacePipelineReset, and Digikam::FacePipelineRetrain.

## ◆ extractor()

virtual bool Digikam::MLPipelineFoundation::extractor | ( |  | ) |
| protected pure virtual

Implemented in Digikam::AIToolsPipeline.

## ◆ finder()

virtual bool Digikam::MLPipelineFoundation::finder | ( |  | ) |
| protected pure virtual

Implemented in Digikam::AIToolsPipeline.

## ◆ loader()

virtual bool Digikam::MLPipelineFoundation::loader | ( |  | ) |
| protected pure virtual

Implemented in Digikam::AIToolsPipeline.

## ◆ start()

bool Digikam::MLPipelineFoundation::start | ( |  | ) |
| virtual

Reimplemented in Digikam::AIToolsPipeline.

## ◆ trainer()

virtual bool Digikam::MLPipelineFoundation::trainer | ( |  | ) |
| protected pure virtual

Implemented in Digikam::AIToolsPipeline.

## ◆ writer()

virtual bool Digikam::MLPipelineFoundation::writer | ( |  | ) |
| protected pure virtual

Implemented in Digikam::AIToolsPipeline.