14 #ifndef ECVL_SUPPORT_EDDL_H_ 15 #define ECVL_SUPPORT_EDDL_H_ 22 #include <eddl/apis/eddl.h> 38 std::array<shared_ptr<Augmentation>, 3> augs_;
49 augs_[+st]->Apply(img, gt);
90 bool verify =
false) :
94 augs_(std::move(augs)),
109 Image tmp = this->
samples_[0].LoadImage(ctype);
116 auto y = tmp.channels_.find(
'y');
117 auto x = tmp.channels_.find(
'x');
118 assert(y != std::string::npos && x != std::string::npos);
158 void LoadBatch(Tensor*& images, Tensor*& labels);
192 void TensorToView(Tensor*& t, View<DataType::float32>& v);
215 void ImageToTensor(
const Image& img, Tensor*& t,
const int& offset);
222 #endif // ECVL_SUPPORT_EDDL_H_
std::vector< int > resize_dims_
Dimensions (HxW) to which Dataset images must be resized.
SplitType current_split_
Current split from which images are loaded.
int batch_size_
Size of each dataset mini batch.
int n_channels_
Number of channels of the images.
int n_channels_gt_
Number of channels of the ground truth images.
ColorType
Enum class representing the ECVL supported color spaces.
std::vector< int > & GetSplit()
Returns the image indexes of the current Split.
void ImageToTensor(const Image &img, Tensor *&t)
Convert an ECVL Image into an EDDL Tensor.
void TensorToView(Tensor *&t, View< DataType::float32 > &v)
Convert an EDDL Tensor into an ECVL View.
DLDataset(const filesystem::path &filename, const int batch_size, DatasetAugmentations augs=DatasetAugmentations(), ColorType ctype=ColorType::BGR, ColorType ctype_gt=ColorType::GRAY, bool verify=false)
ColorType ctype_
ecvl::ColorType of the Dataset images.
void SetSplit(const SplitType &split)
Set the current Split.
DatasetAugmentations(std::array< shared_ptr< Augmentation >, 3 > augs={ nullptr, nullptr, nullptr })
void LoadBatch(Tensor *&images, Tensor *&labels)
Load a batch into images and labels tensor.
ColorType ctype_gt_
ecvl::ColorType of the Dataset ground truth images.
bool Apply(SplitType st, Image &img, const Image >=Image())
void ResetAllBatches()
Reset the batch counter of each Split.
std::mutex mutex_current_batch_
std::mutex to add exclusive access to attribute current_batch_.
DatasetAugmentations augs_
ecvl::DatasetAugmentations to be applied to the Dataset images (and ground truth if exist) for each s...
SplitType
Enum class representing the Dataset supported splits.
std::vector< Sample > samples_
Vector containing all the Dataset samples. See Sample.
DeepHealth Deep Learning Dataset.
std::array< int, 3 > current_batch_
Number of batches already loaded for each split.
void TensorToImage(Tensor *&t, Image &img)
Convert an EDDL Tensor into an ECVL Image.
void ResetCurrentBatch()
Reset the batch counter of the current Split.