DesonDai commited on
Commit
bac741f
·
verified ·
1 Parent(s): 90a4f43

Add files using upload-large-folder tool

Browse files
Files changed (38) hide show
  1. START_HERE.md +79 -0
  2. from +0 -0
  3. import +0 -0
  4. results/comparison/uipress_256/uipress_256/clip_scores.json +58 -0
  5. results/comparison/uipress_256/uipress_256/html_predictions/0.html +49 -0
  6. results/comparison/uipress_256/uipress_256/html_predictions/10.html +5 -0
  7. results/comparison/uipress_256/uipress_256/html_predictions/100.html +25 -0
  8. results/comparison/uipress_256/uipress_256/html_predictions/101.html +5 -0
  9. results/comparison/uipress_256/uipress_256/html_predictions/103.html +25 -0
  10. results/comparison/uipress_256/uipress_256/html_predictions/106.html +5 -0
  11. results/comparison/uipress_256/uipress_256/html_predictions/108.html +5 -0
  12. results/comparison/uipress_256/uipress_256/html_predictions/11.html +594 -0
  13. results/comparison/uipress_256/uipress_256/html_predictions/115.html +5 -0
  14. results/comparison/uipress_256/uipress_256/html_predictions/116.html +11 -0
  15. results/comparison/uipress_256/uipress_256/html_predictions/119.html +8 -0
  16. results/comparison/uipress_256/uipress_256/html_predictions/121.html +10 -0
  17. results/comparison/uipress_256/uipress_256/html_predictions/123.html +5 -0
  18. results/comparison/uipress_256/uipress_256/html_predictions/125.html +35 -0
  19. results/comparison/uipress_256/uipress_256/html_predictions/126.html +9 -0
  20. results/comparison/uipress_256/uipress_256/html_predictions/131.html +558 -0
  21. results/comparison/uipress_256/uipress_256/html_predictions/137.html +5 -0
  22. results/comparison/uipress_256/uipress_256/html_predictions/138.html +5 -0
  23. results/comparison/uipress_256/uipress_256/html_predictions/139.html +5 -0
  24. results/comparison/uipress_256/uipress_256/html_predictions/14.html +625 -0
  25. results/comparison/uipress_256/uipress_256/html_predictions/141.html +5 -0
  26. results/comparison/uipress_256/uipress_256/per_sample.json +352 -0
  27. results/comparison/uipress_256/uipress_256/summary.json +8 -0
  28. results/comparison/visionzip_256_quick2/visionzip_256/html_predictions/0.html +464 -0
  29. results/comparison/visionzip_256_quick2/visionzip_256/per_sample.json +9 -0
  30. results/comparison/visionzip_256_quick2/visionzip_256/summary.json +8 -0
  31. results/element_analysis.json +200 -0
  32. scripts/eval_all.py +298 -153
  33. scripts/step_case_study.py +230 -0
  34. scripts/step_clip_batch.py +170 -0
  35. scripts/step_element_analysis.py +256 -0
  36. scripts/step_ssim_bootstrap.py +228 -0
  37. scripts/train_compressor.py +76 -46
  38. sync_up.py +83 -15
START_HERE.md CHANGED
@@ -4,6 +4,49 @@
4
  > **统一模型**: Qwen3-VL-8B-Instruct
5
  > **预计总时间**: 2-3 天
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  ---
8
 
9
  ## 0. 项目结构
@@ -223,6 +266,42 @@ results/comparison/
223
  └── qwen3_res_230400/
