![]() |
|
DeepHealth Deep Learning Dataset. More...
#include <support_eddl.h>
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... | |
![]() | |
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... | |
![]() | |
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< Sample > | samples_ |
Vector containing all the Dataset samples. See Sample. More... | |
Split | split_ |
Splits of the Dataset. See Split. More... | |
Additional Inherited Members | |
![]() | |
static const std::regex | url_regex_ |
DeepHealth Deep Learning Dataset.
This class extends the DeepHealth Dataset with Deep Learning specific members.
Definition at line 62 of file support_eddl.h.
|
inline |
[in] | filename | Path to the Dataset file. |
[in] | batch_size | Size of each dataset mini batch. |
[in] | augs | Array 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] | ctype | ecvl::ColorType of the Dataset images. |
[in] | ctype_gt | ecvl::ColorType of the Dataset ground truth images. |
[in] | verify | If 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.
std::vector<int>& ecvl::DLDataset::GetSplit | ( | ) |
std::vector<int>& ecvl::DLDataset::GetSplit | ( | const SplitType & | split | ) |
Returns the image indexes of the requested Split.
[in] | split | ecvl::SplitType representing the Split to get ("training", "validation", or "test"). |
void ecvl::DLDataset::LoadBatch | ( | Tensor *& | images, |
Tensor *& | labels | ||
) |
Load a batch into images and labels tensor
.
[out] | images | tensor which stores the batch of images. |
[out] | labels | tensor which stores the batch of labels. |
void ecvl::DLDataset::LoadBatch | ( | Tensor *& | images | ) |
Load a batch into images tensor
. Useful for tests set when you don't have labels.
[out] | images | tensor which stores the batch of images. |
void ecvl::DLDataset::ResetAllBatches | ( | ) |
Reset the batch counter of each Split.
void ecvl::DLDataset::ResetCurrentBatch | ( | ) |
Reset the batch counter of the current Split.
void ecvl::DLDataset::SetSplit | ( | const SplitType & | split | ) |
Set the current Split.
[in] | split | ecvl::SplitType representing the Split to set ("training", "validation", or "test"). |
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.
int ecvl::DLDataset::batch_size_ |
Size of each dataset mini batch.
Definition at line 65 of file support_eddl.h.
ColorType ecvl::DLDataset::ctype_ |
ecvl::ColorType of the Dataset images.
Definition at line 71 of file support_eddl.h.
ColorType ecvl::DLDataset::ctype_gt_ |
ecvl::ColorType of the Dataset ground truth images.
Definition at line 72 of file support_eddl.h.
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.
SplitType ecvl::DLDataset::current_split_ |
Current split from which images are loaded.
Definition at line 68 of file support_eddl.h.
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.
int ecvl::DLDataset::n_channels_ |
Number of channels of the images.
Definition at line 66 of file support_eddl.h.
int ecvl::DLDataset::n_channels_gt_ |
Number of channels of the ground truth images.
Definition at line 67 of file support_eddl.h.
std::vector<int> ecvl::DLDataset::resize_dims_ |
Dimensions (HxW) to which Dataset images must be resized.
Definition at line 69 of file support_eddl.h.