Function mindspore::dataset::DIV2K

Function Documentation

inline std::shared_ptr<DIV2KDataset> mindspore::dataset::DIV2K(const std::string &dataset_dir, const std::string &usage, const std::string &downgrade, int32_t scale, bool decode = false, const std::shared_ptr<Sampler> &sampler = std::make_shared<RandomSampler>(), const std::shared_ptr<DatasetCache> &cache = nullptr)

Function to create a DIV2KDataset.

Note

The generated dataset has two columns [“hr_image”, “lr_image”].

Parameters
  • dataset_dir[in] The dataset dir to be read.

  • usage[in] The type of dataset. Acceptable usages include “train”, “valid” or “all”.

  • downgrade[in] The mode of downgrade. Acceptable downgrades include “bicubic”, “unknown”, “mild”, “difficult” or “wild”.

  • scale[in] The scale of downgrade. Acceptable scales include 2, 3, 4 or 8.

  • decode[in] Decode the images after reading (default=false).

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

Returns

Shared pointer to the current DIV2KDataset.