摘要
With the fast-growing graphical user interface(GUI)development workload in the Internet industry,some work attempted to generate maintainable front-end code from GUI screenshots.It can be more suitable for using user interface(UI)design drafts that contain UI metadata.However,fragmented layers inevitably appear in the UI design drafts,which greatly reduces the quality of the generated code.None of the existing automated GUI techniques detects and merges the fragmented layers to improve the accessibility of generated code.In this paper,we propose UI layers merger(UILM),a vision-based method that can automatically detect and merge fragmented layers into UI components.Our UILM contains the merging area detector(MAD)and a layer merging algorithm.The MAD incorporates the boundary prior knowledge to accurately detect the boundaries of UI components.Then,the layer merging algorithm can search for the associated layers within the components’boundaries and merge them into a whole.We present a dynamic data augmentation approach to boost the performance of MAD.We also construct a large-scale UI dataset for training the MAD and testing the performance of UILM.Experimental results show that the proposed method outperforms the best baseline regarding merging area detection and achieves decent layer merging accuracy.A user study on a real application also confirms the effectiveness of our UILM.
基金
Project supported by the National Key R&D Program of China(No.2018AAA0100703)
the National Natural Science Foundation of China(Nos.62006208 and 62107035)
the Ng Teng Fong Charitable Foundation in the form of ZJU-SUTD IDEA Grant
the Alibaba-Zhejiang University Joint Research Institute of Frontier Technologies。