mscoco
MSCOCODataset
¶
Bases: DirDataset
A specialized DirDataset to handle MSCOCO data.
This dataset combines images from the MSCOCO data directory with their corresponding bboxes, masks, and captions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_dir |
str
|
The path the directory containing MSOCO images. |
required |
annotation_file |
str
|
The path to the file containing annotation data. |
required |
caption_file |
str
|
The path the file containing caption data. |
required |
include_bboxes |
bool
|
Whether images should be paired with their associated bounding boxes. If true, images without bounding boxes will be ignored and other images may be oversampled in order to take their place. |
True
|
include_masks |
bool
|
Whether images should be paired with their associated masks. If true, images without masks will be ignored and other images may be oversampled in order to take their place. |
False
|
include_captions |
bool
|
Whether images should be paired with their associated captions. If true, images without captions will be ignored and other images may be oversampled in order to take their place. |
False
|
min_bbox_area |
Bounding boxes with a total area less than |
1.0
|
Source code in fastestimator\fastestimator\dataset\data\mscoco.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
load_data
¶
Load and return the COCO dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
root_dir |
Optional[str]
|
The path to store the downloaded data. When |
None
|
load_bboxes |
bool
|
Whether to load bbox-related data. |
True
|
load_masks |
bool
|
Whether to load mask data (in the form of an array of 1-hot images). |
False
|
load_captions |
bool
|
Whether to load caption-related data. |
False
|
Returns:
Type | Description |
---|---|
Tuple[MSCOCODataset, MSCOCODataset]
|
(train_data, eval_data) |