Public Member Functions | Public Attributes | List of all members
ecvl::DLDataset Class Reference

DeepHealth Deep Learning Dataset. More...

#include <support_eddl.h>

Inheritance diagram for ecvl::DLDataset:
ecvl::Dataset

Public Member Functions

 DLDataset (const filesystem::path &filename, const int batch_size, DatasetAugmentations augs=DatasetAugmentations(), ColorType ctype=ColorType::BGR, ColorType ctype_gt=ColorType::GRAY, bool verify=false)
 
std::vector< int > & GetSplit ()
 Returns the image indexes of the current Split. More...
 
std::vector< int > & GetSplit (const SplitType &split)
 Returns the image indexes of the requested Split. More...
 
void ResetCurrentBatch ()
 Reset the batch counter of the current Split. More...
 
void ResetAllBatches ()
 Reset the batch counter of each Split. More...
 
void SetSplit (const SplitType &split)
 Set the current Split. More...
 
void LoadBatch (Tensor *&images, Tensor *&labels)
 Load a batch into images and labels tensor. More...
 
void LoadBatch (Tensor *&images)
 Load a batch into images tensor. Useful for tests set when you don't have labels. More...
 
- Public Member Functions inherited from ecvl::Dataset
 Dataset ()
 
 Dataset (const filesystem::path &filename, bool verify=false)
 
void Dump (const filesystem::path &file_path)
 Dump the Dataset into a YAML file following the DeepHealth Dataset Format. More...
 

Public Attributes

int batch_size_
 Size of each dataset mini batch. More...
 
int n_channels_
 Number of channels of the images. More...
 
int n_channels_gt_
 Number of channels of the ground truth images. More...
 
SplitType current_split_
 Current split from which images are loaded. More...
 
std::vector< int > resize_dims_
 Dimensions (HxW) to which Dataset images must be resized. More...
 
std::array< int, 3 > current_batch_ = { 0,0,0 }
 Number of batches already loaded for each split. More...
 
ColorType ctype_
 ecvl::ColorType of the Dataset images. More...
 
ColorType ctype_gt_
 ecvl::ColorType of the Dataset ground truth images. More...
 
DatasetAugmentations augs_
 ecvl::DatasetAugmentations to be applied to the Dataset images (and ground truth if exist) for each split. More...
 
std::mutex mutex_current_batch_
 std::mutex to add exclusive access to attribute current_batch_. More...
 
- Public Attributes inherited from ecvl::Dataset
std::string name_ = "DeepHealth dataset"
 Name of the Dataset. More...
 
std::string description_ = "This is the DeepHealth example dataset!"
 Description of the Dataset. More...
 
std::vector< std::string > classes_
 Vector with all the classes available in the Dataset. More...
 
std::vector< std::string > features_
 Vector with all the features available in the Dataset. More...
 
std::vector< Samplesamples_
 Vector containing all the Dataset samples. See Sample. More...
 
Split split_
 Splits of the Dataset. See Split. More...
 

Additional Inherited Members

- Static Public Attributes inherited from ecvl::Dataset
static const std::regex url_regex_
 

Detailed Description

DeepHealth Deep Learning Dataset.

This class extends the DeepHealth Dataset with Deep Learning specific members.

Examples
example_ecvl_eddl.cpp.

Definition at line 62 of file support_eddl.h.

Constructor & Destructor Documentation

◆ DLDataset()

ecvl::DLDataset::DLDataset ( const filesystem::path &  filename,
const int  batch_size,
DatasetAugmentations  augs = DatasetAugmentations(),
ColorType  ctype = ColorType::BGR,
ColorType  ctype_gt = ColorType::GRAY,
bool  verify = false 
)
inline
Parameters
[in]filenamePath to the Dataset file.
[in]batch_sizeSize of each dataset mini batch.
[in]augsArray with three DatasetAugmentations (training, validation and test) to be applied to the Dataset images (and ground truth if exists) for each split. If no augmentation is required or the split doesn't exist, nullptr has to be passed.
[in]ctypeecvl::ColorType of the Dataset images.
[in]ctype_gtecvl::ColorType of the Dataset ground truth images.
[in]verifyIf true, a list of all the images in the Dataset file which don't exist is printed with an ECVL_WARNING_MSG.

