sh-future commited on
Commit
ebfc3ef
·
verified ·
1 Parent(s): 922458b

Initial commit from dev repo

Browse files
.gitattributes CHANGED
@@ -1,5 +1,6 @@
1
  *.7z filter=lfs diff=lfs merge=lfs -text
2
  *.arrow filter=lfs diff=lfs merge=lfs -text
 
3
  *.bin filter=lfs diff=lfs merge=lfs -text
4
  *.bz2 filter=lfs diff=lfs merge=lfs -text
5
  *.ckpt filter=lfs diff=lfs merge=lfs -text
 
1
  *.7z filter=lfs diff=lfs merge=lfs -text
2
  *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.avro filter=lfs diff=lfs merge=lfs -text
4
  *.bin filter=lfs diff=lfs merge=lfs -text
5
  *.bz2 filter=lfs diff=lfs merge=lfs -text
6
  *.ckpt filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,3 +1,217 @@
1
  ---
2
- {}
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ dataset_info:
3
+ features:
4
+ - name: src_html_path
5
+ dtype: string
6
+ - name: src_css_path
7
+ dtype: string
8
+ - name: web_type
9
+ dtype: string
10
+ - name: css_framework
11
+ dtype: string
12
+ - name: image_instruct
13
+ dtype: image
14
+ - name: modification_category
15
+ dtype: string
16
+ - name: style
17
+ dtype: string
18
+ - name: image_has_arrow
19
+ dtype: bool
20
+ - name: image_has_enclosure
21
+ dtype: bool
22
+ - name: image_has_ui_sketch
23
+ dtype: bool
24
+ - name: ref_html_path
25
+ dtype: string
26
+ - name: ref_css_path
27
+ dtype: string
28
+ splits:
29
+ - name: test
30
+ num_bytes: 888818482
31
+ num_examples: 350
32
+ download_size: 887208210
33
+ dataset_size: 888818482
34
+ configs:
35
+ - config_name: default
36
+ data_files:
37
+ - split: test
38
+ path: data/test-*
39
+ ---
40
+
41
+ # UI-Redline-bench
42
+
43
+ This dataset contains the benchmark data for the paper **"UI-Redline-bench: 赤入れ指示によるWebUIコード修正ベンチマーク"**.
44
+
45
+ The benchmark evaluates the capability of Vision-Language Models (VLMs) to modify Web UI code (HTML/CSS) based on visual "redline" instructions (handwritten or digital) drawn on screenshots.
46
+
47
+ **📄 [Paper](https://www.anlp.jp/proceedings/annual_meeting/2026/pdf_dir/B8-1.pdf)** | **💻 [GitHub Repository (Evaluation Code & Runnable Environment)](https://github.com/future-architect/UI-Redline-bench)**
48
+
49
+ ## Dataset Description
50
+
51
+ * **Repository:** [future-architect/UI-Redline-bench](https://github.com/future-architect/UI-Redline-bench)
52
+ * **Total Instances:** 350
53
+ * **Web Types:** News, Online Store, Portfolio
54
+ * **CSS Frameworks:** Vanilla, Bootstrap, Tailwind CSS
55
+ * **Modification Categories:** Layout, Color Contrast, Text Readability, Button Usability, Learnability
56
+
57
+ ### Usage
58
+
59
+ This Hugging Face dataset contains only the images and the corresponding metadata.
60
+ To run the experiments, please follow the steps below to clone the GitHub repository for evaluation scripts and place the dataset accordingly.
61
+ You can optionally clone this Hugging Face repository if you want to inspect the images manually.
62
+
63
+ ```bash
64
+ mkdir ui-redline-workspace
65
+ cd ui-redline-workspace
66
+
67
+ # 1. Clone the GitHub repository (REQUIRED for running code)
68
+ git clone https://github.com/future-architect/UI-Redline-bench.git
69
+
70
+ # 2. (Optional) Clone this Hugging Face dataset
71
+ # Only needed if you want to browse instruction images manually on your local machine.
72
+ # The python script will download the dataset automatically via API.
73
+
74
+ # Initialize Git LFS (Required to download large image/parquet files)
75
+ git lfs install
76
+
77
+ # Clone into a specific directory to avoid name conflict
78
+ git clone https://huggingface.co/datasets/future-architect/UI-Redline-bench UI-Redline-bench-dataset
79
+
80
+ ```
81
+
82
+ The resulting directory structure should look like this:
83
+
84
+ ```text
85
+ ui-redline-workspace/
86
+ ├── UI-Redline-bench/ # GitHub Repo: Scripts, HTML, CSS (The execution environment)
87
+ │ ├── data/
88
+ │ ├── script/
89
+ │ └── ...
90
+ └── UI-Redline-bench-dataset/ # HF Repo: (Optional) For manual image inspection
91
+ └── ...
92
+
93
+ ```
94
+
95
+ ## Dataset Structure
96
+
97
+ Each record represents a modification task. The file paths provided (`src_html_path`, etc.) are relative to the root of the **GitHub repository** (`UI-Redline-bench/`).
98
+
99
+ | Field | Type | Description |
100
+ | --- | --- | --- |
101
+ | `src_html_path` | string | Relative path to the **original** HTML code (e.g., `data/news/bootstrap/src/index.html`). |
102
+ | `src_css_path` | string | Relative path to the **original** CSS code. |
103
+ | `web_type` | string | Type of the website (`news`, `onlinestore`, `portfolio`). |
104
+ | `css_framework` | string | CSS framework used (`vanilla`, `bootstrap`, `tailwind`). |
105
+ | `image_instruct` | image | The visual instruction (redline) image input for the VLM. |
106
+ | `modification_category` | string | Category of the modification (e.g., `layout`, `color_contrast`). |
107
+ | `style` | string | Style of the visual instruction (`digital` or `handwritten`). |
108
+ | `image_has_arrow` | bool | Whether the instruction image contains arrows. |
109
+ | `image_has_enclosure` | bool | Whether the instruction image contains enclosures/bounding boxes. |
110
+ | `image_has_ui_sketch` | bool | Whether the instruction image contains sketches of new UI elements. |
111
+ | `ref_html_path` | string | Relative path to the **ground truth** HTML code. |
112
+ | `ref_css_path` | string | Relative path to the **ground truth** CSS code. |
113
+
114
+ ## Usage Example (Running Inference)
115
+
116
+ This example demonstrates how to load the dataset and run inference by importing the scripts directly from the cloned GitHub repository.
117
+ Save the following code as `run_benchmark.py` in your `ui-redline-workspace` directory.
118
+
119
+ ```python
120
+ import os
121
+ import sys
122
+ from datasets import load_dataset
123
+
124
+ # 1. Setup Paths
125
+ # Assuming you are in the 'ui-redline-workspace' directory.
126
+ GITHUB_REPO_ROOT = os.path.abspath("./UI-Redline-bench")
127
+ HF_DATASET_PATH = os.path.abspath("./UI-Redline-bench-dataset")
128
+ OUTPUT_DIR = os.path.abspath("./output_results")
129
+
130
+ # 2. Add GitHub script directory to sys.path to allow imports
131
+ sys.path.append(os.path.join(GITHUB_REPO_ROOT, "script"))
132
+
133
+ try:
134
+ # -------------------------------------------------------------------------
135
+ # IMPORT THE TARGET MODEL SCRIPT HERE
136
+ # Change this line depending on the model you want to evaluate:
137
+ # from prediction_based_on_image_gpt5 import process_sample
138
+ # from prediction_based_on_image_claude import process_sample
139
+ # from prediction_based_on_image_gemini import process_sample
140
+ # from prediction_based_on_image_qwen import process_sample
141
+ # -------------------------------------------------------------------------
142
+ from prediction_based_on_image_gemini import process_sample
143
+ except ImportError as e:
144
+ print("Error importing scripts. Make sure you are running this script with the correct environment (e.g., via 'uv run').")
145
+ raise e
146
+
147
+ # 3. Load Dataset
148
+ if os.path.exists(HF_DATASET_PATH):
149
+ print(f"Loading dataset locally from: {HF_DATASET_PATH}")
150
+ ds = load_dataset(HF_DATASET_PATH, split="test")
151
+ else:
152
+ print("Local dataset not found. Downloading from Hugging Face Hub...")
153
+ ds = load_dataset("future-architect/UI-Redline-bench", split="test")
154
+
155
+ # 4. Iterate and Run Inference
156
+ for example in ds:
157
+ # The dataset returns a PIL.Image object, which can be passed directly to the scripts.
158
+ img_input = example['image_instruct']
159
+
160
+ # Construct absolute paths for HTML/CSS
161
+ html_path = os.path.join(GITHUB_REPO_ROOT, example['src_html_path'])
162
+ css_path = os.path.join(GITHUB_REPO_ROOT, example['src_css_path'])
163
+
164
+ # Construct output directory for this case
165
+ case_output_dir = os.path.join(OUTPUT_DIR, os.path.dirname(example['ref_html_path']))
166
+
167
+ print(f"Processing: {html_path}")
168
+
169
+ # Call the imported function directly
170
+ process_sample(
171
+ html_path=html_path,
172
+ css_path=css_path,
173
+ image_path=img_input,
174
+ output_dir=case_output_dir
175
+ )
176
+
177
+ print("Inference completed.")
178
+
179
+ ```
180
+
181
+ ### How to execute the script
182
+
183
+ Since we use `uv` for dependency management, you must run the script using the correct environment defined in the GitHub repository.
184
+
185
+ **For GPT, Claude, and Gemini (API-based models):**
186
+ Use the `cpu-env`.
187
+
188
+ ```bash
189
+ uv run --project UI-Redline-bench/cpu-env python run_benchmark.py
190
+
191
+ ```
192
+
193
+ **For Qwen (Local vLLM model):**
194
+ Use the `gpu-env`. Make sure you have started the vLLM server beforehand.
195
+
196
+ ```bash
197
+ # 1. Start the server (in a separate terminal)
198
+ uv run --project UI-Redline-bench/gpu-env bash UI-Redline-bench/script/launch_vllm_server.sh
199
+
200
+ # 2. Run the benchmark
201
+ uv run --project UI-Redline-bench/gpu-env python run_benchmark.py
202
+
203
+ ```
204
+
205
+ ## Citation
206
+
207
+ If you use this dataset, please cite our paper:
208
+
209
+ ```bibtex
210
+ @inproceedings{hiai2026uiredline,
211
+ title={UI-Redline-bench: 赤入れ指示によるWebUIコード修正ベンチマーク},
212
+ author={肥合智史 and 藤井諒 and 岸波洋介 and 森下睦},
213
+ booktitle={Proceedings of the 32nd Annual Meeting of the Association for Natural Language Processing (NLP2026)},
214
+ year={2026}
215
+ }
216
+
217
+ ```
data/test-00000-of-00002.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c2f5c8ad9eecb50b0ae2b415e3fbf8388546eb3f4a6c96f73997ea2d1590a6ce
3
+ size 476940267
data/test-00001-of-00002.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9211e85a6a4d8502a5642ceac9670868c96435c25d0db67de88ebbe929c2e20
3
+ size 410267943