14 #ifndef ECVL_DATASET_GENERATOR_H_ 15 #define ECVL_DATASET_GENERATOR_H_ 42 std::string tmp = p.path().stem().string();
45 if (tmp ==
"training" || tmp ==
"validation" || tmp ==
"test") {
133 filesystem::path tmp;
143 for (
auto& p : filesystem::directory_iterator(tmp)) {
144 if (filesystem::is_directory(p.path())) {
145 d_.
classes_.push_back(p.path().stem().string());
156 #endif // ECVL_DATASET_GENERATOR_H_ void LoadImagesAndSplits()
Call LoadSplitImages and load the splits with indexes of corresponding images.
GenerateClassificationDataset(const filesystem::path &dataset_root_directory)
GenerateClassificationDataset constructor.
std::vector< std::string > classes_
Vector with all the classes available in the Dataset.
std::string description_
Description of the Dataset.
virtual int LoadSplitImages(const filesystem::path &split) override
Load the path of images and labels of the specified split.
GenerateSegmentationDataset(const filesystem::path &dataset_root_directory, filesystem::path suffix="", filesystem::path gt_name="")
GenerateSegmentationDataset constructor.
Abstract class which fill the dataset object with name and description, features common to all types ...
filesystem::path gt_name_
path containing the ground truth name for images that share the same ground truth
virtual int LoadSplitImages(const filesystem::path &split)=0
Load the path of images and labels of the specified split.
std::vector< std::string > splits_
vector containing the splits found in the dataset directory, if present
const filesystem::path dataset_root_directory_
path containing the root directory of the dataset
filesystem::path suffix_
path containing the suffix or extension of ground truth images
ecvl::Dataset d_
Dataset object to fill.
Dataset GetDataset()
Return the Dataset object obtained from the directory structure.
std::vector< int > num_samples_
vector containing the number of samples for each split
virtual ~GenerateDataset()=default
GenerateDataset(const filesystem::path &dataset_root_directory)
GenerateDataset constructor.
std::string name_
Name of the Dataset.
Generate an ecvl::Dataset from a directory tree for a segmentation task.
Generate an ecvl::Dataset from a directory tree for a classification task.
virtual int LoadSplitImages(const filesystem::path &split) override
Load the path of images and labels of the specified split.