Definition at line 85 of file support_eddl.h.

Member Function Documentation

◆ GetSplit() [1/2]

std::vector<int>& ecvl::DLDataset::GetSplit ( )

Returns the image indexes of the current Split.

Returns
vector of image indexes of the Split in use.

◆ GetSplit() [2/2]

std::vector<int>& ecvl::DLDataset::GetSplit ( const SplitType split)

Returns the image indexes of the requested Split.

Parameters
[in]splitecvl::SplitType representing the Split to get ("training", "validation", or "test").
Returns
vector of image indexes of the requested Split.

◆ LoadBatch() [1/2]

void ecvl::DLDataset::LoadBatch ( Tensor *&  images,
Tensor *&  labels 
)

Load a batch into images and labels tensor.

Parameters
[out]imagestensor which stores the batch of images.
[out]labelstensor which stores the batch of labels.
Examples
example_ecvl_eddl.cpp.

◆ LoadBatch() [2/2]

void ecvl::DLDataset::LoadBatch ( Tensor *&  images)

Load a batch into images tensor. Useful for tests set when you don't have labels.

Parameters
[out]imagestensor which stores the batch of images.

◆ ResetAllBatches()

void ecvl::DLDataset::ResetAllBatches ( )

Reset the batch counter of each Split.

◆ ResetCurrentBatch()

void ecvl::DLDataset::ResetCurrentBatch ( )

Reset the batch counter of the current Split.

◆ SetSplit()

void ecvl::DLDataset::SetSplit ( const SplitType split)

Set the current Split.

Parameters
[in]splitecvl::SplitType representing the Split to set ("training", "validation", or "test").
Examples
example_ecvl_eddl.cpp.

Member Data Documentation

◆ augs_

DatasetAugmentations ecvl::DLDataset::augs_

ecvl::DatasetAugmentations to be applied to the Dataset images (and ground truth if exist) for each split.

Definition at line 73 of file support_eddl.h.

◆ batch_size_

int ecvl::DLDataset::batch_size_

Size of each dataset mini batch.

Definition at line 65 of file support_eddl.h.

◆ ctype_

ColorType ecvl::DLDataset::ctype_

ecvl::ColorType of the Dataset images.

Definition at line 71 of file support_eddl.h.

◆ ctype_gt_

ColorType ecvl::DLDataset::ctype_gt_

ecvl::ColorType of the Dataset ground truth images.

Definition at line 72 of file support_eddl.h.

◆ current_batch_

std::array<int, 3> ecvl::DLDataset::current_batch_ = { 0,0,0 }

Number of batches already loaded for each split.

Definition at line 70 of file support_eddl.h.

◆ current_split_

SplitType ecvl::DLDataset::current_split_

Current split from which images are loaded.

Definition at line 68 of file support_eddl.h.

◆ mutex_current_batch_

std::mutex ecvl::DLDataset::mutex_current_batch_

std::mutex to add exclusive access to attribute current_batch_.

Definition at line 74 of file support_eddl.h.

◆ n_channels_

int ecvl::DLDataset::n_channels_

Number of channels of the images.

Examples
example_ecvl_eddl.cpp.

Definition at line 66 of file support_eddl.h.

◆ n_channels_gt_

int ecvl::DLDataset::n_channels_gt_

Number of channels of the ground truth images.

Definition at line 67 of file support_eddl.h.

◆ resize_dims_

std::vector<int> ecvl::DLDataset::resize_dims_

Dimensions (HxW) to which Dataset images must be resized.

Examples
example_ecvl_eddl.cpp.

Definition at line 69 of file support_eddl.h.


The documentation for this class was generated from the following file: