File size: 1,681 Bytes
8ef8f5b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
# filepath: README.md
configs:
- config_name: default
  data_files:
  - split: test
    path: data_test.parquet
  - split: rest
    path: data_rest.parquet
  features:
    root: Image
    page_url: string
    annotation: string
    metadata: string
    image_refs:
    - path: string
      image: Image
    svg_assets:
    - path: string
      content: string
---

# Figma2Code Dataset

This dataset contains preprocessed Figma design files for the task of generating UI code from Figma designs.

## Dataset Structure

The dataset is divided into two splits: `test` and `rest`. Each sample in the dataset includes the following features:

- `root`: The main screenshot of the UI page as a PIL Image object.
- `page_url`: The original URL of the Figma page.
- `annotation`: A JSON string containing manual annotations about the UI's content and description.
- `metadata`: A JSON string containing the complete preprocessed Figma node tree and properties.
- `image_refs`: A list of dictionaries, where each dictionary contains the relative `path` and the `image` data (as a PIL Image) for bitmap assets.
- `svg_assets`: A list of dictionaries, where each dictionary contains the relative `path` and the string `content` for SVG vector assets.

## How to Use

You can load the dataset using the `datasets` library:

```python
from datasets import load_dataset

# Load the dataset
ds = load_dataset("anonymousauthor001/ds001")

# Access the different splits
test_split = ds["test"]
rest_split = ds["rest"]

# Get the first sample from the test split
sample = test_split[0]
print(sample.keys())
# dict_keys(['root', 'page_url', 'annotation', 'metadata', 'image_refs', 'svg_assets'])