visdial / README.md
jxu124's picture
Update README.md
b966f33
|
raw
history blame
1.2 kB
metadata
license: cc-by-4.0
dataset_info:
  features:
    - name: image
      dtype: string
    - name: caption
      dtype: string
    - name: dialog
      sequence:
        sequence: string
  splits:
    - name: train
      num_bytes: 72983994
      num_examples: 123287
    - name: test
      num_bytes: 3146123
      num_examples: 8000
    - name: validation
      num_bytes: 1294797
      num_examples: 2064
  download_size: 32870167
  dataset_size: 77424914

Usage:

from dataclasses import dataclass
import datasets

# load and path setting
ds_visdial = datasets.load_dataset('jxu124/visdial')
path_map = {
    "coco/train2014": f"/datasets/coco/train2014",
    "coco/val2014": f"/datasets/coco/val2014",
    "visdial/VisualDialog_test2018": f"/datasets/visdial/VisualDialog_test2018",
    "visdial/VisualDialog_val2018": f"/datasets/visdial/VisualDialog_val2018"
}

# apply to your datasets
@dataclass
class ReplaceImagePath():
    path_map: {}
    def __call__(self, features):
        for k, v in self.path_map.items():
            features['image'] = features['image'].replace(k, v)
        return features
ds_visdial = ds_visdial.map(ReplaceImagePath(path_map=path_map)).cast_column("image", datasets.Image())