Function mindspore::dataset::FakeImage

Function Documentation

inline std::shared_ptr<FakeImageDataset> mindspore::dataset::FakeImage(int32_t num_images = 1000, const std::vector<int32_t> &image_size = {224, 224, 3}, int32_t num_classes = 10, int32_t base_seed = 0, const std::shared_ptr<Sampler> &sampler = std::make_shared<RandomSampler>(), const std::shared_ptr<DatasetCache> &cache = nullptr)

Function to create a FakeImageDataset.

Note

The generated dataset has two columns [“image”, “label”].

Parameters
  • num_images[in] The number of images to generate, which must be positive (default = 1000).

  • image_size[in] Size of the images, which must be a vector of three positive values (default = {224, 224, 3}).

  • num_classes[in] The number of classes of the images, which must be positive (default = 10).

  • base_seed[in] The base seed to generate the images (default = 0).

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