224
  ```
225
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  ### 预期对比表
227
 
228
  | 方法 | Tokens | CLIP (预期) | 延迟 | 显存 |
 
4
  > **统一模型**: Qwen3-VL-8B-Instruct
5
  > **预计总时间**: 2-3 天
6
 
7
+ ## 当前任务状态(已按实际运行标记)
8
+
9
+ - [x] `1. 环境配置`:依赖与基础环境已可用。
10
+ - [x] `2. 数据准备`:训练与评估数据已就位并可被脚本读取。
11
+ - [x] `3.1 Smoke Test`:单卡冒烟已跑通。
12
+ - [x] `3.2 正式训练`:已完成(最新日志:`Epoch 4: avg_loss=0.2288`,并保存 `checkpoints/optical/epoch4.pt`)。
13
+ - [ ] `3.3 选择最佳 checkpoint`:待最终确认(当前已有 `epoch0/epoch1/epoch4/latest/best`,建议按最低 loss 更新 `best.pt`)。
14
+ - [x] `4.1 一键并行评估(50样本)`:已完成。
15
+ - [x] `4.2 逐个评估(已完成项)`:`baseline`、`visionzip-256`、`visionzip-128`、`efficientui(prune=0.6)`、`uipress-256`。
16
+ - [x] `4.2 逐个评估(补齐项)`:`resolution(230400/1003520)`、`visionzip-64`、`efficientui(prune=0.8)` 已完成。
17
+ - [x] `4.3 计算 CLIP 分数`:已完成(`results/benchmark/all_clip_scores.json`)。
18
+ - [x] `SSIM/bootstrap`:已完成(`results/benchmark/ssim_scores.json`、`results/benchmark/bootstrap_ci.json`)。
19
+ - [x] `element_analysis`:已完成(`results/element_analysis.json`)。
20
+ - [ ] `case study`:尚未执行。
21
+
22
+ ### 执行约定(当前)
23
+
24
+ - 所有新任务统一使用 `nohup` 后台启动,并写入 `logs/*.nohup.log`。
25
+
26
+ ### 现在可继续做(按优先级)
27
+
28
+ 1) **最终 checkpoint 选择(推荐先做)**
29
+ ```bash
30
+ for f in checkpoints/optical/epoch*.pt; do
31
+ echo -n "$f: "
32
+ python -c "import torch; c=torch.load('$f', map_location='cpu'); print(f'loss={c[\"loss\"]:.4f}')"
33
+ done
34
+ # 将最佳 epoch 覆盖为 best.pt
35
+ # cp checkpoints/optical/epochX.pt checkpoints/optical/best.pt
36
+ ```
37
+
38
+ 2) **补跑 case study(nohup)**
39
+ ```bash
40
+ nohup bash -lc 'PYTHONPATH=. python scripts/step_case_study.py' \
41
+ > logs/case_study.nohup.log 2>&1 < /dev/null &
42
+ ```
43
+
44
+ 3) **可选:重跑失败样本渲染后再算 SSIM(例如 129/130)**
45
+ ```bash
46
+ nohup bash -lc 'PYTHONPATH=. python scripts/step_ssim_bootstrap.py --benchmark_dir results/benchmark --ref_dir data/ref_screenshots' \
47
+ > logs/ssim_rerun.nohup.log 2>&1 < /dev/null &
48
+ ```
49
+
50
  ---
51
 
52
  ## 0. 项目结构
 
266
  └── qwen3_res_230400/
267
  ```
268
 
269
+ ### 当前实测结果(50样本,已完成)
270
+
271
+ | 方法 | n_success | 平均视觉 tokens | 平均延迟 | 平均峰值显存 |
272
+ |:---|---:|---:|---:|---:|
273
+ | Qwen3-VL full | 50/50 | 7299.2 | 90.83s | 16.96GB |
274
+ | VisionZip-256 | 50/50 | 256.0 | 110.44s | 17.07GB |
275
+ | VisionZip-128 | 50/50 | 128.0 | 108.41s | 17.07GB |
276
+ | VisionZip-64 | 50/50 | 64.0 | 92.04s | 17.04GB |
277
+ | EfficientUI-60% | 50/50 | 729.9 | 99.52s | 17.02GB |
278
+ | EfficientUI-80% | 50/50 | 364.0 | 102.37s | 17.05GB |
279
+ | Qwen3-Res-230400 | 50/50 | 844.5 | 94.00s | 16.74GB |
280
+ | Qwen3-Res-1003520 | 50/50 | 3747.5 | 76.96s | 16.79GB |
281
+ | **UIPress-256** | **50/50** | **256.0** | **52.52s** | **17.31GB** |
282
+
283
+ ### 当前 CLIP / SSIM(50样本)
284
+
285
+ | 方法 | CLIP | SSIM |
286
+ |:---|---:|---:|
287
+ | qwen3_res_230400 | 0.7768 | 0.6592 |
288
+ | qwen3_res_1003520 | 0.7750 | 0.6612 |
289
+ | qwen3_full | 0.7563 | 0.6647* |
290
+ | efficientui_prune60 | 0.7523 | 0.6487 |
291
+ | efficientui_prune80 | 0.7380 | 0.6232 |
292
+ | visionzip_256 | 0.7333 | 0.6489 |
293
+ | visionzip_128 | 0.7245 | 0.6461 |
294
+ | uipress_256 | 0.7232 | 0.6323 |
295
+ | visionzip_64 | 0.7197 | 0.6452 |
296
+
297
+ \* `qwen3_full` 与 `qwen3_res_1003520` 在 SSIM 渲染阶段各有少量超时样本(统计时已按可用样本数计算)。
298
+
299
+ ### 当前还能马上做什么(全部可立即启动)
300
+
301
+ 1. **恢复训练(优先)**:当前训练在 `E2 S4272/10000` 中断,可从 `checkpoints/optical/latest.pt` 继续。
302
+ 2. **补齐剩余评估档位**:`resolution`、`visionzip-64`、`efficientui(prune=0.8)`。
303
+ 3. **后处理与统计**:运行 `step_clip_batch.py`、`step_ssim_bootstrap.py`,然后做 `step_element_analysis.py` / `step_case_study.py`。
304
+
305
  ### 预期对比表
306
 
307
  | 方法 | Tokens | CLIP (预期) | 延迟 | 显存 |
from ADDED
File without changes
import ADDED
File without changes
results/comparison/uipress_256/uipress_256/clip_scores.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "n": 50,
3
+ "avg_clip": 0.7232,
4
+ "min_clip": 0.4485,
5
+ "max_clip": 0.8768,
6
+ "per_sample": {
7
+ "0": 0.6477,
8
+ "1": 0.6416,
9
+ "10": 0.8694,
10
+ "100": 0.6019,
11
+ "101": 0.8444,
12
+ "102": 0.6862,
13
+ "103": 0.6421,
14
+ "104": 0.733,
15
+ "105": 0.7572,
16
+ "106": 0.653,
17
+ "107": 0.7705,
18
+ "108": 0.6961,
19
+ "109": 0.7902,
20
+ "11": 0.5583,
21
+ "110": 0.7974,
22
+ "111": 0.755,
23
+ "112": 0.8091,
24
+ "113": 0.6079,
25
+ "114": 0.6899,
26
+ "115": 0.8383,
27
+ "116": 0.7303,
28
+ "117": 0.6555,
29
+ "118": 0.6899,
30
+ "119": 0.715,
31
+ "12": 0.6144,
32
+ "120": 0.722,
33
+ "121": 0.8399,
34
+ "122": 0.4485,
35
+ "123": 0.7539,
36
+ "125": 0.6337,
37
+ "126": 0.7624,
38
+ "127": 0.8295,
39
+ "128": 0.7319,
40
+ "129": 0.834,
41
+ "13": 0.8209,
42
+ "130": 0.7926,
43
+ "131": 0.754,
44
+ "132": 0.8207,
45
+ "133": 0.8479,
46
+ "134": 0.6171,
47
+ "135": 0.8655,
48
+ "136": 0.5819,
49
+ "137": 0.7602,
50
+ "138": 0.4775,
51
+ "139": 0.8768,
52
+ "14": 0.7486,
53
+ "140": 0.821,
54
+ "141": 0.7551,
55
+ "142": 0.7435,
56
+ "143": 0.5266
57
+ }
58
+ }
results/comparison/uipress_256/uipress_256/html_predictions/0.html ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <body>
4
+ <div class="container">
5
+ <div class="header">
6
+ <div class="logo">
7
+ <h1>WELCOME TO OUR WEBSITE</h1>
8
+ </div>
9
+ <nav class="navbar">
10
+ <ul>
11
+ <li><a href="#">Home</a></li>
12
+ <li><a href="#">About</a></li>
13
+ <li><a href="#">Services</a></li>
14
+ <li><a href="#">Contact</a></li>
15
+ </ul>
16
+ </div>
17
+ </div>
18
+ <div class="hero">
19
+ <h2>Our Mission</h2>
20
+ <p>At our company, we are dedicated to providing exceptional services and products to our valued customers.</p>
21
+ </div>
22
+ <div class="content">
23
+ <div class="section">
24
+ <h3>Our Services</h3>
25
+ <ul>
26
+ <li>Service 1</li>
27
+ <li>Service 2</li>
28
+ <li>Service 2</li>
29
+ </ul>
30
+ </div>
31
+ <div class="section">
32
+ <h3>Our Team</h3>
33
+ <div class="team-member">
34
+ <img src="team-member.jpg" alt="Team Member">
35
+ <h4>John Doe</h4>
36
+ <p>Team Leader</p>
37
+ </div>
38
+ <div class="team-member">
39
+ <img src="team-member.jpg" alt="Team Member">
40
+ <h4>Jane Smith</h4>
41
+ <p>Team Member</p>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ <footer>
46
+ <p>&copy; 2024 Our Company. All rights reserved.</p>
47
+ </footer>
48
+ </body>
49
+ </html>
results/comparison/uipress_256/uipress_256/html_predictions/10.html ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-
results/comparison/uipress_256/uipress_256/html_predictions/100.html ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <body>
4
+ <div class="container">
5
+ <div class="header">
6
+ <div class="logo">
7
+ <h1>WELCOME TO OUR WEBSITE</h1>
8
+ </div>
9
+ <div class="nav">
10
+ <a href="#">Home</a>
11
+ <a href="#">About</a>
12
+ <a href="#">Services</a>
13
+ <a href="#">Contact</a>
14
+ </div>
15
+ </div>
16
+ <div class="hero">
17
+ <h2>Our Services</h2>
18
+ <p>We offer a wide range of services to meet your needs.</p>
19
+ </div>
20
+ <div class="footer">
21
+ <p>© 2024 My Website. All rights reserved.</p>
22
+ </div>
23
+ </div>
24
+ </body>
25
+ </html>
results/comparison/uipress_256/uipress_256/html_predictions/101.html ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-
results/comparison/uipress_256/uipress_256/html_predictions/103.html ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <body>
4
+ <div class="container">
5
+ <div class="header">
6
+ <div class="logo">
7
+ <h1>WELCOME TO OUR WEBSITE</h1>
8
+ </div>
9
+ <div class="nav">
10
+ <a href="#">Home</a>
11
+ <a href="#">About</a>
12
+ <a href="#">Services</a>
13
+ <a href="#">Contact</a>
14
+ </div>
15
+ </div>
16
+ <div class="hero">
17
+ <h2>Our Services</h2>
18
+ <p>We offer a wide range of services to meet your needs.</p>
19
+ </div>
20
+ <div class="footer">
21
+ <p>© 2024 Our Website. All rights reserved.</p>
22
+ </div>
23
+ </div>
24
+ </body>
25
+ </html>
results/comparison/uipress_256/uipress_256/html_predictions/106.html ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-
results/comparison/uipress_256/uipress_256/html_predictions/108.html ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-
results/comparison/uipress_256/uipress_256/html_predictions/11.html ADDED
@@ -0,0 +1,594 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <title>WELCOME TO THE OFFICIAL WEBSITE OF THE HOSPITAL OF THE CITY OF LONDON</title>
6
+ <style>
7
+ body {
8
+ margin: 0;
9
+ padding: 0;
10
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
11
+ background-color: #f5f5f;
12
+ overflow-x: hidden;
13
+ overflow-y: auto;
14
+ }
15
+ .container {
16
+ width: 100%;
17
+ height: 100%;
18
+ position: relative;
19
+ }
20
+ .header {
21
+ width: 0;
22
+ height: 100%;
23
+ position: absolute;
24
+ top: 0;
25
+ left: 0;
26
+ z-index: 100;
27
+ background-color: #000000;
28
+ color: #ffffff;
29
+ font-size: 16px;
30
+ padding: 0;
31
+ margin: 0;
32
+ overflow: hidden;
33
+ }
34
+ .header .logo {
35
+ width: 100%;
36
+ height: 100%;
37
+ position: absolute;
38
+ top: 0;
39
+ left: 0;
40
+ z-index: 100;
41
+ background-color: #000000;
42
+ color: #ffffff;
43
+ font-size: 16px;
44
+ padding: 0;
45
+ margin: 0;
46
+ overflow: hidden;
47
+ }
48
+ .header .logo .logo {
49
+ width: 100%;
50
+ height: 100%;
51
+ position: absolute;
52
+ top: 0;
53
+ left: 0;
54
+ z-index: 100;
55
+ background-color: #000000;
56
+ color: #ffffff;
57
+ font-size: 16px;
58
+ padding: 0;
59
+ margin: 0;
60
+ overflow: hidden;
61
+ }
62
+ .header .logo .logo img {
63
+ width: 100%;
64
+ height: 100%;
65
+ position: absolute;
66
+ top: 0;
67
+ left: 0;
68
+ z-index: 100;
69
+ background-color: #000000;
70
+ color: #ffffff;
71
+ font-size: 16px;
72
+ padding: 0;
73
+ margin: 0;
74
+ overflow: hidden;
75
+ }
76
+ .header .logo .logo img {
77
+ width: 100%;
78
+ height: 100%;
79
+ position: absolute;
80
+ top: 0;
81
+ left: 0;
82
+ z-index: 100;
83
+ background-color: #000000;
84
+ color: #ffffff;
85
+ font-size: 16px;
86
+ padding: 0;
87
+ margin: 0;
88
+ overflow: hidden;
89
+ }
90
+ .header .logo .logo img {
91
+ width: 100%;
92
+ height: 100%;
93
+ position: absolute;
94
+ top: 0;
95
+ left: 0;
96
+ z-index: 100;
97
+ background-color: #0000000;
98
+ color: #ffffff;
99
+ font-size: 16px;
100
+ padding: 0;
101
+ margin: 0;
102
+ overflow: hidden;
103
+ }
104
+ .header .logo .logo img {
105
+ width: 100%;
106
+ height: 100%;
107
+ position: absolute;
108
+ top: 0;
109
+ left: 0;
110
+ z-index: 100;
111
+ background-color: #000000;
112
+ color: #ffffff;
113
+ font-size: 16px;
114
+ padding: 0;
115
+ margin: 0;
116
+ overflow: hidden;
117
+ }
118
+ .header .logo .logo img {
119
+ width: 100%;
120
+ height: 100%;
121
+ position: absolute;
122
+ top: 0;
123
+ left: 0;
124
+ z-index: 100;
125
+ background-color: #000000;
126
+ color: #ffffff;
127
+ font-size: 16px;
128
+ padding: 0;
129
+ margin: 0;
130
+ overflow: hidden;
131
+ }
132
+ .header .logo .logo img {
133
+ width: 100%;
134
+ height: 100%;
135
+ position: absolute;
136
+ top: 0;
137
+ left: 0;
138
+ z-index: 100;
139
+ background-color: #000000;
140
+ color: #ffffff;
141
+ font-size: 16px;
142
+ padding: 0;
143
+ margin: 0;
144
+ overflow: hidden;
145
+ }
146
+ .header .logo .logo img {
147
+ width: 100%;
148
+ height: 100%;
149
+ position: absolute;
150
+ top: 0;
151
+ left: 0;
152
+ z-index: 100;
153
+ background-color: #000000;
154
+ color: #ffffff;
155
+ font-size: 16px;
156
+ padding: 0;
157
+ margin: 0;
158
+ overflow: hidden;
159
+ }
160
+ .header .logo .logo img {
161
+ width: 100%;
162
+ height: 100%;
163
+ position: absolute;
164
+ top: 0;
165
+ left: 0;
166
+ z-index: 100;
167
+ background-color: #000000;
168
+ color: #ffffff;
169
+ font-size: 16px;
170
+ padding: 0;
171
+ margin: 0;
172
+ overflow: hidden;
173
+ }
174
+ .header .logo .logo img {
175
+ width: 100%;
176
+ height: 100%;
177
+ position: absolute;
178
+ top: 0;
179
+ left: 0;
180
+ z-index: 100;
181
+ background-color: #000000;
182
+ color: #ffffff;
183
+ font-size: 16px;
184
+ padding: 0;
185
+ margin: 0;
186
+ overflow: hidden;
187
+ }
188
+ .header .logo .logo img {
189
+ width: 100%;
190
+ height: 100%;
191
+ position: absolute;
192
+ top: 0;
193
+ left: 0;
194
+ z-index: 100;
195
+ background-color: #000000;
196
+ color: #ffffff;
197
+ font-size: 16px;
198
+ padding: 0;
199
+ margin: 0;
200
+ overflow: hidden;
201
+ }
202
+ .header .logo .logo img {
203
+ width: 100%;
204
+ height: 100%;
205
+ position: absolute;
206
+ top: 0;
207
+ left: 0;
208
+ z-index: 100;
209
+ background-color: #000000;
210
+ color: #ffffff;
211
+ font-size: 16px;
212
+ padding: 0;
213
+ margin: 0;
214
+ overflow: hidden;
215
+ }
216
+ .header .logo .logo img {
217
+ width: 100%;
218
+ height: 100%;
219
+ position: absolute;
220
+ top: 0;
221
+ left: 0;
222
+ z-index: 100;
223
+ background-color: #000000;
224
+ color: #ffffff;
225
+ font-size: 16px;
226
+ padding: 0;
227
+ margin: 0;
228
+ overflow: hidden;
229
+ }
230
+ .header .logo .logo img {
231
+ width: 100%;
232
+ height: 100%;
233
+ position: absolute;
234
+ top: 0;
235
+ left: 0;
236
+ z-index: 100;
237
+ background-color: #000000;
238
+ color: #ffffff;
239
+ font-size: 16px;
240
+ padding: 0;
241
+ margin: 0;
242
+ overflow: hidden;
243
+ }
244
+ .header .logo .logo img {
245
+ width: 100%;
246
+ height: 100%;
247
+ position: absolute;
248
+ top: 0;
249
+ left: 0;
250
+ z-index: 100;
251
+ background-color: #000000;
252
+ color: #ffffff;
253
+ font-size: 16px;
254
+ padding: 0;
255
+ margin: 0;
256
+ overflow: hidden;
257
+ }
258
+ .header .logo .logo img {
259
+ width: 100%;
260
+ height: 100%;
261
+ position: absolute;
262
+ top: 0;
263
+ left: 0;
264
+ z-index: 100;
265
+ background-color: #000000;
266
+ color: #ffffff;
267
+ font-size: 16px;
268
+ padding: 0;
269
+ margin: 0;
270
+ overflow: hidden;
271
+ }
272
+ .header .logo .logo img {
273
+ width: 100%;
274
+ height: 100%;
275
+ position: absolute;
276
+ top: 0;
277
+ left: 0;
278
+ z-index: 100;
279
+ background-color: #000000;
280
+ color: #ffffff;
281
+ font-size: 16px;
282
+ padding: 0;
283
+ margin: 0;
284
+ overflow: hidden;
285
+ }
286
+ .header .logo .logo img {
287
+ width: 100%;
288
+ height: 100%;
289
+ position: absolute;
290
+ top: 0;
291
+ left: 0;
292
+ z-index: 100;
293
+ background-color: #000000;
294
+ color: #ffffff;
295
+ font-size: 16px;
296
+ padding: 0;
297
+ margin: 0;
298
+ overflow: hidden;
299
+ }
300
+ .header .logo .logo img {
301
+ width: 100%;
302
+ height: 100%;
303
+ position: absolute;
304
+ top: 0;
305
+ left: 0;
306
+ z-index: 100;
307
+ background-color: #000000;
308
+ color: #ffffff;
309
+ font-size: 16px;
310
+ padding: 0;
311
+ margin: 0;
312
+ overflow: hidden;
313
+ }
314
+ .header .logo .logo img {
315
+ width: 100%;
316
+ height: 100%;
317
+ position: absolute;
318
+ top: 0;
319
+ left: 0;
320
+ z-index: 100;
321
+ background-color: #000000;
322
+ color: #ffffff;
323
+ font-size: 16px;
324
+ padding: 0;
325
+ margin: 0;
326
+ overflow: hidden;
327
+ }
328
+ .header .logo .logo img {
329
+ width: 100%;
330
+ height: 100%;
331
+ position: absolute;
332
+ top: 0;
333
+ left: 0;
334
+ z-index: 100;
335
+ background-color: #000000;
336
+ color: #ffffff;
337
+ font-size: 16px;
338
+ padding: 0;
339
+ margin: 0;
340
+ overflow: hidden;
341
+ }
342
+ .header .logo .logo img {
343
+ width: 100%;
344
+ height: 100%;
345
+ position: absolute;
346
+ top: 0;
347
+ left: 0;
348
+ z-index: 100;
349
+ background-color: #000000;
350
+ color: #ffffff;
351
+ font-size: 16px;
352
+ padding: 0;
353
+ margin: 0;
354
+ overflow: hidden;
355
+ }
356
+ .header .logo .logo img {
357
+ width: 100%;
358
+ height: 100%;
359
+ position: absolute;
360
+ top: 0;
361
+ left: 0;
362
+ z-index: 100;
363
+ background-color: #000000;
364
+ color: #ffffff;
365
+ font-size: 16px;
366
+ padding: 0;
367
+ margin: 0;
368
+ overflow: hidden;
369
+ }
370
+ .header .logo .logo img {
371
+ width: 100%;
372
+ height: 100%;
373
+ position: absolute;
374
+ top: 0;
375
+ left: 0;
376
+ z-index: 100;
377
+ background-color: #000000;
378
+ color: #ffffff;
379
+ font-size: 16px;
380
+ padding: 0;
381
+ margin: 0;
382
+ overflow: hidden;
383
+ }
384
+ .header .logo .logo img {
385
+ width: 100%;
386
+ height: 100%;
387
+ position: absolute;
388
+ top: 0;
389
+ left: 0;
390
+ z-index: 100;
391
+ background-color: #000000;
392
+ color: #ffffff;
393
+ font-size: 16px;
394
+ padding: 0;
395
+ margin: 0;
396
+ overflow: hidden;
397
+ }
398
+ .header .logo .logo img {
399
+ width: 100%;
400
+ height: 100%;
401
+ position: absolute;
402
+ top: 0;
403
+ left: 0;
404
+ z-index: 100;
405
+ background-color: #000000;
406
+ color: #ffffff;
407
+ font-size: 16px;
408
+ padding: 0;
409
+ margin: 0;
410
+ overflow: hidden;
411
+ }
412
+ .header .logo .logo img {
413
+ width: 100%;
414
+ height: 100%;
415
+ position: absolute;
416
+ top: 0;
417
+ left: 0;
418
+ z-index: 100;
419
+ background-color: #000000;
420
+ color: #ffffff;
421
+ font-size: 16px;
422
+ padding: 0;
423
+ margin: 0;
424
+ overflow: hidden;
425
+ }
426
+ .header .logo .logo img {
427
+ width: 100%;
428
+ height: 100%;
429
+ position: absolute;
430
+ top: 0;
431
+ left: 0;
432
+ z-index: 100;
433
+ background-color: #000000;
434
+ color: #ffffff;
435
+ font-size: 16px;
436
+ padding: 0;
437
+ margin: 0;
438
+ overflow: hidden;
439
+ }
440
+ .header .logo .logo img {
441
+ width: 100%;
442
+ height: 100%;
443
+ position: absolute;
444
+ top: 0;
445
+ left: 0;
446
+ z-index: 100;
447
+ background-color: #000000;
448
+ color: #ffffff;
449
+ font-size: 16px;
450
+ padding: 0;
451
+ margin: 0;
452
+ overflow: hidden;
453
+ }
454
+ .header .logo .logo img {
455
+ width: 100%;
456
+ height: 100%;
457
+ position: absolute;
458
+ top: 0;
459
+ left: 0;
460
+ z-index: 100;
461
+ background-color: #000000;
462
+ color: #ffffff;
463
+ font-size: 16px;
464
+ padding: 0;
465
+ margin: 0;
466
+ overflow: hidden;
467
+ }
468
+ .header .logo .logo img {
469
+ width: 100%;
470
+ height: 100%;
471
+ position: absolute;
472
+ top: 0;
473
+ left: 0;
474
+ z-index: 100;
475
+ background-color: #000000;
476
+ color: #ffffff;
477
+ font-size: 16px;
478
+ padding: 0;
479
+ margin: 0;
480
+ overflow: hidden;
481
+ }
482
+ .header .logo .logo img {
483
+ width: 100%;
484
+ height: 100%;
485
+ position: absolute;
486
+ top: 0;
487
+ left: 0;
488
+ z-index: 100;
489
+ background-color: #000000;
490
+ color: #ffffff;
491
+ font-size: 16px;
492
+ padding: 0;
493
+ margin: 0;
494
+ overflow: hidden;
495
+ }
496
+ .header .logo .logo img {
497
+ width: 100%;
498
+ height: 100%;
499
+ position: absolute;
500
+ top: 0;
501
+ left: 0;
502
+ z-index: 100;
503
+ background-color: #000000;
504
+ color: #ffffff;
505
+ font-size: 16px;
506
+ padding: 0;
507
+ margin: 0;
508
+ overflow: hidden;
509
+ }
510
+ .header .logo .logo img {
511
+ width: 100%;
512
+ height: 100%;
513
+ position: absolute;
514
+ top: 0;
515
+ left: 0;
516
+ z-index: 100;
517
+ background-color: #000000;
518
+ color: #ffffff;
519
+ font-size: 16px;
520
+ padding: 0;
521
+ margin: 0;
522
+ overflow: hidden;
523
+ }
524
+ .header .logo .logo img {
525
+ width: 100%;
526
+ height: 100%;
527
+ position: absolute;
528
+ top: 0;
529
+ left: 0;
530
+ z-index: 100;
531
+ background-color: #000000;
532
+ color: #ffffff;
533
+ font-size: 16px;
534
+ padding: 0;
535
+ margin: 0;
536
+ overflow: hidden;
537
+ }
538
+ .header .logo .logo img {
539
+ width: 100%;
540
+ height: 100%;
541
+ position: absolute;
542
+ top: 0;
543
+ left: 0;
544
+ z-index: 100;
545
+ background-color: #000000;
546
+ color: #ffffff;
547
+ font-size: 16px;
548
+ padding: 0;
549
+ margin: 0;
550
+ overflow: hidden;
551
+ }
552
+ .header .logo .logo img {
553
+ width: 100%;
554
+ height: 100%;
555
+ position: absolute;
556
+ top: 0;
557
+ left: 0;
558
+ z-index: 100;
559
+ background-color: #000000;
560
+ color: #ffffff;
561
+ font-size: 16px;
562
+ padding: 0;
563
+ margin: 0;
564
+ overflow: hidden;
565
+ }
566
+ .header .logo .logo img {
567
+ width: 100%;
568
+ height: 100%;
569
+ position: absolute;
570
+ top: 0;
571
+ left: 0;
572
+ z-index: 100;
573
+ background-color: #000000;
574
+ color: #ffffff;
575
+ font-size: 16px;
576
+ padding: 0;
577
+ margin: 0;
578
+ overflow: hidden;
579
+ }
580
+ .header .logo .logo img {
581
+ width: 100%;
582
+ height: 100%;
583
+ position: absolute;
584
+ top: 0;
585
+ left: 0;
586
+ z-index: 100;
587
+ background-color: #000000;
588
+ color: #ffffff;
589
+ font-size: 16px;
590
+ padding: 0;
591
+ margin: 0;
592
+ overflow: hidden;
593
+ }
594
+ .
results/comparison/uipress_256/uipress_256/html_predictions/115.html ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-
results/comparison/uipress_256/uipress_256/html_predictions/116.html ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <title>WELCOME TO THE OFFICIAL WEBSITE</title>
6
+ <style>
7
+ body {
8
+ margin: 0;
9
+ padding: 0;
10
+ font-family: 'Segoe UI', Tahoma, sans-serif;
11
+ background: #f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f5f
results/comparison/uipress_256/uipress_256/html_predictions/119.html ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <body>
5
+ <div class="container">
6
+ <div class="header">
7
+ <div class="logo">
8
+ <img src="https://www.12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345
results/comparison/uipress_256/uipress_256/html_predictions/121.html ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html
3
+ <html>
4
+ <head>
5
+ <title>Our Story</title>
6
+ <style>
7
+ body {
8
+ font-family: Arial, sans-serif;
9
+ margin: 0;
10
+ padding:
results/comparison/uipress_256/uipress_256/html_predictions/123.html ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-
results/comparison/uipress_256/uipress_256/html_predictions/125.html ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <body>
4
+ <div style="container">
5
+ <div style="header">
6
+ <h1>WELCOME TO THE OFFICIAL WEBSITE OF THE HOSPITAL</h1>
7
+ </div>
8
+ <div style="content">
9
+ <p style="text-align: center;">
10
+ <img src="https://via.placeholder.com/800x150" alt="Hospital Logo" />
11
+ <h2>Our Mission</h2>
12
+ <p style="text-align: justify;">
13
+ To provide high-quality, affordable, and accessible healthcare services to the community, with a focus on patient-centered care and continuous improvement.
14
+ </p>
15
+ <h2>Our Vision</h2>
16
+ <p style="text-align: justify;">
17
+ To be the leading healthcare provider in our region, recognized for excellence in patient care, innovation, and community impact.
18
+ </p>
19
+ <h2>Our Values</h2>
20
+ <ul style="list-style-type: square; padding-left: 20px;">
21
+ <li>Compassion</li>
22
+ <li>Integrity</li>
23
+ <li>Excellence</li>
24
+ <li>Respect</li>
25
+ <li>Empathy</li>
26
+ </ul>
27
+ </div>
28
+ <div style="footer">
29
+ <p style="text-align: center;">
30
+ &copy; 2024 | All Rights Reserved
31
+ </p>
32
+ </div>
33
+ </div>
34
+ </body>
35
+ </html>
results/comparison/uipress_256/uipress_256/html_predictions/126.html ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html
3
+ <html>
4
+ <head>
5
+ <title>WELCOME TO THE OFFICIAL WEBSITE</title>
6
+ <style>
7
+ body {
8
+ margin: 0;
9
+ padding:
results/comparison/uipress_256/uipress_256/html_predictions/131.html ADDED
@@ -0,0 +1,558 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <title>WELCOME TO THE OFFICIAL WEBSITE OF THE FASHION DESIGNER</title>
6
+ <style>
7
+ body {
8
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
9
+ margin: 0;
10
+ padding: 0;
11
+ background-color: #f5f5f;
12
+ overflow-x: hidden;
13
+ overflow-y: scroll;
14
+ }
15
+ .header {
16
+ position: fixed;
17
+ top: 0;
18
+ left: 0;
19
+ width: 100%;
20
+ height: 100vh;
21
+ background-color: #000000;
22
+ z-index: 999;
23
+ display: flex;
24
+ flex-direction: column;
25
+ justify-content: space-between;
26
+ align-items: center;
27
+ padding: 10px 0;
28
+ box-sizing: border-box;
29
+ }
30
+ .header .logo {
31
+ width: 100%;
32
+ height: 100px;
33
+ display: flex;
34
+ justify-content: center;
35
+ align-items: center;
36
+ background-color: #000000;
37
+ color: #ffffff;
38
+ font-size: 24px;
39
+ font-weight: bold;
40
+ text-transform: uppercase;
41
+ letter-spacing: 2px;
42
+ text-align: center;
43
+ padding: 10px 0;
44
+ }
45
+ .header .nav {
46
+ width: 100%;
47
+ height: 60px;
48
+ display: flex;
49
+ justify-content: space-between;
50
+ align-items: center;
51
+ padding: 0 10px;
52
+ box-sizing: border-box;
53
+ }
54
+ .header .nav a {
55
+ color: #ffffff;
56
+ text-decoration: none;
57
+ font-size: 16px;
58
+ font-weight: bold;
59
+ padding: 0 10px;
60
+ transition: all 0.3s;
61
+ }
62
+ .header .nav a:hover {
63
+ color: #ffcc00;
64
+ transform: scale(1.05);
65
+ }
66
+ .header .nav .logo {
67
+ width: 100%;
68
+ height: 100%;
69
+ display: flex;
70
+ justify-content: center;
71
+ align-items: center;
72
+ background-color: #000000;
73
+ color: #ffffff;
74
+ font-size: 24px;
75
+ font-weight: bold;
76
+ text-transform: uppercase;
77
+ letter-spacing: 2px;
78
+ text-align: center;
79
+ padding: 10px 0;
80
+ }
81
+ .header .nav .logo a {
82
+ color: #ffffff;
83
+ text-decoration: none;
84
+ font-size: 16px;
85
+ font-weight: bold;
86
+ padding: 0 10px;
87
+ transition: all 0.3s;
88
+ }
89
+ .header .nav .logo a:hover {
90
+ color: #ffcc00;
91
+ transform: scale(1.05);
92
+ }
93
+ .header .nav .logo a {
94
+ color: #ffffff;
95
+ text-decoration: none;
96
+ font-size: 16px;
97
+ font-weight: bold;
98
+ padding: 0 10px;
99
+ transition: all 0.3s;
100
+ }
101
+ .header .nav .logo a:hover {
102
+ color: #ffcc00;
103
+ transform: scale(1.05);
104
+ }
105
+ .header .nav .logo a {
106
+ color: #ffffff;
107
+ text-decoration: none;
108
+ font-size: 16px;
109
+ font-weight: bold;
110
+ padding: 0 10px;
111
+ transition: all 0.3s;
112
+ }
113
+ .header .nav .logo a:hover {
114
+ color: #ffcc00;
115
+ transform: scale(1.05);
116
+ }
117
+ .header .nav .logo a {
118
+ color: #ffffff;
119
+ text-decoration: none;
120
+ font-size: 16px;
121
+ font-weight: bold;
122
+ padding: 0 10px;
123
+ transition: all 0.3s;
124
+ }
125
+ .header .nav .logo a:hover {
126
+ color: #ffcc00;
127
+ transform: scale(1.05);
128
+ }
129
+ .header .nav .logo a {
130
+ color: #ffffff;
131
+ text-decoration: none;
132
+ font-size: 16px;
133
+ font-weight: bold;
134
+ padding: 0 10px;
135
+ transition: all 0.3s;
136
+ }
137
+ .header .nav .logo a:hover {
138
+ color: #ffcc00;
139
+ transform: scale(1.05);
140
+ }
141
+ .header .nav .logo a {
142
+ color: #ffffff;
143
+ text-decoration: none;
144
+ font-size: 16px;
145
+ font-weight: bold;
146
+ padding: 0 10px;
147
+ transition: all 0.3s;
148
+ }
149
+ .header .nav .logo a:hover {
150
+ color: #ffcc00;
151
+ transform: scale(1.05);
152
+ }
153
+ .header .nav .logo a {
154
+ color: #ffffff;
155
+ text-decoration: none;
156
+ font-size: 16px;
157
+ font-weight: bold;
158
+ padding: 0 10px;
159
+ transition: all 0.3s;
160
+ }
161
+ .header .nav .logo a:hover {
162
+ color: #ffcc00;
163
+ transform: scale(1.05);
164
+ }
165
+ .header .nav .logo a {
166
+ color: #ffffff;
167
+ text-decoration: none;
168
+ font-size: 16px;
169
+ font-weight: bold;
170
+ padding: 0 10px;
171
+ transition: all 0.3s;
172
+ }
173
+ .header .nav .logo a:hover {
174
+ color: #ffcc00;
175
+ transform: scale(1.05);
176
+ }
177
+ .header .nav .logo a {
178
+ color: #ffffff;
179
+ text-decoration: none;
180
+ font-size: 16px;
181
+ font-weight: bold;
182
+ padding: 0 10px;
183
+ transition: all 0.3s;
184
+ }
185
+ .header .nav .logo a:hover {
186
+ color: #ffcc00;
187
+ transform: scale(1.05);
188
+ }
189
+ .header .nav .logo a {
190
+ color: #ffffff;
191
+ text-decoration: none;
192
+ font-size: 16px;
193
+ font-weight: bold;
194
+ padding: 0 10px;
195
+ transition: all 0.3s;
196
+ }
197
+ .header .nav .logo a:hover {
198
+ color: #ffcc00;
199
+ transform: scale(1.05);
200
+ }
201
+ .header .nav .logo a {
202
+ color: #ffffff;
203
+ text-decoration: none;
204
+ font-size: 16px;
205
+ font-weight: bold;
206
+ padding: 0 10px;
207
+ transition: all 0.3s;
208
+ }
209
+ .header .nav .logo a:hover {
210
+ color: #ffcc00;
211
+ transform: scale(1.05);
212
+ }
213
+ .header .nav .logo a {
214
+ color: #ffffff;
215
+ text-decoration: none;
216
+ font-size: 16px;
217
+ font-weight: bold;
218
+ padding: 0 10px;
219
+ transition: all 0.3s;
220
+ }
221
+ .header .nav .logo a:hover {
222
+ color: #ffcc00;
223
+ transform: scale(1.05);
224
+ }
225
+ .header .nav .logo a {
226
+ color: #ffffff;
227
+ text-decoration: none;
228
+ font-size: 16px;
229
+ font-weight: bold;
230
+ padding: 0 10px;
231
+ transition: all 0.3s;
232
+ }
233
+ .header .nav .logo a:hover {
234
+ color: #ffcc00;
235
+ transform: scale(1.05);
236
+ }
237
+ .header .nav .logo a {
238
+ color: #ffffff;
239
+ text-decoration: none;
240
+ font-size: 16px;
241
+ font-weight: bold;
242
+ padding: 0 10px;
243
+ transition: all 0.3s;
244
+ }
245
+ .header .nav .logo a:hover {
246
+ color: #ffcc00;
247
+ transform: scale(1.05);
248
+ }
249
+ .header .nav .logo a {
250
+ color: #ffffff;
251
+ text-decoration: none;
252
+ font-size: 16px;
253
+ font-weight: bold;
254
+ padding: 0 10px;
255
+ transition: all 0.3s;
256
+ }
257
+ .header .nav .logo a:hover {
258
+ color: #ffcc00;
259
+ transform: scale(1.05);
260
+ }
261
+ .header .nav .logo a {
262
+ color: #ffffff;
263
+ text-decoration: none;
264
+ font-size: 16px;
265
+ font-weight: bold;
266
+ padding: 0 10px;
267
+ transition: all 0.3s;
268
+ }
269
+ .header .nav .logo a:hover {
270
+ color: #ffcc00;
271
+ transform: scale(1.05);
272
+ }
273
+ .header .nav .logo a {
274
+ color: #ffffff;
275
+ text-decoration: none;
276
+ font-size: 16px;
277
+ font-weight: bold;
278
+ padding: 0 10px;
279
+ transition: all 0.3s;
280
+ }
281
+ .header .nav .logo a:hover {
282
+ color: #ffcc00;
283
+ transform: scale(1.05);
284
+ }
285
+ .header .nav .logo a {
286
+ color: #ffffff;
287
+ text-decoration: none;
288
+ font-size: 16px;
289
+ font-weight: bold;
290
+ padding: 0 10px;
291
+ transition: all 0.3s;
292
+ }
293
+ .header .nav .logo a:hover {
294
+ color: #ffcc00;
295
+ transform: scale(1.05);
296
+ }
297
+ .header .nav .logo a {
298
+ color: #ffffff;
299
+ text-decoration: none;
300
+ font-size: 16px;
301
+ font-weight: bold;
302
+ padding: 0 10px;
303
+ transition: all 0.3s;
304
+ }
305
+ .header .nav .logo a:hover {
306
+ color: #ffcc00;
307
+ transform: scale(1.05);
308
+ }
309
+ .header .nav .logo a {
310
+ color: #ffffff;
311
+ text-decoration: none;
312
+ font-size: 16px;
313
+ font-weight: bold;
314
+ padding: 0 10px;
315
+ transition: all 0.3s;
316
+ }
317
+ .header .nav .logo a:hover {
318
+ color: #ffcc00;
319
+ transform: scale(1.05);
320
+ }
321
+ .header .nav .logo a {
322
+ color: #ffffff;
323
+ text-decoration: none;
324
+ font-size: 16px;
325
+ font-weight: bold;
326
+ padding: 0 10px;
327
+ transition: all 0.3s;
328
+ }
329
+ .header .nav .logo a:hover {
330
+ color: #ffcc00;
331
+ transform: scale(1.05);
332
+ }
333
+ .header .nav .logo a {
334
+ color: #ffffff;
335
+ text-decoration: none;
336
+ font-size: 16px;
337
+ font-weight: bold;
338
+ padding: 0 10px;
339
+ transition: all 0.3s;
340
+ }
341
+ .header .nav .logo a:hover {
342
+ color: #ffcc00;
343
+ transform: scale(1.05);
344
+ }
345
+ .header .nav .logo a {
346
+ color: #ffffff;
347
+ text-decoration: none;
348
+ font-size: 16px;
349
+ font-weight: bold;
350
+ padding: 0 10px;
351
+ transition: all 0.3s;
352
+ }
353
+ .header .nav .logo a:hover {
354
+ color: #ffcc00;
355
+ transform: scale(1.05);
356
+ }
357
+ .header .nav .logo a {
358
+ color: #ffffff;
359
+ text-decoration: none;
360
+ font-size: 16px;
361
+ font-weight: bold;
362
+ padding: 0 10px;
363
+ transition: all 0.3s;
364
+ }
365
+ .header .nav .logo a:hover {
366
+ color: #ffcc00;
367
+ transform: scale(1.05);
368
+ }
369
+ .header .nav .logo a {
370
+ color: #ffffff;
371
+ text-decoration: none;
372
+ font-size: 16px;
373
+ font-weight: bold;
374
+ padding: 0 10px;
375
+ transition: all 0.3s;
376
+ }
377
+ .header .nav .logo a:hover {
378
+ color: #ffcc00;
379
+ transform: scale(1.05);
380
+ }
381
+ .header .nav .logo a {
382
+ color: #ffffff;
383
+ text-decoration: none;
384
+ font-size: 16px;
385
+ font-weight: bold;
386
+ padding: 0 10px;
387
+ transition: all 0.3s;
388
+ }
389
+ .header .nav .logo a:hover {
390
+ color: #ffcc00;
391
+ transform: scale(1.05);
392
+ }
393
+ .header .nav .logo a {
394
+ color: #ffffff;
395
+ text-decoration: none;
396
+ font-size: 16px;
397
+ font-weight: bold;
398
+ padding: 0 10px;
399
+ transition: all 0.3s;
400
+ }
401
+ .header .nav .logo a:hover {
402
+ color: #ffcc00;
403
+ transform: scale(1.05);
404
+ }
405
+ .header .nav .logo a {
406
+ color: #ffffff;
407
+ text-decoration: none;
408
+ font-size: 16px;
409
+ font-weight: bold;
410
+ padding: 0 10px;
411
+ transition: all 0.3s;
412
+ }
413
+ .header .nav .logo a:hover {
414
+ color: #ffcc00;
415
+ transform: scale(1.05);
416
+ }
417
+ .header .nav .logo a {
418
+ color: #ffffff;
419
+ text-decoration: none;
420
+ font-size: 16px;
421
+ font-weight: bold;
422
+ padding: 0 10px;
423
+ transition: all 0.3s;
424
+ }
425
+ .header .nav .logo a:hover {
426
+ color: #ffcc00;
427
+ transform: scale(1.05);
428
+ }
429
+ .header .nav .logo a {
430
+ color: #ffffff;
431
+ text-decoration: none;
432
+ font-size: 16px;
433
+ font-weight: bold;
434
+ padding: 0 10px;
435
+ transition: all 0.3s;
436
+ }
437
+ .header .nav .logo a:hover {
438
+ color: #ffcc00;
439
+ transform: scale(1.05);
440
+ }
441
+ .header .nav .logo a {
442
+ color: #ffffff;
443
+ text-decoration: none;
444
+ font-size: 16px;
445
+ font-weight: bold;
446
+ padding: 0 10px;
447
+ transition: all 0.3s;
448
+ }
449
+ .header .nav .logo a:hover {
450
+ color: #ffcc00;
451
+ transform: scale(1.05);
452
+ }
453
+ .header .nav .logo a {
454
+ color: #ffffff;
455
+ text-decoration: none;
456
+ font-size: 16px;
457
+ font-weight: bold;
458
+ padding: 0 10px;
459
+ transition: all 0.3s;
460
+ }
461
+ .header .nav .logo a:hover {
462
+ color: #ffcc00;
463
+ transform: scale(1.05);
464
+ }
465
+ .header .nav .logo a {
466
+ color: #ffffff;
467
+ text-decoration: none;
468
+ font-size: 16px;
469
+ font-weight: bold;
470
+ padding: 0 10px;
471
+ transition: all 0.3s;
472
+ }
473
+ .header .nav .logo a:hover {
474
+ color: #ffcc00;
475
+ transform: scale(1.05);
476
+ }
477
+ .header .nav .logo a {
478
+ color: #ffffff;
479
+ text-decoration: none;
480
+ font-size: 16px;
481
+ font-weight: bold;
482
+ padding: 0 10px;
483
+ transition: all 0.3s;
484
+ }
485
+ .header .nav .logo a:hover {
486
+ color: #ffcc00;
487
+ transform: scale(1.05);
488
+ }
489
+ .header .nav .logo a {
490
+ color: #ffffff;
491
+ text-decoration: none;
492
+ font-size: 16px;
493
+ font-weight: bold;
494
+ padding: 0 10px;
495
+ transition: all 0.3s;
496
+ }
497
+ .header .nav .logo a:hover {
498
+ color: #ffcc00;
499
+ transform: scale(1.05);
500
+ }
501
+ .header .nav .logo a {
502
+ color: #ffffff;
503
+ text-decoration: none;
504
+ font-size: 16px;
505
+ font-weight: bold;
506
+ padding: 0 10px;
507
+ transition: all 0.3s;
508
+ }
509
+ .header .nav .logo a:hover {
510
+ color: #ffcc00;
511
+ transform: scale(1.05);
512
+ }
513
+ .header .nav .logo a {
514
+ color: #ffffff;
515
+ text-decoration: none;
516
+ font-size: 16px;
517
+ font-weight: bold;
518
+ padding: 0 10px;
519
+ transition: all 0.3s;
520
+ }
521
+ .header .nav .logo a:hover {
522
+ color: #ffcc00;
523
+ transform: scale(1.05);
524
+ }
525
+ .header .nav .logo a {
526
+ color: #ffffff;
527
+ text-decoration: none;
528
+ font-size: 16px;
529
+ font-weight: bold;
530
+ padding: 0 10px;
531
+ transition: all 0.3s;
532
+ }
533
+ .header .nav .logo a:hover {
534
+ color: #ffcc00;
535
+ transform: scale(1.05);
536
+ }
537
+ .header .nav .logo a {
538
+ color: #ffffff;
539
+ text-decoration: none;
540
+ font-size: 16px;
541
+ font-weight: bold;
542
+ padding: 0 10px;
543
+ transition: all 0.3s;
544
+ }
545
+ .header .nav .logo a:hover {
546
+ color: #ffcc00;
547
+ transform: scale(1.05);
548
+ }
549
+ .header .nav .logo a {
550
+ color: #ffffff;
551
+ text-decoration: none;
552
+ font-size: 16px;
553
+ font-weight: bold;
554
+ padding: 0 10px;
555
+ transition: all 0.3s;
556
+ }
557
+ .header .nav .logo a:hover {
558
+ color: #
results/comparison/uipress_256/uipress_256/html_predictions/137.html ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-
results/comparison/uipress_256/uipress_256/html_predictions/138.html ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-
results/comparison/uipress_256/uipress_256/html_predictions/139.html ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-
results/comparison/uipress_256/uipress_256/html_predictions/14.html ADDED
@@ -0,0 +1,625 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <title>WELCOME TO THE OFFICIAL WEBSITE OF THE HOSPITAL OF THE CITY OF BAGUIOS</title>
6
+ <style>
7
+ body {
8
+ margin: 0;
9
+ padding: 0;
10
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
11
+ background-color: #f5f5f;
12
+ overflow-x: hidden;
13
+ overflow-y: auto;
14
+ }
15
+ .container {
16
+ width: 100%;
17
+ height: 100%;
18
+ position: relative;
19
+ padding: 0;
20
+ margin: 0;
21
+ }
22
+ .header {
23
+ width: 100%;
24
+ height: 100%;
25
+ position: relative;
26
+ background-color: #000000;
27
+ padding: 0;
28
+ margin: 0;
29
+ }
30
+ .header .logo {
31
+ width: 100%;
32
+ height: 100%;
33
+ position: absolute;
34
+ top: 0;
35
+ left: 0;
36
+ padding: 0;
37
+ margin: 0;
38
+ z-index: 100;
39
+ }
40
+ .header .logo img {
41
+ width: 100%;
42
+ height: 100%;
43
+ position: absolute;
44
+ top: 0;
45
+ left: 0;
46
+ z-index: 100;
47
+ }
48
+ .header .logo .logo {
49
+ width: 100%;
50
+ height: 100%;
51
+ position: absolute;
52
+ top: 0;
53
+ left: 0;
54
+ z-index: 100;
55
+ }
56
+ .header .logo .logo img {
57
+ width: 100%;
58
+ height: 100%;
59
+ position: absolute;
60
+ top: 0;
61
+ left: 0;
62
+ z-index: 100;
63
+ }
64
+ .header .logo .logo {
65
+ width: 100%;
66
+ height: 100%;
67
+ position: absolute;
68
+ top: 0;
69
+ left: 0;
70
+ z-index: 100;
71
+ }
72
+ .header .logo .logo img {
73
+ width: 100%;
74
+ height: 100%;
75
+ position: absolute;
76
+ top: 0;
77
+ left: 0;
78
+ z-index: 100;
79
+ }
80
+ .header .logo .logo {
81
+ width: 100%;
82
+ height: 100%;
83
+ position: absolute;
84
+ top: 0;
85
+ left: 0;
86
+ z-index: 100;
87
+ }
88
+ .header .logo .logo img {
89
+ width: 100%;
90
+ height: 100%;
91
+ position: absolute;
92
+ top: 0;
93
+ left: 0;
94
+ z-index: 100;
95
+ }
96
+ .header .logo .logo {
97
+ width: 100%;
98
+ height: 100%;
99
+ position: absolute;
100
+ top: 0;
101
+ left: 0;
102
+ z-index: 100;
103
+ }
104
+ .header .logo .logo img {
105
+ width: 100%;
106
+ height: 100%;
107
+ position: absolute;
108
+ top: 0;
109
+ left: 0;
110
+ z-index: 100;
111
+ }
112
+ .header .logo .logo {
113
+ width: 100%;
114
+ height: 100%;
115
+ position: absolute;
116
+ top: 0;
117
+ left: 0;
118
+ z-index: 100;
119
+ }
120
+ .header .logo .logo img {
121
+ width: 100%;
122
+ height: 100%;
123
+ position: absolute;
124
+ top: 0;
125
+ left: 0;
126
+ z-index: 100;
127
+ }
128
+ .header .logo .logo {
129
+ width: 100%;
130
+ height: 100%;
131
+ position: absolute;
132
+ top: 0;
133
+ left: 0;
134
+ z-index: 100;
135
+ }
136
+ .header .logo .logo img {
137
+ width: 100%;
138
+ height: 100%;
139
+ position: absolute;
140
+ top: 0;
141
+ left: 0;
142
+ z-index: 100;
143
+ }
144
+ .header .logo .logo {
145
+ width: 100%;
146
+ height: 100%;
147
+ position: absolute;
148
+ top: 0;
149
+ left: 0;
150
+ z-index: 100;
151
+ }
152
+ .header .logo .logo img {
153
+ width: 100%;
154
+ height: 100%;
155
+ position: absolute;
156
+ top: 0;
157
+ left: 0;
158
+ z-index: 100;
159
+ }
160
+ .header .logo .logo {
161
+ width: 100%;
162
+ height: 100%;
163
+ position: absolute;
164
+ top: 0;
165
+ left: 0;
166
+ z-index: 100;
167
+ }
168
+ .header .logo .logo img {
169
+ width: 100%;
170
+ height: 100%;
171
+ position: absolute;
172
+ top: 0;
173
+ left: 0;
174
+ z-index: 100;
175
+ }
176
+ .header .logo .logo {
177
+ width: 100%;
178
+ height: 100%;
179
+ position: absolute;
180
+ top: 0;
181
+ left: 0;
182
+ z-index: 100;
183
+ }
184
+ .header .logo .logo img {
185
+ width: 100%;
186
+ height: 100%;
187
+ position: absolute;
188
+ top: 0;
189
+ left: 0;
190
+ z-index: 100;
191
+ }
192
+ .header .logo .logo {
193
+ width: 100%;
194
+ height: 100%;
195
+ position: absolute;
196
+ top: 0;
197
+ left: 0;
198
+ z-index: 100;
199
+ }
200
+ .header .logo .logo img {
201
+ width: 100%;
202
+ height: 100%;
203
+ position: absolute;
204
+ top: 0;
205
+ left: 0;
206
+ z-index: 100;
207
+ }
208
+ .header .logo .logo {
209
+ width: 100%;
210
+ height: 100%;
211
+ position: absolute;
212
+ top: 0;
213
+ left: 0;
214
+ z-index: 100;
215
+ }
216
+ .header .logo .logo img {
217
+ width: 100%;
218
+ height: 100%;
219
+ position: absolute;
220
+ top: 0;
221
+ left: 0;
222
+ z-index: 100;
223
+ }
224
+ .header .logo .logo {
225
+ width: 100%;
226
+ height: 100%;
227
+ position: absolute;
228
+ top: 0;
229
+ left: 0;
230
+ z-index: 100;
231
+ }
232
+ .header .logo .logo img {
233
+ width: 100%;
234
+ height: 100%;
235
+ position: absolute;
236
+ top: 0;
237
+ left: 0;
238
+ z-index: 100;
239
+ }
240
+ .header .logo .logo {
241
+ width: 100%;
242
+ height: 100%;
243
+ position: absolute;
244
+ top: 0;
245
+ left: 0;
246
+ z-index: 100;
247
+ }
248
+ .header .logo .logo img {
249
+ width: 100%;
250
+ height: 100%;
251
+ position: absolute;
252
+ top: 0;
253
+ left: 0;
254
+ z-index: 100;
255
+ }
256
+ .header .logo .logo {
257
+ width: 100%;
258
+ height: 100%;
259
+ position: absolute;
260
+ top: 0;
261
+ left: 0;
262
+ z-index: 100;
263
+ }
264
+ .header .logo .logo img {
265
+ width: 100%;
266
+ height: 100%;
267
+ position: absolute;
268
+ top: 0;
269
+ left: 0;
270
+ z-index: 100;
271
+ }
272
+ .header .logo .logo {
273
+ width: 100%;
274
+ height: 100%;
275
+ position: absolute;
276
+ top: 0;
277
+ left: 0;
278
+ z-index: 100;
279
+ }
280
+ .header .logo .logo img {
281
+ width: 100%;
282
+ height: 100%;
283
+ position: absolute;
284
+ top: 0;
285
+ left: 0;
286
+ z-index: 100;
287
+ }
288
+ .header .logo .logo {
289
+ width: 100%;
290
+ height: 100%;
291
+ position: absolute;
292
+ top: 0;
293
+ left: 0;
294
+ z-index: 100;
295
+ }
296
+ .header .logo .logo img {
297
+ width: 100%;
298
+ height: 100%;
299
+ position: absolute;
300
+ top: 0;
301
+ left: 0;
302
+ z-index: 100;
303
+ }
304
+ .header .logo .logo {
305
+ width: 100%;
306
+ height: 100%;
307
+ position: absolute;
308
+ top: 0;
309
+ left: 0;
310
+ z-index: 100;
311
+ }
312
+ .header .logo .logo img {
313
+ width: 100%;
314
+ height: 100%;
315
+ position: absolute;
316
+ top: 0;
317
+ left: 0;
318
+ z-index: 100;
319
+ }
320
+ .header .logo .logo {
321
+ width: 100%;
322
+ height: 100%;
323
+ position: absolute;
324
+ top: 0;
325
+ left: 0;
326
+ z-index: 100;
327
+ }
328
+ .header .logo .logo img {
329
+ width: 100%;
330
+ height: 100%;
331
+ position: absolute;
332
+ top: 0;
333
+ left: 0;
334
+ z-index: 100;
335
+ }
336
+ .header .logo .logo {
337
+ width: 100%;
338
+ height: 100%;
339
+ position: absolute;
340
+ top: 0;
341
+ left: 0;
342
+ z-index: 100;
343
+ }
344
+ .header .logo .logo img {
345
+ width: 100%;
346
+ height: 100%;
347
+ position: absolute;
348
+ top: 0;
349
+ left: 0;
350
+ z-index: 100;
351
+ }
352
+ .header .logo .logo {
353
+ width: 100%;
354
+ height: 100%;
355
+ position: absolute;
356
+ top: 0;
357
+ left: 0;
358
+ z-index: 100;
359
+ }
360
+ .header .logo .logo img {
361
+ width: 100%;
362
+ height: 100%;
363
+ position: absolute;
364
+ top: 0;
365
+ left: 0;
366
+ z-index: 100;
367
+ }
368
+ .header .logo .logo {
369
+ width: 100%;
370
+ height: 100%;
371
+ position: absolute;
372
+ top: 0;
373
+ left: 0;
374
+ z-index: 100;
375
+ }
376
+ .header .logo .logo img {
377
+ width: 100%;
378
+ height: 100%;
379
+ position: absolute;
380
+ top: 0;
381
+ left: 0;
382
+ z-index: 100;
383
+ }
384
+ .header .logo .logo {
385
+ width: 100%;
386
+ height: 100%;
387
+ position: absolute;
388
+ top: 0;
389
+ left: 0;
390
+ z-index: 100;
391
+ }
392
+ .header .logo .logo img {
393
+ width: 100%;
394
+ height: 100%;
395
+ position: absolute;
396
+ top: 0;
397
+ left: 0;
398
+ z-index: 100;
399
+ }
400
+ .header .logo .logo {
401
+ width: 100%;
402
+ height: 100%;
403
+ position: absolute;
404
+ top: 0;
405
+ left: 0;
406
+ z-index: 100;
407
+ }
408
+ .header .logo .logo img {
409
+ width: 100%;
410
+ height: 100%;
411
+ position: absolute;
412
+ top: 0;
413
+ left: 0;
414
+ z-index: 100;
415
+ }
416
+ .header .logo .logo {
417
+ width: 100%;
418
+ height: 100%;
419
+ position: absolute;
420
+ top: 0;
421
+ left: 0;
422
+ z-index: 100;
423
+ }
424
+ .header .logo .logo img {
425
+ width: 100%;
426
+ height: 100%;
427
+ position: absolute;
428
+ top: 0;
429
+ left: 0;
430
+ z-index: 100;
431
+ }
432
+ .header .logo .logo {
433
+ width: 100%;
434
+ height: 100%;
435
+ position: absolute;
436
+ top: 0;
437
+ left: 0;
438
+ z-index: 100;
439
+ }
440
+ .header .logo .logo img {
441
+ width: 100%;
442
+ height: 100%;
443
+ position: absolute;
444
+ top: 0;
445
+ left: 0;
446
+ z-index: 100;
447
+ }
448
+ .header .logo .logo {
449
+ width: 100%;
450
+ height: 100%;
451
+ position: absolute;
452
+ top: 0;
453
+ left: 0;
454
+ z-index: 100;
455
+ }
456
+ .header .logo .logo img {
457
+ width: 100%;
458
+ height: 100%;
459
+ position: absolute;
460
+ top: 0;
461
+ left: 0;
462
+ z-index: 100;
463
+ }
464
+ .header .logo .logo {
465
+ width: 100%;
466
+ height: 100%;
467
+ position: absolute;
468
+ top: 0;
469
+ left: 0;
470
+ z-index: 100;
471
+ }
472
+ .header .logo .logo img {
473
+ width: 100%;
474
+ height: 100%;
475
+ position: absolute;
476
+ top: 0;
477
+ left: 0;
478
+ z-index: 100;
479
+ }
480
+ .header .logo .logo {
481
+ width: 100%;
482
+ height: 100%;
483
+ position: absolute;
484
+ top: 0;
485
+ left: 0;
486
+ z-index: 100;
487
+ }
488
+ .header .logo .logo img {
489
+ width: 100%;
490
+ height: 100%;
491
+ position: absolute;
492
+ top: 0;
493
+ left: 0;
494
+ z-index: 100;
495
+ }
496
+ .header .logo .logo {
497
+ width: 100%;
498
+ height: 100%;
499
+ position: absolute;
500
+ top: 0;
501
+ left: 0;
502
+ z-index: 100;
503
+ }
504
+ .header .logo .logo img {
505
+ width: 100%;
506
+ height: 100%;
507
+ position: absolute;
508
+ top: 0;
509
+ left: 0;
510
+ z-index: 100;
511
+ }
512
+ .header .logo .logo {
513
+ width: 100%;
514
+ height: 100%;
515
+ position: absolute;
516
+ top: 0;
517
+ left: 0;
518
+ z-index: 100;
519
+ }
520
+ .header .logo .logo img {
521
+ width: 100%;
522
+ height: 100%;
523
+ position: absolute;
524
+ top: 0;
525
+ left: 0;
526
+ z-index: 100;
527
+ }
528
+ .header .logo .logo {
529
+ width: 100%;
530
+ height: 100%;
531
+ position: absolute;
532
+ top: 0;
533
+ left: 0;
534
+ z-index: 100;
535
+ }
536
+ .header .logo .logo img {
537
+ width: 100%;
538
+ height: 100%;
539
+ position: absolute;
540
+ top: 0;
541
+ left: 0;
542
+ z-index: 100;
543
+ }
544
+ .header .logo .logo {
545
+ width: 100%;
546
+ height: 100%;
547
+ position: absolute;
548
+ top: 0;
549
+ left: 0;
550
+ z-index: 100;
551
+ }
552
+ .header .logo .logo img {
553
+ width: 100%;
554
+ height: 100%;
555
+ position: absolute;
556
+ top: 0;
557
+ left: 0;
558
+ z-index: 100;
559
+ }
560
+ .header .logo .logo {
561
+ width: 100%;
562
+ height: 100%;
563
+ position: absolute;
564
+ top: 0;
565
+ left: 0;
566
+ z-index: 100;
567
+ }
568
+ .header .logo .logo img {
569
+ width: 100%;
570
+ height: 100%;
571
+ position: absolute;
572
+ top: 0;
573
+ left: 0;
574
+ z-index: 100;
575
+ }
576
+ .header .logo .logo {
577
+ width: 100%;
578
+ height: 100%;
579
+ position: absolute;
580
+ top: 0;
581
+ left: 0;
582
+ z-index: 100;
583
+ }
584
+ .header .logo .logo img {
585
+ width: 100%;
586
+ height: 100%;
587
+ position: absolute;
588
+ top: 0;
589
+ left: 0;
590
+ z-index: 100;
591
+ }
592
+ .header .logo .logo {
593
+ width: 100%;
594
+ height: 100%;
595
+ position: absolute;
596
+ top: 0;
597
+ left: 0;
598
+ z-index: 100;
599
+ }
600
+ .header .logo .logo img {
601
+ width: 100%;
602
+ height: 100%;
603
+ position: absolute;
604
+ top: 0;
605
+ left: 0;
606
+ z-index: 100;
607
+ }
608
+ .header .logo .logo {
609
+ width: 100%;
610
+ height: 100%;
611
+ position: absolute;
612
+ top: 0;
613
+ left: 0;
614
+ z-index: 100;
615
+ }
616
+ .header .logo .logo img {
617
+ width: 100%;
618
+ height: 100%;
619
+ position: absolute;
620
+ top: 0;
621
+ left: 0;
622
+ z-index: 100;
623
+ }
624
+ .header .logo .logo {
625
+ width:
results/comparison/uipress_256/uipress_256/html_predictions/141.html ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-
results/comparison/uipress_256/uipress_256/per_sample.json ADDED
@@ -0,0 +1,352 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "id": "0",
4
+ "n_visual_tokens": 256,
5
+ "latency_s": 16.51,
6
+ "peak_mem_gb": 17.13,
7
+ "output_len": 1490
8
+ },
9
+ {
10
+ "id": "1",
11
+ "n_visual_tokens": 256,
12
+ "latency_s": 1.15,
13
+ "peak_mem_gb": 16.94,
14
+ "output_len": 61
15
+ },
16
+ {
17
+ "id": "10",
18
+ "n_visual_tokens": 256,
19
+ "latency_s": 1.93,
20
+ "peak_mem_gb": 17.62,
21
+ "output_len": 61
22
+ },
23
+ {
24
+ "id": "100",
25
+ "n_visual_tokens": 256,
26
+ "latency_s": 7.31,
27
+ "peak_mem_gb": 17.11,
28
+ "output_len": 683
29
+ },
30
+ {
31
+ "id": "101",
32
+ "n_visual_tokens": 256,
33
+ "latency_s": 1.59,
34
+ "peak_mem_gb": 17.37,
35
+ "output_len": 61
36
+ },
37
+ {
38
+ "id": "102",
39
+ "n_visual_tokens": 256,
40
+ "latency_s": 13.52,
41
+ "peak_mem_gb": 17.15,
42
+ "output_len": 1410
43
+ },
44
+ {
45
+ "id": "103",
46
+ "n_visual_tokens": 256,
47
+ "latency_s": 7.08,
48
+ "peak_mem_gb": 17.11,
49
+ "output_len": 684
50
+ },
51
+ {
52
+ "id": "104",
53
+ "n_visual_tokens": 256,
54
+ "latency_s": 158.76,
55
+ "peak_mem_gb": 17.54,
56
+ "output_len": 10665
57
+ },
58
+ {
59
+ "id": "105",
60
+ "n_visual_tokens": 256,
61
+ "latency_s": 11.99,
62
+ "peak_mem_gb": 17.13,
63
+ "output_len": 1129
64
+ },
65
+ {
66
+ "id": "106",
67
+ "n_visual_tokens": 256,
68
+ "latency_s": 1.61,
69
+ "peak_mem_gb": 17.38,
70
+ "output_len": 61
71
+ },
72
+ {
73
+ "id": "107",
74
+ "n_visual_tokens": 256,
75
+ "latency_s": 2.28,
76
+ "peak_mem_gb": 17.36,
77
+ "output_len": 135
78
+ },
79
+ {
80
+ "id": "108",
81
+ "n_visual_tokens": 256,
82
+ "latency_s": 1.64,
83
+ "peak_mem_gb": 17.29,
84
+ "output_len": 61
85
+ },
86
+ {
87
+ "id": "109",
88
+ "n_visual_tokens": 256,
89
+ "latency_s": 19.8,
90
+ "peak_mem_gb": 17.01,
91
+ "output_len": 2014
92
+ },
93
+ {
94
+ "id": "11",
95
+ "n_visual_tokens": 256,
96
+ "latency_s": 156.35,
97
+ "peak_mem_gb": 17.39,
98
+ "output_len": 15523
99
+ },
100
+ {
101
+ "id": "110",
102
+ "n_visual_tokens": 256,
103
+ "latency_s": 160.41,
104
+ "peak_mem_gb": 17.56,
105
+ "output_len": 14937
106
+ },
107
+ {
108
+ "id": "111",
109
+ "n_visual_tokens": 256,
110
+ "latency_s": 160.89,
111
+ "peak_mem_gb": 17.49,
112
+ "output_len": 11093
113
+ },
114
+ {
115
+ "id": "112",
116
+ "n_visual_tokens": 256,
117
+ "latency_s": 12.47,
118
+ "peak_mem_gb": 17.01,
119
+ "output_len": 1092
120
+ },
121
+ {
122
+ "id": "113",
123
+ "n_visual_tokens": 256,
124
+ "latency_s": 0.96,
125
+ "peak_mem_gb": 16.94,
126
+ "output_len": 61
127
+ },
128
+ {
129
+ "id": "114",
130
+ "n_visual_tokens": 256,
131
+ "latency_s": 7.41,
132
+ "peak_mem_gb": 17.89,
133
+ "output_len": 524
134
+ },
135
+ {
136
+ "id": "115",
137
+ "n_visual_tokens": 256,
138
+ "latency_s": 0.98,
139
+ "peak_mem_gb": 16.94,
140
+ "output_len": 61
141
+ },
142
+ {
143
+ "id": "116",
144
+ "n_visual_tokens": 256,
145
+ "latency_s": 189.32,
146
+ "peak_mem_gb": 17.67,
147
+ "output_len": 4278
148
+ },
149
+ {
150
+ "id": "117",
151
+ "n_visual_tokens": 256,
152
+ "latency_s": 27.95,
153
+ "peak_mem_gb": 16.98,
154
+ "output_len": 1173
155
+ },
156
+ {
157
+ "id": "118",
158
+ "n_visual_tokens": 256,
159
+ "latency_s": 4.75,
160
+ "peak_mem_gb": 17.62,
161
+ "output_len": 114
162
+ },
163
+ {
164
+ "id": "119",
165
+ "n_visual_tokens": 256,
166
+ "latency_s": 338.31,
167
+ "peak_mem_gb": 17.44,
168
+ "output_len": 4219
169
+ },
170
+ {
171
+ "id": "12",
172
+ "n_visual_tokens": 256,
173
+ "latency_s": 2.06,
174
+ "peak_mem_gb": 16.94,
175
+ "output_len": 61
176
+ },
177
+ {
178
+ "id": "120",
179
+ "n_visual_tokens": 256,
180
+ "latency_s": 26.24,
181
+ "peak_mem_gb": 16.98,
182
+ "output_len": 1032
183
+ },
184
+ {
185
+ "id": "121",
186
+ "n_visual_tokens": 256,
187
+ "latency_s": 6.52,
188
+ "peak_mem_gb": 17.74,
189
+ "output_len": 180
190
+ },
191
+ {
192
+ "id": "122",
193
+ "n_visual_tokens": 256,
194
+ "latency_s": 3.51,
195
+ "peak_mem_gb": 17.46,
196
+ "output_len": 61
197
+ },
198
+ {
199
+ "id": "123",
200
+ "n_visual_tokens": 256,
201
+ "latency_s": 2.06,
202
+ "peak_mem_gb": 16.94,
203
+ "output_len": 61
204
+ },
205
+ {
206
+ "id": "125",
207
+ "n_visual_tokens": 256,
208
+ "latency_s": 27.72,
209
+ "peak_mem_gb": 17.21,
210
+ "output_len": 1207
211
+ },
212
+ {
213
+ "id": "126",
214
+ "n_visual_tokens": 256,
215
+ "latency_s": 6.21,
216
+ "peak_mem_gb": 17.69,
217
+ "output_len": 158
218
+ },
219
+ {
220
+ "id": "127",
221
+ "n_visual_tokens": 256,
222
+ "latency_s": 2.07,
223
+ "peak_mem_gb": 16.94,
224
+ "output_len": 61
225
+ },
226
+ {
227
+ "id": "128",
228
+ "n_visual_tokens": 256,
229
+ "latency_s": 27.48,
230
+ "peak_mem_gb": 17.05,
231
+ "output_len": 1363
232
+ },
233
+ {
234
+ "id": "129",
235
+ "n_visual_tokens": 256,
236
+ "latency_s": 234.42,
237
+ "peak_mem_gb": 17.71,
238
+ "output_len": 14331
239
+ },
240
+ {
241
+ "id": "13",
242
+ "n_visual_tokens": 256,
243
+ "latency_s": 158.92,
244
+ "peak_mem_gb": 17.58,
245
+ "output_len": 13648
246
+ },
247
+ {
248
+ "id": "130",
249
+ "n_visual_tokens": 256,
250
+ "latency_s": 157.18,
251
+ "peak_mem_gb": 17.56,
252
+ "output_len": 14865
253
+ },
254
+ {
255
+ "id": "131",
256
+ "n_visual_tokens": 256,
257
+ "latency_s": 154.34,
258
+ "peak_mem_gb": 17.38,
259
+ "output_len": 15728
260
+ },
261
+ {
262
+ "id": "132",
263
+ "n_visual_tokens": 256,
264
+ "latency_s": 160.23,
265
+ "peak_mem_gb": 17.55,
266
+ "output_len": 4718
267
+ },
268
+ {
269
+ "id": "133",
270
+ "n_visual_tokens": 256,
271
+ "latency_s": 1.37,
272
+ "peak_mem_gb": 17.33,
273
+ "output_len": 61
274
+ },
275
+ {
276
+ "id": "134",
277
+ "n_visual_tokens": 256,
278
+ "latency_s": 4.61,
279
+ "peak_mem_gb": 17.19,
280
+ "output_len": 396
281
+ },
282
+ {
283
+ "id": "135",
284
+ "n_visual_tokens": 256,
285
+ "latency_s": 160.6,
286
+ "peak_mem_gb": 17.56,
287
+ "output_len": 15537
288
+ },
289
+ {
290
+ "id": "136",
291
+ "n_visual_tokens": 256,
292
+ "latency_s": 2.32,
293
+ "peak_mem_gb": 17.75,
294
+ "output_len": 76
295
+ },
296
+ {
297
+ "id": "137",
298
+ "n_visual_tokens": 256,
299
+ "latency_s": 0.96,
300
+ "peak_mem_gb": 16.94,
301
+ "output_len": 61
302
+ },
303
+ {
304
+ "id": "138",
305
+ "n_visual_tokens": 256,
306
+ "latency_s": 0.97,
307
+ "peak_mem_gb": 16.94,
308
+ "output_len": 61
309
+ },
310
+ {
311
+ "id": "139",
312
+ "n_visual_tokens": 256,
313
+ "latency_s": 1.86,
314
+ "peak_mem_gb": 17.51,
315
+ "output_len": 61
316
+ },
317
+ {
318
+ "id": "14",
319
+ "n_visual_tokens": 256,
320
+ "latency_s": 158.72,
321
+ "peak_mem_gb": 17.41,
322
+ "output_len": 15035
323
+ },
324
+ {
325
+ "id": "140",
326
+ "n_visual_tokens": 256,
327
+ "latency_s": 1.55,
328
+ "peak_mem_gb": 17.37,
329
+ "output_len": 61
330
+ },
331
+ {
332
+ "id": "141",
333
+ "n_visual_tokens": 256,
334
+ "latency_s": 2.13,
335
+ "peak_mem_gb": 17.58,
336
+ "output_len": 61
337
+ },
338
+ {
339
+ "id": "142",
340
+ "n_visual_tokens": 256,
341
+ "latency_s": 1.28,
342
+ "peak_mem_gb": 16.95,
343
+ "output_len": 61
344
+ },
345
+ {
346
+ "id": "143",
347
+ "n_visual_tokens": 256,
348
+ "latency_s": 15.58,
349
+ "peak_mem_gb": 17.05,
350
+ "output_len": 1278
351
+ }
352
+ ]
results/comparison/uipress_256/uipress_256/summary.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "method": "uipress_256",
3
+ "n_samples": 50,
4
+ "n_success": 50,
5
+ "avg_visual_tokens": 256.0,
6
+ "avg_latency_s": 52.52,
7
+ "avg_peak_mem_gb": 17.31
8
+ }
results/comparison/visionzip_256_quick2/visionzip_256/html_predictions/0.html ADDED
@@ -0,0 +1,464 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```html
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-
6
+ <title>Banana Oatmeal Muffins</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ background-color: #f9f9f;
11
+ padding: 20px;
12
+ line-height: 1.5;
13
+ color: #333333;
14
+ }
15
+ h1, h2, h3 {
16
+ color: #222222;
17
+ margin-top: 10px;
18
+ margin-bottom: 10px;
19
+ }
20
+ h1 {
21
+ font-size: 24px;
22
+ }
23
+ h2 {
24
+ font-size: 20px;
25
+ }
26
+ h3 {
27
+ font-size: 16px;
28
+ }
29
+ .header {
30
+ display: flex;
31
+ justify-content: space-between;
32
+ align-items: center;
33
+ margin-bottom: 20px;
34
+ padding: 10px 0;
35
+ background-color: #f0f0f0f;
36
+ border-bottom: 1px solid #ddd;
37
+ }
38
+ .header h1 {
39
+ font-size: 24px;
40
+ font-weight: bold;
41
+ }
42
+ .header .btn {
43
+ background-color: #444444;
44
+ color: white;
45
+ padding: 5px 10px;
46
+ border: none;
47
+ border-radius: 4px;
48
+ cursor: pointer;
49
+ font-size: 14px;
50
+ margin-left: 10px;
51
+ }
52
+ .header .btn:hover {
53
+ background-color: #555555;
54
+ }
55
+ .header .btn:disabled {
56
+ background-color: #888888;
57
+ cursor: not-allowed;
58
+ }
59
+ .header .btn:disabled:hover {
60
+ background-color: #888888;
61
+ }
62
+ .header .btn:disabled:active {
63
+ background-color: #888888;
64
+ }
65
+ .header .btn:disabled:active:hover {
66
+ background-color: #888888;
67
+ }
68
+ .header .btn:disabled:active:active {
69
+ background-color: #888888;
70
+ }
71
+ .header .btn:disabled:active:active:hover {
72
+ background-color: #888888;
73
+ }
74
+ .header .btn:disabled:active:active:active {
75
+ background-color: #888888;
76
+ }
77
+ .header .btn:disabled:active:active:hover {
78
+ background-color: #888888;
79
+ }
80
+ .header .btn:disabled:active:active:active {
81
+ background-color: #888888;
82
+ }
83
+ .header .btn:disabled:active:active:hover {
84
+ background-color: #888888;
85
+ }
86
+ .header .btn:disabled:active:active:active {
87
+ background-color: #888888;
88
+ }
89
+ .header .btn:disabled:active:active:hover {
90
+ background-color: #888888;
91
+ }
92
+ .header .btn:disabled:active:active:active {
93
+ background-color: #888888;
94
+ }
95
+ .header .btn:disabled:active:active:hover {
96
+ background-color: #888888;
97
+ }
98
+ .header .btn:disabled:active:active:active {
99
+ background-color: #888888;
100
+ }
101
+ .header .btn:disabled:active:active:hover {
102
+ background-color: #888888;
103
+ }
104
+ .header .btn:disabled:active:active:active {
105
+ background-color: #888888;
106
+ }
107
+ .header .btn:disabled:active:active:hover {
108
+ background-color: #888888;
109
+ }
110
+ .header .btn:disabled:active:active:active {
111
+ background-color: #888888;
112
+ }
113
+ .header .btn:disabled:active:active:hover {
114
+ background-color: #888888;
115
+ }
116
+ .header .btn:disabled:active:active:active {
117
+ background-color: #888888;
118
+ }
119
+ .header .btn:disabled:active:active:hover {
120
+ background-color: #888888;
121
+ }
122
+ .header .btn:disabled:active:active:active {
123
+ background-color: #888888;
124
+ }
125
+ .header .btn:disabled:active:active:hover {
126
+ background-color: #888888;
127
+ }
128
+ .header .btn:disabled:active:active:active {
129
+ background-color: #888888;
130
+ }
131
+ .header .btn:disabled:active:active:hover {
132
+ background-color: #888888;
133
+ }
134
+ .header .btn:disabled:active:active:active {
135
+ background-color: #888888;
136
+ }
137
+ .header .btn:disabled:active:active:hover {
138
+ background-color: #888888;
139
+ }
140
+ .header .btn:disabled:active:active:active {
141
+ background-color: #888888;
142
+ }
143
+ .header .btn:disabled:active:active:hover {
144
+ background-color: #888888;
145
+ }
146
+ .header .btn:disabled:active:active:active {
147
+ background-color: #888888;
148
+ }
149
+ .header .btn:disabled:active:active:hover {
150
+ background-color: #888888;
151
+ }
152
+ .header .btn:disabled:active:active:active {
153
+ background-color: #888888;
154
+ }
155
+ .header .btn:disabled:active:active:hover {
156
+ background-color: #888888;
157
+ }
158
+ .header .btn:disabled:active:active:active {
159
+ background-color: #888888;
160
+ }
161
+ .header .btn:disabled:active:active:hover {
162
+ background-color: #888888;
163
+ }
164
+ .header .btn:disabled:active:active:active {
165
+ background-color: #888888;
166
+ }
167
+ .header .btn:disabled:active:active:hover {
168
+ background-color: #888888;
169
+ }
170
+ .header .btn:disabled:active:active:active {
171
+ background-color: #888888;
172
+ }
173
+ .header .btn:disabled:active:active:hover {
174
+ background-color: #888888;
175
+ }
176
+ .header .btn:disabled:active:active:active {
177
+ background-color: #888888;
178
+ }
179
+ .header .btn:disabled:active:active:hover {
180
+ background-color: #888888;
181
+ }
182
+ .header .btn:disabled:active:active:active {
183
+ background-color: #888888;
184
+ }
185
+ .header .btn:disabled:active:active:hover {
186
+ background-color: #888888;
187
+ }
188
+ .header .btn:disabled:active:active:active {
189
+ background-color: #888888;
190
+ }
191
+ .header .btn:disabled:active:active:hover {
192
+ background-color: #888888;
193
+ }
194
+ .header .btn:disabled:active:active:active {
195
+ background-color: #888888;
196
+ }
197
+ .header .btn:disabled:active:active:hover {
198
+ background-color: #888888;
199
+ }
200
+ .header .btn:disabled:active:active:active {
201
+ background-color: #888888;
202
+ }
203
+ .header .btn:disabled:active:active:hover {
204
+ background-color: #888888;
205
+ }
206
+ .header .btn:disabled:active:active:active {
207
+ background-color: #888888;
208
+ }
209
+ .header .btn:disabled:active:active:hover {
210
+ background-color: #888888;
211
+ }
212
+ .header .btn:disabled:active:active:active {
213
+ background-color: #888888;
214
+ }
215
+ .header .btn:disabled:active:active:hover {
216
+ background-color: #888888;
217
+ }
218
+ .header .btn:disabled:active:active:active {
219
+ background-color: #888888;
220
+ }
221
+ .header .btn:disabled:active:active:hover {
222
+ background-color: #888888;
223
+ }
224
+ .header .btn:disabled:active:active:active {
225
+ background-color: #888888;
226
+ }
227
+ .header .btn:disabled:active:active:hover {
228
+ background-color: #888888;
229
+ }
230
+ .header .btn:disabled:active:active:active {
231
+ background-color: #888888;
232
+ }
233
+ .header .btn:disabled:active:active:hover {
234
+ background-color: #888888;
235
+ }
236
+ .header .btn:disabled:active:active:active {
237
+ background-color: #888888;
238
+ }
239
+ .header .btn:disabled:active:active:hover {
240
+ background-color: #888888;
241
+ }
242
+ .header .btn:disabled:active:active:active {
243
+ background-color: #888888;
244
+ }
245
+ .header .btn:disabled:active:active:hover {
246
+ background-color: #888888;
247
+ }
248
+ .header .btn:disabled:active:active:active {
249
+ background-color: #888888;
250
+ }
251
+ .header .btn:disabled:active:active:hover {
252
+ background-color: #888888;
253
+ }
254
+ .header .btn:disabled:active:active:active {
255
+ background-color: #888888;
256
+ }
257
+ .header .btn:disabled:active:active:hover {
258
+ background-color: #888888;
259
+ }
260
+ .header .btn:disabled:active:active:active {
261
+ background-color: #888888;
262
+ }
263
+ .header .btn:disabled:active:active:hover {
264
+ background-color: #888888;
265
+ }
266
+ .header .btn:disabled:active:active:active {
267
+ background-color: #888888;
268
+ }
269
+ .header .btn:disabled:active:active:hover {
270
+ background-color: #888888;
271
+ }
272
+ .header .btn:disabled:active:active:active {
273
+ background-color: #888888;
274
+ }
275
+ .header .btn:disabled:active:active:hover {
276
+ background-color: #888888;
277
+ }
278
+ .header .btn:disabled:active:active:active {
279
+ background-color: #888888;
280
+ }
281
+ .header .btn:disabled:active:active:hover {
282
+ background-color: #888888;
283
+ }
284
+ .header .btn:disabled:active:active:active {
285
+ background-color: #888888;
286
+ }
287
+ .header .btn:disabled:active:active:hover {
288
+ background-color: #888888;
289
+ }
290
+ .header .btn:disabled:active:active:active {
291
+ background-color: #888888;
292
+ }
293
+ .header .btn:disabled:active:active:hover {
294
+ background-color: #888888;
295
+ }
296
+ .header .btn:disabled:active:active:active {
297
+ background-color: #888888;
298
+ }
299
+ .header .btn:disabled:active:active:hover {
300
+ background-color: #888888;
301
+ }
302
+ .header .btn:disabled:active:active:active {
303
+ background-color: #888888;
304
+ }
305
+ .header .btn:disabled:active:active:hover {
306
+ background-color: #888888;
307
+ }
308
+ .header .btn:disabled:active:active:active {
309
+ background-color: #888888;
310
+ }
311
+ .header .btn:disabled:active:active:hover {
312
+ background-color: #888888;
313
+ }
314
+ .header .btn:disabled:active:active:active {
315
+ background-color: #888888;
316
+ }
317
+ .header .btn:disabled:active:active:hover {
318
+ background-color: #888888;
319
+ }
320
+ .header .btn:disabled:active:active:active {
321
+ background-color: #888888;
322
+ }
323
+ .header .btn:disabled:active:active:hover {
324
+ background-color: #888888;
325
+ }
326
+ .header .btn:disabled:active:active:active {
327
+ background-color: #888888;
328
+ }
329
+ .header .btn:disabled:active:active:hover {
330
+ background-color: #888888;
331
+ }
332
+ .header .btn:disabled:active:active:active {
333
+ background-color: #888888;
334
+ }
335
+ .header .btn:disabled:active:active:hover {
336
+ background-color: #888888;
337
+ }
338
+ .header .btn:disabled:active:active:active {
339
+ background-color: #888888;
340
+ }
341
+ .header .btn:disabled:active:active:hover {
342
+ background-color: #888888;
343
+ }
344
+ .header .btn:disabled:active:active:active {
345
+ background-color: #888888;
346
+ }
347
+ .header .btn:disabled:active:active:hover {
348
+ background-color: #888888;
349
+ }
350
+ .header .btn:disabled:active:active:active {
351
+ background-color: #888888;
352
+ }
353
+ .header .btn:disabled:active:active:hover {
354
+ background-color: #888888;
355
+ }
356
+ .header .btn:disabled:active:active:active {
357
+ background-color: #888888;
358
+ }
359
+ .header .btn:disabled:active:active:hover {
360
+ background-color: #888888;
361
+ }
362
+ .header .btn:disabled:active:active:active {
363
+ background-color: #888888;
364
+ }
365
+ .header .btn:disabled:active:active:hover {
366
+ background-color: #888888;
367
+ }
368
+ .header .btn:disabled:active:active:active {
369
+ background-color: #888888;
370
+ }
371
+ .header .btn:disabled:active:active:hover {
372
+ background-color: #888888;
373
+ }
374
+ .header .btn:disabled:active:active:active {
375
+ background-color: #888888;
376
+ }
377
+ .header .btn:disabled:active:active:hover {
378
+ background-color: #888888;
379
+ }
380
+ .header .btn:disabled:active:active:active {
381
+ background-color: #888888;
382
+ }
383
+ .header .btn:disabled:active:active:hover {
384
+ background-color: #888888;
385
+ }
386
+ .header .btn:disabled:active:active:active {
387
+ background-color: #888888;
388
+ }
389
+ .header .btn:disabled:active:active:hover {
390
+ background-color: #888888;
391
+ }
392
+ .header .btn:disabled:active:active:active {
393
+ background-color: #888888;
394
+ }
395
+ .header .btn:disabled:active:active:hover {
396
+ background-color: #888888;
397
+ }
398
+ .header .btn:disabled:active:active:active {
399
+ background-color: #888888;
400
+ }
401
+ .header .btn:disabled:active:active:hover {
402
+ background-color: #888888;
403
+ }
404
+ .header .btn:disabled:active:active:active {
405
+ background-color: #888888;
406
+ }
407
+ .header .btn:disabled:active:active:hover {
408
+ background-color: #888888;
409
+ }
410
+ .header .btn:disabled:active:active:active {
411
+ background-color: #888888;
412
+ }
413
+ .header .btn:disabled:active:active:hover {
414
+ background-color: #888888;
415
+ }
416
+ .header .btn:disabled:active:active:active {
417
+ background-color: #888888;
418
+ }
419
+ .header .btn:disabled:active:active:hover {
420
+ background-color: #888888;
421
+ }
422
+ .header .btn:disabled:active:active:active {
423
+ background-color: #888888;
424
+ }
425
+ .header .btn:disabled:active:active:hover {
426
+ background-color: #888888;
427
+ }
428
+ .header .btn:disabled:active:active:active {
429
+ background-color: #888888;
430
+ }
431
+ .header .btn:disabled:active:active:hover {
432
+ background-color: #888888;
433
+ }
434
+ .header .btn:disabled:active:active:active {
435
+ background-color: #888888;
436
+ }
437
+ .header .btn:disabled:active:active:hover {
438
+ background-color: #888888;
439
+ }
440
+ .header .btn:disabled:active:active:active {
441
+ background-color: #888888;
442
+ }
443
+ .header .btn:disabled:active:active:hover {
444
+ background-color: #888888;
445
+ }
446
+ .header .btn:disabled:active:active:active {
447
+ background-color: #888888;
448
+ }
449
+ .header .btn:disabled:active:active:hover {
450
+ background-color: #888888;
451
+ }
452
+ .header .btn:disabled:active:active:active {
453
+ background-color: #888888;
454
+ }
455
+ .header .btn:disabled:active:active:hover {
456
+ background-color: #888888;
457
+ }
458
+ .header .btn:disabled:active:active:active {
459
+ background-color: #888888;
460
+ }
461
+ .header .btn:disabled:active:active:hover {
462
+ background-color: #888888;
463
+ }
464
+ .header .btn:disabled
results/comparison/visionzip_256_quick2/visionzip_256/per_sample.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "id": "0",
4
+ "n_visual_tokens": 256,
5
+ "latency_s": 157.09,
6
+ "peak_mem_gb": 17.18,
7
+ "output_len": 15111
8
+ }
9
+ ]
results/comparison/visionzip_256_quick2/visionzip_256/summary.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "method": "visionzip_256",
3
+ "n_samples": 1,
4
+ "n_success": 1,
5
+ "avg_visual_tokens": 256.0,
6
+ "avg_latency_s": 157.09,
7
+ "avg_peak_mem_gb": 17.18
8
+ }
results/element_analysis.json ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "efficientui_prune60": {
3
+ "n_samples": 50,
4
+ "avg_text_f1": 0.6962,
5
+ "avg_element_f1": 0.7658,
6
+ "avg_dom_depth": 4.8,
7
+ "avg_dom_nodes": 25.8,
8
+ "avg_css_properties": 48.2,
9
+ "avg_css_unique_props": 15.5,
10
+ "per_category_f1": {
11
+ "buttons": 0.8213,
12
+ "inputs": 0.8941,
13
+ "images": 0.845,
14
+ "links": 0.6323,
15
+ "headings": 0.5976,
16
+ "lists": 0.7519,
17
+ "tables": 0.96,
18
+ "forms": 0.98,
19
+ "nav": 0.7691,
20
+ "containers": 0.6164,
21
+ "text_inline": 0.5557
22
+ }
23
+ },
24
+ "efficientui_prune80": {
25
+ "n_samples": 50,
26
+ "avg_text_f1": 0.5292,
27
+ "avg_element_f1": 0.6945,
28
+ "avg_dom_depth": 4.0,
29
+ "avg_dom_nodes": 19.5,
30
+ "avg_css_properties": 34.2,
31
+ "avg_css_unique_props": 10.1,
32
+ "per_category_f1": {
33
+ "buttons": 0.82,
34
+ "inputs": 0.8382,
35
+ "images": 0.82,
36
+ "links": 0.5088,
37
+ "headings": 0.421,
38
+ "lists": 0.6778,
39
+ "tables": 0.96,
40
+ "forms": 0.98,
41
+ "nav": 0.736,
42
+ "containers": 0.4202,
43
+ "text_inline": 0.4574
44
+ }
45
+ },
46
+ "qwen3_full": {
47
+ "n_samples": 50,
48
+ "avg_text_f1": 1.0,
49
+ "avg_element_f1": 1.0,
50
+ "avg_dom_depth": 5.7,
51
+ "avg_dom_nodes": 43.6,
52
+ "avg_css_properties": 55.1,
53
+ "avg_css_unique_props": 19.6,
54
+ "per_category_f1": {
55
+ "buttons": 1.0,
56
+ "inputs": 1.0,
57
+ "images": 1.0,
58
+ "links": 1.0,
59
+ "headings": 1.0,
60
+ "lists": 1.0,
61
+ "tables": 1.0,
62
+ "forms": 1.0,
63
+ "nav": 1.0,
64
+ "containers": 1.0,
65
+ "text_inline": 1.0
66
+ }
67
+ },
68
+ "qwen3_res_1003520": {
69
+ "n_samples": 50,
70
+ "avg_text_f1": 0.8869,
71
+ "avg_element_f1": 0.8835,
72
+ "avg_dom_depth": 5.6,
73
+ "avg_dom_nodes": 40.0,
74
+ "avg_css_properties": 59.7,
75
+ "avg_css_unique_props": 20.3,
76
+ "per_category_f1": {
77
+ "buttons": 0.9048,
78
+ "inputs": 0.9533,
79
+ "images": 0.934,
80
+ "links": 0.8491,
81
+ "headings": 0.7725,
82
+ "lists": 0.8799,
83
+ "tables": 0.98,
84
+ "forms": 0.98,
85
+ "nav": 0.8391,
86
+ "containers": 0.8288,
87
+ "text_inline": 0.7974
88
+ }
89
+ },
90
+ "qwen3_res_230400": {
91
+ "n_samples": 50,
92
+ "avg_text_f1": 0.6244,
93
+ "avg_element_f1": 0.7481,
94
+ "avg_dom_depth": 4.6,
95
+ "avg_dom_nodes": 21.8,
96
+ "avg_css_properties": 32.0,
97
+ "avg_css_unique_props": 12.6,
98
+ "per_category_f1": {
99
+ "buttons": 0.8433,
100
+ "inputs": 0.8585,
101
+ "images": 0.836,
102
+ "links": 0.5918,
103
+ "headings": 0.5942,
104
+ "lists": 0.7042,
105
+ "tables": 0.96,
106
+ "forms": 0.96,
107
+ "nav": 0.732,
108
+ "containers": 0.5961,
109
+ "text_inline": 0.5526
110
+ }
111
+ },
112
+ "uipress_256": {
113
+ "n_samples": 50,
114
+ "avg_text_f1": 0.2091,
115
+ "avg_element_f1": 0.6371,
116
+ "avg_dom_depth": 3.9,
117
+ "avg_dom_nodes": 18.4,
118
+ "avg_css_properties": 0.1,
119
+ "avg_css_unique_props": 0.1,
120
+ "per_category_f1": {
121
+ "buttons": 0.74,
122
+ "inputs": 0.8,
123
+ "images": 0.7,
124
+ "links": 0.3995,
125
+ "headings": 0.4197,
126
+ "lists": 0.617,
127
+ "tables": 0.96,
128
+ "forms": 0.96,
129
+ "nav": 0.72,
130
+ "containers": 0.3521,
131
+ "text_inline": 0.3395
132
+ }
133
+ },
134
+ "visionzip_128": {
135
+ "n_samples": 50,
136
+ "avg_text_f1": 0.2804,
137
+ "avg_element_f1": 0.6619,
138
+ "avg_dom_depth": 3.6,
139
+ "avg_dom_nodes": 23.3,
140
+ "avg_css_properties": 23.0,
141
+ "avg_css_unique_props": 8.3,
142
+ "per_category_f1": {
143
+ "buttons": 0.75,
144
+ "inputs": 0.8,
145
+ "images": 0.78,
146
+ "links": 0.437,
147
+ "headings": 0.3963,
148
+ "lists": 0.68,
149
+ "tables": 0.96,
150
+ "forms": 0.94,
151
+ "nav": 0.7533,
152
+ "containers": 0.4076,
153
+ "text_inline": 0.3763
154
+ }
155
+ },
156
+ "visionzip_256": {
157
+ "n_samples": 50,
158
+ "avg_text_f1": 0.3574,
159
+ "avg_element_f1": 0.6661,
160
+ "avg_dom_depth": 3.3,
161
+ "avg_dom_nodes": 9.4,
162
+ "avg_css_properties": 13.8,
163
+ "avg_css_unique_props": 6.1,
164
+ "per_category_f1": {
165
+ "buttons": 0.8,
166
+ "inputs": 0.78,
167
+ "images": 0.8,
168
+ "links": 0.4269,
169
+ "headings": 0.3264,
170
+ "lists": 0.715,
171
+ "tables": 0.96,
172
+ "forms": 0.96,
173
+ "nav": 0.74,
174
+ "containers": 0.3956,
175
+ "text_inline": 0.4234
176
+ }
177
+ },
178
+ "visionzip_64": {
179
+ "n_samples": 50,
180
+ "avg_text_f1": 0.1966,
181
+ "avg_element_f1": 0.6567,
182
+ "avg_dom_depth": 2.9,
183
+ "avg_dom_nodes": 12.4,
184
+ "avg_css_properties": 11.1,
185
+ "avg_css_unique_props": 5.5,
186
+ "per_category_f1": {
187
+ "buttons": 0.78,
188
+ "inputs": 0.82,
189
+ "images": 0.8,
190
+ "links": 0.3603,
191
+ "headings": 0.3433,
192
+ "lists": 0.68,
193
+ "tables": 0.96,
194
+ "forms": 0.96,
195
+ "nav": 0.74,
196
+ "containers": 0.3583,
197
+ "text_inline": 0.4214
198
+ }
199
+ }
200
+ }
scripts/eval_all.py CHANGED
@@ -43,6 +43,13 @@ from tqdm import tqdm
43
  PROJECT_ROOT = Path(__file__).parent.parent
44
  sys.path.insert(0, str(PROJECT_ROOT))
45
 
 
 
 
 
 
 
 
46
  UI2CODE_PROMPT = (
47
  "Convert this webpage screenshot to HTML code. "
48
  "Generate a complete, self-contained HTML file with inline CSS. "
@@ -178,42 +185,107 @@ class VisionZipMethod:
178
  self._install_hook()
179
 
180
  def _install_hook(self):
181
- """Hook into model.visual to compress output tokens."""
182
- orig_visual = self.model.visual
183
-
184
- def hooked_visual(hidden_states, grid_thw):
185
- # Run original visual encoder
186
- embeds = orig_visual(hidden_states, grid_thw=grid_thw)
187
- # Compress each image's tokens
188
- compressed_list = []
189
- offset = 0
190
- for i in range(grid_thw.shape[0]):
191
- t, h, w = grid_thw[i].tolist()
192
- n = int(t) * int(h) * int(w)
193
- img_tokens = embeds[offset:offset + n] # [n, D]
194
- offset += n
195
-
196
- selected = self._select_tokens(img_tokens)
197
- compressed_list.append(selected)
198
-
199
- self._compressed_embeds = torch.cat(compressed_list, dim=0)
200
- # Build new grid_thw: treat as 1D sequence
201
- k = self.keep_tokens
202
- sqrt_k = int(k ** 0.5)
203
- # Find closest factorization
204
- for h in range(sqrt_k, 0, -1):
205
- if k % h == 0:
206
- w = k // h
207
- break
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  else:
209
- h, w = k, 1
210
- self._new_grid_thw = torch.tensor(
211
- [[1, h, w]] * grid_thw.shape[0],
212
- device=grid_thw.device, dtype=grid_thw.dtype,
213
- )
214
- return self._compressed_embeds
 
 
 
 
 
 
215
 
216
- self.model.visual = hooked_visual
 
217
 
218
  def _select_tokens(self, tokens):
219
  """Select dominant + contextual tokens based on L2 norm (proxy for attention)."""
@@ -264,33 +336,7 @@ class VisionZipMethod:
264
  torch.cuda.reset_peak_memory_stats()
265
  t0 = time.time()
266
 
267
- # We need to handle the mismatch between expected and actual
268
- # visual token count. Override image_grid_thw after visual processing.
269
- orig_grid = inputs.get("image_grid_thw", None)
270
-
271
  with torch.no_grad():
272
- # Process pixel_values through visual encoder (hook will compress)
273
- pixel_values = inputs.get("pixel_values")
274
- if pixel_values is not None:
275
- visual_out = self.model.visual(
276
- pixel_values, grid_thw=orig_grid,
277
- )
278
- # Now rebuild inputs with compressed token count
279
- n_compressed = visual_out.shape[0]
280
- new_grid = self._new_grid_thw
281
-
282
- # Rebuild input_ids with correct number of image tokens
283
- input_ids = inputs["input_ids"][0].tolist()
284
- img_positions = [i for i, t in enumerate(input_ids) if t == IMAGE_TOKEN_ID]
285
- if img_positions:
286
- before = input_ids[:img_positions[0]]
287
- after = input_ids[img_positions[-1] + 1:]
288
- new_ids = before + [IMAGE_TOKEN_ID] * n_compressed + after
289
- inputs["input_ids"] = torch.tensor([new_ids], device=self.model.device)
290
- inputs["image_grid_thw"] = new_grid
291
- if "attention_mask" in inputs:
292
- inputs["attention_mask"] = torch.ones_like(inputs["input_ids"])
293
-
294
  out = self.model.generate(
295
  **inputs, max_new_tokens=4096,
296
  temperature=0.1, do_sample=True, top_p=0.9,
@@ -364,58 +410,110 @@ class EfficientUIMethod:
364
  return importance
365
 
366
  def _install_hook(self):
367
- """Hook visual encoder to prune tokens based on element importance."""
368
- self._current_image = None
369
- orig_visual = self.model.visual
370
-
371
- def hooked_visual(hidden_states, grid_thw):
372
- embeds = orig_visual(hidden_states, grid_thw=grid_thw)
373
- if self._current_image is None:
374
- return embeds
375
-
376
- compressed_list = []
377
- offset = 0
378
- for i in range(grid_thw.shape[0]):
379
- t, h, w = grid_thw[i].tolist()
380
- t, h, w = int(t), int(h), int(w)
381
- n = t * h * w
382
- img_tokens = embeds[offset:offset + n]
383
- offset += n
384
-
385
- # Compute element-based importance
386
- importance = self._compute_element_mask(
387
- self._current_image, h, w,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
388
  )
389
- importance_flat = torch.tensor(
390
- importance.flatten(), device=img_tokens.device,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391
  )
392
 
393
- # Keep top (1 - prune_ratio) tokens
394
- n_keep = max(int(n * (1 - self.prune_ratio)), 16)
395
- _, top_idx = importance_flat.topk(n_keep)
396
- top_idx = top_idx.sort().values
397
- selected = img_tokens[top_idx]
398
- compressed_list.append(selected)
399
-
400
- self._compressed = torch.cat(compressed_list, dim=0)
401
- self._n_kept = sum(s.shape[0] for s in compressed_list)
402
-
403
- # Compute new grid
404
- n_kept = compressed_list[0].shape[0]
405
- sqrt_n = int(n_kept ** 0.5)
406
- for h in range(sqrt_n, 0, -1):
407
- if n_kept % h == 0:
408
- w = n_kept // h
409
- break
410
  else:
411
- h, w = n_kept, 1
412
- self._new_grid = torch.tensor(
413
- [[1, h, w]] * grid_thw.shape[0],
414
- device=grid_thw.device, dtype=grid_thw.dtype,
415
- )
416
- return self._compressed
 
 
417
 
418
- self.model.visual = hooked_visual
 
 
 
 
 
419
 
420
  def generate(self, image):
421
  self._current_image = image
@@ -432,24 +530,6 @@ class EfficientUIMethod:
432
  t0 = time.time()
433
 
434
  with torch.no_grad():
435
- pixel_values = inputs.get("pixel_values")
436
- orig_grid = inputs.get("image_grid_thw")
437
-
438
- if pixel_values is not None:
439
- visual_out = self.model.visual(pixel_values, grid_thw=orig_grid)
440
- n_compressed = visual_out.shape[0]
441
-
442
- input_ids = inputs["input_ids"][0].tolist()
443
- img_pos = [i for i, t in enumerate(input_ids) if t == IMAGE_TOKEN_ID]
444
- if img_pos:
445
- before = input_ids[:img_pos[0]]
446
- after = input_ids[img_pos[-1] + 1:]
447
- new_ids = before + [IMAGE_TOKEN_ID] * n_compressed + after
448
- inputs["input_ids"] = torch.tensor([new_ids], device=self.model.device)
449
- inputs["image_grid_thw"] = self._new_grid
450
- if "attention_mask" in inputs:
451
- inputs["attention_mask"] = torch.ones_like(inputs["input_ids"])
452
-
453
  out = self.model.generate(
454
  **inputs, max_new_tokens=4096,
455
  temperature=0.1, do_sample=True, top_p=0.9,
@@ -488,7 +568,7 @@ class UIPressMethod:
488
  )
489
 
490
  # Load compressor
491
- llm_hidden = self.model.config.hidden_size
492
  self.compressor = OpticalCompressor(
493
  hidden_dim=llm_hidden, target_tokens=target_tokens,
494
  ).to(self.model.device, torch.bfloat16).eval()
@@ -496,7 +576,11 @@ class UIPressMethod:
496
  ckpt = torch.load(checkpoint, map_location=self.model.device)
497
  comp_state = ckpt.get("compressor", ckpt)
498
  clean_state = {k.replace("module.", ""): v for k, v in comp_state.items()}
499
- self.compressor.load_state_dict(clean_state)
 
 
 
 
500
 
501
  # Load LoRA if present
502
  if "lora" in ckpt:
@@ -509,16 +593,95 @@ class UIPressMethod:
509
  self._install_hook()
510
 
511
  def _install_hook(self):
512
- orig_visual = self.model.visual
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
513
 
514
- def hooked_visual(hidden_states, grid_thw):
515
- embeds = orig_visual(hidden_states, grid_thw=grid_thw)
516
- with torch.no_grad():
517
- compressed, new_grid = self.compressor(embeds, grid_thw)
518
- self._new_grid = new_grid
519
- return compressed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
520
 
521
- self.model.visual = hooked_visual
 
522
 
523
  def generate(self, image):
524
  messages = [{"role": "user", "content": [
@@ -534,24 +697,6 @@ class UIPressMethod:
534
  t0 = time.time()
535
 
536
  with torch.no_grad():
537
- pixel_values = inputs.get("pixel_values")
538
- orig_grid = inputs.get("image_grid_thw")
539
-
540
- if pixel_values is not None:
541
- visual_out = self.model.visual(pixel_values, grid_thw=orig_grid)
542
- n_compressed = visual_out.shape[0]
543
-
544
- input_ids = inputs["input_ids"][0].tolist()
545
- img_pos = [i for i, t in enumerate(input_ids) if t == IMAGE_TOKEN_ID]
546
- if img_pos:
547
- before = input_ids[:img_pos[0]]
548
- after = input_ids[img_pos[-1] + 1:]
549
- new_ids = before + [IMAGE_TOKEN_ID] * n_compressed + after
550
- inputs["input_ids"] = torch.tensor([new_ids], device=self.model.device)
551
- inputs["image_grid_thw"] = self._new_grid
552
- if "attention_mask" in inputs:
553
- inputs["attention_mask"] = torch.ones_like(inputs["input_ids"])
554
-
555
  out = self.model.generate(
556
  **inputs, max_new_tokens=4096,
557
  temperature=0.1, do_sample=True, top_p=0.9,
 
43
  PROJECT_ROOT = Path(__file__).parent.parent
44
  sys.path.insert(0, str(PROJECT_ROOT))
45
 
46
+ from models.qwen3_vl_compat import get_visual_module, set_visual_module
47
+
48
+
49
+ def _llm_hidden(model):
50
+ cfg = model.config
51
+ return cfg.text_config.hidden_size if hasattr(cfg, "text_config") else cfg.hidden_size
52
+
53
  UI2CODE_PROMPT = (
54
  "Convert this webpage screenshot to HTML code. "
55
  "Generate a complete, self-contained HTML file with inline CSS. "
 
185
  self._install_hook()
186
 
187
  def _install_hook(self):
188
+ """Patch Qwen3VLModel.forward to inject compression and fix masked_scatter dimension."""
189
+ self_ = self
190
+
191
+ def hooked_forward(self, input_ids=None, attention_mask=None, position_ids=None,
192
+ past_key_values=None, inputs_embeds=None,
193
+ pixel_values=None, pixel_values_videos=None,
194
+ image_grid_thw=None, video_grid_thw=None,
195
+ mm_token_type_ids=None, cache_position=None, **kwargs):
196
+ if pixel_values is not None and image_grid_thw is not None:
197
+ vo = self.get_image_features(pixel_values, image_grid_thw, return_dict=True)
198
+ pooler = vo.pooler_output
199
+ flat = torch.cat(pooler, dim=0) if isinstance(pooler, (list, tuple)) else pooler
200
+
201
+ # Step 2: compute LLM grid and compress
202
+ sms = self_._get_spatial_merge_size()
203
+ gl = image_grid_thw.clone()
204
+ gl[:, 1] = gl[:, 1] // sms
205
+ gl[:, 2] = gl[:, 2] // sms
206
+
207
+ parts, offset = [], 0
208
+ for i in range(image_grid_thw.shape[0]):
209
+ t, h, w = gl[i].tolist()
210
+ n = int(t) * int(h) * int(w)
211
+ tok = flat[offset:offset + n]
212
+ offset += n
213
+ parts.append(self_._select_tokens(tok))
214
+
215
+ comp = torch.cat(parts, dim=0)
216
+
217
+ # Step 3: new grid_thw for position IDs
218
+ k = self_.keep_tokens
219
+ sq = int(k ** 0.5)
220
+ for hh in range(sq, 0, -1):
221
+ if k % hh == 0:
222
+ ww = k // hh
223
+ break
224
+ else:
225
+ hh, ww = k, 1
226
+ # compute_3d_position_ids expects pre-merge grid, so scale back.
227
+ new_grid = torch.tensor(
228
+ [[1, hh * sms, ww * sms]] * image_grid_thw.shape[0],
229
+ device=image_grid_thw.device, dtype=image_grid_thw.dtype,
230
+ )
231
+ self_._new_grid_thw = new_grid
232
+
233
+ # Step 4: build inputs_embeds and substitute image positions
234
+ if inputs_embeds is None:
235
+ inputs_embeds = self.get_input_embeddings()(input_ids)
236
+
237
+ B, S, D = inputs_embeds.shape
238
+ flat_embeds = inputs_embeds.reshape(B * S, D).contiguous()
239
+ image_mask_2d = (input_ids == self.config.image_token_id) # [B, S]
240
+ image_mask_flat = image_mask_2d.reshape(B * S) # [B*S]
241
+ flat_indices = image_mask_flat.nonzero(as_tuple=True)[0] # [N_orig]
242
+ n_comp = comp.shape[0]
243
+ flat_indices = flat_indices[:n_comp]
244
+
245
+ flat_embeds[flat_indices] = comp.to(inputs_embeds.dtype)
246
+ inputs_embeds = flat_embeds.view(B, S, D)
247
+
248
+ # Mark only injected compressed positions as image tokens for RoPE.
249
+ rope_mm_token_type_ids = torch.zeros_like(input_ids, dtype=torch.int)
250
+ batch_idx = flat_indices // S
251
+ seq_idx = flat_indices % S
252
+ rope_mm_token_type_ids[batch_idx, seq_idx] = 1
253
+
254
+ # Step 5: compute position_ids with new_grid
255
+ position_ids = self.compute_3d_position_ids(
256
+ input_ids=input_ids, image_grid_thw=new_grid,
257
+ video_grid_thw=video_grid_thw, inputs_embeds=inputs_embeds,
258
+ attention_mask=attention_mask, past_key_values=past_key_values,
259
+ mm_token_type_ids=rope_mm_token_type_ids,
260
+ )
261
+
262
+ # Step 6: call language_model
263
+ outputs = self.language_model(
264
+ input_ids=None, position_ids=position_ids,
265
+ attention_mask=attention_mask, past_key_values=past_key_values,
266
+ inputs_embeds=inputs_embeds, cache_position=cache_position,
267
+ visual_pos_masks=None, deepstack_visual_embeds=None, **kwargs,
268
+ )
269
+ from transformers.models.qwen3_vl.modeling_qwen3_vl import Qwen3VLModelOutputWithPast
270
+ return Qwen3VLModelOutputWithPast(
271
+ **outputs, rope_deltas=getattr(self, 'rope_deltas', None)
272
+ )
273
  else:
274
+ return self_._orig_fwd(
275
+ input_ids=input_ids, attention_mask=attention_mask,
276
+ position_ids=position_ids, past_key_values=past_key_values,
277
+ inputs_embeds=inputs_embeds, pixel_values=pixel_values,
278
+ pixel_values_videos=pixel_values_videos,
279
+ image_grid_thw=image_grid_thw, video_grid_thw=video_grid_thw,
280
+ mm_token_type_ids=mm_token_type_ids, cache_position=cache_position, **kwargs
281
+ )
282
+
283
+ import types
284
+ self._orig_fwd = self.model.model.forward
285
+ self.model.model.forward = types.MethodType(hooked_forward, self.model.model)
286
 
287
+ def _get_spatial_merge_size(self):
288
+ return self.model.model.visual.spatial_merge_size
289
 
290
  def _select_tokens(self, tokens):
291
  """Select dominant + contextual tokens based on L2 norm (proxy for attention)."""
 
336
  torch.cuda.reset_peak_memory_stats()
337
  t0 = time.time()
338
 
 
 
 
 
339
  with torch.no_grad():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
340
  out = self.model.generate(
341
  **inputs, max_new_tokens=4096,
342
  temperature=0.1, do_sample=True, top_p=0.9,
 
410
  return importance
411
 
412
  def _install_hook(self):
413
+ """Patch Qwen3VLModel.forward to prune tokens by element importance."""
414
+ self_ = self
415
+
416
+ def hooked_forward(self, input_ids=None, attention_mask=None, position_ids=None,
417
+ past_key_values=None, inputs_embeds=None,
418
+ pixel_values=None, pixel_values_videos=None,
419
+ image_grid_thw=None, video_grid_thw=None,
420
+ mm_token_type_ids=None, cache_position=None, **kwargs):
421
+ if pixel_values is not None and image_grid_thw is not None:
422
+ vo = self.get_image_features(pixel_values, image_grid_thw, return_dict=True)
423
+ pooler = vo.pooler_output
424
+ flat = torch.cat(pooler, dim=0) if isinstance(pooler, (list, tuple)) else pooler
425
+
426
+ sms = self_._get_spatial_merge_size()
427
+ gl = image_grid_thw.clone()
428
+ gl[:, 1] = gl[:, 1] // sms
429
+ gl[:, 2] = gl[:, 2] // sms
430
+
431
+ parts, offset = [], 0
432
+ for i in range(image_grid_thw.shape[0]):
433
+ t, h, w = gl[i].tolist()
434
+ n = int(t) * int(h) * int(w)
435
+ tok = flat[offset:offset + n]
436
+ offset += n
437
+ cur_img = self_._current_image
438
+ if cur_img is None:
439
+ cur_img = Image.new("RGB", (224, 224))
440
+ imp = self_._compute_element_mask(cur_img, int(h), int(w))
441
+ imp_flat = torch.tensor(imp.flatten(), device=tok.device)
442
+ n_keep = max(int(n * (1 - self_.prune_ratio)), 16)
443
+ _, top_idx = imp_flat.topk(n_keep)
444
+ top_idx, _ = top_idx.sort()
445
+ parts.append(tok[top_idx])
446
+
447
+ comp = torch.cat(parts, dim=0)
448
+ self_._n_kept = int(comp.shape[0])
449
+ nk = parts[0].shape[0]
450
+ sq = int(nk ** 0.5)
451
+ for hh in range(sq, 0, -1):
452
+ if nk % hh == 0:
453
+ ww = nk // hh
454
+ break
455
+ else:
456
+ hh, ww = nk, 1
457
+ # compute_3d_position_ids expects pre-merge grid, so scale back.
458
+ new_grid = torch.tensor(
459
+ [[1, hh * sms, ww * sms]] * image_grid_thw.shape[0],
460
+ device=image_grid_thw.device, dtype=image_grid_thw.dtype,
461
  )
462
+ self_._new_grid = new_grid
463
+
464
+ if inputs_embeds is None:
465
+ inputs_embeds = self.get_input_embeddings()(input_ids)
466
+
467
+ B, S, D = inputs_embeds.shape
468
+ flat_embeds = inputs_embeds.reshape(B * S, D).contiguous()
469
+ image_mask_2d = (input_ids == self.config.image_token_id) # [B, S]
470
+ image_mask_flat = image_mask_2d.reshape(B * S) # [B*S]
471
+ flat_indices = image_mask_flat.nonzero(as_tuple=True)[0] # [N_orig]
472
+ n_comp = comp.shape[0]
473
+ flat_indices = flat_indices[:n_comp]
474
+
475
+ flat_embeds[flat_indices] = comp.to(inputs_embeds.dtype)
476
+ inputs_embeds = flat_embeds.view(B, S, D)
477
+
478
+ # Mark only injected compressed positions as image tokens for RoPE.
479
+ rope_mm_token_type_ids = torch.zeros_like(input_ids, dtype=torch.int)
480
+ batch_idx = flat_indices // S
481
+ seq_idx = flat_indices % S
482
+ rope_mm_token_type_ids[batch_idx, seq_idx] = 1
483
+
484
+ position_ids = self.compute_3d_position_ids(
485
+ input_ids=input_ids, image_grid_thw=new_grid,
486
+ video_grid_thw=video_grid_thw, inputs_embeds=inputs_embeds,
487
+ attention_mask=attention_mask, past_key_values=past_key_values,
488
+ mm_token_type_ids=rope_mm_token_type_ids,
489
  )
490
 
491
+ outputs = self.language_model(
492
+ input_ids=None, position_ids=position_ids,
493
+ attention_mask=attention_mask, past_key_values=past_key_values,
494
+ inputs_embeds=inputs_embeds, cache_position=cache_position,
495
+ visual_pos_masks=None, deepstack_visual_embeds=None, **kwargs,
496
+ )
497
+ from transformers.models.qwen3_vl.modeling_qwen3_vl import Qwen3VLModelOutputWithPast
498
+ return Qwen3VLModelOutputWithPast(
499
+ **outputs, rope_deltas=getattr(self, 'rope_deltas', None)
500
+ )
 
 
 
 
 
 
 
501
  else:
502
+ return self_._orig_fwd(
503
+ input_ids=input_ids, attention_mask=attention_mask,
504
+ position_ids=position_ids, past_key_values=past_key_values,
505
+ inputs_embeds=inputs_embeds, pixel_values=pixel_values,
506
+ pixel_values_videos=pixel_values_videos,
507
+ image_grid_thw=image_grid_thw, video_grid_thw=video_grid_thw,
508
+ mm_token_type_ids=mm_token_type_ids, cache_position=cache_position, **kwargs
509
+ )
510
 
511
+ import types
512
+ self._orig_fwd = self.model.model.forward
513
+ self.model.model.forward = types.MethodType(hooked_forward, self.model.model)
514
+
515
+ def _get_spatial_merge_size(self):
516
+ return self.model.model.visual.spatial_merge_size
517
 
518
  def generate(self, image):
519
  self._current_image = image
 
530
  t0 = time.time()
531
 
532
  with torch.no_grad():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
533
  out = self.model.generate(
534
  **inputs, max_new_tokens=4096,
535
  temperature=0.1, do_sample=True, top_p=0.9,
 
568
  )
569
 
570
  # Load compressor
571
+ llm_hidden = _llm_hidden(self.model)
572
  self.compressor = OpticalCompressor(
573
  hidden_dim=llm_hidden, target_tokens=target_tokens,
574
  ).to(self.model.device, torch.bfloat16).eval()
 
576
  ckpt = torch.load(checkpoint, map_location=self.model.device)
577
  comp_state = ckpt.get("compressor", ckpt)
578
  clean_state = {k.replace("module.", ""): v for k, v in comp_state.items()}
579
+ missing, unexpected = self.compressor.load_state_dict(clean_state, strict=False)
580
+ if missing:
581
+ print(f" Warning: missing compressor keys: {missing}")
582
+ if unexpected:
583
+ print(f" Warning: unexpected compressor keys: {unexpected}")
584
 
585
  # Load LoRA if present
586
  if "lora" in ckpt:
 
593
  self._install_hook()
594
 
595
  def _install_hook(self):
596
+ """Patch Qwen3VLModel.forward to apply OpticalCompressor compression."""
597
+ self_ = self
598
+
599
+ def hooked_forward(self, input_ids=None, attention_mask=None, position_ids=None,
600
+ past_key_values=None, inputs_embeds=None,
601
+ pixel_values=None, pixel_values_videos=None,
602
+ image_grid_thw=None, video_grid_thw=None,
603
+ mm_token_type_ids=None, cache_position=None, **kwargs):
604
+ if pixel_values is not None and image_grid_thw is not None:
605
+ vo = self.get_image_features(pixel_values, image_grid_thw, return_dict=True)
606
+ pooler = vo.pooler_output
607
+ flat = torch.cat(pooler, dim=0) if isinstance(pooler, (list, tuple)) else pooler
608
+
609
+ sms = self_._get_spatial_merge_size()
610
+ gl = image_grid_thw.clone()
611
+ gl[:, 1] = gl[:, 1] // sms
612
+ gl[:, 2] = gl[:, 2] // sms
613
+
614
+ num_images = image_grid_thw.shape[0]
615
+ parts, new_grids_llm, offset = [], [], 0
616
+ for i in range(num_images):
617
+ t, h, w = gl[i].tolist()
618
+ n = int(t) * int(h) * int(w)
619
+ tok = flat[offset:offset + n]
620
+ offset += n
621
+ comp, new_grid_img = self_.compressor(tok.unsqueeze(0), gl[i:i+1])
622
+ parts.append(comp.squeeze(0))
623
+ new_grids_llm.append(new_grid_img.squeeze(0))
624
+
625
+ comp = torch.cat(parts, dim=0)
626
+ new_grid_llm = torch.stack(new_grids_llm, dim=0)
627
+ new_grid = new_grid_llm.clone()
628
+ new_grid[:, 1] = new_grid[:, 1] * sms
629
+ new_grid[:, 2] = new_grid[:, 2] * sms
630
+ self_._new_grid = new_grid
631
+
632
+ if inputs_embeds is None:
633
+ inputs_embeds = self.get_input_embeddings()(input_ids)
634
+
635
+ B, S, D = inputs_embeds.shape
636
+ flat_embeds = inputs_embeds.reshape(B * S, D).contiguous()
637
+ image_mask_2d = (input_ids == self.config.image_token_id) # [B, S]
638
+ image_mask_flat = image_mask_2d.reshape(B * S) # [B*S]
639
+ flat_indices = image_mask_flat.nonzero(as_tuple=True)[0] # [N_orig]
640
+ n_comp = comp.shape[0]
641
+ flat_indices = flat_indices[:n_comp]
642
+
643
+ flat_embeds[flat_indices] = comp.to(inputs_embeds.dtype)
644
+ inputs_embeds = flat_embeds.view(B, S, D)
645
+
646
+ # Mark only injected compressed positions as image tokens for RoPE.
647
+ rope_mm_token_type_ids = torch.zeros_like(input_ids, dtype=torch.int)
648
+ batch_idx = flat_indices // S
649
+ seq_idx = flat_indices % S
650
+ rope_mm_token_type_ids[batch_idx, seq_idx] = 1
651
+
652
+ position_ids = self.compute_3d_position_ids(
653
+ input_ids=input_ids, image_grid_thw=new_grid,
654
+ video_grid_thw=video_grid_thw, inputs_embeds=inputs_embeds,
655
+ attention_mask=attention_mask, past_key_values=past_key_values,
656
+ mm_token_type_ids=rope_mm_token_type_ids,
657
+ )
658
 
659
+ outputs = self.language_model(
660
+ input_ids=None, position_ids=position_ids,
661
+ attention_mask=attention_mask, past_key_values=past_key_values,
662
+ inputs_embeds=inputs_embeds, cache_position=cache_position,
663
+ visual_pos_masks=None, deepstack_visual_embeds=None, **kwargs,
664
+ )
665
+ from transformers.models.qwen3_vl.modeling_qwen3_vl import Qwen3VLModelOutputWithPast
666
+ return Qwen3VLModelOutputWithPast(
667
+ **outputs, rope_deltas=getattr(self, 'rope_deltas', None)
668
+ )
669
+ else:
670
+ return self_._orig_fwd(
671
+ input_ids=input_ids, attention_mask=attention_mask,
672
+ position_ids=position_ids, past_key_values=past_key_values,
673
+ inputs_embeds=inputs_embeds, pixel_values=pixel_values,
674
+ pixel_values_videos=pixel_values_videos,
675
+ image_grid_thw=image_grid_thw, video_grid_thw=video_grid_thw,
676
+ mm_token_type_ids=mm_token_type_ids, cache_position=cache_position, **kwargs
677
+ )
678
+
679
+ import types
680
+ self._orig_fwd = self.model.model.forward
681
+ self.model.model.forward = types.MethodType(hooked_forward, self.model.model)
682
 
683
+ def _get_spatial_merge_size(self):
684
+ return self.model.model.visual.spatial_merge_size
685
 
686
  def generate(self, image):
687
  messages = [{"role": "user", "content": [
 
697
  t0 = time.time()
698
 
699
  with torch.no_grad():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
700
  out = self.model.generate(
701
  **inputs, max_new_tokens=4096,
702
  temperature=0.1, do_sample=True, top_p=0.9,
scripts/step_case_study.py ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Case Study: Generate side-by-side visual comparisons.
3
+ Selects representative examples and creates HTML comparison pages.
4
+
5
+ Usage:
6
+ python scripts/step_case_study.py
7
+ """
8
+
9
+ import json
10
+ import os
11
+ import sys
12
+ from pathlib import Path
13
+
14
+ import numpy as np
15
+ from PIL import Image
16
+
17
+ PROJECT_ROOT = Path(__file__).parent.parent
18
+ sys.path.insert(0, str(PROJECT_ROOT))
19
+
20
+ METHODS_TO_COMPARE = [
21
+ "deepseek_tiny",
22
+ "deepseek_base",
23
+ "deepseek_large",
24
+ "qwen3_256",
25
+ "qwen3_1k",
26
+ "qwen3_full",
27
+ ]
28
+
29
+ METHOD_LABELS = {
30
+ "deepseek_tiny": "DeepSeek-OCR tiny (73 tok)",
31
+ "deepseek_base": "DeepSeek-OCR base (273 tok)",
32
+ "deepseek_large": "DeepSeek-OCR large (421 tok)",
33
+ "qwen3_256": "Qwen3-VL 256 (722 tok)",
34
+ "qwen3_1k": "Qwen3-VL 1k (3043 tok)",
35
+ "qwen3_full": "Qwen3-VL full (6746 tok)",
36
+ }
37
+
38
+
39
+ def select_representative_samples(benchmark_dir, n=8):
40
+ """Select diverse, representative samples based on CLIP score variance."""
41
+ clips_by_sample = {}
42
+
43
+ for method in METHODS_TO_COMPARE:
44
+ clip_file = Path(benchmark_dir) / method / "clip_scores.json"
45
+ if not clip_file.exists():
46
+ continue
47
+ with open(clip_file) as f:
48
+ data = json.load(f)
49
+ per_sample = data.get("per_sample", {})
50
+ for sid, val in per_sample.items():
51
+ score = val.get("clip_score", val) if isinstance(val, dict) else float(val)
52
+ clips_by_sample.setdefault(sid, {})[method] = score
53
+
54
+ candidates = []
55
+ for sid, scores in clips_by_sample.items():
56
+ if len(scores) < 4:
57
+ continue
58
+ vals = list(scores.values())
59
+ candidates.append({
60
+ "id": sid,
61
+ "mean_clip": np.mean(vals),
62
+ "std_clip": np.std(vals),
63
+ "max_clip": max(vals),
64
+ "min_clip": min(vals),
65
+ "range": max(vals) - min(vals),
66
+ "scores": scores,
67
+ })
68
+
69
+ candidates.sort(key=lambda c: -c["range"])
70
+
71
+ selected = []
72
+ high_quality = [c for c in candidates if c["mean_clip"] > 0.85]
73
+ if high_quality:
74
+ selected.append(high_quality[0])
75
+
76
+ low_quality = [c for c in candidates if c["mean_clip"] < 0.65 and c not in selected]
77
+ if low_quality:
78
+ selected.append(low_quality[0])
79
+
80
+ high_variance = [c for c in candidates if c not in selected]
81
+ high_variance.sort(key=lambda c: -c["range"])
82
+ for c in high_variance[:3]:
83
+ if c not in selected:
84
+ selected.append(c)
85
+
86
+ mid_range = [c for c in candidates if 0.70 < c["mean_clip"] < 0.80 and c not in selected]
87
+ mid_range.sort(key=lambda c: -c["range"])
88
+ for c in mid_range[:3]:
89
+ if c not in selected:
90
+ selected.append(c)
91
+
92
+ return selected[:n]
93
+
94
+
95
+ def render_html_to_png(html_path, output_path, width=1280, height=1024):
96
+ """Render HTML to PNG screenshot."""
97
+ try:
98
+ from playwright.sync_api import sync_playwright
99
+ with sync_playwright() as p:
100
+ browser = p.chromium.launch(headless=True, args=['--no-sandbox', '--disable-gpu'])
101
+ page = browser.new_page(viewport={"width": width, "height": height})
102
+ page.goto(f"file://{html_path}", wait_until="networkidle", timeout=15000)
103
+ page.wait_for_timeout(500)
104
+ page.screenshot(path=str(output_path), full_page=False)
105
+ browser.close()
106
+ return True
107
+ except Exception as e:
108
+ print(f" Render failed: {e}")
109
+ return False
110
+
111
+
112
+ def generate_case_study_html(selected, benchmark_dir, ref_dir, output_dir):
113
+ """Generate an HTML page with side-by-side comparisons."""
114
+ output_dir = Path(output_dir)
115
+ output_dir.mkdir(parents=True, exist_ok=True)
116
+ images_dir = output_dir / "images"
117
+ images_dir.mkdir(exist_ok=True)
118
+
119
+ for sample in selected:
120
+ sid = sample["id"]
121
+ ref_src = Path(ref_dir) / f"{sid}.png"
122
+ if ref_src.exists():
123
+ ref_dst = images_dir / f"ref_{sid}.png"
124
+ if not ref_dst.exists():
125
+ img = Image.open(ref_src)
126
+ img.thumbnail((640, 800))
127
+ img.save(str(ref_dst))
128
+
129
+ for method in METHODS_TO_COMPARE:
130
+ html_path = Path(benchmark_dir) / method / "html_predictions" / f"{sid}.html"
131
+ render_path = images_dir / f"{method}_{sid}.png"
132
+ if html_path.exists() and not render_path.exists():
133
+ print(f" Rendering {method}/{sid}...")
134
+ ok = render_html_to_png(str(html_path.resolve()), str(render_path))
135
+ if ok:
136
+ img = Image.open(render_path)
137
+ img.thumbnail((640, 800))
138
+ img.save(str(render_path))
139
+
140
+ rows_html = []
141
+ for i, sample in enumerate(selected):
142
+ sid = sample["id"]
143
+ scores_str = " | ".join(
144
+ f"{METHOD_LABELS.get(m, m).split('(')[0].strip()}: {sample['scores'].get(m, 'N/A'):.3f}"
145
+ if isinstance(sample['scores'].get(m), float) else f"{m}: N/A"
146
+ for m in METHODS_TO_COMPARE
147
+ )
148
+
149
+ cells = [f'<td><img src="images/ref_{sid}.png" alt="ref"><br><b>Original</b></td>']
150
+ for method in METHODS_TO_COMPARE:
151
+ label = METHOD_LABELS.get(method, method)
152
+ clip = sample["scores"].get(method)
153
+ clip_str = f"CLIP: {clip:.3f}" if clip else "N/A"
154
+ img_file = f"images/{method}_{sid}.png"
155
+ cells.append(f'<td><img src="{img_file}" alt="{method}"><br><b>{label}</b><br>{clip_str}</td>')
156
+
157
+ row = f"""
158
+ <tr class="case-header">
159
+ <td colspan="{len(METHODS_TO_COMPARE) + 1}">
160
+ <b>Case {i+1}</b> (Sample ID: {sid}) — Mean CLIP: {sample['mean_clip']:.3f}, Range: {sample['range']:.3f}
161
+ </td>
162
+ </tr>
163
+ <tr class="case-images">
164
+ {''.join(cells)}
165
+ </tr>
166
+ """
167
+ rows_html.append(row)
168
+
169
+ html = f"""<!DOCTYPE html>
170
+ <html>
171
+ <head>
172
+ <title>UIPress Case Study</title>
173
+ <style>
174
+ body {{ font-family: 'Segoe UI', Arial, sans-serif; margin: 20px; background: #f5f5f5; }}
175
+ h1 {{ color: #333; }}
176
+ table {{ border-collapse: collapse; width: 100%; background: white; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }}
177
+ .case-header td {{ background: #2c3e50; color: white; padding: 10px 15px; font-size: 14px; }}
178
+ .case-images td {{ padding: 8px; text-align: center; vertical-align: top; border: 1px solid #ddd; font-size: 12px; }}
179
+ .case-images img {{ max-width: 200px; max-height: 300px; border: 1px solid #ccc; display: block; margin: 0 auto 5px; }}
180
+ b {{ display: block; margin-top: 3px; }}
181
+ </style>
182
+ </head>
183
+ <body>
184
+ <h1>UIPress: Visual Token Compression Case Study</h1>
185
+ <p>Side-by-side comparison of {len(selected)} representative examples across {len(METHODS_TO_COMPARE)} methods.</p>
186
+ <table>
187
+ {''.join(rows_html)}
188
+ </table>
189
+ </body>
190
+ </html>"""
191
+
192
+ output_file = output_dir / "case_study.html"
193
+ output_file.write_text(html)
194
+ print(f"Case study saved to {output_file}")
195
+
196
+ summary = {
197
+ "n_cases": len(selected),
198
+ "methods": METHODS_TO_COMPARE,
199
+ "cases": [{
200
+ "id": s["id"],
201
+ "mean_clip": round(s["mean_clip"], 4),
202
+ "clip_range": round(s["range"], 4),
203
+ "scores": {k: round(v, 4) for k, v in s["scores"].items()},
204
+ } for s in selected],
205
+ }
206
+ with open(output_dir / "case_study_summary.json", "w") as f:
207
+ json.dump(summary, f, indent=2)
208
+
209
+ return output_file
210
+
211
+
212
+ def main():
213
+ benchmark_dir = PROJECT_ROOT / "results" / "benchmark"
214
+ ref_dir = PROJECT_ROOT / "data" / "ref_screenshots"
215
+ output_dir = PROJECT_ROOT / "results" / "case_study"
216
+
217
+ print("Selecting representative samples...")
218
+ selected = select_representative_samples(str(benchmark_dir), n=8)
219
+
220
+ print(f"\nSelected {len(selected)} cases:")
221
+ for s in selected:
222
+ print(f" ID={s['id']}: mean_clip={s['mean_clip']:.3f}, range={s['range']:.3f}")
223
+
224
+ print("\nGenerating case study...")
225
+ output_file = generate_case_study_html(selected, str(benchmark_dir), str(ref_dir), str(output_dir))
226
+ print(f"\nDone! Open {output_file} in a browser to view.")
227
+
228
+
229
+ if __name__ == "__main__":
230
+ main()
scripts/step_clip_batch.py ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Batch CLIP scoring for all benchmark results.
3
+ Computes CLIP similarity between generated HTML screenshots and reference images.
4
+
5
+ Usage:
6
+ conda activate uipress-qwen
7
+ CUDA_VISIBLE_DEVICES=X PYTHONPATH=. python scripts/step_clip_batch.py
8
+ """
9
+
10
+ import os
11
+ os.environ["HF_ENDPOINT"] = os.environ.get("HF_ENDPOINT", "https://hf-mirror.com")
12
+ os.environ["HF_HOME"] = os.environ.get("HF_HOME", "/root/rivermind-data/huggingface")
13
+
14
+ import json
15
+ import sys
16
+ import tempfile
17
+ from pathlib import Path
18
+
19
+ import torch
20
+ from PIL import Image
21
+ from tqdm import tqdm
22
+
23
+ PROJECT_ROOT = Path(__file__).parent.parent
24
+
25
+
26
+ class CLIPScorer:
27
+ def __init__(self, device="cuda"):
28
+ import open_clip
29
+ self.device = device
30
+ self.model, _, self.preprocess = open_clip.create_model_and_transforms(
31
+ "ViT-B-32", pretrained="openai"
32
+ )
33
+ self.model = self.model.to(device).eval()
34
+
35
+ @torch.no_grad()
36
+ def score(self, img1, img2):
37
+ t1 = self.preprocess(img1).unsqueeze(0).to(self.device)
38
+ t2 = self.preprocess(img2).unsqueeze(0).to(self.device)
39
+ f1 = self.model.encode_image(t1)
40
+ f2 = self.model.encode_image(t2)
41
+ f1 = f1 / f1.norm(dim=-1, keepdim=True)
42
+ f2 = f2 / f2.norm(dim=-1, keepdim=True)
43
+ return float((f1 * f2).sum())
44
+
45
+
46
+ def render_html(html_path, output_path, width=1280, height=1024):
47
+ try:
48
+ from playwright.sync_api import sync_playwright
49
+ abs_path = os.path.abspath(html_path)
50
+ with sync_playwright() as p:
51
+ browser = p.chromium.launch(headless=True)
52
+ page = browser.new_page(viewport={"width": width, "height": height})
53
+ page.goto(f"file://{abs_path}", wait_until="networkidle", timeout=30000)
54
+ page.screenshot(path=output_path, full_page=False)
55
+ browser.close()
56
+ return True
57
+ except Exception as e:
58
+ try:
59
+ from selenium import webdriver
60
+ from selenium.webdriver.chrome.options import Options
61
+ opts = Options()
62
+ opts.add_argument("--headless")
63
+ opts.add_argument("--no-sandbox")
64
+ opts.add_argument(f"--window-size={width},{height}")
65
+ driver = webdriver.Chrome(options=opts)
66
+ driver.get(f"file://{os.path.abspath(html_path)}")
67
+ import time; time.sleep(2)
68
+ driver.save_screenshot(output_path)
69
+ driver.quit()
70
+ return True
71
+ except:
72
+ return False
73
+
74
+
75
+ def eval_method(method_dir, ref_dir, scorer, tmp_dir):
76
+ html_dir = Path(method_dir) / "html_predictions"
77
+ if not html_dir.exists():
78
+ return None
79
+
80
+ html_files = sorted(html_dir.glob("*.html"))
81
+ if not html_files:
82
+ return None
83
+
84
+ scores = {}
85
+ for hf in tqdm(html_files, desc=f"CLIP {html_dir.parent.name}"):
86
+ sid = hf.stem
87
+ ref_img_path = Path(ref_dir) / f"{sid}.png"
88
+ if not ref_img_path.exists():
89
+ continue
90
+
91
+ ref_img = Image.open(ref_img_path).convert("RGB")
92
+ pred_img_path = os.path.join(tmp_dir, f"{sid}.png")
93
+ ok = render_html(str(hf), pred_img_path)
94
+
95
+ if ok and os.path.exists(pred_img_path):
96
+ pred_img = Image.open(pred_img_path).convert("RGB")
97
+ clip = scorer.score(ref_img, pred_img)
98
+ else:
99
+ clip = 0.0
100
+ scores[sid] = clip
101
+
102
+ if not scores:
103
+ return None
104
+
105
+ vals = list(scores.values())
106
+ return {
107
+ "n": len(vals),
108
+ "avg_clip": round(sum(vals) / len(vals), 4),
109
+ "min_clip": round(min(vals), 4),
110
+ "max_clip": round(max(vals), 4),
111
+ "per_sample": {k: round(v, 4) for k, v in scores.items()},
112
+ }
113
+
114
+
115
+ def main():
116
+ import argparse
117
+ parser = argparse.ArgumentParser()
118
+ parser.add_argument("--benchmark_dir", default=str(PROJECT_ROOT / "results" / "benchmark"))
119
+ parser.add_argument("--ref_dir", default=str(PROJECT_ROOT / "data" / "ref_screenshots"))
120
+ parser.add_argument("--methods", nargs="*", default=None)
121
+ args = parser.parse_args()
122
+
123
+ bench_dir = Path(args.benchmark_dir)
124
+ ref_dir = Path(args.ref_dir)
125
+
126
+ if not ref_dir.exists():
127
+ print(f"Reference dir not found: {ref_dir}")
128
+ sys.exit(1)
129
+
130
+ scorer = CLIPScorer()
131
+ all_clip = {}
132
+
133
+ methods = args.methods or sorted(
134
+ d.name for d in bench_dir.iterdir()
135
+ if d.is_dir() and (d / "html_predictions").exists()
136
+ )
137
+
138
+ with tempfile.TemporaryDirectory() as tmp:
139
+ for method in methods:
140
+ method_dir = bench_dir / method
141
+ if not method_dir.exists():
142
+ continue
143
+ print(f"\n=== {method} ===")
144
+ result = eval_method(method_dir, ref_dir, scorer, tmp)
145
+ if result:
146
+ all_clip[method] = result
147
+ print(f" CLIP: {result['avg_clip']:.4f} (n={result['n']})")
148
+
149
+ clip_file = method_dir / "clip_scores.json"
150
+ with open(clip_file, "w") as f:
151
+ json.dump(result, f, indent=2)
152
+
153
+ agg_file = bench_dir / "all_clip_scores.json"
154
+ summary = {k: {kk: vv for kk, vv in v.items() if kk != "per_sample"}
155
+ for k, v in all_clip.items()}
156
+ with open(agg_file, "w") as f:
157
+ json.dump(summary, f, indent=2)
158
+
159
+ print(f"\n{'='*60}")
160
+ print(f"{'Method':<20} {'CLIP':>8} {'N':>5}")
161
+ print("-" * 40)
162
+ for k in sorted(summary, key=lambda x: summary[x]["avg_clip"], reverse=True):
163
+ v = summary[k]
164
+ print(f"{k:<20} {v['avg_clip']:>8.4f} {v['n']:>5}")
165
+ print(f"{'='*60}")
166
+ print(f"Saved to: {agg_file}")
167
+
168
+
169
+ if __name__ == "__main__":
170
+ main()
scripts/step_element_analysis.py ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Per-Element HTML Structure Analysis (Cross-Method Comparison)
3
+ ==============================================================
4
+ Analyzes generated HTML across all methods without requiring ground truth.
5
+ Uses the best-performing method (qwen3_1k) as reference baseline.
6
+
7
+ Metrics per method:
8
+ - DOM depth, node count, element type distribution
9
+ - CSS property count & diversity
10
+ - Text content F1 vs reference method
11
+ - Element recall/precision vs reference method
12
+ - Output token efficiency (quality per token)
13
+
14
+ Usage:
15
+ python scripts/step_element_analysis.py
16
+ """
17
+
18
+ import json
19
+ import re
20
+ import sys
21
+ from collections import Counter, defaultdict
22
+ from pathlib import Path
23
+
24
+ PROJECT_ROOT = Path(__file__).parent.parent
25
+ sys.path.insert(0, str(PROJECT_ROOT))
26
+
27
+ from bs4 import BeautifulSoup
28
+
29
+
30
+ TAG_GROUPS = {
31
+ "buttons": {"button"},
32
+ "inputs": {"input", "textarea", "select"},
33
+ "images": {"img", "svg", "picture"},
34
+ "links": {"a"},
35
+ "headings": {"h1", "h2", "h3", "h4", "h5", "h6"},
36
+ "lists": {"ul", "ol", "li"},
37
+ "tables": {"table", "tr", "td", "th"},
38
+ "forms": {"form"},
39
+ "nav": {"nav", "header", "footer", "aside"},
40
+ "containers": {"div", "section", "article", "main"},
41
+ "text_inline": {"p", "span", "label", "strong", "em", "b", "i"},
42
+ }
43
+
44
+
45
+ def extract_elements(html_str):
46
+ try:
47
+ soup = BeautifulSoup(html_str, "html.parser")
48
+ except Exception:
49
+ return {}
50
+ counts = {}
51
+ for category, tags in TAG_GROUPS.items():
52
+ counts[category] = sum(len(soup.find_all(tag)) for tag in tags)
53
+ counts["total_tags"] = len(soup.find_all(True))
54
+ return counts
55
+
56
+
57
+ def extract_css_props(html_str):
58
+ props = Counter()
59
+ for match in re.finditer(r'style\s*=\s*"([^"]*)"', html_str, re.IGNORECASE):
60
+ for prop in match.group(1).split(";"):
61
+ if ":" in prop:
62
+ name = prop.split(":")[0].strip().lower()
63
+ if name:
64
+ props[name] += 1
65
+ for match in re.finditer(r'<style[^>]*>(.*?)</style>', html_str, re.DOTALL | re.IGNORECASE):
66
+ for prop in re.findall(r'([\w-]+)\s*:', match.group(1)):
67
+ props[prop.lower()] += 1
68
+ return dict(props)
69
+
70
+
71
+ def extract_text(html_str):
72
+ try:
73
+ soup = BeautifulSoup(html_str, "html.parser")
74
+ for tag in soup(["script", "style", "meta", "link"]):
75
+ tag.decompose()
76
+ return soup.get_text(separator=" ", strip=True)
77
+ except Exception:
78
+ return ""
79
+
80
+
81
+ def dom_metrics(html_str):
82
+ try:
83
+ soup = BeautifulSoup(html_str, "html.parser")
84
+ except Exception:
85
+ return {"max_depth": 0, "total_nodes": 0}
86
+
87
+ max_depth = 0
88
+ stack = [(soup, 0)]
89
+ while stack:
90
+ el, d = stack.pop()
91
+ if d > max_depth:
92
+ max_depth = d
93
+ if d > 200:
94
+ continue
95
+ for c in el.children:
96
+ if hasattr(c, 'name') and c.name:
97
+ stack.append((c, d + 1))
98
+
99
+ return {
100
+ "max_depth": max_depth,
101
+ "total_nodes": len(soup.find_all(True)),
102
+ }
103
+
104
+
105
+ def char_f1(pred, ref):
106
+ if not pred and not ref:
107
+ return 1.0
108
+ if not pred or not ref:
109
+ return 0.0
110
+ pc, rc = Counter(pred.lower()), Counter(ref.lower())
111
+ common = sum((pc & rc).values())
112
+ if common == 0:
113
+ return 0.0
114
+ p = common / sum(pc.values())
115
+ r = common / sum(rc.values())
116
+ return 2 * p * r / (p + r)
117
+
118
+
119
+ def element_f1(pred_counts, ref_counts):
120
+ results = {}
121
+ for cat in TAG_GROUPS:
122
+ rn = ref_counts.get(cat, 0)
123
+ pn = pred_counts.get(cat, 0)
124
+ if rn == 0 and pn == 0:
125
+ results[cat] = 1.0
126
+ elif rn == 0 or pn == 0:
127
+ results[cat] = 0.0
128
+ else:
129
+ matched = min(pn, rn)
130
+ recall = matched / rn
131
+ precision = matched / pn
132
+ results[cat] = 2 * recall * precision / (recall + precision)
133
+ return results
134
+
135
+
136
+ def analyze_all(benchmark_dir, ref_method="qwen3_1k"):
137
+ bench = Path(benchmark_dir)
138
+ methods = sorted(d.name for d in bench.iterdir()
139
+ if d.is_dir() and (d / "html_predictions").exists())
140
+
141
+ if ref_method not in methods:
142
+ print(f"Reference method {ref_method} not found, using first: {methods[0]}")
143
+ ref_method = methods[0]
144
+
145
+ ref_dir = bench / ref_method / "html_predictions"
146
+ ref_htmls = {}
147
+ for f in sorted(ref_dir.glob("*.html")):
148
+ ref_htmls[f.stem] = f.read_text(encoding="utf-8", errors="ignore")
149
+
150
+ print(f"Reference: {ref_method} ({len(ref_htmls)} samples)")
151
+
152
+ ref_elements = {sid: extract_elements(h) for sid, h in ref_htmls.items()}
153
+ ref_texts = {sid: extract_text(h) for sid, h in ref_htmls.items()}
154
+ ref_css = {sid: extract_css_props(h) for sid, h in ref_htmls.items()}
155
+
156
+ all_results = {}
157
+
158
+ for method in methods:
159
+ html_dir = bench / method / "html_predictions"
160
+ pred_htmls = {}
161
+ for f in sorted(html_dir.glob("*.html")):
162
+ if f.stem in ref_htmls:
163
+ pred_htmls[f.stem] = f.read_text(encoding="utf-8", errors="ignore")
164
+
165
+ if not pred_htmls:
166
+ continue
167
+
168
+ text_f1s = []
169
+ dom_depths = []
170
+ dom_nodes = []
171
+ css_counts = []
172
+ css_unique = []
173
+ elem_f1s = defaultdict(list)
174
+ total_element_f1s = []
175
+
176
+ for sid, pred_html in pred_htmls.items():
177
+ pred_elem = extract_elements(pred_html)
178
+ ref_elem = ref_elements.get(sid, {})
179
+ pred_text = extract_text(pred_html)
180
+ ref_text = ref_texts.get(sid, "")
181
+ pred_css = extract_css_props(pred_html)
182
+ dm = dom_metrics(pred_html)
183
+
184
+ text_f1s.append(char_f1(pred_text, ref_text))
185
+ dom_depths.append(dm["max_depth"])
186
+ dom_nodes.append(dm["total_nodes"])
187
+ css_counts.append(sum(pred_css.values()))
188
+ css_unique.append(len(pred_css))
189
+
190
+ ef1 = element_f1(pred_elem, ref_elem)
191
+ for cat, val in ef1.items():
192
+ elem_f1s[cat].append(val)
193
+ total_element_f1s.append(sum(ef1.values()) / len(ef1))
194
+
195
+ n = len(pred_htmls)
196
+ per_cat = {}
197
+ for cat in TAG_GROUPS:
198
+ vals = elem_f1s[cat]
199
+ per_cat[cat] = round(sum(vals) / len(vals), 4) if vals else 0
200
+
201
+ result = {
202
+ "n_samples": n,
203
+ "avg_text_f1": round(sum(text_f1s) / n, 4),
204
+ "avg_element_f1": round(sum(total_element_f1s) / n, 4),
205
+ "avg_dom_depth": round(sum(dom_depths) / n, 1),
206
+ "avg_dom_nodes": round(sum(dom_nodes) / n, 1),
207
+ "avg_css_properties": round(sum(css_counts) / n, 1),
208
+ "avg_css_unique_props": round(sum(css_unique) / n, 1),
209
+ "per_category_f1": per_cat,
210
+ }
211
+ all_results[method] = result
212
+
213
+ return all_results
214
+
215
+
216
+ def main():
217
+ import argparse
218
+ parser = argparse.ArgumentParser()
219
+ parser.add_argument("--benchmark_dir", default=str(PROJECT_ROOT / "results" / "benchmark"))
220
+ parser.add_argument("--ref_method", default="qwen3_1k")
221
+ parser.add_argument("--output", default=str(PROJECT_ROOT / "results" / "element_analysis.json"))
222
+ args = parser.parse_args()
223
+
224
+ results = analyze_all(args.benchmark_dir, args.ref_method)
225
+
226
+ Path(args.output).parent.mkdir(parents=True, exist_ok=True)
227
+ with open(args.output, "w") as f:
228
+ json.dump(results, f, indent=2)
229
+
230
+ print(f"\n{'='*90}")
231
+ print(f"{'Method':<25} {'TextF1':>8} {'ElemF1':>8} {'Depth':>6} {'Nodes':>7} {'CSS':>6} {'N':>4}")
232
+ print("-" * 70)
233
+ for k in sorted(results, key=lambda x: results[x]["avg_text_f1"], reverse=True):
234
+ v = results[k]
235
+ print(f"{k:<25} {v['avg_text_f1']:>8.4f} {v['avg_element_f1']:>8.4f} "
236
+ f"{v['avg_dom_depth']:>6.1f} {v['avg_dom_nodes']:>7.0f} "
237
+ f"{v['avg_css_properties']:>6.0f} {v['n_samples']:>4}")
238
+ print(f"{'='*90}")
239
+
240
+ print("\nPer-category Element F1 (vs qwen3_1k):")
241
+ cats = list(TAG_GROUPS.keys())
242
+ header = f"{'Method':<25}" + "".join(f"{c[:6]:>8}" for c in cats)
243
+ print(header)
244
+ print("-" * (25 + 8 * len(cats)))
245
+ for method in sorted(results):
246
+ row = f"{method:<25}"
247
+ for cat in cats:
248
+ val = results[method]["per_category_f1"].get(cat, 0)
249
+ row += f"{val:>8.3f}"
250
+ print(row)
251
+
252
+ print(f"\nSaved to: {args.output}")
253
+
254
+
255
+ if __name__ == "__main__":
256
+ main()
scripts/step_ssim_bootstrap.py ADDED
@@ -0,0 +1,228 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ SSIM + Bootstrap CI computation for all benchmark methods.
3
+ Works with existing rendered screenshots and per-sample CLIP scores.
4
+
5
+ Usage:
6
+ python scripts/step_ssim_bootstrap.py --benchmark_dir results/benchmark --ref_dir data/ref_screenshots
7
+ python scripts/step_ssim_bootstrap.py --benchmark_dir results/benchmark_websight --ref_dir data/ref_screenshots_websight
8
+ """
9
+
10
+ import argparse
11
+ import json
12
+ import os
13
+ import sys
14
+ from pathlib import Path
15
+
16
+ import numpy as np
17
+ from PIL import Image
18
+
19
+ PROJECT_ROOT = Path(__file__).parent.parent
20
+
21
+
22
+ def compute_ssim_pil(img1, img2, win_size=7):
23
+ """Compute SSIM between two PIL images using numpy (no skimage dependency)."""
24
+ target_size = (min(img1.width, img2.width, 512), min(img1.height, img2.height, 512))
25
+ a = np.array(img1.resize(target_size).convert("RGB"), dtype=np.float64)
26
+ b = np.array(img2.resize(target_size).convert("RGB"), dtype=np.float64)
27
+
28
+ C1 = (0.01 * 255) ** 2
29
+ C2 = (0.03 * 255) ** 2
30
+
31
+ ssims = []
32
+ for ch in range(3):
33
+ mu1 = uniform_filter(a[:, :, ch], win_size)
34
+ mu2 = uniform_filter(b[:, :, ch], win_size)
35
+ mu1_sq = mu1 ** 2
36
+ mu2_sq = mu2 ** 2
37
+ mu1_mu2 = mu1 * mu2
38
+ sigma1_sq = uniform_filter(a[:, :, ch] ** 2, win_size) - mu1_sq
39
+ sigma2_sq = uniform_filter(b[:, :, ch] ** 2, win_size) - mu2_sq
40
+ sigma12 = uniform_filter(a[:, :, ch] * b[:, :, ch], win_size) - mu1_mu2
41
+
42
+ ssim_map = ((2 * mu1_mu2 + C1) * (2 * sigma12 + C2)) / \
43
+ ((mu1_sq + mu2_sq + C1) * (sigma1_sq + sigma2_sq + C2))
44
+ ssims.append(ssim_map.mean())
45
+
46
+ return float(np.mean(ssims))
47
+
48
+
49
+ def uniform_filter(arr, size):
50
+ """Simple uniform (box) filter."""
51
+ from scipy.ndimage import uniform_filter as _uf
52
+ return _uf(arr, size=size, mode='reflect')
53
+
54
+
55
+ def render_html_to_screenshot(html_path, out_path, width=1280, height=1024, timeout=15000):
56
+ """Render HTML file to PNG screenshot using Playwright."""
57
+ try:
58
+ from playwright.sync_api import sync_playwright
59
+ with sync_playwright() as p:
60
+ browser = p.chromium.launch(headless=True, args=['--no-sandbox', '--disable-gpu'])
61
+ page = browser.new_page(viewport={"width": width, "height": height})
62
+ page.goto(f"file://{html_path}", wait_until="networkidle", timeout=timeout)
63
+ page.wait_for_timeout(1000)
64
+ page.screenshot(path=str(out_path), full_page=True)
65
+ browser.close()
66
+ return True
67
+ except Exception as e:
68
+ print(f" Render failed for {html_path}: {e}")
69
+ return False
70
+
71
+
72
+ def compute_ssim_for_method(method_dir, ref_dir, render_cache_dir):
73
+ """Compute per-sample SSIM for a method."""
74
+ html_dir = Path(method_dir) / "html_predictions"
75
+ if not html_dir.exists():
76
+ return None
77
+
78
+ ref_dir = Path(ref_dir)
79
+ render_dir = Path(render_cache_dir) / Path(method_dir).name
80
+ render_dir.mkdir(parents=True, exist_ok=True)
81
+
82
+ html_files = sorted(html_dir.glob("*.html"))
83
+ per_sample = {}
84
+
85
+ for html_path in html_files:
86
+ sample_id = html_path.stem
87
+ ref_path = ref_dir / f"{sample_id}.png"
88
+ if not ref_path.exists():
89
+ continue
90
+
91
+ rendered_path = render_dir / f"{sample_id}.png"
92
+ if not rendered_path.exists():
93
+ ok = render_html_to_screenshot(str(html_path.resolve()), str(rendered_path))
94
+ if not ok:
95
+ continue
96
+
97
+ try:
98
+ ref_img = Image.open(ref_path).convert("RGB")
99
+ rendered_img = Image.open(rendered_path).convert("RGB")
100
+ ssim = compute_ssim_pil(ref_img, rendered_img)
101
+ per_sample[sample_id] = ssim
102
+ except Exception as e:
103
+ print(f" SSIM error for {sample_id}: {e}")
104
+ continue
105
+
106
+ if not per_sample:
107
+ return None
108
+
109
+ return {
110
+ "n_samples": len(per_sample),
111
+ "avg_ssim": round(float(np.mean(list(per_sample.values()))), 4),
112
+ "std_ssim": round(float(np.std(list(per_sample.values()))), 4),
113
+ "per_sample": per_sample,
114
+ }
115
+
116
+
117
+ def bootstrap_ci(scores, n_bootstrap=10000, ci=0.95, seed=42):
118
+ """Compute bootstrap confidence interval."""
119
+ rng = np.random.RandomState(seed)
120
+ scores = np.array(scores)
121
+ n = len(scores)
122
+ boot_means = np.array([
123
+ rng.choice(scores, size=n, replace=True).mean()
124
+ for _ in range(n_bootstrap)
125
+ ])
126
+ alpha = (1 - ci) / 2
127
+ lo = float(np.percentile(boot_means, 100 * alpha))
128
+ hi = float(np.percentile(boot_means, 100 * (1 - alpha)))
129
+ return {
130
+ "mean": float(scores.mean()),
131
+ "ci_lower": round(lo, 4),
132
+ "ci_upper": round(hi, 4),
133
+ "ci_width": round(hi - lo, 4),
134
+ "std": round(float(scores.std()), 4),
135
+ "n": n,
136
+ }
137
+
138
+
139
+ def compute_bootstrap_for_all(benchmark_dir):
140
+ """Compute bootstrap CI for all methods from per-sample CLIP scores."""
141
+ benchmark_dir = Path(benchmark_dir)
142
+ results = {}
143
+
144
+ for method_dir in sorted(benchmark_dir.iterdir()):
145
+ if not method_dir.is_dir():
146
+ continue
147
+ clip_file = method_dir / "clip_scores.json"
148
+ if not clip_file.exists():
149
+ continue
150
+
151
+ with open(clip_file) as f:
152
+ clip_data = json.load(f)
153
+
154
+ per_sample = clip_data.get("per_sample", {})
155
+ if not per_sample:
156
+ continue
157
+
158
+ scores = []
159
+ for k, v in per_sample.items():
160
+ if isinstance(v, dict):
161
+ scores.append(v.get("clip_score", 0))
162
+ else:
163
+ scores.append(float(v))
164
+
165
+ if not scores:
166
+ continue
167
+
168
+ ci_result = bootstrap_ci(scores)
169
+ results[method_dir.name] = ci_result
170
+ print(f" {method_dir.name}: CLIP={ci_result['mean']:.4f} [{ci_result['ci_lower']:.4f}, {ci_result['ci_upper']:.4f}]")
171
+
172
+ return results
173
+
174
+
175
+ def main():
176
+ parser = argparse.ArgumentParser()
177
+ parser.add_argument("--benchmark_dir", type=str, default=str(PROJECT_ROOT / "results" / "benchmark"))
178
+ parser.add_argument("--ref_dir", type=str, default=str(PROJECT_ROOT / "data" / "ref_screenshots"))
179
+ parser.add_argument("--render_cache", type=str, default=str(PROJECT_ROOT / "results" / "rendered_screenshots"))
180
+ parser.add_argument("--skip_ssim", action="store_true")
181
+ parser.add_argument("--skip_bootstrap", action="store_true")
182
+ args = parser.parse_args()
183
+
184
+ benchmark_dir = Path(args.benchmark_dir)
185
+ output = {}
186
+
187
+ if not args.skip_bootstrap:
188
+ print("=" * 60)
189
+ print("Computing Bootstrap CI for CLIP scores...")
190
+ print("=" * 60)
191
+ bootstrap_results = compute_bootstrap_for_all(args.benchmark_dir)
192
+ output["bootstrap_ci"] = bootstrap_results
193
+
194
+ ci_file = benchmark_dir / "bootstrap_ci.json"
195
+ with open(ci_file, "w") as f:
196
+ json.dump(bootstrap_results, f, indent=2)
197
+ print(f"\nSaved to {ci_file}")
198
+
199
+ if not args.skip_ssim:
200
+ print("\n" + "=" * 60)
201
+ print("Computing SSIM scores...")
202
+ print("=" * 60)
203
+ ssim_results = {}
204
+ for method_dir in sorted(benchmark_dir.iterdir()):
205
+ if not method_dir.is_dir():
206
+ continue
207
+ html_dir = method_dir / "html_predictions"
208
+ if not html_dir.exists():
209
+ continue
210
+ print(f"\n Processing {method_dir.name}...")
211
+ result = compute_ssim_for_method(str(method_dir), args.ref_dir, args.render_cache)
212
+ if result:
213
+ ssim_results[method_dir.name] = {
214
+ "n_samples": result["n_samples"],
215
+ "avg_ssim": result["avg_ssim"],
216
+ "std_ssim": result["std_ssim"],
217
+ }
218
+ print(f" SSIM={result['avg_ssim']:.4f} ± {result['std_ssim']:.4f} (n={result['n_samples']})")
219
+ output[f"ssim_{method_dir.name}"] = result
220
+
221
+ ssim_file = benchmark_dir / "ssim_scores.json"
222
+ with open(ssim_file, "w") as f:
223
+ json.dump(ssim_results, f, indent=2)
224
+ print(f"\nSaved to {ssim_file}")
225
+
226
+
227
+ if __name__ == "__main__":
228
+ main()
scripts/train_compressor.py CHANGED
@@ -244,6 +244,9 @@ class CompressedQwen3VL(nn.Module):
244
  target_tokens=target_tokens,
245
  ).to(torch.bfloat16)
246
 
 
 
 
247
  # Add LoRA to LLM decoder
248
  self._add_lora(lora_r, lora_alpha)
249
 
@@ -271,6 +274,59 @@ class CompressedQwen3VL(nn.Module):
271
  )
272
  setattr(attn, proj_name, self.lora_modules[lora_key])
273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  def prepare_inputs(self, images, htmls):
275
  """Prepare model inputs for a batch of image-html pairs."""
276
  batch_messages = []
@@ -293,61 +349,35 @@ class CompressedQwen3VL(nn.Module):
293
  return inputs
294
 
295
  def forward(self, images, htmls, device):
296
- """Full training forward pass. Returns loss scalar."""
297
- # 1. Prepare inputs
 
 
 
 
298
  inputs = self.prepare_inputs(images, htmls)
299
  pixel_values = inputs["pixel_values"].to(device, torch.bfloat16)
300
  image_grid_thw = inputs["image_grid_thw"].to(device)
301
  input_ids = inputs["input_ids"].to(device)
302
 
303
- # 2. Get visual embeddings from frozen ViT+Merger
304
- with torch.no_grad():
305
- visual_embeds = self.base_model.visual(
306
- pixel_values, grid_thw=image_grid_thw,
307
- ) # [total_tokens, hidden_dim]
308
-
309
- # 3. Compress
310
- compressed, new_grid_thw = self.compressor(
311
- visual_embeds, image_grid_thw,
312
- ) # [total_compressed, hidden_dim]
313
-
314
- # 4. Build new input sequence
315
- new_input_ids, labels = self._rebuild_sequence(
316
- input_ids, htmls, device,
317
- )
318
-
319
- # 5. Build inputs_embeds
320
- lm = self.base_model.model
321
- if hasattr(lm, "language_model"):
322
- embed_layer = lm.language_model.embed_tokens
323
- elif hasattr(lm, "embed_tokens"):
324
- embed_layer = lm.embed_tokens
325
- else:
326
- embed_layer = lm.get_input_embeddings()
327
-
328
- with torch.no_grad():
329
- text_embeds = embed_layer(new_input_ids) # [B, seq_len, D]
330
-
331
- # Scatter compressed visual tokens into the sequence
332
- inputs_embeds = self._scatter_visual(
333
- text_embeds, new_input_ids, compressed, new_grid_thw,
334
- )
335
-
336
- # 6. Build position_ids (vectorized, no Python loops over tokens)
337
- position_ids = self._build_position_ids(
338
- new_input_ids, new_grid_thw, device,
339
- )
340
 
341
- # 7. Forward through LLM
342
- pad_token_id = self.processor.tokenizer.pad_token_id
343
- if pad_token_id is None:
344
- pad_token_id = 0
345
  attention_mask = (new_input_ids != pad_token_id).long()
346
 
 
 
 
 
 
347
  outputs = self.base_model(
348
- inputs_embeds=inputs_embeds,
349
  attention_mask=attention_mask,
350
- position_ids=position_ids,
 
 
351
  labels=labels,
352
  )
353
  return outputs.loss
@@ -543,7 +573,7 @@ def train(args):
543
  sampler = DistributedSampler(dataset) if is_distributed else None
544
  loader = DataLoader(
545
  dataset, batch_size=args.batch_size, sampler=sampler,
546
- shuffle=(sampler is None), num_workers=2, pin_memory=True,
547
  collate_fn=lambda batch: batch,
548
  )
549
 
 
244
  target_tokens=target_tokens,
245
  ).to(torch.bfloat16)
246
 
247
+ # Monkey-patch get_image_features so it auto-compresses visual tokens.
248
+ self._patch_vision(compressor=self.compressor, target_tokens=target_tokens)
249
+
250
  # Add LoRA to LLM decoder
251
  self._add_lora(lora_r, lora_alpha)
252
 
 
274
  )
275
  setattr(attn, proj_name, self.lora_modules[lora_key])
276
 
277
+ def _patch_vision(self, compressor, target_tokens):
278
+ """Monkey-patch get_image_features to auto-compress visual tokens.
279
+
280
+ The compressed tokens PER IMAGE = target_tokens (not T*H*W/spatial_merge_size^2).
281
+ We intercept get_image_features so Qwen3-VL's M-RoPE / placeholder_mask /
282
+ masked_scatter all work unchanged — only the actual embedding values change.
283
+ """
284
+ import functools
285
+
286
+ orig_get_img = self.base_model.model.get_image_features
287
+
288
+ @functools.wraps(orig_get_img)
289
+ def patched_get_image_features(pixel_values, image_grid_thw=None, **kwargs):
290
+ import torch
291
+ from transformers.models.qwen3_vl.modeling_qwen3_vl import (
292
+ BaseModelOutputWithDeepstackFeatures,
293
+ )
294
+ vision_output = orig_get_img(pixel_values, image_grid_thw, **kwargs)
295
+ pooler = vision_output.pooler_output
296
+ if not isinstance(pooler, (list, tuple)):
297
+ flat = pooler
298
+ else:
299
+ flat = torch.cat(pooler, dim=0)
300
+
301
+ # Compute LLM-side grid after spatial merge
302
+ vis = self.base_model.model.visual
303
+ sms = vis.spatial_merge_size
304
+ grid_llm = image_grid_thw.clone()
305
+ grid_llm[:, 1] = grid_llm[:, 1] // sms
306
+ grid_llm[:, 2] = grid_llm[:, 2] // sms
307
+ num_images = image_grid_thw.shape[0]
308
+ compressed_parts = []
309
+ offset = 0
310
+ for i in range(num_images):
311
+ t, h, w = grid_llm[i].tolist()
312
+ n_orig = t * h * w
313
+ orig_slice = flat[offset: offset + n_orig]
314
+ offset += n_orig
315
+ comp_part, _ = compressor(orig_slice.unsqueeze(0), grid_llm[i:i+1])
316
+ compressed_parts.append(comp_part.squeeze(0))
317
+
318
+ compressed_flat = torch.cat(compressed_parts, dim=0)
319
+ split_sizes = [target_tokens] * num_images
320
+
321
+ # Reconstruct pooler_output as list (expected by Qwen3VLModel.forward)
322
+ vision_output.pooler_output = torch.split(compressed_flat, split_sizes)
323
+ # Disable deepstack processing to avoid dimension mismatch
324
+ vision_output.deepstack_features = []
325
+
326
+ return vision_output
327
+
328
+ self.base_model.model.get_image_features = patched_get_image_features
329
+
330
  def prepare_inputs(self, images, htmls):
331
  """Prepare model inputs for a batch of image-html pairs."""
332
  batch_messages = []
 
349
  return inputs
350
 
351
  def forward(self, images, htmls, device):
352
+ """Full training forward pass. Returns loss scalar.
353
+
354
+ The _patch_vision monkey-patch auto-compresses visual tokens inside
355
+ get_image_features, so Qwen3-VL's forward handles M-RoPE, placeholder_mask,
356
+ and masked_scatter automatically. We only supply the HTML teacher targets.
357
+ """
358
  inputs = self.prepare_inputs(images, htmls)
359
  pixel_values = inputs["pixel_values"].to(device, torch.bfloat16)
360
  image_grid_thw = inputs["image_grid_thw"].to(device)
361
  input_ids = inputs["input_ids"].to(device)
362
 
363
+ # Build HTML target (teacher forcing)
364
+ new_input_ids, labels = self._rebuild_sequence(input_ids, htmls, device)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
 
366
+ # Attention mask
367
+ pad_token_id = self.processor.tokenizer.pad_token_id or 0
 
 
368
  attention_mask = (new_input_ids != pad_token_id).long()
369
 
370
+ # Forward through Qwen3-VL.
371
+ # input_ids: provides #image tokens for M-RoPE / placeholder_mask.
372
+ # pixel_values + image_grid_thw: trigger patched get_image_features
373
+ # which returns compressed embeddings → auto masked-scattered.
374
+ # output_hidden_states=False: disables deepstack_features mismatch.
375
  outputs = self.base_model(
376
+ input_ids=new_input_ids,
377
  attention_mask=attention_mask,
378
+ pixel_values=pixel_values,
379
+ image_grid_thw=image_grid_thw,
380
+ output_hidden_states=False,
381
  labels=labels,
382
  )
383
  return outputs.loss
 
573
  sampler = DistributedSampler(dataset) if is_distributed else None
574
  loader = DataLoader(
575
  dataset, batch_size=args.batch_size, sampler=sampler,
576
+ shuffle=(sampler is None), num_workers=0, pin_memory=True,
577
  collate_fn=lambda batch: batch,
578
  )
579
 
sync_up.py CHANGED
@@ -1,17 +1,85 @@
 
 
 
1
  from huggingface_hub import HfApi
2
 
3
- api = HfApi()
4
-
5
- # 执行上传
6
- api.upload_folder(
7
- folder_path=".", # 要上传的本地文件夹
8
- repo_id="DesonDai/UIPress",
9
- repo_type="dataset",
10
- path_in_repo=".", # 上传到仓库的根目录
11
- commit_message="Sync local changes to HF", # 提交信息
12
- # 如果需要忽略某些大文件夹或日志,取消下行注释并修改
13
- # ignore_patterns=["*.log", "__pycache__/*", "data/websight/*"],
14
- # token="你的_HuggingFace_Token"
15
- )
16
-
17
- print("🚀 本地内容已同步到云端。")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import argparse
2
+ import os
3
+
4
  from huggingface_hub import HfApi
5
 
6
+
7
+ def parse_args() -> argparse.Namespace:
8
+ parser = argparse.ArgumentParser(description="Sync local folder to Hugging Face repository.")
9
+ parser.add_argument("--repo_id", default="DesonDai/UIPress")
10
+ parser.add_argument("--repo_type", default="dataset", choices=["dataset", "model", "space"])
11
+ parser.add_argument("--folder_path", default=".")
12
+ parser.add_argument("--path_in_repo", default=".")
13
+ parser.add_argument("--commit_message", default="Sync local changes to HF")
14
+ parser.add_argument(
15
+ "--mode",
16
+ default="large",
17
+ choices=["large", "regular"],
18
+ help="large: upload_large_folder (recommended for big folders); regular: upload_folder",
19
+ )
20
+ parser.add_argument(
21
+ "--token_env",
22
+ default="HF_TOKEN",
23
+ help="Environment variable that stores Hugging Face token.",
24
+ )
25
+ parser.add_argument(
26
+ "--ignore",
27
+ nargs="*",
28
+ default=[
29
+ ".git/*",
30
+ ".cursor/*",
31
+ "__pycache__/*",
32
+ "*.pyc",
33
+ "OLD/*",
34
+ "*.tar.gz",
35
+ ],
36
+ help="Glob patterns to ignore while uploading.",
37
+ )
38
+ parser.add_argument("--num_workers", type=int, default=4)
39
+ return parser.parse_args()
40
+
41
+
42
+ def main() -> None:
43
+ args = parse_args()
44
+ repo_id = args.repo_id.strip().strip("/")
45
+ if "/" not in repo_id:
46
+ raise RuntimeError(
47
+ f"Invalid --repo_id '{args.repo_id}'. Expected format: <namespace>/<repo_name>, "
48
+ "for example: DesonDai/UIPress"
49
+ )
50
+
51
+ token = os.environ.get(args.token_env)
52
+ if not token:
53
+ raise RuntimeError(
54
+ f"Missing token: please set {args.token_env} first, then rerun."
55
+ )
56
+
57
+ api = HfApi(token=token)
58
+
59
+ if args.mode == "large":
60
+ # Recommended for large folders: more robust and resumable uploads.
61
+ api.upload_large_folder(
62
+ repo_id=repo_id,
63
+ folder_path=args.folder_path,
64
+ repo_type=args.repo_type,
65
+ ignore_patterns=args.ignore,
66
+ num_workers=args.num_workers,
67
+ print_report=True,
68
+ print_report_every=30,
69
+ )
70
+ else:
71
+ api.upload_folder(
72
+ repo_id=repo_id,
73
+ folder_path=args.folder_path,
74
+ repo_type=args.repo_type,
75
+ path_in_repo=args.path_in_repo,
76
+ commit_message=args.commit_message,
77
+ ignore_patterns=args.ignore,
78
+ token=token,
79
+ )
80
+
81
+ print(f"Sync completed: {args.repo_type}/{repo_id}")
82
+
83
+
84
+ if __name__ == "__main__":
85
+ main()