![]() |
ImFusion SDK 4.3
|
#include <ImFusion/ML/DataElement.h>
Main interface for data elements used for wrapping other ImFusion types and use them in a machine learning specific workflow. More...
Main interface for data elements used for wrapping other ImFusion types and use them in a machine learning specific workflow.
A data element should implement the concept of batch size, such that different types of data, such as images, keypoints etc. can be batched, stacked or splitted in a transparent and standardized way.
This class is used for creating containers of heterogeneous elements, see DataItem.
Public Types | |
enum class | CloneOptions { Everything = 0 , Container , NoImageData } |
Option to control which parts of the data element are to be copied when cloning the DataElement. More... | |
Public Member Functions | |
virtual ElementType | type () const =0 |
Returns the type of the underlying data. | |
template<typename Derived> | |
Derived * | typed () |
template<typename Derived> | |
const Derived * | typed () const |
virtual std::shared_ptr< Data > | content () const |
Returns the underlying data object. | |
virtual void | setContent (std::shared_ptr< Data >)=0 |
Sets the underlying data object. | |
virtual int | dimension () const =0 |
Returns the dimensionality of the underlying data. | |
virtual size_t | batchSize () const =0 |
Returns the batch size of the element. | |
virtual std::vector< std::shared_ptr< DataElement > > | split ()=0 |
Split an element into several ones along the batch dimension. | |
virtual std::unique_ptr< DataElement > | clone (CloneOptions opt=CloneOptions::Everything) const =0 |
Create a (shallow or deep) copy of the element. | |
const DataComponentList & | components () const |
Convenience function to expose the DataComponents of the underlying Data object. | |
DataComponentList & | components () |
bool | isTarget () const |
Returns true if this element is marked as a label. | |
void | tagAsTarget () |
Mark this element as being a label. | |
void | untagAsTarget () |
Remove label status from this element. | |
Static Public Member Functions | |
static std::unique_ptr< DataElement > | stack (const std::vector< std::shared_ptr< DataElement > > &elements) |
Stack several elements along the batch dimension. | |
Protected Attributes | |
std::shared_ptr< Data > | m_data |
Additional Inherited Members | |
![]() | |
NotCopyable (NotCopyable &&) noexcept=default | |
NotCopyable & | operator= (NotCopyable &&) noexcept=default |
NotCopyable (const NotCopyable &)=delete | |
NotCopyable & | operator= (const NotCopyable &)=delete |
|
strong |
Option to control which parts of the data element are to be copied when cloning the DataElement.
|
pure virtual |
Returns the type of the underlying data.
Implemented in BoundingBoxElement, ImageElement, KeypointsElement, TensorSetElement, and VectorElement.
|
pure virtual |
Sets the underlying data object.
Derived methods can throw an exception if derived type of Data does not fit with the Element type
Implemented in BoundingBoxElement, KeypointsElement, SISBasedElement, and TensorSetElement.
|
pure virtual |
Returns the dimensionality of the underlying data.
Implemented in BoundingBoxElement, KeypointsElement, SISBasedElement, TensorSetElement, and VectorElement.
|
pure virtual |
Returns the batch size of the element.
Implemented in BoundingBoxElement, KeypointsElement, SISBasedElement, and TensorSetElement.
|
pure virtual |
Split an element into several ones along the batch dimension.
After a call to this function, the element is empty.
Implemented in BoundingBoxElement, ImageElement, KeypointsElement, TensorSetElement, and VectorElement.
|
pure virtual |
Create a (shallow or deep) copy of the element.
Implemented in BoundingBoxElement, ImageElement, KeypointsElement, TensorSetElement, and VectorElement.