Function mindspore::dataset::VOC

Function Documentation

inline std::shared_ptr<VOCDataset> mindspore::dataset::VOC(const std::string &dataset_dir, const std::string &task, const std::string &usage, const std::map<std::string, int32_t> &class_indexing, bool decode, const Sampler *sampler, const std::shared_ptr<DatasetCache> &cache = nullptr, bool extra_metadata = false)

Function to create a VOCDataset.

Note

The generated dataset has multi-columns :

  • task=’Detection’, column: [[‘image’, dtype=uint8], [‘bbox’, dtype=float32], [‘label’, dtype=uint32], [‘difficult’, dtype=uint32], [‘truncate’, dtype=uint32]].

  • task=’Segmentation’, column: [[‘image’, dtype=uint8], [‘target’,dtype=uint8]].

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).

Returns

Shared pointer to the VOCDataset.