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

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

#include <dataset_generator.h>

Inheritance diagram for ecvl::GenerateSegmentationDataset:
ecvl::GenerateDataset

Public Member Functions

 GenerateSegmentationDataset (const filesystem::path &dataset_root_directory, filesystem::path suffix="", filesystem::path gt_name="")
 GenerateSegmentationDataset 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...
 

Public Attributes

filesystem::path suffix_
 path containing the suffix or extension of ground truth images More...
 
filesystem::path gt_name_
 path containing the ground truth name for images that share the same ground truth More...
 
- 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 segmentation 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 can have images and ground truth in different subdirectories (named "images" and "ground_truth") or in the same directory. If the ground truth images have a particular suffix or a different extension (necessary if they are in the same directory as the images) it's necessary to specify it in the constructor. For more detailed information about the supported directory structure check https://github.com/deephealthproject/ecvl/wiki/ECVL-Dataset-Generator.

Definition at line 88 of file dataset_generator.h.

Constructor & Destructor Documentation

◆ GenerateSegmentationDataset()

ecvl::GenerateSegmentationDataset::GenerateSegmentationDataset ( const filesystem::path &  dataset_root_directory,
filesystem::path  suffix = "",
filesystem::path  gt_name = "" 
)
inline

GenerateSegmentationDataset constructor.

Parameters
[in]dataset_root_directorypath containing the root directory of the dataset.
[in]suffixsuffix or extension of ground truth images, necessary if it's different from corresponding images (e.g., "_segmentation.png" or ".png").
[in]gt_namename of the ground truth for images that share the same ground truth. All images in the split (if available) which don't have their own ground truth will use this one.

Definition at line 101 of file dataset_generator.h.

Member Function Documentation

◆ LoadSplitImages()

virtual int ecvl::GenerateSegmentationDataset::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.

Member Data Documentation

◆ gt_name_

filesystem::path ecvl::GenerateSegmentationDataset::gt_name_

path containing the ground truth name for images that share the same ground truth

Definition at line 92 of file dataset_generator.h.

◆ suffix_

filesystem::path ecvl::GenerateSegmentationDataset::suffix_

path containing the suffix or extension of ground truth images

Definition at line 91 of file dataset_generator.h.


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