ImFusion SDK 4.3
DataElement Class Referenceabstract

#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...

+ Inheritance diagram for DataElement:

Detailed Description

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< Datacontent () 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< DataElementclone (CloneOptions opt=CloneOptions::Everything) const =0
 Create a (shallow or deep) copy of the element.
 
const DataComponentListcomponents () const
 Convenience function to expose the DataComponents of the underlying Data object.
 
DataComponentListcomponents ()
 
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< DataElementstack (const std::vector< std::shared_ptr< DataElement > > &elements)
 Stack several elements along the batch dimension.
 

Protected Attributes

std::shared_ptr< Datam_data
 

Additional Inherited Members

- Protected Member Functions inherited from NotCopyable
 NotCopyable (NotCopyable &&) noexcept=default
 
NotCopyableoperator= (NotCopyable &&) noexcept=default
 
 NotCopyable (const NotCopyable &)=delete
 
NotCopyableoperator= (const NotCopyable &)=delete
 

Member Enumeration Documentation

◆ CloneOptions

enum class CloneOptions
strong

Option to control which parts of the data element are to be copied when cloning the DataElement.

Enumerator
Everything 

Copy everything, including the underlying data.

Container 

For keypoints and bounding boxes, onyl clone the container without the underlying data.

NoImageData 

For images and vectors, only clone the container without the underlying data.

Member Function Documentation

◆ type()

virtual ElementType type ( ) const
pure virtual

Returns the type of the underlying data.

Implemented in BoundingBoxElement, ImageElement, KeypointsElement, TensorSetElement, and VectorElement.

◆ setContent()

virtual void setContent ( std::shared_ptr< Data > )
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.

◆ dimension()

virtual int dimension ( ) const
pure virtual

Returns the dimensionality of the underlying data.

Implemented in BoundingBoxElement, KeypointsElement, SISBasedElement, TensorSetElement, and VectorElement.

◆ batchSize()

virtual size_t batchSize ( ) const
pure virtual

Returns the batch size of the element.

Implemented in BoundingBoxElement, KeypointsElement, SISBasedElement, and TensorSetElement.

◆ split()

virtual std::vector< std::shared_ptr< DataElement > > split ( )
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.

◆ clone()

virtual std::unique_ptr< DataElement > clone ( CloneOptions opt = CloneOptions::Everything) const
pure virtual

Create a (shallow or deep) copy of the element.

Implemented in BoundingBoxElement, ImageElement, KeypointsElement, TensorSetElement, and VectorElement.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close