Skip to content

Commit

Permalink
integrate huggingface#4952 to image docs too
Browse files Browse the repository at this point in the history
  • Loading branch information
polinaeterna committed Sep 20, 2022
1 parent 4f91782 commit 6212444
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/source/image_dataset_script.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ Then users can load your dataset by specifying `imagefolder` in [`load_dataset`]
>>> dataset = load_dataset("imagefolder", data_dir="/path/to/folder")
```

You can also use `imagefolder` to load datasets involving multiple splits. To do so, your dataset directory should have the following structure:

```
folder/train/dog/golden_retriever.png
folder/train/cat/maine_coon.png
folder/test/dog/german_shepherd.png
folder/test/cat/bengal.png
```

If there is additional information you'd like to include about your dataset, like text captions or bounding boxes, add it as a `metadata.jsonl` file in your folder. This lets you quickly create datasets for different computer vision tasks like text captioning or object detection.

```
Expand Down

1 comment on commit 6212444

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show benchmarks

PyArrow==6.0.0

Show updated benchmarks!

Benchmark: benchmark_array_xd.json

metric read_batch_formatted_as_numpy after write_array2d read_batch_formatted_as_numpy after write_flattened_sequence read_batch_formatted_as_numpy after write_nested_sequence read_batch_unformated after write_array2d read_batch_unformated after write_flattened_sequence read_batch_unformated after write_nested_sequence read_col_formatted_as_numpy after write_array2d read_col_formatted_as_numpy after write_flattened_sequence read_col_formatted_as_numpy after write_nested_sequence read_col_unformated after write_array2d read_col_unformated after write_flattened_sequence read_col_unformated after write_nested_sequence read_formatted_as_numpy after write_array2d read_formatted_as_numpy after write_flattened_sequence read_formatted_as_numpy after write_nested_sequence read_unformated after write_array2d read_unformated after write_flattened_sequence read_unformated after write_nested_sequence write_array2d write_flattened_sequence write_nested_sequence
new / old (diff) 0.008342 / 0.011353 (-0.003011) 0.004076 / 0.011008 (-0.006932) 0.034285 / 0.038508 (-0.004223) 0.039229 / 0.023109 (0.016119) 0.358928 / 0.275898 (0.083030) 0.448159 / 0.323480 (0.124679) 0.006535 / 0.007986 (-0.001451) 0.003964 / 0.004328 (-0.000365) 0.008327 / 0.004250 (0.004077) 0.051940 / 0.037052 (0.014887) 0.347857 / 0.258489 (0.089367) 0.401095 / 0.293841 (0.107254) 0.038358 / 0.128546 (-0.090188) 0.010942 / 0.075646 (-0.064704) 0.307957 / 0.419271 (-0.111314) 0.071138 / 0.043533 (0.027605) 0.342207 / 0.255139 (0.087068) 0.377403 / 0.283200 (0.094203) 0.124321 / 0.141683 (-0.017362) 1.689859 / 1.452155 (0.237704) 1.710595 / 1.492716 (0.217878)

Benchmark: benchmark_getitem_100B.json

metric get_batch_of_1024_random_rows get_batch_of_1024_rows get_first_row get_last_row
new / old (diff) 0.231681 / 0.018006 (0.213675) 0.492543 / 0.000490 (0.492053) 0.007878 / 0.000200 (0.007678) 0.000129 / 0.000054 (0.000075)

Benchmark: benchmark_indices_mapping.json

metric select shard shuffle sort train_test_split
new / old (diff) 0.025021 / 0.037411 (-0.012390) 0.119161 / 0.014526 (0.104635) 0.128383 / 0.176557 (-0.048173) 0.190125 / 0.737135 (-0.547010) 0.135712 / 0.296338 (-0.160626)

Benchmark: benchmark_iterating.json

metric read 5000 read 50000 read_batch 50000 10 read_batch 50000 100 read_batch 50000 1000 read_formatted numpy 5000 read_formatted pandas 5000 read_formatted tensorflow 5000 read_formatted torch 5000 read_formatted_batch numpy 5000 10 read_formatted_batch numpy 5000 1000 shuffled read 5000 shuffled read 50000 shuffled read_batch 50000 10 shuffled read_batch 50000 100 shuffled read_batch 50000 1000 shuffled read_formatted numpy 5000 shuffled read_formatted_batch numpy 5000 10 shuffled read_formatted_batch numpy 5000 1000
new / old (diff) 0.474755 / 0.215209 (0.259545) 4.930227 / 2.077655 (2.852572) 2.179508 / 1.504120 (0.675388) 1.895738 / 1.541195 (0.354544) 1.926037 / 1.468490 (0.457546) 0.506630 / 4.584777 (-4.078147) 4.669866 / 3.745712 (0.924154) 4.266096 / 5.269862 (-1.003766) 2.175588 / 4.565676 (-2.390088) 0.054653 / 0.424275 (-0.369622) 0.011662 / 0.007607 (0.004055) 0.559070 / 0.226044 (0.333025) 5.589107 / 2.268929 (3.320179) 2.511367 / 55.444624 (-52.933258) 2.113947 / 6.876477 (-4.762530) 2.229656 / 2.142072 (0.087584) 0.591292 / 4.805227 (-4.213936) 0.128495 / 6.500664 (-6.372169) 0.065028 / 0.075469 (-0.010441)

Benchmark: benchmark_map_filter.json

