Function mindspore::dataset::Coco
Defined in File datasets.h
Function Documentation
Function to create a CocoDataset.
Note
The generated dataset has multi-columns :
task=’Detection’, column: [[‘image’, dtype=uint8], [‘bbox’, dtype=float32], [‘category_id’, dtype=uint32], [‘iscrowd’, dtype=uint32]].
task=’Stuff’, column: [[‘image’, dtype=uint8], [‘segmentation’,dtype=float32], [‘iscrowd’, dtype=uint32]].
task=’Keypoint’, column: [[‘image’, dtype=uint8], [‘keypoints’, dtype=float32], [‘num_keypoints’, dtype=uint32]].
task=’Panoptic’, column: [[‘image’, dtype=uint8], [‘bbox’, dtype=float32], [‘category_id’, dtype=uint32], [‘iscrowd’, dtype=uint32], [‘area’, dtype=uitn32]].
task=’Captioning’, column: [[‘image’, dtype=uint8], [‘captions’, dtype=string]].
- Parameters
dataset_dir – [in] Path to the root directory that contains the dataset.
annotation_file – [in] Path to the annotation json.
task – [in] Set the task type of reading coco data. Supported task types are “Detection”, “Stuff”, “Panoptic”, “Keypoint” and “Captioning”.
decode – [in] Decode the images after reading.
sampler – [in] 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 CocoDataset.