User interface to code (UI2Code) aims to generate executable code that can faithfully reconstruct a given input UI. Prior work focuses largely on web pages and mobile screens, leaving app widgets underexplored. Unlike web or mobile UIs with rich hierarchical context, widgets are compact, context-free micro-interfaces that summarize key information through dense layouts and iconography under strict spatial constraints. Moreover, while (image, code) pairs are widely available for web or mobile UIs, widget designs are proprietary and lack accessible markup. We formalize this setting as the Widget-to-Code (Widget2Code) and introduce an image-only widget benchmark with fine-grained, multi-dimensional evaluation metrics. Benchmarking shows that although generalized multimodal large language models (MLLMs) outperform specialized UI2Code methods, they still produce unreliable and visually inconsistent code. To address these limitations, we develop a baseline that jointly advances perceptual understanding and structured code generation. At the perceptual level, we follow widget design principles to assemble atomic components into complete layouts, equipped with icon retrieval and reusable visualization modules. At the system level, we design an end-to-end infrastructure, WidgetFactory, which includes a framework-agnostic widget-tailored domain-specific language (WidgetDSL) and a compiler that translates it into multiple front-end implementations (e.g., React, HTML/CSS). An adaptive rendering module further refines spatial dimensions to satisfy compactness constraints. Together, these contributions substantially enhance visual fidelity, establishing a strong baseline and unified infrastructure for future Widget2Code research.


翻译:从用户界面到代码(UI2Code)的目标是生成能够忠实重建给定输入UI的可执行代码。现有工作主要聚焦于网页和移动屏幕,而对应用控件的探索尚不充分。与具有丰富层次化上下文的网页或移动端UI不同,控件是紧凑、无上下文的微交互界面,通过密集布局和图标在严格空间约束下汇总关键信息。此外,虽然(图像,代码)对在网页或移动端UI中广泛可用,但控件设计具有专有性且缺乏可访问的标记语言。我们将此设定形式化为控件到代码任务,并引入纯图像控件基准以及细粒度、多维度的评估指标体系。基准测试表明,尽管通用多模态大语言模型在性能上优于专用UI2Code方法,但其生成的代码仍存在不可靠与视觉不一致的问题。为解决这些局限,我们开发了一个联合推进感知理解与结构化代码生成的基线方案。在感知层面,我们遵循控件设计原则,将原子组件组装为完整布局,并配备图标检索与可复用可视化模块。在系统层面,我们设计了一个端到端基础设施——WidgetFactory,包含与框架无关的控件定制领域特定语言及其编译器,可将其转换为多种前端实现(如React、HTML/CSS)。自适应渲染模块进一步优化空间尺寸以满足紧凑性约束。这些贡献共同显著提升了视觉保真度,为未来控件到代码研究奠定了强基线基础与统一基础设施。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
《软件定义网络元素与机器代码的形式化验证》
专知会员服务
13+阅读 · 2025年11月18日
《基于大型语言模型的软件工程自动化研究》最新264页
专知会员服务
38+阅读 · 2025年7月14日
设计和构建强大的大语言模型智能体
专知会员服务
55+阅读 · 2024年10月6日
【WWW2024教程】大型语言模型驱动智能体,附slides
专知会员服务
64+阅读 · 2024年5月14日
用户画像基础
DataFunTalk
12+阅读 · 2020年8月1日
计算机视觉方向简介 | 多视角立体视觉MVS
计算机视觉life
15+阅读 · 2019年10月10日
React Native 分包哪家强?看这文就够了!
程序人生
13+阅读 · 2019年1月16日
超像素、语义分割、实例分割、全景分割 傻傻分不清?
计算机视觉life
19+阅读 · 2018年11月27日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
美国军方使用的10种反无人机武器(2026年更新)
专知会员服务
10+阅读 · 今天4:07
认知战与交战性质的改变:神经战略视角
专知会员服务
7+阅读 · 5月8日
相关VIP内容
《软件定义网络元素与机器代码的形式化验证》
专知会员服务
13+阅读 · 2025年11月18日
《基于大型语言模型的软件工程自动化研究》最新264页
专知会员服务
38+阅读 · 2025年7月14日
设计和构建强大的大语言模型智能体
专知会员服务
55+阅读 · 2024年10月6日
【WWW2024教程】大型语言模型驱动智能体,附slides
专知会员服务
64+阅读 · 2024年5月14日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员