Alex E commited on
Commit
924c908
·
verified ·
1 Parent(s): 4712573

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +104 -1
README.md CHANGED
@@ -10,4 +10,107 @@ tags:
10
  - chart
11
  size_categories:
12
  - 10K<n<100K
13
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  - chart
11
  size_categories:
12
  - 10K<n<100K
13
+ ---
14
+
15
+ # Bar Chart Annotation Dataset
16
+
17
+ A collection of synthetic bar chart images with detailed structural annotations. Split into three subsets for different stages of a chart understanding pipeline.
18
+
19
+ ---
20
+
21
+ ## Subsets
22
+
23
+ | Subset | Folder | Train | Test |
24
+ |---|---|---|---|
25
+ | `encoder_training` | `hf_ready/encoder_training/` | 100,000 | 100 |
26
+ | `decoder_training` | `hf_ready/decoder_training/` | 17,000 | 3,400 |
27
+ | `pipeline_testing` | `hf_ready/pipeline_testing/` | — | 100 |
28
+
29
+ Each subset is a standalone HuggingFace dataset (its own repo), formatted as sharded Parquet files under a `data/` subfolder.
30
+
31
+ ---
32
+
33
+ ## Columns
34
+
35
+ | Column | Type | Description |
36
+ |---|---|---|
37
+ | `filename` | `string` | Original file stem (e.g. `train_42`) — use to reconstruct or cross-reference source files |
38
+ | `image` | `binary` | Original PNG bytes (RGBA, 1272×954) |
39
+ | `annotation` | `string` | Verbatim JSON annotation — identical to the source `.json` files |
40
+ | `chart_type` | `string` | `"vertical"` or `"horizontal"` |
41
+ | `title` | `string` | Chart title text |
42
+ | `num_features` | `int32` | Number of data features (legend entries) |
43
+ | `num_categories` | `int32` | Number of category-axis ticks |
44
+ | `value_min` | `float32` | Value axis minimum |
45
+ | `value_max` | `float32` | Value axis maximum |
46
+
47
+ ---
48
+
49
+ ## Loading
50
+
51
+ ```python
52
+ from datasets import load_dataset
53
+
54
+ ds = load_dataset("<org>/encoder_training")
55
+ sample = ds["train"][0]
56
+
57
+ # Image
58
+ from PIL import Image
59
+ from io import BytesIO
60
+ img = Image.open(BytesIO(sample["image"]))
61
+
62
+ # Annotation (full structure, unchanged)
63
+ import json
64
+ ann = json.loads(sample["annotation"])
65
+ # ann["chart_metadata"] — title, type, bar_width, legend, origin, size
66
+ # ann["data"] — category_axis, value_axis, features
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Annotation Format
72
+
73
+ Each annotation follows this schema (see `format.json` for the full JSON Schema):
74
+
75
+ ```
76
+ {
77
+ "chart_metadata": {
78
+ "title": { "text": "...", "bbox": [x1, y1, x2, y2] },
79
+ "type": "vertical" | "horizontal",
80
+ "bar_width": <int>,
81
+ "legend": {
82
+ "bbox": [...],
83
+ "entries": [
84
+ { "feature": { "text": "...", "bbox": [...] },
85
+ "patch": { "bbox": [...] } }
86
+ ]
87
+ },
88
+ "origin": { "bbox": [...] },
89
+ "size": { "bbox": [...] }
90
+ },
91
+ "data": {
92
+ "category_axis": {
93
+ "label": { "text": "...", "bbox": [...] },
94
+ "bbox": [...],
95
+ "ticks": [ { "label": { "text": "...", "bbox": [...] }, "bbox": [...] } ]
96
+ },
97
+ "value_axis": {
98
+ "label": { "text": "...", "bbox": [...] },
99
+ "min_value": <number>,
100
+ "max_value": <number>,
101
+ "bbox": [...],
102
+ "ticks": [ { "label": { "text": "...", "bbox": [...] }, "bbox": [...] } ]
103
+ },
104
+ "features": [
105
+ {
106
+ "feature": "...",
107
+ "data": [
108
+ { "category": "...", "value": <number>, "bbox": [...] }
109
+ ]
110
+ }
111
+ ]
112
+ }
113
+ }
114
+ ```
115
+
116
+ All bounding boxes are `[x1, y1, x2, y2]` in pixel coordinates.