Aidge backend OpenCV API#

Databases#

MNIST#

class MNIST : public Aidge::Database#

Public Types

enum DataType#

Values:

enumerator Unsigned#
enumerator Signed#
enumerator Short#
enumerator Int#
enumerator Float#
enumerator Double#

Public Functions

inline MNIST(const std::string &dataPath, bool train, bool loadDataInMemory = false)#

Data Transformations.

~MNIST() noexcept#
virtual std::vector<std::shared_ptr<Tensor>> getItem(const std::size_t index) const final override#

Fetch an item of the database.

Parameters:

index – index of the item.

Returns:

vector of data mapped to index.

inline virtual std::size_t getLen() const noexcept final override#

Get the number of items in the database.

Returns:

std::size_t

inline virtual std::size_t getNbModalities() const noexcept final override#

Get the number of modalities in one database item.

Returns:

std::size_t

union MagicNumber#

Public Members

std::uint32_t value#
std::uint8_t byte[4]#
class aidge_backend_opencv.MNIST#
__init__(self: aidge_backend_opencv.aidge_backend_opencv.MNIST, dataPath: str, train: bool, load_data_in_memory: bool = False) None#
get_item(self: aidge_backend_opencv.aidge_backend_opencv.MNIST, index: int) List[aidge_core.aidge_core.Tensor]#

Return samples of each data modality for the given index.

Parameters:

index (int) – Database index corresponding to one item

get_len(self: aidge_backend_opencv.aidge_backend_opencv.MNIST) int#

Return the number of items in the database.

get_nb_modalities(self: aidge_backend_opencv.aidge_backend_opencv.MNIST) int#

Return the number of modalities in one item of the database.

len(self: aidge_core.aidge_core.Database) int#

UTILS#

std::shared_ptr<Tensor> Aidge::tensorOpencv(cv::Mat mat)#

Instanciate an aidge tensor with backend “opencv” from an opencv matrix.

Parameters:

mat – the cv::mat to instanciate the tensor from

Returns:

std::shared_ptr<Tensor> aidge tensor