metric filter map fast-tokenizer batched map identity map identity batched map no-op batched map no-op batched numpy map no-op batched pandas map no-op batched pytorch map no-op batched tensorflow
new / old (diff) 1.641971 / 1.841788 (-0.199817) 15.485600 / 8.074308 (7.411292) 28.011993 / 10.191392 (17.820601) 0.986534 / 0.680424 (0.306111) 0.641466 / 0.534201 (0.107265) 0.447493 / 0.579283 (-0.131790) 0.528332 / 0.434364 (0.093968) 0.328585 / 0.540337 (-0.211752) 0.300579 / 1.386936 (-1.086357)
PyArrow==latest
Show updated benchmarks!

Benchmark: benchmark_array_xd.json

metric read_batch_formatted_as_numpy after write_array2d read_batch_formatted_as_numpy after write_flattened_sequence read_batch_formatted_as_numpy after write_nested_sequence read_batch_unformated after write_array2d read_batch_unformated after write_flattened_sequence read_batch_unformated after write_nested_sequence read_col_formatted_as_numpy after write_array2d read_col_formatted_as_numpy after write_flattened_sequence read_col_formatted_as_numpy after write_nested_sequence read_col_unformated after write_array2d read_col_unformated after write_flattened_sequence read_col_unformated after write_nested_sequence read_formatted_as_numpy after write_array2d read_formatted_as_numpy after write_flattened_sequence read_formatted_as_numpy after write_nested_sequence read_unformated after write_array2d read_unformated after write_flattened_sequence read_unformated after write_nested_sequence write_array2d write_flattened_sequence write_nested_sequence
new / old (diff) 0.006399 / 0.011353 (-0.004954) 0.004233 / 0.011008 (-0.006775) 0.030958 / 0.038508 (-0.007550) 0.037292 / 0.023109 (0.014183) 0.436744 / 0.275898 (0.160846) 0.486031 / 0.323480 (0.162551) 0.004389 / 0.007986 (-0.003597) 0.003788 / 0.004328 (-0.000540) 0.005027 / 0.004250 (0.000777) 0.050298 / 0.037052 (0.013246) 0.447221 / 0.258489 (0.188732) 0.473735 / 0.293841 (0.179894) 0.033775 / 0.128546 (-0.094771) 0.010204 / 0.075646 (-0.065442) 0.279137 / 0.419271 (-0.140134) 0.061187 / 0.043533 (0.017654) 0.419756 / 0.255139 (0.164617) 0.463573 / 0.283200 (0.180373) 0.120055 / 0.141683 (-0.021628) 1.715671 / 1.452155 (0.263516) 1.795886 / 1.492716 (0.303170)

Benchmark: benchmark_getitem_100B.json

metric get_batch_of_1024_random_rows get_batch_of_1024_rows get_first_row get_last_row
new / old (diff) 0.242796 / 0.018006 (0.224789) 0.471557 / 0.000490 (0.471067) 0.008913 / 0.000200 (0.008713) 0.000102 / 0.000054 (0.000047)

Benchmark: benchmark_indices_mapping.json

metric select shard shuffle sort train_test_split
new / old (diff) 0.025214 / 0.037411 (-0.012198) 0.109671 / 0.014526 (0.095145) 0.129224 / 0.176557 (-0.047333) 0.186174 / 0.737135 (-0.550961) 0.128027 / 0.296338 (-0.168311)

Benchmark: benchmark_iterating.json

metric read 5000 read 50000 read_batch 50000 10 read_batch 50000 100 read_batch 50000 1000 read_formatted numpy 5000 read_formatted pandas 5000 read_formatted tensorflow 5000 read_formatted torch 5000 read_formatted_batch numpy 5000 10 read_formatted_batch numpy 5000 1000 shuffled read 5000 shuffled read 50000 shuffled read_batch 50000 10 shuffled read_batch 50000 100 shuffled read_batch 50000 1000 shuffled read_formatted numpy 5000 shuffled read_formatted_batch numpy 5000 10 shuffled read_formatted_batch numpy 5000 1000
new / old (diff) 0.463925 / 0.215209 (0.248716) 4.642950 / 2.077655 (2.565295) 2.235550 / 1.504120 (0.731430) 2.022566 / 1.541195 (0.481372) 2.030904 / 1.468490 (0.562413) 0.480213 / 4.584777 (-4.104564) 4.335317 / 3.745712 (0.589604) 4.567643 / 5.269862 (-0.702219) 2.046683 / 4.565676 (-2.518994) 0.060419 / 0.424275 (-0.363856) 0.013337 / 0.007607 (0.005730) 0.603605 / 0.226044 (0.377561) 6.077297 / 2.268929 (3.808369) 2.880896 / 55.444624 (-52.563728) 2.474477 / 6.876477 (-4.402000) 2.617998 / 2.142072 (0.475926) 0.610108 / 4.805227 (-4.195119) 0.139367 / 6.500664 (-6.361297) 0.069879 / 0.075469 (-0.005591)

Benchmark: benchmark_map_filter.json

metric filter map fast-tokenizer batched map identity map identity batched map no-op batched map no-op batched numpy map no-op batched pandas map no-op batched pytorch map no-op batched tensorflow
new / old (diff) 1.867793 / 1.841788 (0.026005) 16.494443 / 8.074308 (8.420135) 28.547075 / 10.191392 (18.355683) 1.126377 / 0.680424 (0.445953) 0.737153 / 0.534201 (0.202952) 0.448288 / 0.579283 (-0.130995) 0.511192 / 0.434364 (0.076828) 0.335312 / 0.540337 (-0.205026) 0.324476 / 1.386936 (-1.062460)

CML watermark

Please sign in to comment.