Method and device for identifying component elements in design manuscript
Through the combination of component detection model and element structure information, component elements in the design draft are identified, which solves the problem of low identification accuracy in the existing technology and achieves efficient and accurate component element identification.
Patent Information
- Application Number
- CN202410764265.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-08-30
AI Technical Summary
In the existing technology, the recognition accuracy of component elements in design drafts is low, especially the misrecognition problem caused by the similarity of features of non-component elements and component elements.
The component detection model is used to identify the component positions in the design draft, and the element structure information is combined to screen candidate elements. The reference element is determined by matching the component position and the candidate element position, thereby identifying the target component element and improving the recognition accuracy.
It improves the recognition accuracy of component elements and achieves fast and accurate component element recognition. It is suitable for high-concurrency and high-request business scenarios and does not rely solely on the image characteristics of component elements.
Smart Images

Figure CN118570822A
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of computer technology, and more particularly to a method and device for identifying component elements in a design draft. Background Art
[0002] With the rapid development of computer technology and Internet technology, WEB, applications, small programs, etc. have gradually emerged. More and more companies and organizations have begun to use WEB, applications, small programs, etc. to promote products, services and brands, attract user attention and participation, and accordingly need to develop and design various front-end pages. Front-end page development is a process of creating front-end pages such as WEB pages or application pages and presenting them to users. For the specific process of front-end page development, it is usually necessary to first design the design draft corresponding to the front-end page and render it. Since the design draft often includes components such as buttons, icons, background images, lotteries, and flip cards that can be reused in the design process, an important task in the design work is to effectively identify these various component elements so that they can be effectively used in the subsequent design stage.
[0003] In the prior art, the image features of each element in the design draft can be extracted based on machine learning algorithms or image classification methods to identify the component elements in the design draft. However, the above methods rely on the model to extract and analyze the component features, and since the features of some non-component elements and component elements are very similar, non-component elements may be mistakenly identified as component elements, resulting in low recognition accuracy of component elements. Therefore, a more accurate method is needed to perform component element recognition operations or processing in the design draft. Summary of the invention
[0004] In view of this, the embodiments of this specification provide a method for identifying component elements in a design draft. One or more embodiments of this specification also relate to a device for identifying component elements in a design draft, a computing device, a computer-readable storage medium, and a computer program product to solve the technical defects existing in the prior art.
[0005] According to a first aspect of an embodiment of this specification, a method for identifying component elements in a design draft is provided, including:
[0006] Acquire a picture to be identified in the design draft to be identified, and identify a component detection result of the picture to be identified using a component detection model, wherein the component detection result includes a component position of at least one component;
[0007] Acquire element structure information of each element in the to-be-recognized image, and determine candidate elements from the elements according to the element structure information;
[0008] Matching the component position of the at least one component with the element position of each candidate element respectively, and determining a reference element corresponding to the at least one component;
[0009] According to the reference element corresponding to the at least one component, a target component element included in the to-be-identified picture is determined.
[0010] According to a second aspect of an embodiment of this specification, a device for identifying component elements in a design draft is provided, including:
[0011] The recognition module is configured to obtain a picture to be recognized in the design draft to be recognized, and recognize a component detection result of the picture to be recognized by using a component detection model, wherein the component detection result includes a component position of at least one component;
[0012] A first determination module is configured to obtain element structure information of each element in the to-be-recognized image, and determine a candidate element from the elements according to the element structure information;
[0013] a matching module, configured to match the component position of the at least one component with the element position of each candidate element, respectively, to determine a reference element corresponding to the at least one component;
[0014] The second determination module is configured to determine a target component element included in the to-be-identified image according to a reference element corresponding to the at least one component.
[0015] According to a third aspect of an embodiment of this specification, a computing device is provided, including:
[0016] Memory and processor;
[0017] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method for identifying component elements in the above-mentioned design draft are implemented.
[0018] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the method for identifying component elements in the above-mentioned design draft are implemented.
[0019] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instruction, which, when executed by a processor, implements the steps of the method for identifying component elements in the above-mentioned design draft.
[0020] The embodiments of the present specification provide a method for identifying component elements in a design draft, which includes obtaining a picture to be identified in the design draft, and using a component detection model to identify a component detection result of the picture to be identified, wherein the component detection result includes a component position of at least one component; obtaining element structure information of each element in the picture to be identified, and determining candidate elements from the elements according to the element structure information; matching the component position of the at least one component with the element position of each candidate element, respectively, to determine a reference element corresponding to the at least one component; and determining a target component element included in the picture to be identified according to the reference element corresponding to the at least one component.
[0021] In one embodiment of the present specification, a component detection model is used to identify the component detection results of the image to be identified, and the component position of each component in the image to be identified is obtained; and the element structure information of each element in the image to be identified can be used to screen out candidate elements, and then the component position identified by the component detection model is matched with the element position of each candidate element to determine at least one reference element corresponding to the component, thereby determining the target component element included in the image to be identified. In this way, the component detection model is used to directly identify the component position of each component in the image to be identified, without the need to render each element in the image to be identified separately, with high operating efficiency, capable of meeting high-concurrency, high-request business scenarios, and combining the element structure information of each element in the image to be identified and the identification results of the component detection model to determine the target component element, which does not rely solely on the image features of the component element, greatly improving the recognition accuracy of the component element, and being able to quickly and accurately determine the component element. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a flowchart of a method for identifying component elements in a design draft provided by an embodiment of this specification;
[0023] Figure 2 is a schematic diagram of a sample picture provided in one embodiment of this specification;
[0024] Figure 3 It is a schematic diagram of a processing process of a method for identifying component elements in a design draft provided by an embodiment of this specification;
[0025] Figure 4 It is a structural schematic diagram of a device for identifying component elements in a design draft provided by an embodiment of this specification;
[0026] Figure 5 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0027] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0028] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0029] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0030] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0031] First, the terms involved in one or more embodiments of this specification are explained.
[0032] Design draft: It is a key visual document created by designers for product design during the product development process. It consists of a series of different component elements and non-component elements, which are arranged according to a specific layout to ensure the consistency and efficiency of product design. The design draft shows the product's appearance design elements in detail, including colors, fonts, graphics and user interface layout, etc., providing detailed planning and guidance for the product's visual presentation and user experience.
[0033] Component elements: refers to design elements that can be reused multiple times in a design draft. After they are created in a design document, they can be repeatedly applied in multiple different interfaces or structures. Component elements greatly promote the consistency and work efficiency of the design process. In addition, the reusability of component elements also makes it easier to modify and update the design, further improving the flexibility and responsiveness of design work.
[0034] Structure tree: a model used to describe and organize the hierarchical relationship of all elements in a design. It displays all design elements from the top to the bottom in hierarchical order, including components, layouts, pages, etc. The structure tree of a design appears in the form of a tree diagram, where each node represents an element in the design (including component elements and non-component elements), and the connecting lines between nodes represent the hierarchy and relationship between these elements.
[0035] Object Detection: It is a key technology in the field of computer vision, which aims to identify and locate one or more specific targets in a picture or video frame. Unlike image classification (which only identifies the main objects in the image), object detection requires not only identifying the type of object present in the image, but also determining the location of the object, which is usually achieved by drawing a bounding box.
[0036] It should be noted that in the field of UI (User Interface) / UX (User experience) design, reusable design elements such as buttons, icons, background images, lotteries, and flip cards are collectively referred to as component elements. An important task in design work is to effectively classify these various design elements so that they can be effectively used in subsequent design stages. At present, designers often need to invest a lot of time and energy to manually classify these elements. This process is not only time-consuming and labor-intensive, but also due to the influence of personal subjective judgment, the accuracy and consistency of the classification are difficult to guarantee. Therefore, finding a method that can accurately and efficiently complete the classification of design elements has become one of the problems to be solved in the field of design.
[0037] In one possible implementation, the classification of component elements and non-component elements depends on the manual operation of the designer. Specifically, according to industry specifications and company product characteristics, reasonable classification categories and standards are manually summarized, and then various component elements are sorted out from past design documents, and a component library can be formed for subsequent use.
[0038] In another possible implementation, artificial intelligence and machine learning models can be used to classify elements. It is common to use feature engineering to design multiple features and use machine learning classification algorithms to build models. At the same time, there are also methods of classification using image classification models, which are obtained by rendering corresponding pictures of candidate elements in the design draft and inputting them into the model. Machine learning models rely on the effectiveness and richness of design features, so when faced with design drafts under various design modes, there are problems such as low accuracy; image classification methods need to process a large number of non-component elements, and the model needs to learn situations where images are similar but the classifications are different (for example, the same circle, when it indicates a non-interactive state, the category is "label", and when it indicates an interactive state, the category is "button"), and this problem is usually difficult to be solved by classification models.
[0039] Therefore, in order to solve the above technical problems, the embodiments of this specification provide a method for identifying component elements in a design draft. Based on the component detection model, the image to be identified in the design draft to be identified is identified and the components are extracted. Each component in the design draft to be identified can be directly identified without the need to render each element in the design draft separately. Therefore, it is more efficient and can meet high-concurrency and high-request business scenarios. In addition, the component detection algorithm can extract features of both the whole and the part of the input image, so as to judge the component category by learning the context content, so it has higher classification accuracy. Furthermore, the component detection model can be any image-based target detection algorithm, and the detection algorithm can be replaced and updated in the architecture without making any changes, so it has high compatibility and robustness.
[0040] The embodiments of this specification also combine the element structure information of each element in the image to be identified, the screening strategy and the recognition results of the component detection model to determine the target component elements. It does not only rely on the image features of the component elements, which greatly improves the recognition accuracy of the component elements. It can also quickly increase or decrease strategies and replace models according to the complexity of the task, speed requirements, etc., and can quickly and accurately determine the component elements. Through the model plus strategy approach, a high-accuracy and high-recall component element recognition and classification scheme is achieved.
[0041] In this specification, a method for identifying component elements in a design draft is provided. This specification also relates to a device for identifying component elements in a design draft, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.
[0042] See also Figure 1 , Figure 1 A flowchart of a method for identifying component elements in a design draft provided according to an embodiment of the present specification is shown, which specifically includes the following steps 102-108.
[0043] Step 102: Obtain a picture to be identified in the design draft to be identified, and use a component detection model to identify a component detection result of the picture to be identified, wherein the component detection result includes a component position of at least one component.
[0044] Specifically, the design draft to be identified refers to the visual draft designed by the designer for the product during the product development process. It is composed of a series of different component elements and non-component elements arranged according to a customized layout. Among them, component elements refer to design elements that can be reused when designing different pages, such as buttons, pop-up windows, icons, background images, lotteries, flip signs, cards, etc.; non-component elements refer to design elements that cannot be reused.
[0045] The design draft to be identified includes many pages. The image to be identified is the image corresponding to the current page to be identified in the design draft to be identified. The current page to be identified can be selected by the user or automatically selected based on the set rules. For example, the set rule is to select the page with more elements as the current page to be identified. In specific implementation, the corresponding current page to be identified can be rendered through the file of the design draft to be identified, and the corresponding image to be identified can be obtained by rendering or screenshot. In general, the design platform can view the design renderings, so the image to be identified can be directly screenshoted or obtained through background rendering.
[0046] The component detection model is a model based on the target detection algorithm. The component detection model is mainly processed by an image-based deep learning model. For example, the component detection model may include YOLO, fast RCNN, DETR, etc. The input and output of the above-mentioned component detection models are consistent, that is, the image to be detected is input, and the position, size and category of the detected target can be output. Any of the above-mentioned models can be used as the component detection model in the embodiments of this specification.
[0047] In actual implementation, the component detection model is trained by annotating samples. Specifically, a training sample set is obtained, which includes a large number of sample images. Each sample image carries a corresponding detection label, which can be obtained by annotation, including the component position and component category of each component in the sample image; a sample image is obtained from the training sample set, and the sample image is input into the initial target detection model to obtain an output prediction result; a loss value is calculated according to the detection label and the prediction result, and the model parameters are adjusted in reverse according to the loss value, and sample images are continuously obtained from the training sample set for model training until the training stop condition is reached, thereby obtaining a trained component detection model.
[0048] Among them, the component position refers to the component area where the component is located, which is often a bounding box that can represent the position, shape, size, etc. of the component; the component category refers to the category to which the component belongs, such as buttons, pop-ups, icons, background images, etc.
[0049] It should be noted that by learning from common sample images, the trained component detection model can understand the characteristics of components of different categories, locate existing components in the image, and more accurately output the possible component positions of the components in the image, as well as the corresponding component categories.
[0050] For example, Figure 2 is a schematic diagram of a sample image provided in an embodiment of this specification, such as Figure 2 As shown, the sample image includes 5 components, namely component 1 to component 5. The detection label carried by the sample image includes 5 components, the component positions of component 1 to component 5 (the positions of the bounding boxes), and the corresponding component categories.
[0051] In the embodiments of the present specification, the image to be identified in the design draft to be identified is identified and components are extracted based on the trained component detection model. Each component in the design draft to be identified can be directly identified without the need to render each element in the design draft separately. Therefore, it is more efficient and can meet high-concurrency and high-request business scenarios. In addition, the component detection algorithm can extract features of both the whole and part of the input image, so as to judge the component category by learning the context content, so it has higher classification accuracy. Furthermore, the component detection model can be any image-based target detection algorithm, and the detection algorithm can be replaced and updated in the architecture without making any changes, so it has high compatibility and robustness.
[0052] It should be noted that the method for identifying component elements in a design draft can be applied to a component identification platform, which can be an independent platform for identifying component elements and creating a component resource library for design use, or the component identification platform can be a design platform for identifying component elements, creating a component resource library, and implementing the design of the design draft.
[0053] In addition, the component identification platform can be a client or a server. Among them, the client can be a browser, App (Application), or a web application such as H5 (HyperText Markup Language5, Hypertext Markup Language Version 5) application, or a light application (also known as a mini-program, a lightweight application) or a cloud application. The client can be deployed in an electronic device and needs to rely on the device to run or some Apps in the device to run. For example, the electronic device can have a display screen and support information browsing, such as a personal mobile terminal such as a mobile phone, a tablet computer, a personal computer, etc. Various other types of applications can also be configured in the electronic device, such as human-computer dialogue applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, mailbox platforms, social platform software, etc.
[0054] The server may include servers that provide various services, and may be implemented as a distributed server cluster consisting of multiple servers, or as a single server. The server may also be a server of a distributed system, or a server combined with a blockchain. The server may also be a cloud server for basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.
[0055] Step 104: Obtain element structure information of each element in the image to be identified, and determine candidate elements from each element according to the element structure information.
[0056] In practical applications, the design draft to be identified designed by the designer can be obtained. The design draft to be identified includes multiple elements arranged according to a custom layout. Some elements have a cascade relationship. Therefore, the overall structural information of the design draft to be identified can be directly obtained, and then the element structural information of each element in the image to be identified can be determined from it. The element structural information of each element in the image to be identified stores the information of each element. These elements are basic units defined by the component recognition platform, such as rectangles, vectors, groups, frames, etc., which are arranged in a hierarchical structure, so they can present a tree structure, that is, the element structural information can be a structure tree, and each element in the image to be identified is a node in the structure tree. Nodes with a connection relationship have a hierarchical relationship. The acquisition of the structure tree is generally automatically completed and exported by the component recognition platform.
[0057] In an optional implementation of this embodiment, the element structure information includes the hierarchical relationship and position relationship of each element; determining the candidate element from each element according to the element structure information includes:
[0058] According to the hierarchical relationship, positional relationship and the set structural specification strategy, the elements in the image to be identified are regrouped to obtain the first element;
[0059] Filter the second element from the first element according to the hierarchical relationship, positional relationship and redundant filtering strategy;
[0060] According to the element attribute information of the second element, non-component elements in the second element that meet the attribute filtering strategy are screened out to obtain candidate elements.
[0061] Specifically, the hierarchical relationship refers to whether there is an inclusion relationship between at least two elements, such as a parent-child relationship, a brother relationship, etc., and the positional relationship refers to the relationship between the display positions of at least two elements in the image to be identified, such as whether there is overlap, whether they are adjacent, etc.
[0062] In actual implementation, the element screening strategy can be pre-configured to screen the elements indicated by the element structure information and determine the candidate elements that need to be matched with the component detection results. The element screening strategy includes a structure specification strategy, a redundant filtering strategy, an attribute filtering strategy, etc. Among them, the structure specification strategy refers to a strategy for reconstructing the structural relationship of elements. The structure specification strategy is the rule for grouping elements, that is, what kind of structure elements can be grouped into one element; the redundant filtering strategy refers to a strategy for filtering repeated redundant elements in each element, such as filtering out the covered elements in the first element, and the remaining elements are used as the second elements that are screened out; the attribute filtering strategy refers to a strategy for filtering attribute information that is obviously not a component element, such as filtering out the elements whose attribute information of the second element is text, and the remaining elements are used as candidate elements that are screened out.
[0063] It should be noted that since the element structure information is a complete expression of the image to be identified in the design draft to be identified, there are a large number of redundant elements and dirty data, which will seriously affect the accuracy of the subsequent matching algorithm. Therefore, they can be deleted through the element screening strategy before matching. The element screening strategy mainly identifies and screens by analyzing the hierarchical relationship and position relationship between elements, element attribute information, etc. The elements retained after identification are the screened candidate elements.
[0064] In actual implementation, when creating design drafts, different people have different creation habits, but the final visual effects are the same, that is, different element structure information may correspond to the same visual image, so different element structure information may cause problems for subsequent matching and fail to accurately recall component elements. Therefore, according to the hierarchical relationship, position relationship and the set structural specification strategy, the elements in the image to be identified can be regrouped to obtain the first element, and the obtained first element structure is similar.
[0065] For example, the structural specification strategy is to group elements with similar positions and hierarchical relationships into one element. For example, a designer designs an illustration that includes many elements. Some designers may draw a big tree first, then merge the big tree into one layer, draw a flower, merge the flower into one layer, and then merge the tree and the flower into one layer; while some designers may not have this process, such as drawing each element one by one, and each stroke will correspond to an element, which will result in a lot of elements. Therefore, the elements corresponding to the strokes are a kind of interference information. The strokes corresponding to the tree can be grouped into an element "tree", and the strokes corresponding to the flower can be grouped into an element "flower" to obtain a similar structure and remove redundant information.
[0066] It should be noted that the structural specification strategy can be used to standardize the design. According to a certain unified strategy, similar structures can be generated as much as possible for different design drafts to remove structural interference information. In addition, the redundant filtering strategy can also be used to filter out repeated redundant elements, further filter out data, and reduce the interference of repeated content.
[0067] Furthermore, some elements are obviously not component elements, such as text, color, a large number of vector nodes in icons, etc. These elements are meaningless nodes, so it is also possible to identify element attribute information and filter out non-component elements in the second element that meet the attribute filtering strategy to obtain candidate elements, thereby using the attribute filtering strategy to filter out meaningless elements that cannot be component elements and reduce interference information.
[0068] In the embodiments of this specification, a structural standardization strategy is used to regroup the elements so that the structure of the elements is standardized, a redundant filtering strategy is used to remove redundant elements, and an attribute filtering strategy is used to filter out meaningless elements, and the elements that remain are the selected candidate elements. In this way, through the configuration of multiple element screening strategies, candidate elements are selected from the elements in the image to be identified, and can be subsequently matched with the detection results of the component detection model, which greatly reduces the amount of data that needs to be matched, and can also reduce the matching errors caused by too many matching items in the subsequent matching process, thereby improving the recognition efficiency and recognition accuracy of component elements.
[0069] Of course, in actual implementation, in addition to the above-mentioned structure specification strategy, redundant filtering strategy, and attribute filtering strategy, other element screening strategies can also be configured according to business needs to filter elements that do not need to be matched, and the embodiments of this specification do not limit this.
[0070] In an optional implementation of this embodiment, the redundant filtering strategy retains one of at least two elements with the same display content; and the second element is filtered from the first element according to the hierarchical relationship, the position relationship and the redundant filtering strategy, including:
[0071] When the hierarchical relationship indicates that at least two elements have a parent-child relationship, and the positional relationship indicates that at least two elements are located at the same position, determining whether the display contents of the parent element and the child element of the at least two elements are the same;
[0072] If they are the same, any one of the parent element and child element with the same display content will be used as the second element.
[0073] It should be noted that when at least two elements have a parent-child relationship and the position relationship indicates that at least two elements are located in the same position, it can be determined whether the display content of the parent element and the child element in the at least two elements is the same. If they are the same, one of them can be selected as the second element to be filtered out.
[0074] In the embodiments of the present specification, when the displayed content is the same, one of them is selected as a representative, which can filter out a large number of redundant elements, greatly reducing the amount of data that needs to be matched. It can also reduce matching errors caused by too many matching items in the subsequent matching process, thereby improving the recognition efficiency and recognition accuracy of component elements.
[0075] Step 106: Match the component position of at least one component with the element position of each candidate element respectively, and determine a reference element corresponding to the at least one component.
[0076] It should be noted that after obtaining the component detection results and candidate elements, the component positions of each component in the component detection results can be matched with the element positions of each candidate element through a matching algorithm to correspond the detected components to the candidate elements and bind the relationship between the two.
[0077] In actual implementation, multiple matching indicators may be used to match the component position of at least one component with the element position of each candidate element, and candidate elements that meet the requirements are selected and retained as matched reference elements.
[0078] In one possible implementation, the component position of at least one component can be matched with the element position of each candidate element to determine the reference element corresponding to the at least one component; in another possible implementation, the candidate element close to the component position of at least one component can be determined, and then the component position of at least one component can be matched with the element position of each close candidate element to determine the reference element corresponding to the at least one component. Wherein, close position can mean that the distance is within a set range. In this way, when matching the detected components with the candidate elements, only the candidate elements with close positions are considered, and other candidate elements that are far away can be ignored, thereby reducing the amount of data required for matching calculations.
[0079] In an optional implementation of this embodiment, the component position indicates a component region where the component is located, and the element position indicates an element region where the candidate element is located; matching the component position of at least one component with the element position of each candidate element respectively to determine a reference element corresponding to at least one component includes:
[0080] Determine respectively the intersection-and-area ratios of a first component region of a first component and an element region of each candidate element, wherein the first component is any one of the at least one component, and the first component region is a region indicated by a component position of the first component;
[0081] Determine a target candidate element from each candidate element according to the intersection area ratio;
[0082] When the intersection area ratio corresponding to the target candidate element is greater than the recall threshold, the target candidate element is used as the reference element corresponding to the first component.
[0083] In actual implementation, the component position indicates the component area where the component is located, and the element position indicates the element area where the candidate element is located. The overlap index of the component area and the element area is calculated to represent the corresponding relationship between the two. For example, the intersection over union (IOU) area can be used to match the two.
[0084] Specifically, the first component is determined from the identified components, and then the intersection area ratio of the first component area indicated by the component position of the first component and the element area of each candidate element is calculated respectively, and the candidate element with the largest intersection area ratio is selected as the target candidate element corresponding to the first component; when the intersection area ratio corresponding to the target candidate element is greater than the recall threshold, it means that the two can be regarded as one element, and the target candidate element can be used as the reference element corresponding to the first component; if the intersection area ratio corresponding to the target candidate element is not greater than the recall threshold, it means that no candidate element can represent the first component, that is, the first component may be an identification error, there is no corresponding component element, and the identified first component is ignored. Then, continue to select the next component as the first component, determine the corresponding reference element, so that the reference elements corresponding to each identified component can be obtained.
[0085] In the embodiments of the present specification, the reference elements corresponding to each component are determined by utilizing the intersection area ratio of the component area of the component and the element area of each candidate element, and the components identified by the component detection model are associated with the candidate elements determined based on the element structure information. This does not rely solely on the image features of the component elements, thereby greatly improving the recognition accuracy of the component elements and enabling the component elements to be determined quickly and accurately.
[0086] In an optional implementation of this embodiment, when the intersection-and-area ratio corresponding to the target candidate element is greater than the recall threshold, before taking the target candidate element as the reference element corresponding to the first component, the method further includes:
[0087] determining a component size of the first component according to the first component area;
[0088] A corresponding recall threshold is determined according to a component size of the first component, wherein different component sizes correspond to different recall thresholds.
[0089] It should be noted that before the image to be identified is input into the component detection model, it may need to be scaled to a size that the component detection model can identify and process. Therefore, the component detection results identified by the component detection model may have pixel-level errors. Therefore, when mapping the component position in the component detection result back to the image to be identified, pixel-level position errors may occur. For components with larger sizes, the impact at the pixel level is relatively small, while for components with smaller sizes, the impact at the pixel level is relatively large. If the same recall threshold is used for recall, some reference elements may be recalled incorrectly or some reference elements may be missed.
[0090] Therefore, in practical applications, different component sizes may correspond to different recall thresholds, and recall thresholds corresponding to different size ranges may be pre-configured. A higher recall threshold may be configured for a larger component size. Then, the component size of the first component is determined according to the first component area; the corresponding recall threshold is determined according to the component size of the first component, and then based on the recall threshold, it is determined whether to use the target candidate element as the reference element corresponding to the first component. For example, a recall threshold such as 0.5 may be set for a component size less than X1, and a higher recall threshold such as 0.9 may be set for a component size greater than or equal to X1.
[0091] In the embodiments of this specification, in order to find more reference elements matching the components more accurately, different recall thresholds may be set according to different component sizes to improve the fault tolerance of the component detection model, thereby improving the matching accuracy.
[0092] In an optional implementation of this embodiment, after matching the component position of at least one component with the element position of each candidate element and determining the reference element corresponding to the at least one component, the method further includes:
[0093] If the matching result indicates that an error element exists, determining reference attribute information of the error element, wherein the error element includes an element that cannot be matched and / or an element that matches incorrectly;
[0094] The attribute filtering policy is updated according to the reference attribute information to obtain an updated attribute filtering policy, wherein the updated attribute filtering policy is used to filter out elements corresponding to the reference attribute information when determining candidate elements.
[0095] In actual implementation, the reference attribute information of the erroneous element may be added to the attribute filtering strategy, so that the element corresponding to the reference attribute information is filtered out when determining the candidate element.
[0096] It should be noted that the structural specification strategy, redundancy filtering strategy and attribute filtering strategy can all be configured based on actual business needs and experience. In addition, in the process of matching the component position of at least one component with the element position of each candidate element, it may be found that some candidate elements cannot be matched with the component, or the matching is incorrect. At this time, the attribute filtering strategy can be updated according to the reference attribute information corresponding to the elements that cannot be matched and / or the elements that match incorrectly. The elements that cannot be matched and / or the elements that match incorrectly can be filtered out in the candidate element screening stage, further improving the matching efficiency and accuracy.
[0097] Step 108: Determine a target component element included in the image to be identified based on a reference element corresponding to at least one component.
[0098] It should be noted that the reference element corresponding to the component is the component identified by the component detection model, and the corresponding matched element. According to the reference elements corresponding to each component, the target component element included in the image to be identified, that is, the detection result of the component element, can be determined.
[0099] In an optional implementation of this embodiment, determining the target component element included in the to-be-recognized image according to the reference element corresponding to at least one component includes:
[0100] In a case where there are at least two reference elements corresponding to the second component, determining component content corresponding to the second component, wherein the second component is any one of the at least one component;
[0101] Determine the content intersection of the element content of each reference element and the component content of the second component respectively;
[0102] According to the content intersection, a target component element corresponding to the second component is determined from the reference element corresponding to the second component.
[0103] It should be noted that since there are multiple candidate elements with the same position and size (for example, the position and size of the candidate elements including the background elements are generally the same as the position and size of the background elements), there may be more than one reference element matched for each component. If there are at least two reference elements corresponding to the second component, the intersection of the included content can be determined, and the reference elements corresponding to the second component can be screened out.
[0104] In practical applications, the element content of each reference element and the component content of the second component can be respectively intersected, and the reference element with the largest content intersection can be selected as the target component element corresponding to the second component. Specifically, the component content included in the element structure information can be queried based on the identified component position of the second component, and the element content included in each reference element can be queried in the element structure information, and the proportion of the same content between the two can be counted to determine the content intersection.
[0105] For example, for component A identified by the component detection model, the corresponding reference elements are determined from the candidate elements as element 1, element 2, and element 3. Component A includes trees and flowers, element 1 includes trees, element 2 includes flowers, and element 3 includes trees and flowers. The content intersection of component A and the content of elements 1, 2, and 3 is calculated respectively. It can be determined that the content intersection of component A and element 3 is 100%. Therefore, it can be determined that the target component element corresponding to component A is element 3, that is, the component element matched for component A is element 3, and element 3 may be the component element corresponding to the position of component A.
[0106] In the embodiment of this specification, the larger the content intersection is, the more overlapping content there is between the reference element and the second component, and the greater the possibility of a match between the two. Therefore, when at least two reference elements are matched for a certain component, the target reference elements that may be matched can be further determined based on the content intersection to improve the accuracy of the match.
[0107] It should be noted that after determining the target component elements included in the image to be identified based on the reference elements corresponding to at least one component, the identified target component elements may still contain errors, so corresponding post-processing strategies can be performed to further correct the target component elements.
[0108] In an optional implementation of this embodiment, the component detection result further includes a component category of at least one component; and determining, according to a reference element corresponding to the at least one component, a target component element included in the image to be identified includes:
[0109] Determining whether there are unidentified similar elements in a first component category, wherein the first component category is a component category corresponding to any component of the at least one component;
[0110] If so, it is determined whether the similar element is a target component element under the first component category based on the structural information and attribute information of the similar element.
[0111] It should be noted that elements with similar structures may also have similar categories. For example, the image to be identified includes a list. Each row of the list is a component element, and the category is list component. Assuming that the list includes 10 rows, the component detection model only identifies the components corresponding to rows 1 to 8 and matches them to the corresponding component elements. Then, for rows 9 and 10, missed identification may occur. In fact, rows 9 and 10 are also component elements of the list component category.
[0112] Therefore, in actual implementation, it is possible to determine whether there are unidentified similar elements in the identified first component category. If so, the structural information and attribute information of the similar elements can be obtained to determine whether the similar elements are target component elements under a component category. Specifically, similar elements with similar structures to the target component elements under the first component category can be obtained, and the corresponding structural information can be obtained. According to the hierarchical relationship and positional relationship in the structural information, the degree of similarity with each target component element under the first component category can be determined. If the degree of similarity meets the requirements, the similar elements can also be used as target component elements under the identified first component category; if they are not the same, the similar elements can be ignored. And / or, the attribute information of the similar elements can also be determined, and the number of similar elements can be determined according to the attribute information. If the number of target component elements under the first component category is greater than the number of similar elements, the similar elements can also be used as target component elements under the identified first component category.
[0113] For example, if 8 component elements are detected under a component category and there are 2 similar elements, then it can be considered that the 2 similar elements are missed identification. In this case, the 2 similar elements can also be regarded as component elements of the same component category; if 2 component elements are detected under a component category and there are 2 similar elements, then it may be that the 2 similar elements are missed identification or the component detection model may have made an identification error. In this case, the 2 component elements and the 2 similar elements can be ignored to avoid incorrect identification.
[0114] In the embodiments of the present specification, there may be problems with missed detection of components identified by the component detection model. For missed detected elements, it is possible to determine whether there are similar elements with a similar structure to the target component element under a certain component category and which have not been detected based on the element structure information. If there are similar elements, they can be added to the component elements and classified into the component category to improve the recognition accuracy of the component elements.
[0115] In an optional implementation of this embodiment, the component detection result further includes a component category of at least one component; after determining the target component element included in the to-be-identified image according to the reference element corresponding to the at least one component, the following further includes:
[0116] Clustering at least two target component elements with similar positions to obtain a cluster component set;
[0117] The component category corresponding to each target component element in the clustering component set is determined, and the component category corresponding to each target component element in the clustering component set is corrected.
[0118] It should be noted that in addition to outputting the component position of the identified component, the component detection model can also output the identified component category. Therefore, in addition to the problem of missed detection, the identified component may also have the problem of misclassification. The component category corresponding to the target component element can be corrected through clustering.
[0119] In actual implementation, component elements with similar positions are generally of the same category. Therefore, at least two target component elements with similar positions can be clustered to obtain a clustered component set. Then, the component category corresponding to each target component element in the clustered component set is determined. If there are at least two component categories in the clustered component set, the proportion of various component categories can be determined, and the component category with a small proportion can be modified, such as changing the component category with a small proportion to a component category with a large proportion.
[0120] For example, at least two target component elements with similar positions are clustered to obtain a clustered component set including 10 target component elements. The component categories of target component elements 1-8 are all buttons, while the component categories of target component elements 9-10 are icons. At this time, the component categories of target component elements 9-10 can be corrected from icons to buttons.
[0121] In the embodiments of this specification, the component category corresponding to the target component element is corrected through clustering to improve the classification accuracy of the component element.
[0122] In an optional implementation of this embodiment, the component detection result further includes a component category of at least one component; after determining the target component element included in the to-be-identified image according to the reference element corresponding to the at least one component, the following further includes:
[0123] Determine the component category of each target component element;
[0124] According to the component category of each target component element, determine whether there are mutually exclusive component elements that do not meet the business constraint rules in each target component element;
[0125] If it exists, the updated component element is determined based on the confidence of the mutually exclusive component element.
[0126] In actual implementation, in addition to the above-mentioned correction of the component category corresponding to the target component element by clustering, the component category can also be corrected by using the mutually exclusive relationship. Specifically, the component category of each identified target component element can be determined, and then it can be determined whether there are mutually exclusive component elements that do not meet the business constraint rules in each target component element. If so, the component element with high confidence is selected from the mutually exclusive component elements as the final recognition result. Among them, the business constraint rule is a logical constraint pre-configured based on business needs. For example, the status bar and the button are both component elements, but the status bar cannot include a button. Assuming that the component element 1 in the identified target component element is the status bar and the component element 2 is the button, the query element structure information can be known that the member element 2 is located in the component element 1, which does not meet the business constraint rules. At this time, the recognition confidence of the component element 1 and the component element 2 can be obtained. Assuming that the confidence of the component element 1 is high, the component element 1 is the recognized result at this time, and the component element 2 is discarded, that is, the component element is updated to the member element 1 as the final component recognition result.
[0127] It should be noted that the component category corresponding to the target component element is corrected through the mutually exclusive relationship of the business constraint rules to improve the classification accuracy of the component element.
[0128] In actual applications, after identifying the target component elements and the corresponding component categories, a component library can be built based on the identified target component elements. The component library can be used as a resource library and provided to subsequent designers for direct use, or the automatic design function can be used to automatically select the corresponding component elements from the component library based on the description entered by the user to generate the corresponding design draft.
[0129] The embodiments of this specification provide a method for identifying component elements in a design draft, which uses a component detection model to directly identify the component position of each component in the image to be identified, without the need to render each element in the image to be identified separately. It has high operating efficiency and can meet high-concurrency and high-request business scenarios. It also combines the element structure information of each element in the image to be identified and the element screening strategy to screen candidate elements, matches the recognition results of the component detection model, and determines the target component elements. It does not rely solely on the image features of the component elements, greatly improves the recognition accuracy of the component elements, and can quickly and accurately determine the component elements. It can also quickly increase or decrease the element screening strategy and replace the component detection model according to the complexity of the task, speed requirements, etc., and can quickly and accurately determine the component elements. A high-accuracy and high-recall component element recognition and classification scheme is achieved by a model plus strategy approach.
[0130] Figure 3 A schematic diagram of a processing process of a method for identifying component elements in a design draft provided by an embodiment of this specification is shown. Figure 3As shown, a design draft to be identified is obtained, and then a picture to be identified is rendered according to the design draft to be identified, and the picture to be identified is input into a component detection model to obtain the component position and component category of at least one identified component. In addition, a structure tree of the picture to be identified is obtained according to the design draft to be identified, and candidate elements are screened according to the structure tree and the element screening strategy, and the element information of the candidate elements includes the element position. Afterwards, the component position of each component is matched with the element position of each candidate element, and the reference element corresponding to each component is determined, and the target component element included in the picture to be identified is determined according to the reference element. Then, the component element recognition result in the picture to be identified is determined through post-processing strategies such as structurally similar element supplementation, clustering correction, and mutually exclusive screening.
[0131] Corresponding to the above method embodiment, this specification also provides an embodiment of a device for identifying component elements in a design draft. Figure 4 FIG. 1 is a schematic diagram showing a structure of a device for identifying component elements in a design draft provided by an embodiment of the present specification. Figure 4 As shown, the device comprises:
[0132] The identification module 402 is configured to obtain a picture to be identified in the design draft to be identified, and identify a component detection result of the picture to be identified using a component detection model, wherein the component detection result includes a component position of at least one component;
[0133] A first determination module 404 is configured to obtain element structure information of each element in the image to be identified, and determine a candidate element from each element according to the element structure information;
[0134] A matching module 406 is configured to match the component position of at least one component with the element position of each candidate element, respectively, to determine a reference element corresponding to the at least one component;
[0135] The second determination module 408 is configured to determine a target component element included in the to-be-recognized picture according to a reference element corresponding to at least one component.
[0136] Optionally, the element structure information includes the hierarchical relationship and position relationship of each element; the first determination module 404 is further configured to:
[0137] According to the hierarchical relationship, positional relationship and the set structural specification strategy, the elements in the image to be identified are regrouped to obtain the first element;
[0138] Filter the second element from the first element according to the hierarchical relationship, positional relationship and redundant filtering strategy;
[0139] According to the element attribute information of the second element, non-component elements in the second element that meet the attribute filtering strategy are screened out to obtain candidate elements.
[0140] Optionally, the redundancy filtering strategy is to retain one of at least two elements with the same display content; the first determination module 404 is further configured to:
[0141] When the hierarchical relationship indicates that at least two elements have a parent-child relationship, and the positional relationship indicates that at least two elements are located at the same position, determining whether the display contents of the parent element and the child element of the at least two elements are the same;
[0142] If they are the same, any one of the parent element and child element with the same display content will be used as the second element.
[0143] Optionally, the device further includes a first updating module configured to:
[0144] If the matching result indicates that an error element exists, determining reference attribute information of the error element, wherein the error element includes an element that cannot be matched and / or an element that matches incorrectly;
[0145] The attribute filtering policy is updated according to the reference attribute information to obtain an updated attribute filtering policy, wherein the updated attribute filtering policy is used to filter out elements corresponding to the reference attribute information when determining candidate elements.
[0146] Optionally, the component position indicates a component region where the component is located, and the element position indicates an element region where the candidate element is located; the matching module 406 is further configured to:
[0147] Determine respectively the intersection-and-area ratios of a first component region of a first component and an element region of each candidate element, wherein the first component is any one of the at least one component, and the first component region is a region indicated by a component position of the first component;
[0148] Determine a target candidate element from each candidate element according to the intersection area ratio;
[0149] When the intersection area ratio corresponding to the target candidate element is greater than the recall threshold, the target candidate element is used as the reference element corresponding to the first component.
[0150] Optionally, the matching module 406 is further configured to:
[0151] determining a component size of the first component according to the first component area;
[0152] A corresponding recall threshold is determined according to a component size of the first component, wherein different component sizes correspond to different recall thresholds.
[0153] Optionally, the second determining module 408 is further configured to:
[0154] In a case where there are at least two reference elements corresponding to the second component, determining component content corresponding to the second component, wherein the second component is any one of the at least one component;
[0155] Determine the content intersection of the element content of each reference element and the component content of the second component respectively;
[0156] According to the content intersection, a target component element corresponding to the second component is determined from the reference element corresponding to the second component.
[0157] Optionally, the component detection result further includes a component category of at least one component; the second determination module 408 is further configured to:
[0158] Determining whether there are unidentified similar elements in a first component category, wherein the first component category is a component category corresponding to any component of the at least one component;
[0159] If so, it is determined whether the similar element is a target component element under the first component category based on the structural information and attribute information of the similar element.
[0160] Optionally, the component detection result further includes a component category of at least one component; and the device further includes a correction module configured to:
[0161] Clustering at least two target component elements with similar positions to obtain a cluster component set;
[0162] The component category corresponding to each target component element in the clustering component set is determined, and the component category corresponding to each target component element in the clustering component set is corrected.
[0163] Optionally, the component detection result further includes a component category of at least one component; and the apparatus further includes a second updating module configured to:
[0164] Determine the component category of each target component element;
[0165] According to the component category of each target component element, determine whether there are mutually exclusive component elements that do not meet the business constraint rules in each target component element;
[0166] If it exists, the updated component element is determined based on the confidence of the mutually exclusive component element.
[0167] In an embodiment of the present specification, a device for identifying component elements in a design draft is provided, including an identification module, a first determination module, a matching module, and a second determination module. Through the interaction of the above modules, the component position of each component in the image to be identified is identified, and there is no need to render each element in the image to be identified separately. The operation efficiency is high, and it can meet high-concurrency and high-request business scenarios. The element structure information of each element in the image to be identified and the element screening strategy are combined to screen candidate elements, and the recognition results of the component detection model are matched to determine the target component elements. It does not rely solely on the image features of the component elements, greatly improves the recognition accuracy of the component elements, can quickly and accurately determine the component elements, and can quickly increase or decrease the element screening strategy and replace the component detection model according to the complexity of the task, speed requirements, etc., can quickly and accurately determine the component elements, and realizes a high-accuracy and high-recall component element recognition and classification scheme by a model plus strategy method.
[0168] The above is a schematic scheme of a device for identifying component elements in a design draft of this embodiment. It should be noted that the technical scheme of the device for identifying component elements in the design draft and the technical scheme of the method for identifying component elements in the design draft described above belong to the same concept, and the details of the technical scheme of the device for identifying component elements in the design draft that are not described in detail can all be referred to the description of the technical scheme of the method for identifying component elements in the design draft described above.
[0169] Figure 5 The block diagram of a computing device according to an embodiment of the present specification is shown. The components of the computing device 500 include but are not limited to a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and the database 550 is used to store data.
[0170] The computing device 500 also includes an access device 540, which enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).
[0171] In one embodiment of the present specification, the above components of the computing device 500 and Figure 5 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 5 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0172] The computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 500 may also be a mobile or stationary server.
[0173] The processor 520 is used to execute the following computer executable instructions, which, when executed by the processor, implement the steps of the method for identifying component elements in the above-mentioned design draft.
[0174] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the method for identifying component elements in the above-mentioned design draft belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the method for identifying component elements in the above-mentioned design draft.
[0175] An embodiment of the present specification also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the method for identifying component elements in the above-mentioned design draft.
[0176] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the method for identifying component elements in the above-mentioned design draft belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the method for identifying component elements in the above-mentioned design draft.
[0177] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the method for identifying component elements in the above-mentioned design draft.
[0178] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the method for identifying component elements in the above-mentioned design draft belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the method for identifying component elements in the above-mentioned design draft.
[0179] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0180] Computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate form, etc. Computer readable media may include: any entity or device capable of carrying computer program codes, recording media, USB flash drives, mobile hard disks, magnetic disks, optical disks, computer memories, read-only memories (ROM), random access memories (RAM), electric carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the contents of computer readable media may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer readable media do not include electric carrier signals and telecommunication signals.
[0181] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0182] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0183] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to specific implementation methods. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can understand and use this specification well. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A method for identifying component elements in a design draft, characterized in that: The method comprises: Acquire a picture to be identified in the design draft to be identified, and identify a component detection result of the picture to be identified using a component detection model, wherein the component detection result includes a component position of at least one component; Acquire element structure information of each element in the to-be-recognized image, and determine candidate elements from the elements according to the element structure information; Matching the component position of the at least one component with the element position of each candidate element respectively, and determining a reference element corresponding to the at least one component; According to the reference element corresponding to the at least one component, a target component element included in the to-be-identified picture is determined.
2. The method for identifying component elements in a design draft according to claim 1, characterized in that: The element structure information includes the hierarchical relationship and position relationship of each element; The determining a candidate element from the elements according to the element structure information includes: According to the hierarchical relationship, the positional relationship and the set structural specification strategy, regrouping the elements in the to-be-recognized image to obtain a first element; Filtering a second element from the first element according to the hierarchical relationship, the positional relationship, and a redundant filtering strategy; According to the element attribute information of the second element, non-component elements in the second element that meet the attribute filtering policy are screened out to obtain the candidate element.
3. The method for identifying component elements in a design draft according to claim 2, characterized in that: The redundant filtering strategy retains one of at least two elements with the same display content; The filtering of the second element from the first element according to the hierarchical relationship, the positional relationship and the redundant filtering strategy includes: When the hierarchical relationship indicates that at least two elements have a parent-child relationship, and the position relationship indicates that the at least two elements are located at the same position, determining whether display contents of the parent element and the child element of the at least two elements are the same; If they are the same, any one of the parent element and child element with the same display content will be used as the second element.
4. The method for identifying component elements in a design draft according to claim 2, characterized in that: After matching the component position of the at least one component with the element position of each candidate element respectively to determine the reference element corresponding to the at least one component, the method further includes: If the matching result indicates that an error element exists, determining reference attribute information of the error element, wherein the error element includes an element that cannot be matched and / or an element with an error in matching; The attribute filtering policy is updated according to the reference attribute information to obtain an updated attribute filtering policy, wherein the updated attribute filtering policy is used to filter out elements corresponding to the reference attribute information when determining the candidate elements.
5. The method for identifying component elements in a design draft according to claim 1, characterized in that: The component position indicates a component region where the component is located, and the element position indicates an element region where the candidate element is located; and the matching of the component position of the at least one component with the element position of each candidate element to determine a reference element corresponding to the at least one component includes: Determine respectively the intersection-and-area ratios of a first component region of a first component and an element region of each candidate element, wherein the first component is any one of the at least one component, and the first component region is a region indicated by a component position of the first component; Determine a target candidate element from the candidate elements according to the intersection area ratio; When the intersection-and-area ratio corresponding to the target candidate element is greater than a recall threshold, the target candidate element is used as a reference element corresponding to the first component.
6. The method for identifying component elements in a design draft according to claim 5, characterized in that: Before taking the target candidate element as the reference element corresponding to the first component when the intersection-and-area ratio corresponding to the target candidate element is greater than a recall threshold, the method further includes: determining a component size of the first component according to the first component area; A corresponding recall threshold is determined according to a component size of the first component, wherein different component sizes correspond to different recall thresholds.
7. The method for identifying component elements in a design draft according to claim 1, characterized in that: The determining, according to the reference element corresponding to the at least one component, a target component element included in the to-be-recognized picture includes: In a case where there are at least two reference elements corresponding to a second component, determining component content corresponding to the second component, wherein the second component is any one of the at least one component; respectively determining content intersections of element content of each reference element and component content of the second component; According to the content intersection, a target component element corresponding to the second component is determined from reference elements corresponding to the second component.
8. The method for identifying component elements in a design draft according to claim 1, characterized in that: The component detection result also includes a component category of at least one component; and determining, according to a reference element corresponding to the at least one component, a target component element included in the to-be-identified image includes: Determine whether there is an unidentified similar element in a first component category, wherein the first component category is a component category corresponding to any component of the at least one component; If so, it is determined whether the similar element is a target component element under the first component category based on the structural information and attribute information of the similar element.
9. The method for identifying component elements in a design draft according to claim 1, characterized in that: The component detection result also includes a component category of at least one component; after determining the target component element included in the to-be-identified image according to the reference element corresponding to the at least one component, the method further includes: Clustering at least two target component elements with similar positions to obtain a cluster component set; The component category corresponding to each target component element in the cluster component set is determined, and the component category corresponding to each target component element in the cluster component set is modified.
10. The method for identifying component elements in a design draft according to claim 1, characterized in that: The component detection result also includes a component category of at least one component; after determining the target component element included in the to-be-identified image according to the reference element corresponding to the at least one component, the method further includes: Determine the component category of each target component element; Determining, according to the component categories of the target component elements, whether there are mutually exclusive component elements that do not comply with the business constraint rules among the target component elements; If so, the updated component element is determined according to the confidence of the mutually exclusive component element.
11. A device for identifying component elements in a design draft, characterized in that: The device comprises: The recognition module is configured to obtain a picture to be recognized in the design draft to be recognized, and recognize a component detection result of the picture to be recognized by using a component detection model, wherein the component detection result includes a component position of at least one component; A first determination module is configured to obtain element structure information of each element in the to-be-recognized image, and determine a candidate element from the elements according to the element structure information; a matching module, configured to match the component position of the at least one component with the element position of each candidate element, respectively, to determine a reference element corresponding to the at least one component; The second determination module is configured to determine a target component element included in the to-be-identified image according to a reference element corresponding to the at least one component.
12. A computing device, characterized in that: include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method for identifying component elements in a design draft described in any one of claims 1 to 10 are implemented.
13. A computer-readable storage medium, characterized in that: It stores computer executable instructions, which, when executed by a processor, implement the steps of the method for identifying component elements in a design draft as described in any one of claims 1 to 10.
14. A computer program product, characterized in that The invention comprises a computer program / instruction, which, when executed by a processor, implements the steps of the method for identifying component elements in a design draft as described in any one of claims 1 to 10.
