# Create Dataset with metadata

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcreate-dataset-with-metadata%2F26703%3E%5C
**Category:** 🤗Datasets\
**Created:** [November 25, 2022, 3:45pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcreate-dataset-with-metadata%2F26703 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnielsr)%5C
**Post date:** [November 25, 2022, 3:45pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcreate-dataset-with-metadata%2F26703%2F1 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmariosasko)%5C
**Post date:** [November 28, 2022, 1:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcreate-dataset-with-metadata%2F26703%2F2 "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).
