You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Paper:**[Storytelling with Dialogue: A Critical Role Dungeons and Dragons Dataset](https://www.aclweb.org/anthology/2020.acl-main.459/)
57
57
-**Point of Contact:**[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
58
-
-**Size of downloaded dataset files:** 279.93 MB
59
-
-**Size of the generated dataset:** 4020.33 MB
60
-
-**Total amount of disk used:** 4300.25 MB
61
58
62
59
### Dataset Summary
63
60
@@ -69,6 +66,7 @@ collaboration and spoken interaction. For each dialogue, there are a large numbe
69
66
and semantic ties to the previous dialogues.
70
67
71
68
### Supported Tasks and Leaderboards
69
+
72
70
`summarization`: The dataset can be used to train a model for abstractive summarization. A [fast abstractive summarization-RL](https://github.com/ChenRocks/fast_abs_rl) model was presented as a baseline, which achieves ROUGE-L-F1 of 25.18.
73
71
74
72
### Languages
@@ -79,13 +77,8 @@ The text in the dataset is in English, as spoken by actors on The Critical Role
79
77
80
78
### Data Instances
81
79
82
-
#### default
83
-
84
-
-**Size of downloaded dataset files:** 279.93 MB
85
-
-**Size of the generated dataset:** 4020.33 MB
86
-
-**Total amount of disk used:** 4300.25 MB
87
-
88
80
An example of 'train' looks as follows.
81
+
89
82
```
90
83
{
91
84
"alignment_score": 3.679936647415161,
@@ -105,7 +98,6 @@ An example of 'train' looks as follows.
105
98
106
99
The data fields are the same among all splits.
107
100
108
-
#### default
109
101
-`chunk`: a `string` feature.
110
102
-`chunk_id`: a `int32` feature.
111
103
-`turn_start`: a `int32` feature.
@@ -120,7 +112,7 @@ The data fields are the same among all splits.
120
112
121
113
| name | train |validation| test |
122
114
|-------|------:|---------:|------:|
123
-
|default|26,232|3,470|4,541|
115
+
|default|38,969|6,327|7,500|
124
116
125
117
## Dataset Creation
126
118
@@ -180,19 +172,16 @@ This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 Inter
180
172
181
173
### Citation Information
182
174
183
-
```
184
-
175
+
```bibtex
185
176
@inproceedings{
186
177
title = {Storytelling with Dialogue: A Critical Role Dungeons and Dragons Dataset},
187
178
author = {Rameshkumar, Revanth and Bailey, Peter},
188
179
year = {2020},
189
180
publisher = {Association for Computational Linguistics},
190
181
conference = {ACL}
191
182
}
192
-
193
183
```
194
184
195
-
196
185
### Contributions
197
186
198
187
Thanks to [@thomwolf](https://github.com/thomwolf), [@lhoestq](https://github.com/lhoestq), [@mariamabarham](https://github.com/mariamabarham), [@lewtun](https://github.com/lewtun) for adding this dataset.
{"default": {"description": "\nStorytelling with Dialogue: A Critical Role Dungeons and Dragons Dataset.\nCritical Role is an unscripted, live-streamed show where a fixed group of people play Dungeons and Dragons, an open-ended role-playing game.\nThe dataset is collected from 159 Critical Role episodes transcribed to text dialogues, consisting of 398,682 turns. It also includes corresponding\nabstractive summaries collected from the Fandom wiki. The dataset is linguistically unique in that the narratives are generated entirely through player\ncollaboration and spoken interaction. For each dialogue, there are a large number of turns, multiple abstractive summaries with varying levels of detail,\nand semantic ties to the previous dialogues.\n", "citation": "\n@inproceedings{\ntitle = {Storytelling with Dialogue: A Critical Role Dungeons and Dragons Dataset},\nauthor = {Rameshkumar, Revanth and Bailey, Peter},\nyear = {2020},\npublisher = {Association for Computational Linguistics},\nconference = {ACL}\n}\n ", "homepage": "https://github.com/RevanthRameshkumar/CRD3", "license": "", "features": {"chunk": {"dtype": "string", "id": null, "_type": "Value"}, "chunk_id": {"dtype": "int32", "id": null, "_type": "Value"}, "turn_start": {"dtype": "int32", "id": null, "_type": "Value"}, "turn_end": {"dtype": "int32", "id": null, "_type": "Value"}, "alignment_score": {"dtype": "float32", "id": null, "_type": "Value"}, "turns": {"feature": {"names": {"dtype": "string", "id": null, "_type": "Value"}, "utterances": {"dtype": "string", "id": null, "_type": "Value"}, "number": {"dtype": "int32", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "crd3", "config_name": "default", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 318560673, "num_examples": 52796, "dataset_name": "crd3"}, "test": {"name": "test", "num_bytes": 318560673, "num_examples": 52796, "dataset_name": "crd3"}, "validation": {"name": "validation", "num_bytes": 318560673, "num_examples": 52796, "dataset_name": "crd3"}}, "download_checksums": {"https://github.com/RevanthRameshkumar/CRD3/archive/master.zip": {"num_bytes": 294222220, "checksum": "c77a937394f265735ba54b32a7a051f77a97d264c74b0535dee77ef9791815b5"}}, "download_size": 294222220, "post_processing_size": null, "dataset_size": 955682019, "size_in_bytes": 1249904239}}
1
+
{"default": {"description": "\nStorytelling with Dialogue: A Critical Role Dungeons and Dragons Dataset.\nCritical Role is an unscripted, live-streamed show where a fixed group of people play Dungeons and Dragons, an open-ended role-playing game.\nThe dataset is collected from 159 Critical Role episodes transcribed to text dialogues, consisting of 398,682 turns. It also includes corresponding\nabstractive summaries collected from the Fandom wiki. The dataset is linguistically unique in that the narratives are generated entirely through player\ncollaboration and spoken interaction. For each dialogue, there are a large number of turns, multiple abstractive summaries with varying levels of detail,\nand semantic ties to the previous dialogues.\n", "citation": "\n@inproceedings{\ntitle = {Storytelling with Dialogue: A Critical Role Dungeons and Dragons Dataset},\nauthor = {Rameshkumar, Revanth and Bailey, Peter},\nyear = {2020},\npublisher = {Association for Computational Linguistics},\nconference = {ACL}\n}\n ", "homepage": "https://github.com/RevanthRameshkumar/CRD3", "license": "", "features": {"chunk": {"dtype": "string", "id": null, "_type": "Value"}, "chunk_id": {"dtype": "int32", "id": null, "_type": "Value"}, "turn_start": {"dtype": "int32", "id": null, "_type": "Value"}, "turn_end": {"dtype": "int32", "id": null, "_type": "Value"}, "alignment_score": {"dtype": "float32", "id": null, "_type": "Value"}, "turns": [{"names": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "utterances": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "number": {"dtype": "int32", "id": null, "_type": "Value"}}]}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "crd3", "config_name": "default", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 236605152, "num_examples": 38969, "dataset_name": "crd3"}, "test": {"name": "test", "num_bytes": 40269203, "num_examples": 7500, "dataset_name": "crd3"}, "validation": {"name": "validation", "num_bytes": 41543528, "num_examples": 6327, "dataset_name": "crd3"}}, "download_checksums": {"https://huggingface.co/datasets/crd3/resolve/72bffe55b4d5bf19b530d3e417447b3384ba3673/data/aligned%20data.zip": {"num_bytes": 117519820, "checksum": "c66bd9f7848bcd514a35c154edd2fc874f1a3076876d8bd7208bf3caf4b7fb0b"}}, "download_size": 117519820, "post_processing_size": null, "dataset_size": 318417883, "size_in_bytes": 435937703}}
Copy file name to clipboardExpand all lines: docs/source/image_process.mdx
+165-1Lines changed: 165 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,11 @@ Both parameter values default to 1000, which can be expensive if you are storing
39
39
40
40
## Data augmentation
41
41
42
-
🤗 Datasets can apply data augmentations from any library or package to your dataset. This guide will use the transforms from [torchvision](https://pytorch.org/vision/stable/transforms.html).
42
+
🤗 Datasets can apply data augmentations from any library or package to your dataset.
43
+
44
+
### Image Classification
45
+
46
+
First let's see how you can transform image classification datasets. This guide will use the transforms from [torchvision](https://pytorch.org/vision/stable/transforms.html).
43
47
44
48
<Tip>
45
49
@@ -88,3 +92,163 @@ Now you can take a look at the augmented image by indexing into the `pixel_value
Object detection models identify something in an image, and object detection datasets are used for applications such as autonomous driving and detecting natural hazards like wildfire. This guide will show you how to apply transformations to an object detection dataset following the [tutorial](https://albumentations.ai/docs/examples/example_bboxes/) from [Albumentations](https://albumentations.ai/docs/).
99
+
100
+
To run these examples, make sure you have up-to-date versions of `albumentations` and `cv2` installed:
101
+
102
+
```
103
+
pip install -U albumentations opencv-python
104
+
```
105
+
106
+
In this example, you'll use the [`cppe-5`](https://huggingface.co/datasets/cppe-5) dataset for identifying medical personal protective equipment (PPE) in the context of the COVID-19 pandemic.
107
+
108
+
Load the dataset and take a look at an example:
109
+
110
+
```py
111
+
from datasets import load_dataset
112
+
113
+
>>> ds = load_dataset("cppe-5")
114
+
>>> example = ds['train'][0]
115
+
>>> example
116
+
{'height': 663,
117
+
'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=943x663 at 0x7FC3DC756250>,
118
+
'image_id': 15,
119
+
'objects': {'area': [3796, 1596, 152768, 81002],
120
+
'bbox': [[302.0, 109.0, 73.0, 52.0],
121
+
[810.0, 100.0, 57.0, 28.0],
122
+
[160.0, 31.0, 248.0, 616.0],
123
+
[741.0, 68.0, 202.0, 401.0]],
124
+
'category': [4, 4, 0, 0],
125
+
'id': [114, 115, 116, 117]},
126
+
'width': 943}
127
+
```
128
+
129
+
The dataset has the following fields:
130
+
131
+
-`image`: PIL.Image.Image object containing the image.
132
+
-`image_id`: The image ID.
133
+
-`height`: The image height.
134
+
-`width`: The image width.
135
+
-`objects`: A dictionary containing bounding box metadata for the objects in the image:
136
+
-`id`: The annotation id.
137
+
-`area`: The area of the bounding box.
138
+
-`bbox`: The object's bounding box (in the [coco](https://albumentations.ai/docs/getting_started/bounding_boxes_augmentation/#coco) format).
139
+
-`category`: The object's category, with possible values including `Coverall (0)`, `Face_Shield (1)`, `Gloves (2)`, `Goggles (3)` and `Mask (4)`.
140
+
141
+
You can visualize the `bboxes` on the image using some internal torch utilities. To do that, you will need to reference the [`~datasets.ClassLabel`] feature associated with the category IDs so you can look up the string labels:
With `albumentations`, you can apply transforms that will affect the image while also updating the `bboxes` accordingly. In this case, the image is resized to (480, 480), flipped horizontally, and brightened.
171
+
172
+
`albumentations` expects the image to be in BGR format, not RGB, so you'll have to convert the image before applying the transform.
Use the [`~Dataset.set_transform`] function to apply the transform on-the-fly which consumes less disk space. The randomness of data augmentation may return a different image if you access the same example twice. It is especially useful when training a model for several epochs.
233
+
234
+
```py
235
+
>>> ds['train'].set_transform(transforms)
236
+
```
237
+
238
+
You can verify the transform works by visualizing the 10th example:
239
+
240
+
```py
241
+
>>> example = ds['train'][10]
242
+
>>> to_pil_image(
243
+
... draw_bounding_boxes(
244
+
... example['image'],
245
+
... box_convert(example['bbox'], 'xywh', 'xyxy'),
246
+
...colors='red',
247
+
...labels=[categories.int2str(x) for x in example['category']]
0 commit comments