Datasets:
Tasks:
Image Segmentation
Sub-tasks:
instance-segmentation
Languages:
English
Size:
10K<n<100K
ArXiv:
Tags:
scene-parsing
License:
mariosasko
commited on
Commit
•
0940725
1
Parent(s):
2c09d0e
Add MIT Scene Parsing Benchmark (#3607)
Browse files* Add initial script
* Add MIT Scene Parsing Benchmark
* Info and card
* Minor fix
* Add dummy data
* Update datasets/scene_parse_150/README.md
Co-authored-by: Quentin Lhoest <42851186+lhoestq@users.noreply.github.com>
* Address comments
Co-authored-by: Quentin Lhoest <42851186+lhoestq@users.noreply.github.com>
Commit from https://github.com/huggingface/datasets/commit/a80949681aaa8c904653d9033c44a8230c51f379
- README.md +224 -0
- dataset_infos.json +1 -0
- dummy/instance_segmentation/1.0.0/dummy_data.zip +3 -0
- dummy/scene_parsing/1.0.0/dummy_data.zip +3 -0
- scene_parse_150.py +306 -0
README.md
ADDED
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- crowdsourced
|
4 |
+
- expert-generated
|
5 |
+
language_creators:
|
6 |
+
- found
|
7 |
+
languages:
|
8 |
+
- en
|
9 |
+
licenses:
|
10 |
+
- bsd-3-clause
|
11 |
+
multilinguality:
|
12 |
+
- monolingual
|
13 |
+
size_categories:
|
14 |
+
- 10K<n<100K
|
15 |
+
source_datasets:
|
16 |
+
- extended|ade20k
|
17 |
+
task_categories:
|
18 |
+
- other
|
19 |
+
task_ids:
|
20 |
+
- other-scene-parsing
|
21 |
+
- other-instance-segmentation
|
22 |
+
paperswithcode_id: null
|
23 |
+
pretty_name: MIT Scene Parsing Benchmark
|
24 |
+
---
|
25 |
+
|
26 |
+
# Dataset Card for MIT Scene Parsing Benchmark
|
27 |
+
|
28 |
+
## Table of Contents
|
29 |
+
- [Table of Contents](#table-of-contents)
|
30 |
+
- [Dataset Description](#dataset-description)
|
31 |
+
- [Dataset Summary](#dataset-summary)
|
32 |
+
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
33 |
+
- [Languages](#languages)
|
34 |
+
- [Dataset Structure](#dataset-structure)
|
35 |
+
- [Data Instances](#data-instances)
|
36 |
+
- [Data Fields](#data-fields)
|
37 |
+
- [Data Splits](#data-splits)
|
38 |
+
- [Dataset Creation](#dataset-creation)
|
39 |
+
- [Curation Rationale](#curation-rationale)
|
40 |
+
- [Source Data](#source-data)
|
41 |
+
- [Annotations](#annotations)
|
42 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
43 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
44 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
45 |
+
- [Discussion of Biases](#discussion-of-biases)
|
46 |
+
- [Other Known Limitations](#other-known-limitations)
|
47 |
+
- [Additional Information](#additional-information)
|
48 |
+
- [Dataset Curators](#dataset-curators)
|
49 |
+
- [Licensing Information](#licensing-information)
|
50 |
+
- [Citation Information](#citation-information)
|
51 |
+
- [Contributions](#contributions)
|
52 |
+
|
53 |
+
## Dataset Description
|
54 |
+
|
55 |
+
- **Homepage:** [MIT Scene Parsing Benchmark homepage](https://www.robots.ox.ac.uk/~vgg/research/pass/)
|
56 |
+
- **Repository:** [Scene Parsing repository (Caffe/Torch7)](https://github.com/CSAILVision/sceneparsing),[Scene Parsing repository (PyTorch)](https://github.com/CSAILVision/semantic-segmentation-pytorch) and [Instance Segmentation repository](https://github.com/CSAILVision/placeschallenge/tree/master/instancesegmentation)
|
57 |
+
- **Paper:** [Scene Parsing through ADE20K Dataset.](http://people.csail.mit.edu/bzhou/publication/scene-parse-camera-ready.pdf) and [Semantic Understanding of Scenes through ADE20K Datase](https://arxiv.org/abs/1608.05442)
|
58 |
+
- **Leaderboard:** [MIT Scene Parsing Benchmark leaderboard](http://sceneparsing.csail.mit.edu/#:~:text=twice%20per%20week.-,leaderboard,-Organizers)
|
59 |
+
- **Point of Contact:** [Bolei Zhou](mailto:bzhou@ie.cuhk.edu.hk)
|
60 |
+
|
61 |
+
### Dataset Summary
|
62 |
+
|
63 |
+
Scene parsing is the task of segmenting and parsing an image into different image regions associated with semantic categories, such as sky, road, person, and bed. MIT Scene Parsing Benchmark (SceneParse150) provides a standard training and evaluation platform for the algorithms of scene parsing. The data for this benchmark comes from ADE20K Dataset which contains more than 20K scene-centric images exhaustively annotated with objects and object parts. Specifically, the benchmark is divided into 20K images for training, 2K images for validation, and another batch of held-out images for testing. There are in total 150 semantic categories included for evaluation, which include e.g. sky, road, grass, and discrete objects like person, car, bed. Note that there are non-uniform distribution of objects occuring in the images, mimicking a more natural object occurrence in daily scene.
|
64 |
+
|
65 |
+
The goal of this benchmark is to segment and parse an image into different image regions associated with semantic categories, such as sky, road, person, and bedThis benchamark is similar to semantic segmentation tasks in COCO and Pascal Dataset, but the data is more scene-centric and with a diverse range of object categories. The data for this benchmark comes from ADE20K Dataset which contains more than 20K scene-centric images exhaustively annotated with objects and object parts.
|
66 |
+
|
67 |
+
### Supported Tasks and Leaderboards
|
68 |
+
|
69 |
+
- `scene-parsing`: The goal of this task is to segment the whole image densely into semantic classes (image regions), where each pixel is assigned a class label such as the region of *tree* and the region of *building*.
|
70 |
+
[The leaderboard](http://sceneparsing.csail.mit.edu/#:~:text=twice%20per%20week.-,leaderboard,-Organizers) for this task ranks the models by considering the mean of the pixel-wise accuracy and class-wise IoU as the final score. Pixel-wise accuracy indicates the ratio of pixels which are correctly predicted, while class-wise IoU indicates the Intersection of Union of pixels averaged over all the 150 semantic categories. Refer to the [Development Kit](https://github.com/CSAILVision/sceneparsing) for the detail.
|
71 |
+
|
72 |
+
- `instance-segmentation`: The goal of this task is to detect the object instances inside an image and further generate the precise segmentation masks of the objects. Its difference compared to the task of scene parsing is that in scene parsing there is no instance concept for the segmented regions, instead in instance segmentation if there are three persons in the scene, the network is required to segment each one of the person regions. This task doesn't have an active leaderboard. The performance of the instance segmentation algorithms is evaluated by Average Precision (AP, or mAP), following COCO evaluation metrics. For each image, at most 255 top-scoring instance masks are taken across all categories. Each instance mask prediction is only considered if its IoU with ground truth is above a certain threshold. There are 10 IoU thresholds of 0.50:0.05:0.95 for evaluation. The final AP is averaged across 10 IoU thresholds and 100 categories. You can refer to COCO evaluation page for more explanation: http://mscoco.org/dataset/#detections-eval
|
73 |
+
|
74 |
+
### Languages
|
75 |
+
|
76 |
+
English.
|
77 |
+
|
78 |
+
## Dataset Structure
|
79 |
+
|
80 |
+
### Data Instances
|
81 |
+
|
82 |
+
A data point comprises an image and its annotation mask, which is `None` in the testing set. The `scene_parsing` configuration has an additional `scene_category` field.
|
83 |
+
|
84 |
+
#### `scene_parsing`
|
85 |
+
|
86 |
+
```
|
87 |
+
{
|
88 |
+
'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=683x512 at 0x1FF32A3EDA0>,
|
89 |
+
'annotation': <PIL.PngImagePlugin.PngImageFile image mode=L size=683x512 at 0x1FF32E5B978>,
|
90 |
+
'scene_category': 0
|
91 |
+
}
|
92 |
+
```
|
93 |
+
|
94 |
+
#### `instance_segmentation`
|
95 |
+
|
96 |
+
```
|
97 |
+
{
|
98 |
+
'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=256x256 at 0x20B51B5C400>,
|
99 |
+
'annotation': <PIL.PngImagePlugin.PngImageFile image mode=RGB size=256x256 at 0x20B57051B38>
|
100 |
+
}
|
101 |
+
```
|
102 |
+
|
103 |
+
### Data Fields
|
104 |
+
|
105 |
+
#### `scene_parsing`
|
106 |
+
|
107 |
+
- `image`: A `PIL.Image.Image` object containing the image. Note that when accessing the image column: `dataset[0]["image"]` the image file is automatically decoded. Decoding of a large number of image files might take a significant amount of time. Thus it is important to first query the sample index before the `"image"` column, *i.e.* `dataset[0]["image"]` should **always** be preferred over `dataset["image"][0]`.
|
108 |
+
- `annotation`: A `PIL.Image.Image` object containing the annotation mask.
|
109 |
+
- `scene_category`: A scene category for the image (e.g. `airport_terminal`, `canyon`, `mobile_home`).
|
110 |
+
|
111 |
+
> **Note**: annotation masks contain labels ranging from 0 to 150, where 0 refers to "other objects". Those pixels are not considered in the official evaluation. Refer to [this file](https://github.com/CSAILVision/sceneparsing/blob/master/objectInfo150.csv) for the information about the labels of the 150 semantic categories, including indices, pixel ratios and names.
|
112 |
+
|
113 |
+
#### `instance_segmentation`
|
114 |
+
|
115 |
+
- `image`: A `PIL.Image.Image` object containing the image. Note that when accessing the image column: `dataset[0]["image"]` the image file is automatically decoded. Decoding of a large number of image files might take a significant amount of time. Thus it is important to first query the sample index before the `"image"` column, *i.e.* `dataset[0]["image"]` should **always** be preferred over `dataset["image"][0]`.
|
116 |
+
- `annotation`: A `PIL.Image.Image` object containing the annotation mask.
|
117 |
+
|
118 |
+
> **Note**: in the instance annotation masks, the R(ed) channel encodes category ID, and the G(reen) channel encodes instance ID. Each object instance has a unique instance ID regardless of its category ID. In the dataset, all images have <256 object instances. Refer to [this file (train split)](https://github.com/CSAILVision/placeschallenge/blob/master/instancesegmentation/instanceInfo100_train.txt) and to [this file (validation split)](https://github.com/CSAILVision/placeschallenge/blob/master/instancesegmentation/instanceInfo100_val.txt) for the information about the labels of the 100 semantic categories. To find the mapping between the semantic categories for `instance_segmentation` and `scene_parsing`, refer to [this file](https://github.com/CSAILVision/placeschallenge/blob/master/instancesegmentation/categoryMapping.txt).
|
119 |
+
|
120 |
+
### Data Splits
|
121 |
+
|
122 |
+
The data is split into training, test and validation set. The training data contains 20210 images, the testing data contains 3352 images and the validation data contains 2000 images.
|
123 |
+
|
124 |
+
## Dataset Creation
|
125 |
+
|
126 |
+
### Curation Rationale
|
127 |
+
|
128 |
+
The rationale from the paper for the ADE20K dataset from which this benchmark originates:
|
129 |
+
|
130 |
+
> Semantic understanding of visual scenes is one of the holy grails of computer vision. Despite efforts of the community in data collection, there are still few image datasets covering a wide range of scenes and object categories with pixel-wise annotations for scene understanding. In this work, we present a densely annotated dataset ADE20K, which spans diverse annotations of scenes, objects, parts of objects, and
|
131 |
+
in some cases even parts of parts.
|
132 |
+
|
133 |
+
> The motivation of this work is to collect a dataset that has densely annotated images (every pixel has a semantic label) with a large and an unrestricted open vocabulary. The
|
134 |
+
images in our dataset are manually segmented in great detail, covering a diverse set of scenes, object and object part categories. The challenge for collecting such annotations is finding reliable annotators, as well as the fact that labeling is difficult if the class list is not defined in advance. On the other hand, open vocabulary naming also suffers from naming inconsistencies across different annotators. In contrast,
|
135 |
+
our dataset was annotated by a single expert annotator, providing extremely detailed and exhaustive image annotations. On average, our annotator labeled 29 annotation segments per image, compared to the 16 segments per image labeled by external annotators (like workers from Amazon Mechanical Turk). Furthermore, the data consistency and quality are much higher than that of external annotators.
|
136 |
+
|
137 |
+
### Source Data
|
138 |
+
|
139 |
+
#### Initial Data Collection and Normalization
|
140 |
+
|
141 |
+
Images come from the LabelMe, SUN datasets, and Places and were selected to cover the 900 scene categories defined in the SUN database.
|
142 |
+
|
143 |
+
This benchmark was built by selecting the top 150 objects ranked by their total pixel ratios from the ADE20K dataset. As the original images in the ADE20K dataset have various sizes, for simplicity those large-sized images were rescaled to make their minimum heights or widths as 512. Among the 150 objects, there are 35 stuff classes (i.e., wall, sky, road) and 115 discrete objects (i.e., car, person, table). The annotated pixels of the 150 objects occupy 92.75% of all the pixels in the dataset, where the stuff classes occupy 60.92%, and discrete objects occupy 31.83%.
|
144 |
+
|
145 |
+
#### Who are the source language producers?
|
146 |
+
|
147 |
+
The same as in the LabelMe, SUN datasets, and Places datasets.
|
148 |
+
|
149 |
+
### Annotations
|
150 |
+
|
151 |
+
#### Annotation process
|
152 |
+
|
153 |
+
Annotation process for the ADE20K dataset:
|
154 |
+
|
155 |
+
> **Image Annotation.** For our dataset, we are interested in having a diverse set of scenes with dense annotations of all the objects present. Images come from the LabelMe, SUN datasets, and Places and were selected to cover the 900 scene categories defined in the SUN database. Images were annotated by a single expert worker using the LabelMe interface. Fig. 2 shows a snapshot of the annotation interface and one fully segmented image. The worker provided three types of annotations: object segments with names, object parts, and attributes. All object instances are segmented independently so that the dataset could be used to train and evaluate detection or segmentation algorithms. Datasets such as COCO, Pascal or Cityscape start by defining a set of object categories of interest. However, when labeling all the objects in a scene, working with a predefined list of objects is not possible as new categories
|
156 |
+
appear frequently (see fig. 5.d). Here, the annotator created a dictionary of visual concepts where new classes were added constantly to ensure consistency in object naming. Object parts are associated with object instances. Note that parts can have parts too, and we label these associations as well. For example, the ‘rim’ is a part of a ‘wheel’, which in turn is part of a ‘car’. A ‘knob’ is a part of a ‘door’
|
157 |
+
that can be part of a ‘cabinet’. The total part hierarchy has a depth of 3. The object and part hierarchy is in the supplementary materials.
|
158 |
+
|
159 |
+
> **Annotation Consistency.** Defining a labeling protocol is relatively easy when the labeling task is restricted to a fixed list of object classes, however it becomes challenging when the class list is openended. As the goal is to label all the objects within each image, the list of classes grows unbounded. >Many object classes appear only a few times across the entire collection of images. However, those rare >object classes cannot be ignored as they might be important elements for the interpretation of the scene. >Labeling in these conditions becomes difficult because we need to keep a growing list of all the object >classes in order to have a consistent naming across the entire dataset. Despite the annotator’s best effort, >the process is not free of noise. To analyze the annotation consistency we took a subset of 61 randomly >chosen images from the validation set, then asked our annotator to annotate them again (there is a time difference of six months). One expects that there are some differences between the two annotations. A few examples are shown in Fig 3. On average, 82.4% of the pixels got the same label. The remaining 17.6% of pixels had some errors for which we grouped into three error types as follows:
|
160 |
+
>
|
161 |
+
> • Segmentation quality: Variations in the quality of segmentation and outlining of the object boundary. One typical source of error arises when segmenting complex objects such as buildings and trees, which can be segmented with different degrees of precision. 5.7% of the pixels had this type of error.
|
162 |
+
>
|
163 |
+
> • Object naming: Differences in object naming (due to ambiguity or similarity between concepts, for instance calling a big car a ‘car’ in one segmentation and a ‘truck’ in the another one, or a ‘palm tree’ a‘tree’. 6.0% of the pixels had naming issues. These errors can be reduced by defining a very precise terminology, but this becomes much harder with a large growing vocabulary.
|
164 |
+
>
|
165 |
+
> • Segmentation quantity: Missing objects in one of the two segmentations. There is a very large number of objects in each image and some images might be annotated more thoroughly than others. For example, in the third column of Fig 3 the annotator missed some small objects in different annotations. 5.9% of the pixels are due to missing labels. A similar issue existed in segmentation datasets such as the Berkeley Image segmentation dataset.
|
166 |
+
>
|
167 |
+
> The median error values for the three error types are: 4.8%, 0.3% and 2.6% showing that the mean value is dominated by a few images, and that the most common type of error is segmentation quality.
|
168 |
+
To further compare the annotation done by our single expert annotator and the AMT-like annotators, 20 images
|
169 |
+
from the validation set are annotated by two invited external annotators, both with prior experience in image labeling. The first external annotator had 58.5% of inconsistent pixels compared to the segmentation provided by our annotator, and the second external annotator had 75% of the inconsistent pixels. Many of these inconsistencies are due to the poor quality of the segmentations provided by external annotators (as it has been observed with AMT which requires multiple verification steps for quality control). For the
|
170 |
+
best external annotator (the first one), 7.9% of pixels have inconsistent segmentations (just slightly worse than our annotator), 14.9% have inconsistent object naming and 35.8% of the pixels correspond to missing objects, which is due to the much smaller number of objects annotated by the external annotator in comparison with the ones annotated by our expert annotator. The external annotators labeled on average 16 segments per image while our annotator provided 29 segments per image.
|
171 |
+
|
172 |
+
#### Who are the annotators?
|
173 |
+
|
174 |
+
Three expert annotators and the AMT-like annotators.
|
175 |
+
|
176 |
+
### Personal and Sensitive Information
|
177 |
+
|
178 |
+
[More Information Needed]
|
179 |
+
|
180 |
+
## Considerations for Using the Data
|
181 |
+
|
182 |
+
### Social Impact of Dataset
|
183 |
+
|
184 |
+
[More Information Needed]
|
185 |
+
|
186 |
+
### Discussion of Biases
|
187 |
+
|
188 |
+
[More Information Needed]
|
189 |
+
|
190 |
+
### Other Known Limitations
|
191 |
+
|
192 |
+
Refer to the `Annotation Consistency` subsection of `Annotation Process`.
|
193 |
+
|
194 |
+
## Additional Information
|
195 |
+
|
196 |
+
### Dataset Curators
|
197 |
+
|
198 |
+
Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso and Antonio Torralba.
|
199 |
+
|
200 |
+
### Licensing Information
|
201 |
+
|
202 |
+
The MIT Scene Parsing Benchmark dataset is licensed under a [BSD 3-Clause License](https://github.com/CSAILVision/sceneparsing/blob/master/LICENSE).
|
203 |
+
|
204 |
+
### Citation Information
|
205 |
+
|
206 |
+
```bibtex
|
207 |
+
@inproceedings{zhou2017scene,
|
208 |
+
title={Scene Parsing through ADE20K Dataset},
|
209 |
+
author={Zhou, Bolei and Zhao, Hang and Puig, Xavier and Fidler, Sanja and Barriuso, Adela and Torralba, Antonio},
|
210 |
+
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
|
211 |
+
year={2017}
|
212 |
+
}
|
213 |
+
|
214 |
+
@article{zhou2016semantic,
|
215 |
+
title={Semantic understanding of scenes through the ade20k dataset},
|
216 |
+
author={Zhou, Bolei and Zhao, Hang and Puig, Xavier and Fidler, Sanja and Barriuso, Adela and Torralba, Antonio},
|
217 |
+
journal={arXiv preprint arXiv:1608.05442},
|
218 |
+
year={2016}
|
219 |
+
}
|
220 |
+
```
|
221 |
+
|
222 |
+
### Contributions
|
223 |
+
|
224 |
+
Thanks to [@mariosasko](https://github.com/mariosasko) for adding this dataset.
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"scene_parsing": {"description": "Scene parsing is to segment and parse an image into different image regions associated with semantic categories, such as sky, road, person, and bed.\nMIT Scene Parsing Benchmark (SceneParse150) provides a standard training and evaluation platform for the algorithms of scene parsing.\nThe data for this benchmark comes from ADE20K Dataset which contains more than 20K scene-centric images exhaustively annotated with objects and object parts.\nSpecifically, the benchmark is divided into 20K images for training, 2K images for validation, and another batch of held-out images for testing.\nThere are totally 150 semantic categories included for evaluation, which include stuffs like sky, road, grass, and discrete objects like person, car, bed.\nNote that there are non-uniform distribution of objects occuring in the images, mimicking a more natural object occurrence in daily scene.\n", "citation": "@inproceedings{zhou2017scene,\n title={Scene Parsing through ADE20K Dataset},\n author={Zhou, Bolei and Zhao, Hang and Puig, Xavier and Fidler, Sanja and Barriuso, Adela and Torralba, Antonio},\n booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},\n year={2017}\n}\n\n@article{zhou2016semantic,\n title={Semantic understanding of scenes through the ade20k dataset},\n author={Zhou, Bolei and Zhao, Hang and Puig, Xavier and Fidler, Sanja and Barriuso, Adela and Torralba, Antonio},\n journal={arXiv preprint arXiv:1608.05442},\n year={2016}\n}\n", "homepage": "http://sceneparsing.csail.mit.edu/", "license": "BSD 3-Clause License", "features": {"image": {"decode": true, "id": null, "_type": "Image"}, "annotation": {"decode": true, "id": null, "_type": "Image"}, "scene_category": {"num_classes": 1055, "names": ["airport_terminal", "art_gallery", "badlands", "ball_pit", "bathroom", "beach", "bedroom", "booth_indoor", "botanical_garden", "bridge", "bullring", "bus_interior", "butte", "canyon", "casino_outdoor", "castle", "church_outdoor", "closet", "coast", "conference_room", "construction_site", "corral", "corridor", "crosswalk", "day_care_center", "sand", "elevator_interior", "escalator_indoor", "forest_road", "gangplank", "gas_station", "golf_course", "gymnasium_indoor", "harbor", "hayfield", "heath", "hoodoo", "house", "hunting_lodge_outdoor", "ice_shelf", "joss_house", "kiosk_indoor", "kitchen", "landfill", "library_indoor", "lido_deck_outdoor", "living_room", "locker_room", "market_outdoor", "mountain_snowy", "office", "orchard", "arbor", "bookshelf", "mews", "nook", "preserve", "traffic_island", "palace", "palace_hall", "pantry", "patio", "phone_booth", "establishment", "poolroom_home", "quonset_hut_outdoor", "rice_paddy", "sandbox", "shopfront", "skyscraper", "stone_circle", "subway_interior", "platform", "supermarket", "swimming_pool_outdoor", "television_studio", "indoor_procenium", "train_railway", "coral_reef", "viaduct", "wave", "wind_farm", "bottle_storage", "abbey", "access_road", "air_base", "airfield", "airlock", "airplane_cabin", "airport", "entrance", "airport_ticket_counter", "alcove", "alley", "amphitheater", "amusement_arcade", "amusement_park", "anechoic_chamber", "apartment_building_outdoor", "apse_indoor", "apse_outdoor", "aquarium", "aquatic_theater", "aqueduct", "arcade", "arch", "archaelogical_excavation", "archive", "basketball", "football", "hockey", "performance", "rodeo", "soccer", "armory", "army_base", "arrival_gate_indoor", "arrival_gate_outdoor", "art_school", "art_studio", "artists_loft", "assembly_line", "athletic_field_indoor", "athletic_field_outdoor", "atrium_home", "atrium_public", "attic", "auditorium", "auto_factory", "auto_mechanics_indoor", "auto_mechanics_outdoor", "auto_racing_paddock", "auto_showroom", "backstage", "backstairs", "badminton_court_indoor", "badminton_court_outdoor", "baggage_claim", "shop", "exterior", "balcony_interior", "ballroom", "bamboo_forest", "bank_indoor", "bank_outdoor", "bank_vault", "banquet_hall", "baptistry_indoor", "baptistry_outdoor", "bar", "barbershop", "barn", "barndoor", "barnyard", "barrack", "baseball_field", "basement", "basilica", "basketball_court_indoor", "basketball_court_outdoor", "bathhouse", "batters_box", "batting_cage_indoor", "batting_cage_outdoor", "battlement", "bayou", "bazaar_indoor", "bazaar_outdoor", "beach_house", "beauty_salon", "bedchamber", "beer_garden", "beer_hall", "belfry", "bell_foundry", "berth", "berth_deck", "betting_shop", "bicycle_racks", "bindery", "biology_laboratory", "bistro_indoor", "bistro_outdoor", "bleachers_indoor", "bleachers_outdoor", "boardwalk", "boat_deck", "boathouse", "bog", "bomb_shelter_indoor", "bookbindery", "bookstore", "bow_window_indoor", "bow_window_outdoor", "bowling_alley", "box_seat", "boxing_ring", "breakroom", "brewery_indoor", "brewery_outdoor", "brickyard_indoor", "brickyard_outdoor", "building_complex", "building_facade", "bullpen", "burial_chamber", "bus_depot_indoor", "bus_depot_outdoor", "bus_shelter", "bus_station_indoor", "bus_station_outdoor", "butchers_shop", "cabana", "cabin_indoor", "cabin_outdoor", "cafeteria", "call_center", "campsite", "campus", "natural", "urban", "candy_store", "canteen", "car_dealership", "backseat", "frontseat", "caravansary", "cardroom", "cargo_container_interior", "airplane", "boat", "freestanding", "carport_indoor", "carport_outdoor", "carrousel", "casino_indoor", "catacomb", "cathedral_indoor", "cathedral_outdoor", "catwalk", "cavern_indoor", "cavern_outdoor", "cemetery", "chalet", "chaparral", "chapel", "checkout_counter", "cheese_factory", "chemical_plant", "chemistry_lab", "chicken_coop_indoor", "chicken_coop_outdoor", "chicken_farm_indoor", "chicken_farm_outdoor", "childs_room", "choir_loft_interior", "church_indoor", "circus_tent_indoor", "circus_tent_outdoor", "city", "classroom", "clean_room", "cliff", "booth", "room", "clock_tower_indoor", "cloister_indoor", "cloister_outdoor", "clothing_store", "coast_road", "cockpit", "coffee_shop", "computer_room", "conference_center", "conference_hall", "confessional", "control_room", "control_tower_indoor", "control_tower_outdoor", "convenience_store_indoor", "convenience_store_outdoor", "corn_field", "cottage", "cottage_garden", "courthouse", "courtroom", "courtyard", "covered_bridge_interior", "crawl_space", "creek", "crevasse", "library", "cybercafe", "dacha", "dairy_indoor", "dairy_outdoor", "dam", "dance_school", "darkroom", "delicatessen", "dentists_office", "department_store", "departure_lounge", "vegetation", "desert_road", "diner_indoor", "diner_outdoor", "dinette_home", "vehicle", "dining_car", "dining_hall", "dining_room", "dirt_track", "discotheque", "distillery", "ditch", "dock", "dolmen", "donjon", "doorway_indoor", "doorway_outdoor", "dorm_room", "downtown", "drainage_ditch", "dress_shop", "dressing_room", "drill_rig", "driveway", "driving_range_indoor", "driving_range_outdoor", "drugstore", "dry_dock", "dugout", "earth_fissure", "editing_room", "electrical_substation", "elevated_catwalk", "door", "freight_elevator", "elevator_lobby", "elevator_shaft", "embankment", "embassy", "engine_room", "entrance_hall", "escalator_outdoor", "escarpment", "estuary", "excavation", "exhibition_hall", "fabric_store", "factory_indoor", "factory_outdoor", "fairway", "farm", "fastfood_restaurant", "fence", "cargo_deck", "ferryboat_indoor", "passenger_deck", "cultivated", "wild", "field_road", "fire_escape", "fire_station", "firing_range_indoor", "firing_range_outdoor", "fish_farm", "fishmarket", "fishpond", "fitting_room_interior", "fjord", "flea_market_indoor", "flea_market_outdoor", "floating_dry_dock", "flood", "florist_shop_indoor", "florist_shop_outdoor", "fly_bridge", "food_court", "football_field", "broadleaf", "needleleaf", "forest_fire", "forest_path", "formal_garden", "fort", "fortress", "foundry_indoor", "foundry_outdoor", "fountain", "freeway", "funeral_chapel", "funeral_home", "furnace_room", "galley", "game_room", "garage_indoor", "garage_outdoor", "garbage_dump", "gasworks", "gate", "gatehouse", "gazebo_interior", "general_store_indoor", "general_store_outdoor", "geodesic_dome_indoor", "geodesic_dome_outdoor", "ghost_town", "gift_shop", "glacier", "glade", "gorge", "granary", "great_hall", "greengrocery", "greenhouse_indoor", "greenhouse_outdoor", "grotto", "guardhouse", "gulch", "gun_deck_indoor", "gun_deck_outdoor", "gun_store", "hacienda", "hallway", "handball_court", "hangar_indoor", "hangar_outdoor", "hardware_store", "hat_shop", "hatchery", "hayloft", "hearth", "hedge_maze", "hedgerow", "heliport", "herb_garden", "highway", "hill", "home_office", "home_theater", "hospital", "hospital_room", "hot_spring", "hot_tub_indoor", "hot_tub_outdoor", "hotel_outdoor", "hotel_breakfast_area", "hotel_room", "hunting_lodge_indoor", "hut", "ice_cream_parlor", "ice_floe", "ice_skating_rink_indoor", "ice_skating_rink_outdoor", "iceberg", "igloo", "imaret", "incinerator_indoor", "incinerator_outdoor", "industrial_area", "industrial_park", "inn_indoor", "inn_outdoor", "irrigation_ditch", "islet", "jacuzzi_indoor", "jacuzzi_outdoor", "jail_indoor", "jail_outdoor", "jail_cell", "japanese_garden", "jetty", "jewelry_shop", "junk_pile", "junkyard", "jury_box", "kasbah", "kennel_indoor", "kennel_outdoor", "kindergarden_classroom", "kiosk_outdoor", "kitchenette", "lab_classroom", "labyrinth_indoor", "labyrinth_outdoor", "lagoon", "artificial", "landing", "landing_deck", "laundromat", "lava_flow", "lavatory", "lawn", "lean-to", "lecture_room", "legislative_chamber", "levee", "library_outdoor", "lido_deck_indoor", "lift_bridge", "lighthouse", "limousine_interior", "liquor_store_indoor", "liquor_store_outdoor", "loading_dock", "lobby", "lock_chamber", "loft", "lookout_station_indoor", "lookout_station_outdoor", "lumberyard_indoor", "lumberyard_outdoor", "machine_shop", "manhole", "mansion", "manufactured_home", "market_indoor", "marsh", "martial_arts_gym", "mastaba", "maternity_ward", "mausoleum", "medina", "menhir", "mesa", "mess_hall", "mezzanine", "military_hospital", "military_hut", "military_tent", "mine", "mineshaft", "mini_golf_course_indoor", "mini_golf_course_outdoor", "mission", "dry", "water", "mobile_home", "monastery_indoor", "monastery_outdoor", "moon_bounce", "moor", "morgue", "mosque_indoor", "mosque_outdoor", "motel", "mountain", "mountain_path", "mountain_road", "movie_theater_indoor", "movie_theater_outdoor", "mudflat", "museum_indoor", "museum_outdoor", "music_store", "music_studio", "misc", "natural_history_museum", "naval_base", "newsroom", "newsstand_indoor", "newsstand_outdoor", "nightclub", "nuclear_power_plant_indoor", "nuclear_power_plant_outdoor", "nunnery", "nursery", "nursing_home", "oasis", "oast_house", "observatory_indoor", "observatory_outdoor", "observatory_post", "ocean", "office_building", "office_cubicles", "oil_refinery_indoor", "oil_refinery_outdoor", "oilrig", "operating_room", "optician", "organ_loft_interior", "orlop_deck", "ossuary", "outcropping", "outhouse_indoor", "outhouse_outdoor", "overpass", "oyster_bar", "oyster_farm", "acropolis", "aircraft_carrier_object", "amphitheater_indoor", "archipelago", "questionable", "assembly_hall", "assembly_plant", "awning_deck", "back_porch", "backdrop", "backroom", "backstage_outdoor", "backstairs_indoor", "backwoods", "ballet", "balustrade", "barbeque", "basin_outdoor", "bath_indoor", "bath_outdoor", "bathhouse_outdoor", "battlefield", "bay", "booth_outdoor", "bottomland", "breakfast_table", "bric-a-brac", "brooklet", "bubble_chamber", "buffet", "bulkhead", "bunk_bed", "bypass", "byroad", "cabin_cruiser", "cargo_helicopter", "cellar", "chair_lift", "cocktail_lounge", "corner", "country_house", "country_road", "customhouse", "dance_floor", "deck-house_boat_deck_house", "deck-house_deck_house", "dining_area", "diving_board", "embrasure", "entranceway_indoor", "entranceway_outdoor", "entryway_outdoor", "estaminet", "farm_building", "farmhouse", "feed_bunk", "field_house", "field_tent_indoor", "field_tent_outdoor", "fire_trench", "fireplace", "flashflood", "flatlet", "floating_dock", "flood_plain", "flowerbed", "flume_indoor", "flying_buttress", "foothill", "forecourt", "foreshore", "front_porch", "garden", "gas_well", "glen", "grape_arbor", "grove", "guardroom", "guesthouse", "gymnasium_outdoor", "head_shop", "hen_yard", "hillock", "housing_estate", "housing_project", "howdah", "inlet", "insane_asylum", "outside", "juke_joint", "jungle", "kraal", "laboratorywet", "landing_strip", "layby", "lean-to_tent", "loge", "loggia_outdoor", "lower_deck", "luggage_van", "mansard", "meadow", "meat_house", "megalith", "mens_store_outdoor", "mental_institution_indoor", "mental_institution_outdoor", "military_headquarters", "millpond", "millrace", "natural_spring", "nursing_home_outdoor", "observation_station", "open-hearth_furnace", "operating_table", "outbuilding", "palestra", "parkway", "patio_indoor", "pavement", "pawnshop_outdoor", "pinetum", "piste_road", "pizzeria_outdoor", "powder_room", "pumping_station", "reception_room", "rest_stop", "retaining_wall", "rift_valley", "road", "rock_garden", "rotisserie", "safari_park", "salon", "saloon", "sanatorium", "science_laboratory", "scrubland", "scullery", "seaside", "semidesert", "shelter", "shelter_deck", "shelter_tent", "shore", "shrubbery", "sidewalk", "snack_bar", "snowbank", "stage_set", "stall", "stateroom", "store", "streetcar_track", "student_center", "study_hall", "sugar_refinery", "sunroom", "supply_chamber", "t-bar_lift", "tannery", "teahouse", "threshing_floor", "ticket_window_indoor", "tidal_basin", "tidal_river", "tiltyard", "tollgate", "tomb", "tract_housing", "trellis", "truck_stop", "upper_balcony", "vestibule", "vinery", "walkway", "war_room", "washroom", "water_fountain", "water_gate", "waterscape", "waterway", "wetland", "widows_walk_indoor", "windstorm", "packaging_plant", "pagoda", "paper_mill", "park", "parking_garage_indoor", "parking_garage_outdoor", "parking_lot", "parlor", "particle_accelerator", "party_tent_indoor", "party_tent_outdoor", "pasture", "pavilion", "pawnshop", "pedestrian_overpass_indoor", "penalty_box", "pet_shop", "pharmacy", "physics_laboratory", "piano_store", "picnic_area", "pier", "pig_farm", "pilothouse_indoor", "pilothouse_outdoor", "pitchers_mound", "pizzeria", "planetarium_indoor", "planetarium_outdoor", "plantation_house", "playground", "playroom", "plaza", "podium_indoor", "podium_outdoor", "police_station", "pond", "pontoon_bridge", "poop_deck", "porch", "portico", "portrait_studio", "postern", "power_plant_outdoor", "print_shop", "priory", "promenade", "promenade_deck", "pub_indoor", "pub_outdoor", "pulpit", "putting_green", "quadrangle", "quicksand", "quonset_hut_indoor", "racecourse", "raceway", "raft", "railroad_track", "railway_yard", "rainforest", "ramp", "ranch", "ranch_house", "reading_room", "reception", "recreation_room", "rectory", "recycling_plant_indoor", "refectory", "repair_shop", "residential_neighborhood", "resort", "rest_area", "restaurant", "restaurant_kitchen", "restaurant_patio", "restroom_indoor", "restroom_outdoor", "revolving_door", "riding_arena", "river", "road_cut", "rock_arch", "roller_skating_rink_indoor", "roller_skating_rink_outdoor", "rolling_mill", "roof", "roof_garden", "root_cellar", "rope_bridge", "roundabout", "roundhouse", "rubble", "ruin", "runway", "sacristy", "salt_plain", "sand_trap", "sandbar", "sauna", "savanna", "sawmill", "schoolhouse", "schoolyard", "science_museum", "scriptorium", "sea_cliff", "seawall", "security_check_point", "server_room", "sewer", "sewing_room", "shed", "shipping_room", "shipyard_outdoor", "shoe_shop", "shopping_mall_indoor", "shopping_mall_outdoor", "shower", "shower_room", "shrine", "signal_box", "sinkhole", "ski_jump", "ski_lodge", "ski_resort", "ski_slope", "sky", "skywalk_indoor", "skywalk_outdoor", "slum", "snowfield", "massage_room", "mineral_bath", "spillway", "sporting_goods_store", "squash_court", "stable", "baseball", "stadium_outdoor", "stage_indoor", "stage_outdoor", "staircase", "starting_gate", "steam_plant_outdoor", "steel_mill_indoor", "storage_room", "storm_cellar", "street", "strip_mall", "strip_mine", "student_residence", "submarine_interior", "sun_deck", "sushi_bar", "swamp", "swimming_hole", "swimming_pool_indoor", "synagogue_indoor", "synagogue_outdoor", "taxistand", "taxiway", "tea_garden", "tearoom", "teashop", "television_room", "east_asia", "mesoamerican", "south_asia", "western", "tennis_court_indoor", "tennis_court_outdoor", "tent_outdoor", "terrace_farm", "indoor_round", "indoor_seats", "theater_outdoor", "thriftshop", "throne_room", "ticket_booth", "tobacco_shop_indoor", "toll_plaza", "tollbooth", "topiary_garden", "tower", "town_house", "toyshop", "track_outdoor", "trading_floor", "trailer_park", "train_interior", "train_station_outdoor", "station", "tree_farm", "tree_house", "trench", "trestle_bridge", "tundra", "rail_indoor", "rail_outdoor", "road_indoor", "road_outdoor", "turkish_bath", "ocean_deep", "ocean_shallow", "utility_room", "valley", "van_interior", "vegetable_garden", "velodrome_indoor", "velodrome_outdoor", "ventilation_shaft", "veranda", "vestry", "veterinarians_office", "videostore", "village", "vineyard", "volcano", "volleyball_court_indoor", "volleyball_court_outdoor", "voting_booth", "waiting_room", "walk_in_freezer", "warehouse_indoor", "warehouse_outdoor", "washhouse_indoor", "washhouse_outdoor", "watchtower", "water_mill", "water_park", "water_tower", "water_treatment_plant_indoor", "water_treatment_plant_outdoor", "block", "cascade", "cataract", "fan", "plunge", "watering_hole", "weighbridge", "wet_bar", "wharf", "wheat_field", "whispering_gallery", "widows_walk_interior", "windmill", "window_seat", "barrel_storage", "winery", "witness_stand", "woodland", "workroom", "workshop", "wrestling_ring_indoor", "wrestling_ring_outdoor", "yard", "youth_hostel", "zen_garden", "ziggurat", "zoo", "forklift", "hollow", "hutment", "pueblo", "vat", "perfume_shop", "steel_mill_outdoor", "orchestra_pit", "bridle_path", "lyceum", "one-way_street", "parade_ground", "pump_room", "recycling_plant_outdoor", "chuck_wagon"], "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "scene_parse150", "config_name": "scene_parsing", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 8468086, "num_examples": 20210, "dataset_name": "scene_parse150"}, "test": {"name": "test", "num_bytes": 744607, "num_examples": 3352, "dataset_name": "scene_parse150"}, "validation": {"name": "validation", "num_bytes": 838032, "num_examples": 2000, "dataset_name": "scene_parse150"}}, "download_checksums": {"http://data.csail.mit.edu/places/ADEchallenge/ADEChallengeData2016.zip": {"num_bytes": 967382037, "checksum": "7ff1be44964418441f542a7cc1e1a650e7dc0fc275f5d23252bc9bbdbc977b29"}, "http://data.csail.mit.edu/places/ADEchallenge/release_test.zip": {"num_bytes": 211820497, "checksum": "1878d23b4586e8724adfa5bf2b6a225aea99ec4eaa395aec2e1b47a79be67ee0"}}, "download_size": 1179202534, "post_processing_size": null, "dataset_size": 10050725, "size_in_bytes": 1189253259}, "instance_segmentation": {"description": "Scene parsing is to segment and parse an image into different image regions associated with semantic categories, such as sky, road, person, and bed.\nMIT Scene Parsing Benchmark (SceneParse150) provides a standard training and evaluation platform for the algorithms of scene parsing.\nThe data for this benchmark comes from ADE20K Dataset which contains more than 20K scene-centric images exhaustively annotated with objects and object parts.\nSpecifically, the benchmark is divided into 20K images for training, 2K images for validation, and another batch of held-out images for testing.\nThere are totally 150 semantic categories included for evaluation, which include stuffs like sky, road, grass, and discrete objects like person, car, bed.\nNote that there are non-uniform distribution of objects occuring in the images, mimicking a more natural object occurrence in daily scene.\n", "citation": "@inproceedings{zhou2017scene,\n title={Scene Parsing through ADE20K Dataset},\n author={Zhou, Bolei and Zhao, Hang and Puig, Xavier and Fidler, Sanja and Barriuso, Adela and Torralba, Antonio},\n booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},\n year={2017}\n}\n\n@article{zhou2016semantic,\n title={Semantic understanding of scenes through the ade20k dataset},\n author={Zhou, Bolei and Zhao, Hang and Puig, Xavier and Fidler, Sanja and Barriuso, Adela and Torralba, Antonio},\n journal={arXiv preprint arXiv:1608.05442},\n year={2016}\n}\n", "homepage": "http://sceneparsing.csail.mit.edu/", "license": "BSD 3-Clause License", "features": {"image": {"decode": true, "id": null, "_type": "Image"}, "annotation": {"decode": true, "id": null, "_type": "Image"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "scene_parse150", "config_name": "instance_segmentation", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 862611544, "num_examples": 20210, "dataset_name": "scene_parse150"}, "test": {"name": "test", "num_bytes": 212493928, "num_examples": 3352, "dataset_name": "scene_parse150"}, "validation": {"name": "validation", "num_bytes": 87502294, "num_examples": 2000, "dataset_name": "scene_parse150"}}, "download_checksums": {"http://sceneparsing.csail.mit.edu/data/ChallengeData2017/images.tar": {"num_bytes": 892088320, "checksum": "0fb87b26bc41ea1dcf6735f34fdbbd79587a01dc92614830b16b6d787f52cbc7"}, "http://sceneparsing.csail.mit.edu/data/ChallengeData2017/annotations_instance.tar": {"num_bytes": 90398720, "checksum": "5eb0db23c64779bc646ca535a3d495db0a75700b9467f8a79eecaf728b266acd"}, "http://sceneparsing.csail.mit.edu/data/ChallengeData2017/release_test.tar": {"num_bytes": 214906880, "checksum": "8a1ef1e678135524ec0bb1afa87ece95f5e1d5aead7a69a6fcccad101b7bd009"}}, "download_size": 1197393920, "post_processing_size": null, "dataset_size": 1162607766, "size_in_bytes": 2360001686}}
|
dummy/instance_segmentation/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cf6ceb98f60969dac49d3f88d9e12141584f5ef9310e9b561d8b2c5f5ab46d05
|
3 |
+
size 7125
|
dummy/scene_parsing/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3c86c3c56db1d92e8f38811b2ea008a52a85ac915f11967646540cfe96d0e33e
|
3 |
+
size 201664
|
scene_parse_150.py
ADDED
@@ -0,0 +1,306 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright 2022 The HuggingFace Datasets Authors and the current dataset script contributor.
|
2 |
+
#
|
3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
+
# you may not use this file except in compliance with the License.
|
5 |
+
# You may obtain a copy of the License at
|
6 |
+
#
|
7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8 |
+
#
|
9 |
+
# Unless required by applicable law or agreed to in writing, software
|
10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
+
# See the License for the specific language governing permissions and
|
13 |
+
# limitations under the License.
|
14 |
+
"""MIT Scene Parsing Benchmark."""
|
15 |
+
|
16 |
+
|
17 |
+
import os
|
18 |
+
|
19 |
+
import pandas as pd
|
20 |
+
|
21 |
+
import datasets
|
22 |
+
|
23 |
+
|
24 |
+
_CITATION = """\
|
25 |
+
@inproceedings{zhou2017scene,
|
26 |
+
title={Scene Parsing through ADE20K Dataset},
|
27 |
+
author={Zhou, Bolei and Zhao, Hang and Puig, Xavier and Fidler, Sanja and Barriuso, Adela and Torralba, Antonio},
|
28 |
+
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
|
29 |
+
year={2017}
|
30 |
+
}
|
31 |
+
|
32 |
+
@article{zhou2016semantic,
|
33 |
+
title={Semantic understanding of scenes through the ade20k dataset},
|
34 |
+
author={Zhou, Bolei and Zhao, Hang and Puig, Xavier and Fidler, Sanja and Barriuso, Adela and Torralba, Antonio},
|
35 |
+
journal={arXiv preprint arXiv:1608.05442},
|
36 |
+
year={2016}
|
37 |
+
}
|
38 |
+
"""
|
39 |
+
|
40 |
+
_DESCRIPTION = """\
|
41 |
+
Scene parsing is to segment and parse an image into different image regions associated with semantic categories, such as sky, road, person, and bed.
|
42 |
+
MIT Scene Parsing Benchmark (SceneParse150) provides a standard training and evaluation platform for the algorithms of scene parsing.
|
43 |
+
The data for this benchmark comes from ADE20K Dataset which contains more than 20K scene-centric images exhaustively annotated with objects and object parts.
|
44 |
+
Specifically, the benchmark is divided into 20K images for training, 2K images for validation, and another batch of held-out images for testing.
|
45 |
+
There are totally 150 semantic categories included for evaluation, which include stuffs like sky, road, grass, and discrete objects like person, car, bed.
|
46 |
+
Note that there are non-uniform distribution of objects occuring in the images, mimicking a more natural object occurrence in daily scene.
|
47 |
+
"""
|
48 |
+
|
49 |
+
_HOMEPAGE = "http://sceneparsing.csail.mit.edu/"
|
50 |
+
|
51 |
+
_LICENSE = "BSD 3-Clause License"
|
52 |
+
|
53 |
+
_URLS = {
|
54 |
+
"scene_parsing": {
|
55 |
+
"train/val": "http://data.csail.mit.edu/places/ADEchallenge/ADEChallengeData2016.zip",
|
56 |
+
"test": "http://data.csail.mit.edu/places/ADEchallenge/release_test.zip",
|
57 |
+
},
|
58 |
+
"instance_segmentation": {
|
59 |
+
"images": "http://sceneparsing.csail.mit.edu/data/ChallengeData2017/images.tar",
|
60 |
+
"annotations": "http://sceneparsing.csail.mit.edu/data/ChallengeData2017/annotations_instance.tar",
|
61 |
+
"test": "http://sceneparsing.csail.mit.edu/data/ChallengeData2017/release_test.tar",
|
62 |
+
},
|
63 |
+
}
|
64 |
+
|
65 |
+
_SCENE_CATEGORIES = """\
|
66 |
+
airport_terminal art_gallery badlands ball_pit bathroom beach bedroom booth_indoor botanical_garden bridge bullring
|
67 |
+
bus_interior butte canyon casino_outdoor castle church_outdoor closet coast conference_room construction_site corral
|
68 |
+
corridor crosswalk day_care_center sand elevator_interior escalator_indoor forest_road gangplank gas_station
|
69 |
+
golf_course gymnasium_indoor harbor hayfield heath hoodoo house hunting_lodge_outdoor ice_shelf joss_house kiosk_indoor
|
70 |
+
kitchen landfill library_indoor lido_deck_outdoor living_room locker_room market_outdoor mountain_snowy office orchard
|
71 |
+
arbor bookshelf mews nook preserve traffic_island palace palace_hall pantry patio phone_booth establishment
|
72 |
+
poolroom_home quonset_hut_outdoor rice_paddy sandbox shopfront skyscraper stone_circle subway_interior platform
|
73 |
+
supermarket swimming_pool_outdoor television_studio indoor_procenium train_railway coral_reef viaduct wave wind_farm
|
74 |
+
bottle_storage abbey access_road air_base airfield airlock airplane_cabin airport entrance airport_ticket_counter
|
75 |
+
alcove alley amphitheater amusement_arcade amusement_park anechoic_chamber apartment_building_outdoor apse_indoor
|
76 |
+
apse_outdoor aquarium aquatic_theater aqueduct arcade arch archaelogical_excavation archive basketball football hockey
|
77 |
+
performance rodeo soccer armory army_base arrival_gate_indoor arrival_gate_outdoor art_school art_studio artists_loft
|
78 |
+
assembly_line athletic_field_indoor athletic_field_outdoor atrium_home atrium_public attic auditorium auto_factory
|
79 |
+
auto_mechanics_indoor auto_mechanics_outdoor auto_racing_paddock auto_showroom backstage backstairs
|
80 |
+
badminton_court_indoor badminton_court_outdoor baggage_claim shop exterior balcony_interior ballroom bamboo_forest
|
81 |
+
bank_indoor bank_outdoor bank_vault banquet_hall baptistry_indoor baptistry_outdoor bar barbershop barn barndoor
|
82 |
+
barnyard barrack baseball_field basement basilica basketball_court_indoor basketball_court_outdoor bathhouse
|
83 |
+
batters_box batting_cage_indoor batting_cage_outdoor battlement bayou bazaar_indoor bazaar_outdoor beach_house
|
84 |
+
beauty_salon bedchamber beer_garden beer_hall belfry bell_foundry berth berth_deck betting_shop bicycle_racks bindery
|
85 |
+
biology_laboratory bistro_indoor bistro_outdoor bleachers_indoor bleachers_outdoor boardwalk boat_deck boathouse bog
|
86 |
+
bomb_shelter_indoor bookbindery bookstore bow_window_indoor bow_window_outdoor bowling_alley box_seat boxing_ring
|
87 |
+
breakroom brewery_indoor brewery_outdoor brickyard_indoor brickyard_outdoor building_complex building_facade bullpen
|
88 |
+
burial_chamber bus_depot_indoor bus_depot_outdoor bus_shelter bus_station_indoor bus_station_outdoor butchers_shop
|
89 |
+
cabana cabin_indoor cabin_outdoor cafeteria call_center campsite campus natural urban candy_store canteen
|
90 |
+
car_dealership backseat frontseat caravansary cardroom cargo_container_interior airplane boat freestanding
|
91 |
+
carport_indoor carport_outdoor carrousel casino_indoor catacomb cathedral_indoor cathedral_outdoor catwalk
|
92 |
+
cavern_indoor cavern_outdoor cemetery chalet chaparral chapel checkout_counter cheese_factory chemical_plant
|
93 |
+
chemistry_lab chicken_coop_indoor chicken_coop_outdoor chicken_farm_indoor chicken_farm_outdoor childs_room
|
94 |
+
choir_loft_interior church_indoor circus_tent_indoor circus_tent_outdoor city classroom clean_room cliff booth room
|
95 |
+
clock_tower_indoor cloister_indoor cloister_outdoor clothing_store coast_road cockpit coffee_shop computer_room
|
96 |
+
conference_center conference_hall confessional control_room control_tower_indoor control_tower_outdoor
|
97 |
+
convenience_store_indoor convenience_store_outdoor corn_field cottage cottage_garden courthouse courtroom courtyard
|
98 |
+
covered_bridge_interior crawl_space creek crevasse library cybercafe dacha dairy_indoor dairy_outdoor dam dance_school
|
99 |
+
darkroom delicatessen dentists_office department_store departure_lounge vegetation desert_road diner_indoor
|
100 |
+
diner_outdoor dinette_home vehicle dining_car dining_hall dining_room dirt_track discotheque distillery ditch dock
|
101 |
+
dolmen donjon doorway_indoor doorway_outdoor dorm_room downtown drainage_ditch dress_shop dressing_room drill_rig
|
102 |
+
driveway driving_range_indoor driving_range_outdoor drugstore dry_dock dugout earth_fissure editing_room
|
103 |
+
electrical_substation elevated_catwalk door freight_elevator elevator_lobby elevator_shaft embankment embassy
|
104 |
+
engine_room entrance_hall escalator_outdoor escarpment estuary excavation exhibition_hall fabric_store factory_indoor
|
105 |
+
factory_outdoor fairway farm fastfood_restaurant fence cargo_deck ferryboat_indoor passenger_deck cultivated wild
|
106 |
+
field_road fire_escape fire_station firing_range_indoor firing_range_outdoor fish_farm fishmarket fishpond
|
107 |
+
fitting_room_interior fjord flea_market_indoor flea_market_outdoor floating_dry_dock flood florist_shop_indoor
|
108 |
+
florist_shop_outdoor fly_bridge food_court football_field broadleaf needleleaf forest_fire forest_path formal_garden
|
109 |
+
fort fortress foundry_indoor foundry_outdoor fountain freeway funeral_chapel funeral_home furnace_room galley game_room
|
110 |
+
garage_indoor garage_outdoor garbage_dump gasworks gate gatehouse gazebo_interior general_store_indoor
|
111 |
+
general_store_outdoor geodesic_dome_indoor geodesic_dome_outdoor ghost_town gift_shop glacier glade gorge granary
|
112 |
+
great_hall greengrocery greenhouse_indoor greenhouse_outdoor grotto guardhouse gulch gun_deck_indoor gun_deck_outdoor
|
113 |
+
gun_store hacienda hallway handball_court hangar_indoor hangar_outdoor hardware_store hat_shop hatchery hayloft hearth
|
114 |
+
hedge_maze hedgerow heliport herb_garden highway hill home_office home_theater hospital hospital_room hot_spring
|
115 |
+
hot_tub_indoor hot_tub_outdoor hotel_outdoor hotel_breakfast_area hotel_room hunting_lodge_indoor hut ice_cream_parlor
|
116 |
+
ice_floe ice_skating_rink_indoor ice_skating_rink_outdoor iceberg igloo imaret incinerator_indoor incinerator_outdoor
|
117 |
+
industrial_area industrial_park inn_indoor inn_outdoor irrigation_ditch islet jacuzzi_indoor jacuzzi_outdoor
|
118 |
+
jail_indoor jail_outdoor jail_cell japanese_garden jetty jewelry_shop junk_pile junkyard jury_box kasbah kennel_indoor
|
119 |
+
kennel_outdoor kindergarden_classroom kiosk_outdoor kitchenette lab_classroom labyrinth_indoor labyrinth_outdoor lagoon
|
120 |
+
artificial landing landing_deck laundromat lava_flow lavatory lawn lean-to lecture_room legislative_chamber levee
|
121 |
+
library_outdoor lido_deck_indoor lift_bridge lighthouse limousine_interior liquor_store_indoor liquor_store_outdoor
|
122 |
+
loading_dock lobby lock_chamber loft lookout_station_indoor lookout_station_outdoor lumberyard_indoor
|
123 |
+
lumberyard_outdoor machine_shop manhole mansion manufactured_home market_indoor marsh martial_arts_gym mastaba
|
124 |
+
maternity_ward mausoleum medina menhir mesa mess_hall mezzanine military_hospital military_hut military_tent mine
|
125 |
+
mineshaft mini_golf_course_indoor mini_golf_course_outdoor mission dry water mobile_home monastery_indoor
|
126 |
+
monastery_outdoor moon_bounce moor morgue mosque_indoor mosque_outdoor motel mountain mountain_path mountain_road
|
127 |
+
movie_theater_indoor movie_theater_outdoor mudflat museum_indoor museum_outdoor music_store music_studio misc
|
128 |
+
natural_history_museum naval_base newsroom newsstand_indoor newsstand_outdoor nightclub nuclear_power_plant_indoor
|
129 |
+
nuclear_power_plant_outdoor nunnery nursery nursing_home oasis oast_house observatory_indoor observatory_outdoor
|
130 |
+
observatory_post ocean office_building office_cubicles oil_refinery_indoor oil_refinery_outdoor oilrig operating_room
|
131 |
+
optician organ_loft_interior orlop_deck ossuary outcropping outhouse_indoor outhouse_outdoor overpass oyster_bar
|
132 |
+
oyster_farm acropolis aircraft_carrier_object amphitheater_indoor archipelago questionable assembly_hall assembly_plant
|
133 |
+
awning_deck back_porch backdrop backroom backstage_outdoor backstairs_indoor backwoods ballet balustrade barbeque
|
134 |
+
basin_outdoor bath_indoor bath_outdoor bathhouse_outdoor battlefield bay booth_outdoor bottomland breakfast_table
|
135 |
+
bric-a-brac brooklet bubble_chamber buffet bulkhead bunk_bed bypass byroad cabin_cruiser cargo_helicopter cellar
|
136 |
+
chair_lift cocktail_lounge corner country_house country_road customhouse dance_floor deck-house_boat_deck_house
|
137 |
+
deck-house_deck_house dining_area diving_board embrasure entranceway_indoor entranceway_outdoor entryway_outdoor
|
138 |
+
estaminet farm_building farmhouse feed_bunk field_house field_tent_indoor field_tent_outdoor fire_trench fireplace
|
139 |
+
flashflood flatlet floating_dock flood_plain flowerbed flume_indoor flying_buttress foothill forecourt foreshore
|
140 |
+
front_porch garden gas_well glen grape_arbor grove guardroom guesthouse gymnasium_outdoor head_shop hen_yard hillock
|
141 |
+
housing_estate housing_project howdah inlet insane_asylum outside juke_joint jungle kraal laboratorywet landing_strip
|
142 |
+
layby lean-to_tent loge loggia_outdoor lower_deck luggage_van mansard meadow meat_house megalith mens_store_outdoor
|
143 |
+
mental_institution_indoor mental_institution_outdoor military_headquarters millpond millrace natural_spring
|
144 |
+
nursing_home_outdoor observation_station open-hearth_furnace operating_table outbuilding palestra parkway patio_indoor
|
145 |
+
pavement pawnshop_outdoor pinetum piste_road pizzeria_outdoor powder_room pumping_station reception_room rest_stop
|
146 |
+
retaining_wall rift_valley road rock_garden rotisserie safari_park salon saloon sanatorium science_laboratory scrubland
|
147 |
+
scullery seaside semidesert shelter shelter_deck shelter_tent shore shrubbery sidewalk snack_bar snowbank stage_set
|
148 |
+
stall stateroom store streetcar_track student_center study_hall sugar_refinery sunroom supply_chamber t-bar_lift
|
149 |
+
tannery teahouse threshing_floor ticket_window_indoor tidal_basin tidal_river tiltyard tollgate tomb tract_housing
|
150 |
+
trellis truck_stop upper_balcony vestibule vinery walkway war_room washroom water_fountain water_gate waterscape
|
151 |
+
waterway wetland widows_walk_indoor windstorm packaging_plant pagoda paper_mill park parking_garage_indoor
|
152 |
+
parking_garage_outdoor parking_lot parlor particle_accelerator party_tent_indoor party_tent_outdoor pasture pavilion
|
153 |
+
pawnshop pedestrian_overpass_indoor penalty_box pet_shop pharmacy physics_laboratory piano_store picnic_area pier
|
154 |
+
pig_farm pilothouse_indoor pilothouse_outdoor pitchers_mound pizzeria planetarium_indoor planetarium_outdoor
|
155 |
+
plantation_house playground playroom plaza podium_indoor podium_outdoor police_station pond pontoon_bridge poop_deck
|
156 |
+
porch portico portrait_studio postern power_plant_outdoor print_shop priory promenade promenade_deck pub_indoor
|
157 |
+
pub_outdoor pulpit putting_green quadrangle quicksand quonset_hut_indoor racecourse raceway raft railroad_track
|
158 |
+
railway_yard rainforest ramp ranch ranch_house reading_room reception recreation_room rectory recycling_plant_indoor
|
159 |
+
refectory repair_shop residential_neighborhood resort rest_area restaurant restaurant_kitchen restaurant_patio
|
160 |
+
restroom_indoor restroom_outdoor revolving_door riding_arena river road_cut rock_arch roller_skating_rink_indoor
|
161 |
+
roller_skating_rink_outdoor rolling_mill roof roof_garden root_cellar rope_bridge roundabout roundhouse rubble ruin
|
162 |
+
runway sacristy salt_plain sand_trap sandbar sauna savanna sawmill schoolhouse schoolyard science_museum scriptorium
|
163 |
+
sea_cliff seawall security_check_point server_room sewer sewing_room shed shipping_room shipyard_outdoor shoe_shop
|
164 |
+
shopping_mall_indoor shopping_mall_outdoor shower shower_room shrine signal_box sinkhole ski_jump ski_lodge ski_resort
|
165 |
+
ski_slope sky skywalk_indoor skywalk_outdoor slum snowfield massage_room mineral_bath spillway sporting_goods_store
|
166 |
+
squash_court stable baseball stadium_outdoor stage_indoor stage_outdoor staircase starting_gate steam_plant_outdoor
|
167 |
+
steel_mill_indoor storage_room storm_cellar street strip_mall strip_mine student_residence submarine_interior sun_deck
|
168 |
+
sushi_bar swamp swimming_hole swimming_pool_indoor synagogue_indoor synagogue_outdoor taxistand taxiway tea_garden
|
169 |
+
tearoom teashop television_room east_asia mesoamerican south_asia western tennis_court_indoor tennis_court_outdoor
|
170 |
+
tent_outdoor terrace_farm indoor_round indoor_seats theater_outdoor thriftshop throne_room ticket_booth
|
171 |
+
tobacco_shop_indoor toll_plaza tollbooth topiary_garden tower town_house toyshop track_outdoor trading_floor
|
172 |
+
trailer_park train_interior train_station_outdoor station tree_farm tree_house trench trestle_bridge tundra rail_indoor
|
173 |
+
rail_outdoor road_indoor road_outdoor turkish_bath ocean_deep ocean_shallow utility_room valley van_interior
|
174 |
+
vegetable_garden velodrome_indoor velodrome_outdoor ventilation_shaft veranda vestry veterinarians_office videostore
|
175 |
+
village vineyard volcano volleyball_court_indoor volleyball_court_outdoor voting_booth waiting_room walk_in_freezer
|
176 |
+
warehouse_indoor warehouse_outdoor washhouse_indoor washhouse_outdoor watchtower water_mill water_park water_tower
|
177 |
+
water_treatment_plant_indoor water_treatment_plant_outdoor block cascade cataract fan plunge watering_hole weighbridge
|
178 |
+
wet_bar wharf wheat_field whispering_gallery widows_walk_interior windmill window_seat barrel_storage winery
|
179 |
+
witness_stand woodland workroom workshop wrestling_ring_indoor wrestling_ring_outdoor yard youth_hostel zen_garden
|
180 |
+
ziggurat zoo forklift hollow hutment pueblo vat perfume_shop steel_mill_outdoor orchestra_pit bridle_path lyceum
|
181 |
+
one-way_street parade_ground pump_room recycling_plant_outdoor chuck_wagon
|
182 |
+
"""
|
183 |
+
_SCENE_CATEGORIES = _SCENE_CATEGORIES.strip().split()
|
184 |
+
|
185 |
+
|
186 |
+
class SceneParse150(datasets.GeneratorBasedBuilder):
|
187 |
+
"""MIT Scene Parsing Benchmark dataset."""
|
188 |
+
|
189 |
+
VERSION = datasets.Version("1.0.0")
|
190 |
+
|
191 |
+
BUILDER_CONFIGS = [
|
192 |
+
datasets.BuilderConfig(name="scene_parsing", version=VERSION, description="The scene parsing variant."),
|
193 |
+
datasets.BuilderConfig(
|
194 |
+
name="instance_segmentation", version=VERSION, description="The instance segmentation variant."
|
195 |
+
),
|
196 |
+
]
|
197 |
+
|
198 |
+
DEFAULT_CONFIG_NAME = "scene_parsing"
|
199 |
+
|
200 |
+
def _info(self):
|
201 |
+
if self.config.name == "scene_parsing":
|
202 |
+
features = datasets.Features(
|
203 |
+
{
|
204 |
+
"image": datasets.Image(),
|
205 |
+
"annotation": datasets.Image(),
|
206 |
+
"scene_category": datasets.ClassLabel(names=_SCENE_CATEGORIES),
|
207 |
+
}
|
208 |
+
)
|
209 |
+
else:
|
210 |
+
features = datasets.Features(
|
211 |
+
{
|
212 |
+
"image": datasets.Image(),
|
213 |
+
"annotation": datasets.Image(),
|
214 |
+
}
|
215 |
+
)
|
216 |
+
return datasets.DatasetInfo(
|
217 |
+
description=_DESCRIPTION,
|
218 |
+
features=features,
|
219 |
+
homepage=_HOMEPAGE,
|
220 |
+
license=_LICENSE,
|
221 |
+
citation=_CITATION,
|
222 |
+
)
|
223 |
+
|
224 |
+
def _split_generators(self, dl_manager):
|
225 |
+
urls = _URLS[self.config.name]
|
226 |
+
|
227 |
+
if self.config.name == "scene_parsing":
|
228 |
+
data_dirs = dl_manager.download_and_extract(urls)
|
229 |
+
train_data = val_data = os.path.join(data_dirs["train/val"], "ADEChallengeData2016")
|
230 |
+
test_data = os.path.join(data_dirs["test"], "release_test")
|
231 |
+
else:
|
232 |
+
data_dirs = dl_manager.download(urls)
|
233 |
+
train_data = dl_manager.iter_archive(data_dirs["images"]), dl_manager.iter_archive(
|
234 |
+
data_dirs["annotations"]
|
235 |
+
)
|
236 |
+
val_data = dl_manager.iter_archive(data_dirs["images"]), dl_manager.iter_archive(data_dirs["annotations"])
|
237 |
+
test_data = dl_manager.iter_archive(data_dirs["test"])
|
238 |
+
return [
|
239 |
+
datasets.SplitGenerator(
|
240 |
+
name=datasets.Split.TRAIN,
|
241 |
+
gen_kwargs={
|
242 |
+
"data": train_data,
|
243 |
+
"split": "training",
|
244 |
+
},
|
245 |
+
),
|
246 |
+
datasets.SplitGenerator(
|
247 |
+
name=datasets.Split.TEST,
|
248 |
+
gen_kwargs={"data": test_data, "split": "testing"},
|
249 |
+
),
|
250 |
+
datasets.SplitGenerator(
|
251 |
+
name=datasets.Split.VALIDATION,
|
252 |
+
gen_kwargs={
|
253 |
+
"data": val_data,
|
254 |
+
"split": "validation",
|
255 |
+
},
|
256 |
+
),
|
257 |
+
]
|
258 |
+
|
259 |
+
def _generate_examples(self, data, split):
|
260 |
+
if self.config.name == "scene_parsing":
|
261 |
+
if split == "testing":
|
262 |
+
image_dir = os.path.join(data, split)
|
263 |
+
for idx, image_file in enumerate(os.listdir(image_dir)):
|
264 |
+
yield idx, {
|
265 |
+
"image": os.path.join(image_dir, image_file),
|
266 |
+
"annotation": None,
|
267 |
+
"scene_category": None,
|
268 |
+
}
|
269 |
+
else:
|
270 |
+
image_id2cat = pd.read_csv(
|
271 |
+
os.path.join(data, "sceneCategories.txt"), sep=" ", names=["image_id", "scene_category"]
|
272 |
+
)
|
273 |
+
image_id2cat = image_id2cat.set_index("image_id")
|
274 |
+
images_dir = os.path.join(data, "images", split)
|
275 |
+
annotations_dir = os.path.join(data, "annotations", split)
|
276 |
+
for idx, image_file in enumerate(os.listdir(images_dir)):
|
277 |
+
image_id = image_file.split(".")[0]
|
278 |
+
yield idx, {
|
279 |
+
"image": os.path.join(images_dir, image_file),
|
280 |
+
"annotation": os.path.join(annotations_dir, image_id + ".png"),
|
281 |
+
"scene_category": image_id2cat.loc[image_id, "scene_category"],
|
282 |
+
}
|
283 |
+
else:
|
284 |
+
if split == "testing":
|
285 |
+
for idx, (path, file) in enumerate(data):
|
286 |
+
if path.endswith(".jpg"):
|
287 |
+
yield idx, {
|
288 |
+
"image": {"path": path, "bytes": file.read()},
|
289 |
+
"annotation": None,
|
290 |
+
}
|
291 |
+
else:
|
292 |
+
images, annotations = data
|
293 |
+
image_id2annot = {}
|
294 |
+
# loads the annotations for the split into RAM (less than 100 MB) to support streaming
|
295 |
+
for path_annot, file_annot in annotations:
|
296 |
+
if split in path_annot and path_annot.endswith(".png"):
|
297 |
+
image_id = os.path.basename(path_annot).split(".")[0]
|
298 |
+
image_id2annot[image_id] = (path_annot, file_annot.read())
|
299 |
+
for idx, (path_img, file_img) in enumerate(images):
|
300 |
+
if split in path_img and path_img.endswith(".jpg"):
|
301 |
+
image_id = os.path.basename(path_img).split(".")[0]
|
302 |
+
path_annot, bytes_annot = image_id2annot[image_id]
|
303 |
+
yield idx, {
|
304 |
+
"image": {"path": path_img, "bytes": file_img.read()},
|
305 |
+
"annotation": {"path": path_annot, "bytes": bytes_annot},
|
306 |
+
}
|