# Create Dataset with metadata

**URL:** <https://discuss.huggingface.co/t/create-dataset-with-metadata/26703>\
**Category:** 🤗Datasets\
**Created:** [November 25, 2022, 3:45pm UTC](https://discuss.huggingface.co/t/create-dataset-with-metadata/26703 "2022-11-25T15:45:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](https://discuss.huggingface.co/u/nielsr)\
**Post date:** [November 25, 2022, 3:45pm UTC](https://discuss.huggingface.co/t/create-dataset-with-metadata/26703/1 "2022-11-25T15:45:31Z")

</div>

Hi,

I have 2 folders, “images” and “annotations”. Each annotation is a JSON.

I wonder what the easiest way is to load this as a Dataset. Should the JSON be added as metadata?

---

<div class="post-metadata">

**Author:** ![mariosasko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mariosasko/32/31548_2.png) [@mariosasko](https://discuss.huggingface.co/u/mariosasko)\
**Post date:** [November 28, 2022, 1:32pm UTC](https://discuss.huggingface.co/t/create-dataset-with-metadata/26703/2 "2022-11-28T13:32:06Z")

</div>

Hi!

The easiest way is to load with [`Dataset.from_generator`](https://huggingface.co/docs/datasets/main/en/loading#python-generator). Another option is to adjust the directory structure and file contents and use ImageFolder (with metadata files).
