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

Generate an ecvl::Dataset from a directory tree for a classification task. More...

#include <dataset_generator.h>

Inheritance diagram for ecvl::GenerateClassificationDataset:
ecvl::GenerateDataset

Public Member Functions

 GenerateClassificationDataset (const filesystem::path &dataset_root_directory)
 GenerateClassificationDataset constructor. More...
 
virtual int LoadSplitImages (const filesystem::path &split) override
 Load the path of images and labels of the specified split. More...
 
- Public Member Functions inherited from ecvl::GenerateDataset
 GenerateDataset (const filesystem::path &dataset_root_directory)
 GenerateDataset constructor. More...
 
virtual ~GenerateDataset ()=default
 
void LoadImagesAndSplits ()
 Call LoadSplitImages and load the splits with indexes of corresponding images. More...
 
Dataset GetDataset ()
 Return the Dataset object obtained from the directory structure. More...
 

Additional Inherited Members

- Public Attributes inherited from ecvl::GenerateDataset
const filesystem::path dataset_root_directory_
 path containing the root directory of the dataset More...
 
std::vector< std::string > splits_
 vector containing the splits found in the dataset directory, if present More...
 
std::vector< int > num_samples_
 vector containing the number of samples for each split More...
 
ecvl::Dataset d_
 Dataset object to fill. More...
 

Detailed Description

Generate an ecvl::Dataset from a directory tree for a classification task.

Assumes a directory structure where a top-level directory can have subdirectories named "training", "validation" and "test" (possibly not all present), each of which has in turn one subdirectory for each class, containing the images for that class. For more detailed information about the supported directory structure check https://github.com/deephealthproject/ecvl/wiki/ECVL-Dataset-Generator.

Definition at line 121 of file dataset_generator.h.

Constructor & Destructor Documentation

◆ GenerateClassificationDataset()

ecvl::GenerateClassificationDataset::GenerateClassificationDataset ( const filesystem::path &  dataset_root_directory)
inline

GenerateClassificationDataset constructor.

All the splits must have a directory for each class. If there aren't samples of that class, the directory has to be empty.

Parameters
[in]dataset_root_directorypath containing the root directory of the dataset.

Definition at line 131 of file dataset_generator.h.

Member Function Documentation

◆ LoadSplitImages()

virtual int ecvl::GenerateClassificationDataset::LoadSplitImages ( const filesystem::path &  split)
overridevirtual

Load the path of images and labels of the specified split.

Parameters
[in]splitdirectory name of the split that we are considering.
Returns
The number of samples of the split.

Implements ecvl::GenerateDataset.


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