Class VOCDataset

Inheritance Relationships

Base Type

Class Documentation

class VOCDataset : public mindspore::dataset::Dataset

A source dataset for reading and parsing VOC dataset.

Public Functions

VOCDataset(const std::vector<char> &dataset_dir, const std::vector<char> &task, const std::vector<char> &usage, const std::map<std::vector<char>, int32_t> &class_indexing, bool decode, const std::shared_ptr<Sampler> &sampler, const std::shared_ptr<DatasetCache> &cache, bool extra_metadata)

Constructor of VOCDataset.

Parameters
  • dataset_dir[in] Path to the root directory that contains the dataset.

  • task[in] Set the task type of reading voc data, now only support “Segmentation” or “Detection”.

  • usage[in] The type of data list text file to be read (default = “train”).

  • class_indexing[in] A str-to-int mapping from label name to index, only valid in “Detection” task.

  • decode[in] Decode the images after reading.

  • sampler[in] Shared pointer to a sampler object used to choose samples from the dataset. If sampler is not given, a RandomSampler will be used to randomly iterate the entire dataset (default = RandomSampler()).

  • cache[in] Tensor cache to use (default=nullptr which means no cache is used).

  • extra_metadata[in] Flag to add extra meta-data to row (default=false).

VOCDataset(const std::vector<char> &dataset_dir, const std::vector<char> &task, const std::vector<char> &usage, const std::map<std::vector<char>, int32_t> &class_indexing, bool decode, const Sampler *sampler, const std::shared_ptr<DatasetCache> &cache, bool extra_metadata)

Constructor of VOCDataset.

Parameters
  • dataset_dir[in] Path to the root directory that contains the dataset.

  • task[in] Set the task type of reading voc data, now only support “Segmentation” or “Detection”.

  • usage[in] The type of data list text file to be read.

  • class_indexing[in] A str-to-int mapping from label name to index, only valid in “Detection” task.

  • decode[in] Decode the images after reading.

  • sampler[in] Raw pointer to a sampler object used to choose samples from the dataset.

  • cache[in] Tensor cache to use (default=nullptr which means no cache is used).

  • extra_metadata[in] Flag to add extra meta-data to row (default=false).

VOCDataset(const std::vector<char> &dataset_dir, const std::vector<char> &task, const std::vector<char> &usage, const std::map<std::vector<char>, int32_t> &class_indexing, bool decode, const std::reference_wrapper<Sampler> &sampler, const std::shared_ptr<DatasetCache> &cache, bool extra_metadata)

Constructor of VOCDataset.

Parameters
  • dataset_dir[in] Path to the root directory that contains the dataset.

  • task[in] Set the task type of reading voc data, now only support “Segmentation” or “Detection”.

  • usage[in] The type of data list text file to be read.

  • class_indexing[in] A str-to-int mapping from label name to index, only valid in “Detection” task.

  • decode[in] Decode the images after reading.

  • sampler[in] Raw pointer to a sampler object used to choose samples from the dataset.

  • cache[in] Tensor cache to use (default=nullptr which means no cache is used).

  • extra_metadata[in] Flag to add extra meta-data to row (default=false).

~VOCDataset() override = default

Destructor of VOCDataset.