![]() |
ImFusion SDK 4.3
|
#include <ImFusion/ML/DataLoaders/PreprocessDataLoader.h>
Applies a preprocessing pipeline to each item in the nested loader. More...
Applies a preprocessing pipeline to each item in the nested loader.
Public Member Functions | |
PreprocessDataLoader (std::unique_ptr< DataLoader > loader, const std::vector< Operation::Specs > &specs={}, Phase execPhase=Phase::Always, int parallelCalls=1, bool verbose=false) | |
Constructs a preprocessing loader. | |
PreprocessDataLoader (std::unique_ptr< DataLoader > loader, std::unique_ptr< OperationsSequence > opSeq, Phase execPhase, int parallelCalls=1, bool verbose=false) | |
PreprocessDataLoader (DataLoaderList dataLoaders, const Properties &prop) | |
void | configure (const Properties *prop) override |
Configure this object instance by de-serializing the given Properties. | |
std::optional< DataItem > | next () override |
Advance the loader by one iteration. | |
std::optional< size_t > | size () const override |
Size of the loader, has value only for fixed cardinalities. | |
void | reinit () override |
Reseeds the operations. | |
void | setRandomSeed (unsigned int seed) override |
ML::Status | canBePrefetched () const override |
Indicates whether a loader is eligible for prefetching. | |
![]() | |
DataLoader (std::string name, bool verbose=false) | |
Constructor to be used by DataReaders, as they are the first elements in the chain. | |
DataLoader (std::string name, std::unique_ptr< DataLoader > loader, bool verbose=false) | |
Constructor to be used by all other derived DataLoaders. | |
DataLoader (std::string name, DataLoaderList &&dataLoaders, bool verbose=false) | |
Constructor to be used by all other derived DataLoaders. | |
const std::string & | name () const |
Name of the loader. | |
virtual void | reset () |
Reset the loader in order to restart the iteration. | |
virtual Cardinality | cardinality () const |
Cardinality of this specific loader node. | |
DataLoader * | singleUnderlyingLoader () const |
Return a single underlying dataloader Expects there to be only one, returns a nullptr otherwise. | |
std::unique_ptr< DataLoader > | extractDataloader () |
Return a single underlying dataloader Expects there to be only one, throws an exception otherwise. | |
DataLoaderList & | loaders () |
DataLoaderList const & | loaders () const |
bool | verbose () const |
const std::string & | logDomain () const |
Log domain for AdvancedParameter. | |
![]() | |
virtual void | configuration (Properties *p) const |
Serialize the current object configuration into the given Properties object. | |
virtual void | configureDefaults () |
Retrieve the properties of this object, replaces values with their defaults and sets it again. | |
void | registerParameter (ParameterBase *param) |
Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration(). | |
void | unregisterParameter (const ParameterBase *param) |
Remove the given Parameter or SubProperty from the list of registered parameters. | |
Configurable (const Configurable &rhs) | |
Configurable (Configurable &&rhs) noexcept | |
Configurable & | operator= (const Configurable &) |
Configurable & | operator= (Configurable &&) noexcept |
Additional Inherited Members | |
![]() | |
LoaderParam< bool > | m_verbose = {"verbose", false, this, ParamRequired::No} |
If enabled, print log messages with extra information like timings. | |
![]() | |
Signal | signalParametersChanged |
Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
![]() | |
NotCopyable (NotCopyable &&) noexcept=default | |
NotCopyable & | operator= (NotCopyable &&) noexcept=default |
NotCopyable (const NotCopyable &)=delete | |
NotCopyable & | operator= (const NotCopyable &)=delete |
![]() | |
std::string | m_name |
Cardinality | m_cardinality = Cardinality::Fixed |
Random::Generator | m_randGenerator |
DataLoaderList | m_dataLoaders |
![]() | |
std::vector< Param > | m_params |
List of all registered Parameter and SubProperty instances. | |
|
explicit |
Constructs a preprocessing loader.
loader | previous loader |
specs | specifications for the preprocessing pipeline |
execPhase | specifies the execution phase of the preprocessing pipeline |
parallelCalls | how many asynchronous processes are used for preprocessing the dataset |
|
overridevirtual |
Configure this object instance by de-serializing the given Properties.
The default implementation will do so automatically for all registered Parameter and SubProperty instances.
Reimplemented from DataLoader.
|
overridevirtual |
Advance the loader by one iteration.
The function must pull an item from the underlying node, process it and return it. If the underlyng loader is exhausted, returns an empty optional.
Implements DataLoader.
|
overridevirtual |
Size of the loader, has value only for fixed cardinalities.
Implements DataLoader.
|
overridevirtual |
Reseeds the operations.
Reimplemented from DataLoader.
|
overridevirtual |
Reimplemented from DataLoader.
|
overridevirtual |
Indicates whether a loader is eligible for prefetching.
Typically, a loader can be prefetched if its code can be executed on any thread. However, if the code to be executed in the prefetcher requires the main thread or acquires state that cannot be released by other threads (such as the Python Global Interpreter Lock), this function must return an error code and a message explaining why.
Returns: A status object indicating whether the loader can be prefetched (OK) or not (error code).
Reimplemented from DataLoader.