Image generation method, user interface image generation method, and computing device
By converting the initial image into text description information and iteratively adjusting it, and by utilizing image processing models and code generation models, the problem of low accuracy in converting design drafts into software interfaces in software development is solved, achieving an efficient and accurate image generation process.
Patent Information
- Application Number
- PCT/CN2025/103035
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-15
- Filing Date
- 2025-06-24
- Publication Date
- 2026-01-22
AI Technical Summary
In the software development process, existing technologies have low accuracy when converting design drafts into software interfaces, resulting in a large amount of manual adjustments and time costs.
By converting the initial image into text description information, image generation code is generated using an image processing model and a code generation model. The text description information is then iteratively adjusted until the correlation between the initial image and candidate images meets preset conditions, and the image generation code is automatically optimized to generate the target image.
It improves the accuracy and efficiency of software development, reduces the time and cost of manual adjustments, and ensures that the generated images are consistent with the initial design.
Smart Images

Figure CN2025103035_22012026_PF_FP_ABST
Abstract
Description
Image generation method, user interface image generation method and computing device Cross-references to related applications
[0001] This disclosure claims priority to Chinese patent application No. 202410950077.9, filed on July 15, 2024, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This disclosure relates to the field of computer technology, and in particular to image generation methods, user interface image generation methods, and computing devices. Background Technology
[0003] In software development, user interface design and front-end development are two separate processes. Front-end developers typically need to convert the design drafts into the actual user interface. However, this conversion process is usually time-consuming and resource-intensive, and the accuracy of the conversion is often limited by the precision of human coding, resulting in low accuracy. Furthermore, significant manual adjustments are required during development, wasting both labor and time. Therefore, an effective technical solution is urgently needed to address these issues. Summary of the Invention
[0004] In view of this, embodiments of this disclosure provide an image generation method. One or more embodiments of this disclosure also relate to an image generation apparatus, a user interface image generation method, a user interface image generation device, an image generation system, a computing device, a computer-readable storage medium, and a computer program product, to address the technical deficiency in the prior art where the accuracy of the conversion from design drawings to software interfaces is low.
[0005] According to a first aspect of the present disclosure, an image generation method is provided, comprising: determining text description information for an initial image; generating image generation code corresponding to the initial image based on the text description information; running the image generation code to obtain a candidate image corresponding to the image generation code; adjusting the text description information according to the association relationship between the initial image and the candidate image; and continuing to execute the step of generating image generation code corresponding to the initial image based on the adjusted text description information until the association relationship between the initial image and the candidate image satisfies a preset association condition, and then determining a target image based on the candidate image.
[0006] According to a second aspect of the present disclosure, an image generation apparatus is provided, comprising: a determining module configured to determine textual description information for an initial image; a generating module configured to generate image generation code corresponding to the initial image based on the textual description information; a running module configured to run the image generation code to obtain a candidate image corresponding to the image generation code; and an adjusting module configured to adjust the textual description information based on the association relationship between the initial image and the candidate image, and continue to execute the step of generating image generation code corresponding to the initial image based on the adjusted textual description information until the association relationship between the initial image and the candidate image satisfies a preset association condition, and then determine a target image based on the candidate image.
[0007] According to a third aspect of the present disclosure, a user interface image generation method is provided, comprising: determining text description information for an initial user interface image; generating image generation code corresponding to the initial user interface image based on the text description information; running the image generation code to obtain a candidate user interface image corresponding to the image generation code; adjusting the text description information according to the association relationship between the initial user interface image and the candidate user interface image, and continuing to execute the step of generating image generation code corresponding to the initial user interface image based on the adjusted text description information, until the association relationship between the initial user interface image and the candidate user interface image satisfies a preset association condition, and then determining a target user interface image based on the candidate user interface image.
[0008] According to a fourth aspect of the present disclosure, a user interface image generation apparatus is provided, comprising: a determining module configured to determine text description information for an initial user interface image; a generating module configured to generate image generation code corresponding to the initial user interface image based on the text description information; a running module configured to run the image generation code to obtain a candidate user interface image corresponding to the image generation code; and an adjusting module configured to adjust the text description information based on the association relationship between the initial user interface image and the candidate user interface image, and continue to execute the step of generating image generation code corresponding to the initial user interface image based on the adjusted text description information, until the association relationship between the initial user interface image and the candidate user interface image satisfies a preset association condition, and then determine a target user interface image based on the candidate user interface image.
[0009] According to a fifth aspect of the present disclosure, an image generation system is provided, including an edge device and a cloud device. The edge device is configured to determine an initial image and send the initial image to the cloud device. The cloud device is configured to determine text description information for the initial image; generate image generation code corresponding to the initial image based on the text description information; run the image generation code to obtain a candidate image corresponding to the image generation code; adjust the text description information according to the association between the initial image and the candidate image, and continue to execute the step of generating the image generation code corresponding to the initial image based on the adjusted text description information, until the association between the initial image and the candidate image satisfies a preset association condition; determine a target image based on the candidate image; and send the target image generation code corresponding to the target image to the edge device.
[0010] According to a sixth aspect of the present disclosure, a computing device is provided, comprising: a memory and a processor; the memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, wherein the computer programs / instructions, when executed by the processor, implement the steps of the above-described method.
[0011] According to a seventh aspect of the present disclosure, a computer-readable storage medium is provided that stores a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.
[0012] According to an eighth aspect of the present disclosure, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.
[0013] One embodiment of this disclosure converts an initial image into text description information, generates image generation code corresponding to the initial image based on the text description information, runs the image generation code to obtain candidate images corresponding to the image generation code, adjusts the text description information based on the correlation between the initial image and the candidate images, and continues to iteratively execute the step of generating image generation code based on the adjusted text description information until the correlation between the initial image and the candidate images meets a preset correlation condition. Finally, a target image is determined based on the candidate images. By automatically adjusting the text description information, the image generation code is optimized, ensuring the consistency between the target image generated by the optimized image generation code and the initial image, further ensuring the accuracy of converting the initial image into image generation code, and avoiding the time and labor costs of manually adjusting the image generation code. Attached Figure Description
[0014] Figure 1 is a schematic diagram of an application scenario of an image generation method provided in an embodiment of this disclosure;
[0015] Figure 2 is a flowchart of an image generation method provided in an embodiment of this disclosure;
[0016] Figure 3 is a flowchart of the processing procedure of an image generation method provided in an embodiment of this disclosure;
[0017] Figure 4 is a schematic diagram of the structure of an image generation apparatus provided in an embodiment of this disclosure;
[0018] Figure 5 is a flowchart of a user interface image generation method provided in an embodiment of this disclosure;
[0019] Figure 6 is a schematic diagram of a user interface image generation device provided in an embodiment of the present disclosure;
[0020] Figure 7 is a structural block diagram of a computing device provided in an embodiment of this disclosure. Detailed Implementation
[0021] Numerous specific details are set forth in the following description to provide a full understanding of this disclosure. However, this disclosure can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this disclosure. Therefore, this disclosure is not limited to the specific implementations disclosed below.
[0022] The terminology used in one or more embodiments of this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this disclosure. The singular forms “a,” “the,” and “the” as used in one or more embodiments of this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this disclosure refers to and includes any or all possible combinations of one or more associated listed items.
[0023] 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 disclosure, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this disclosure, and similarly, second may also be referred to as first. Depending on the context, the word “if” as used herein may be interpreted as “when”, “in response to a determination”, or “when…”.
[0024] Furthermore, 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 disclosure are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0025] In one or more embodiments of this disclosure, a large model refers to a deep learning model with a large number of model parameters, typically containing hundreds of millions, tens of billions, hundreds of billions, trillions, or even tens of trillions of model parameters. A large model can also be called a foundation model. It is pre-trained using large-scale unlabeled corpora to produce a pre-trained model with hundreds of millions of parameters. Such models can adapt to a wide range of downstream tasks and have good generalization ability. Examples include Large Language Models (LLMs) and multi-modal pre-training models.
[0026] In practical applications, large models only require a small number of samples to fine-tune the pre-trained model before they can be applied to different tasks. Large models can be widely used in fields such as Natural Language Processing (NLP) and Computer Vision. Specifically, they can be applied to computer vision tasks such as Visual Question Answering (VQA), Image Captioning (IC), and Image Generation, as well as NLP tasks such as text-based sentiment classification, text summarization, and machine translation. The main application scenarios for large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.
[0027] First, the terms and concepts involved in one or more embodiments of this disclosure will be explained.
[0028] UI design, or User Interface, refers to the overall design of a software's human-computer interaction, operational logic, and aesthetic appeal. UI design artwork is a graphical document used to describe an application's interface, including information such as the position, size, color, and font of interface elements.
[0029] Object detection algorithm: It is an algorithm used to identify specific targets in an image, such as face detection, object detection and specific component detection.
[0030] Image similarity algorithms are algorithms used to compare the similarity between images, such as Euclidean distance and cosine similarity.
[0031] CLIP: Contrastive Language-Image Pre-training, is a deep learning model that can understand and associate image content with natural language descriptions.
[0032] This disclosure provides an image generation method. One or more embodiments of this disclosure also relate to an image generation apparatus, a user interface image generation method, a user interface image generation apparatus, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.
[0033] Referring to Figure 1, Figure 1 illustrates an application scenario of an image generation method provided according to an embodiment of the present disclosure.
[0034] Figure 1 includes an edge device 102 and a cloud device 104, wherein the cloud device 104 may be equipped with an image processing model and a code generation model.
[0035] In practice, when designing the application's UI interface, designers can draw UI design drafts on the terminal device 102 and upload them to the cloud device 104. After receiving the UI design draft, the cloud device 104 calls an image processing model to convert the UI design draft into text description information. The text description information is then input into a code generation model to obtain the image generation code corresponding to the UI design draft. The cloud device 104 runs the image generation code to generate the corresponding UI interface image and calculates the similarity between the UI design draft and the UI interface image. If the similarity does not meet a preset similarity threshold, the text description information is adjusted, and the image generation code is regenerated based on the adjusted text description information. The image generation code is then run again to generate the UI interface image, and the similarity between the UI design draft and the UI interface image is calculated again. This process is iterated until the similarity between the UI design draft and the UI interface image reaches the preset similarity threshold. The UI image obtained at this point is the final UI image, and the corresponding image generation code is the final target image generation code. This UI image is returned to the end device 102 for designer confirmation, and the corresponding target image generation code is sent to the developers for adoption, improving application development efficiency. This achieves automatic conversion from UI design drafts to image generation code, thereby reducing manual and time costs.
[0036] The edge device 102 may include a browser, an app (application), or a web application such as an H5 (Hypertext Markup Language 5) application, a lightweight application (also known as a mini-program), or a cloud application. The edge device can be developed based on a software development kit (SDK) provided by the server, such as a real-time communication (RTC) SDK. The edge device can be deployed in an electronic device and depends on the device's operation or certain apps within the device to run. The electronic device may have a display screen and support information browsing, such as a personal mobile terminal like a mobile phone, tablet, or personal computer. Various other types of applications can also be configured in the electronic device, such as human-computer interaction applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, and social media platform software.
[0037] Cloud-side device 104 can be understood as a server providing various services, including physical servers and cloud servers. Examples include servers providing communication services to multiple clients, servers supporting backend training of models used on clients, and servers processing data sent by clients. It should be noted that cloud-side device 104 can be implemented as a distributed server cluster composed of multiple servers, or as a single server. Cloud-side device 104 can also be a server for a distributed system, or a server integrated with blockchain. Cloud-side device 104 can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.
[0038] It is worth noting that the image generation method provided in this embodiment can be executed by the cloud-side device 104. In other embodiments of this disclosure, the image processing model and the code generation model can be deployed in the edge device 102, so that the edge device 102 can also have similar functions to the cloud-side device 104, thereby executing the image generation method provided in this embodiment. In other embodiments, the image generation method provided in this embodiment can also be jointly executed by the edge device 102 and the cloud-side device 104.
[0039] Referring to Figure 2, Figure 2 shows a flowchart of an image generation method provided according to an embodiment of the present disclosure, which specifically includes the following steps.
[0040] Step 202: Determine the text description information for the initial image.
[0041] In this context, the initial image can be understood as a drawn two-dimensional image. For example, in software development, an initial image can be understood as a user interface design draft created by a designer. The text description information of the initial image can be understood as text information describing the image content included in the initial image. This text description information may include layout information in the user interface image, such as the position, size, and color of components.
[0042] In specific implementation, determining the text description information for the initial image includes: determining the initial image; inputting the initial image into an image processing model to obtain the text description information for the initial image output by the image processing model.
[0043] In practical applications, the image processing model can be a CLIP model. Specifically, user interface design artwork can be input into the CLIP model, converting it into text description information. This text description information can include component names, attributes, and layout information. Typically, user interface design artwork contains detailed information such as width, height, color, and font. Inputting the user interface design artwork and its contained vector information into the image processing model generates a linguistic description (i.e., text description information) of the user interface design artwork. This linguistic description includes detailed layout information from the design artwork, such as the position, size, and color of components. For example, for a user interface design artwork containing text, buttons, and input boxes, the image processing model would convert it into the following text description: "A UI page containing text, buttons, and input boxes. The text is at the top, with content xxx and font xx. Below are buttons and input boxes...".
[0044] In addition, before inputting the initial image into the image processing model, the method further includes: determining the second sample image and the sample text description information corresponding to the second sample image; using the second sample image as a training sample and the sample text description information as a training label to train the image processing model to be trained until an image processing model that meets the second training stopping condition is obtained.
[0045] The second training stopping condition can be understood as the number of training iterations reaching a preset threshold and / or the model loss value reaching a preset loss value threshold. The sample text description information corresponding to the second sample image can be understood as a text description used to describe the image content contained in the second sample image.
[0046] Specifically, based on the current CLIP model, the CLIP model can be fine-tuned by training in the field of user interface image design. The second sample image and the sample text description information corresponding to the second sample image can be determined. The second sample image is used as a training sample and the sample text description information is used as a training label to perform supervised training on the CLIP model until an image processing model that meets the second training stopping condition is obtained.
[0047] In summary, by training and fine-tuning the image processing model in the field of user interface image design, the image processing model can describe the initial image in a more detailed and accurate manner, thereby further improving the accuracy of the subsequent image generation code.
[0048] Step 204: Generate image generation code corresponding to the initial image based on the text description information.
[0049] Image generation code can be understood as code used to generate user interface images.
[0050] In a specific implementation, generating the image generation code corresponding to the initial image based on the text description information includes: inputting the text description information into the code generation model to obtain the image generation code corresponding to the initial image output by the code generation model.
[0051] The code generation model can be a large language model.
[0052] In practical applications, textual descriptions can be input into a large-scale language model, which then generates corresponding image generation code. A large-scale language model is a language prediction model capable of generating relevant text output based on given text prompts. For large-scale models, the more detailed and richer the input information, the more accurate and complete the output will be.
[0053] In summary, the code generation model enables the generation of code from images based on textual descriptions, facilitating the subsequent generation of user interface images. By combining image processing and code generation models, the automated conversion process from design drafts to code can be achieved, reducing software development cycles, improving development efficiency, minimizing manual intervention, reducing the need for developers to manually adjust code, and lowering error rates.
[0054] Step 206: Run the image generation code to obtain the candidate image corresponding to the image generation code.
[0055] Specifically, image generation code can be run on the simulator to obtain candidate images corresponding to the image generation code. Understandably, since the image generation code is derived from the text description information of the initial image, the obtained candidate images may differ from the initial images. To reduce these differences, the following iterative adjustment steps are required.
[0056] Step 208: Adjust the text description information according to the association between the initial image and the candidate image, and continue to execute the step of generating the image generation code corresponding to the initial image according to the adjusted text description information until the association between the initial image and the candidate image meets the preset association conditions, and then determine the target image according to the candidate image.
[0057] Specifically, if the correlation between the initial image and the candidate image does not meet the preset correlation conditions, the text description information can be adjusted, and the step of generating the image generation code corresponding to the initial image can be continued based on the adjusted text description information until the correlation between the initial image and the candidate image meets the preset correlation conditions. At this point, the target image can be determined based on the candidate image.
[0058] Furthermore, the image generation code corresponding to the target image can be sent to the software developers as the final code.
[0059] For example, an initial image A1 can be input into an image processing model to obtain text description information B1 corresponding to the initial image A1. This text description information B1 is then input into a code generation model to obtain image generation code C1. Running image generation code C1 yields a candidate image A2 corresponding to image generation code C1. If the association between the initial image A1 and the candidate image A2 does not meet the preset association conditions, the text description information B1 is adjusted to obtain adjusted text description information B2. This adjusted text description information B2 is then input into the code generation model to obtain image generation code C2. Running image generation code C2 yields a candidate image A3 corresponding to image generation code C2. If the association between the initial image A1 and the candidate image A3 does not meet the preset association conditions, the text description information B2 is adjusted again to obtain adjusted text description information B3, and the above process continues. If the association between the initial image A1 and the candidate image A3 meets the preset association conditions, the candidate image A3 can be identified as the target image, and the image generation code C2 corresponding to the candidate image A3 can be identified as the image generation code corresponding to the target image.
[0060] In specific implementation, before adjusting the text description information based on the association between the initial image and the candidate image, the method further includes: calculating the similarity between the initial image and the candidate image; adjusting the text description information based on the association between the initial image and the candidate image includes: adjusting the text description information when it is determined that the similarity between the initial image and the candidate image is less than a preset similarity threshold.
[0061] Specifically, the similarity between the initial image and the candidate image can be calculated. If the similarity between the initial image and the candidate image is less than a preset similarity threshold, it is determined that the difference between the initial image and the candidate image is large, and the text description information needs to be adjusted.
[0062] In summary, through continuous iteration and optimization, it is possible to ensure that the final generated image code is highly consistent with the initial image design, thereby guaranteeing the high efficiency and accuracy of software development and design.
[0063] In specific implementation, calculating the similarity between the initial image and the candidate image includes: determining the initial component included in the initial image, and determining the candidate component in the candidate image that corresponds to the initial component; calculating the similarity between the initial component and the candidate component based on the initial component information of the initial component and the candidate component information of the candidate component; adjusting the text description information when the similarity between the initial image and the candidate image is determined to be less than a preset similarity threshold includes: adjusting the text description information when the similarity between the initial component and the candidate component is determined to be less than the preset similarity threshold.
[0064] In this context, the initial component can be understood as the component included in the initial image, and the candidate component can be understood as the component included in the candidate image. The similarity between the initial image and the candidate image can be understood as the similarity between the initial component in the initial image and the corresponding candidate component in the candidate image. The initial component information can be understood as the attribute information of the initial component in the initial image, and the candidate component information can be understood as the attribute information of the candidate component in the candidate image. Attribute information may include, but is not limited to, position information, color information, type information, and size information.
[0065] For example, an initial image may include initial components a, b, and c. Similarly, a candidate image may include candidate components a, b, and c, each corresponding to one of the initial components. Ideally, the attribute information of initial component a and candidate component a should be identical; for example, they should be in the same location, have the same color, be of the same type, and have the same size. However, due to potential discrepancies between the image generation code generated from the text description information and the actual image generation code corresponding to the initial image, the attribute information of initial component a and candidate component a may differ. Therefore, the image generation method provided in this embodiment can avoid these differences through iteration.
[0066] Based on this, the initial component in the initial image can be determined, and the candidate component in the candidate image corresponding to the initial component can be determined. The similarity between the initial component and the candidate component can be calculated. If the similarity between the initial component and the candidate component is less than a preset similarity threshold, the text description information can be adjusted.
[0067] In summary, by calculating the similarity between the initial component and the candidate component, the initial image and the candidate image can be compared, which facilitates the subsequent adjustment of the text description information, thereby ensuring the consistency between the generated image generation code and the image generation code corresponding to the actual initial image.
[0068] Further, determining the candidate component in the candidate image corresponding to the initial component includes: inputting the candidate image into a target detection model to obtain the candidate components included in the candidate image and the candidate component information of the candidate components output by the target detection model; and determining the candidate component corresponding to the initial component based on the candidate component information and the initial component information of the initial component.
[0069] The object detection model can be implemented based on an object detection algorithm. The object detection model can be, for example, a deep learning model or a neural network model, and this disclosure does not limit this aspect.
[0070] Specifically, candidate images can be input into an object detection model to obtain the output of the model, which includes candidate components within the candidate images, as well as information about the candidate components of those components. Based on this candidate component information and the initial component information of the initial components, candidate components corresponding to the initial components can be determined.
[0071] In practical applications, after inputting candidate images into the object detection model, object detection algorithms can be used to detect and locate candidate components in the candidate images and initial components in the initial images, and then segment and extract them one by one. After that, image similarity algorithms are used to evaluate the similarity between the initial components and the corresponding candidate components. Specifically, the object detection algorithm can obtain the position information, size information, and type information of the initial components and candidate components, and can directly compare whether the type information and position information of the initial components and candidate components match. Furthermore, the similarity can be evaluated one by one for the color information of the initial components and the corresponding candidate components.
[0072] In summary, by using object detection algorithms to evaluate the similarity of components in the initial image and candidate images, it is easier to ensure that the generated image code is consistent with the initial image.
[0073] In one embodiment of this disclosure, the initial component information includes the initial position information of the initial component, and the candidate component information includes the candidate position information of the candidate component; determining the candidate component corresponding to the initial component based on the candidate component information and the initial component information of the initial component includes: calculating the overlapping region between the initial component and the candidate component based on the initial position information and the candidate position information; and determining the candidate component as the candidate component corresponding to the initial component when the overlapping region reaches a preset overlap threshold.
[0074] The initial position information can be understood as the position information of the initial component in the initial image, and the candidate position information can be understood as the position information of the candidate component in the candidate image.
[0075] Specifically, the overlapping area between the initial component and the candidate component can be calculated based on the initial position information of the initial component and the candidate position information of the candidate component. If the area of the overlapping area reaches a preset overlap threshold, the candidate component is determined as the candidate component corresponding to the initial component, that is, the initial component and the candidate component are determined to be in one-to-one correspondence.
[0076] For example, if the initial image includes initial components 1, 2, and 3, and the candidate image includes candidate components 1, 2, and 3, the overlapping region between initial component 1 and candidate component 1 can be determined based on the initial position information of initial component 1 and the candidate position information of candidate component 1. If the area of the overlapping region reaches a preset overlap threshold, it is determined that initial component 1 and candidate component 1 correspond, meaning that initial component 1 and candidate component 1 are the same component. If the area of the overlapping region does not reach the preset overlap threshold, it is determined that initial component 1 and candidate component 1 are not the same component.
[0077] In summary, by determining the one-to-one correspondence between initial and candidate components based on location information, it is easier to conduct similarity evaluation on the one-to-one correspondence between initial and candidate components in the future.
[0078] In addition, before inputting the candidate image into the target detection model, the method further includes: determining a first sample image and the sample components included in the first sample image; using the first sample image as a training sample and the sample component information of the sample components as training labels to train the target detection model to be trained until a target detection model that meets the first training stopping condition is obtained.
[0079] The first training stopping condition can be understood as the model reaching a preset training iteration threshold and / or the model loss value reaching a preset loss value threshold. The first and second training stopping conditions can be the same or different. The first and second sample images can be the same or different. The sample component information can include the sample component's location and attribute information, etc. It is understood that the sample component information is similar to the aforementioned initial component information and candidate component information, and will not be repeated here.
[0080] Specifically, the first sample image and the sample components included in the first sample image can be determined, and the sample image can be used as a training sample, and the sample component information of the sample components can be used as training labels to conduct supervised training on the object detection model until an object detection model that meets the first training stopping condition is obtained.
[0081] In summary, by conducting supervised training on the object detection model, the model gains the ability to detect components, which facilitates the subsequent calculation of the similarity between the initial components and candidate components.
[0082] In specific implementation, adjusting the text description information includes: determining the initial text description information corresponding to the initial component from multiple candidate text description information; updating the initial text description information according to the initial component information to obtain target text description information; after obtaining the target text description information, the method further includes: determining the target text description information as the adjusted text description information.
[0083] Specifically, if the similarity between the initial component and the candidate component does not reach the preset similarity threshold, the inconsistency information between the initial component in the initial image and the candidate component in the candidate image can be determined. The initial text description information corresponding to the initial component can be obtained from the candidate text description information, and the correct component information corresponding to the inconsistency information of the initial component can be filled into the initial text description information to obtain the target text description information. Then, the target text description information is the adjusted text description information.
[0084] For example, if component 1 has a different color in the UI design artwork and in the UI interface image, with blue in the UI design artwork and green in the UI interface image, then the initial text description information corresponding to component 1 can be obtained as "the color of component () is (). The error information of component 1 can be filled into the initial text description information to obtain the target text description information as "the color of component 1 is blue".
[0085] In summary, by modifying and supplementing the corresponding text descriptions for the parts of the candidate images that do not achieve the expected results, the subsequently generated candidate images can achieve the expected results and are highly consistent with the initial images.
[0086] Specifically, after continuing to execute the step of generating the image generation code corresponding to the initial image, the method further includes: if the similarity between the initial component and the candidate component reaches the preset similarity threshold, determining that the association between the initial image and the candidate image satisfies a preset association condition.
[0087] Specifically, if the similarity between each initial component in the initial image and the candidate component corresponding to each initial component in the candidate image reaches a preset similarity threshold, the association between the initial image and the candidate image is determined to meet the preset association conditions.
[0088] One embodiment of this disclosure converts an initial image into text description information, generates image generation code corresponding to the initial image based on the text description information, runs the image generation code to obtain candidate images corresponding to the image generation code, adjusts the text description information based on the correlation between the initial image and the candidate images, and continues to iteratively execute the step of generating image generation code based on the adjusted text description information until the correlation between the initial image and the candidate images meets a preset correlation condition. Finally, a target image is determined based on the candidate images. By automatically adjusting the text description information, the image generation code is optimized, ensuring the consistency between the target image generated by the optimized image generation code and the initial image, and further improving the accuracy of converting the initial image into image generation code. This avoids the time and labor costs of manually adjusting the image generation code.
[0089] The image generation method provided in this disclosure will be further described below with reference to Figure 3, taking the application of the image generation method in software development as an example. Figure 3 shows a flowchart of the processing procedure of an image generation method according to an embodiment of this disclosure, specifically including the following steps.
[0090] Step 302: Input the initial image into the image processing model to obtain the text description information of the initial image output by the image processing model.
[0091] Specifically, the UI design artwork (i.e., the initial image) can be input into the CLIP model (i.e., the image processing model) to obtain the text description information of the UI design artwork.
[0092] Step 304: Input the text description information into the code generation model to obtain the image generation code corresponding to the initial image output by the code generation model.
[0093] Specifically, textual description information can be input into the language model (i.e., the code generation model) to obtain the image generation code for the UI design artwork.
[0094] Step 306: Run the image generation code to obtain the candidate images corresponding to the image generation code.
[0095] Specifically, the image generation code can be run on the simulator to obtain the UI interface image (i.e., candidate image) corresponding to the image generation code.
[0096] Step 308: Calculate the similarity between the initial image and the candidate images.
[0097] Specifically, the position and type information of each component in the UI design draft can be determined. The UI interface image is then input into an object detection model to obtain the position and type information of each component in the UI interface image, output by the object detection model. Based on the position information of each component in the UI design draft and the UI interface image, the overlapping area between the components in the UI design draft and the UI interface image can be calculated. The components corresponding to each other in the UI design draft and the UI interface image are then identified based on the overlapping area. Finally, the similarity between the two corresponding components is determined based on their type information, and this similarity is used as the similarity score between the UI design draft and the UI interface image.
[0098] Step 310: Determine whether the similarity between the initial image and the candidate image reaches the preset similarity threshold. If yes, proceed to step 314; otherwise, proceed to step 312.
[0099] Specifically, it can determine whether the similarity between two corresponding components in each pair reaches a preset similarity threshold.
[0100] Step 312: Adjust the text description information to obtain the adjusted text description information, and continue to step 304.
[0101] Specifically, if the similarity between two corresponding components does not reach the preset similarity threshold, the inconsistency information of the component in the UI design draft and UI interface image can be determined. The initial text description information corresponding to the component can be obtained from the candidate text description information, and the correct component information corresponding to the inconsistency information of the component can be filled into the initial text description information to obtain the target text description information. Then, the target text description information is the adjusted text description information.
[0102] For example, if component 1 has a different color in the UI design artwork and in the UI interface image, and the color of component 1 is blue in the UI design artwork but green in the UI interface image, then the initial text description information corresponding to component 1 can be obtained as "the color of component () is ()," and the error information of component 1 can be filled into the initial text description information to obtain the target text description information as "the color of component 1 is blue."
[0103] Step 314: Determine the target image based on the candidate images.
[0104] Specifically, if the similarity between each pair of corresponding components in the UI design draft and the UI interface image reaches a preset similarity threshold, the current UI interface image can be determined as the final UI interface image. Subsequent application development can then be based on this UI interface image.
[0105] One embodiment of this disclosure converts an initial image into text description information, generates image generation code corresponding to the initial image based on the text description information, runs the image generation code to obtain candidate images corresponding to the image generation code, adjusts the text description information based on the correlation between the initial image and the candidate images, and continues to iteratively execute the step of generating image generation code based on the adjusted text description information until the correlation between the initial image and the candidate images meets a preset correlation condition. Finally, a target image is determined based on the candidate images. By automatically adjusting the text description information, the image generation code is optimized, ensuring the consistency between the target image generated by the optimized image generation code and the initial image, and further improving the accuracy of converting the initial image into image generation code. This avoids the time and labor costs of manually adjusting the image generation code.
[0106] Corresponding to the above method embodiments, this disclosure also provides an image generation apparatus embodiment. FIG4 shows a schematic diagram of the structure of an image generation apparatus provided in one embodiment of this disclosure. As shown in FIG4, the apparatus includes a determining module 402, a generating module 404, a running module 406, and an adjusting module 408.
[0107] The determination module 402 is configured to determine textual description information for the initial image.
[0108] The generation module 404 is configured to generate image generation code corresponding to the initial image based on the text description information.
[0109] The running module 406 is configured to run the image generation code to obtain the candidate image corresponding to the image generation code.
[0110] The adjustment module 408 is configured to adjust the text description information according to the association between the initial image and the candidate image, and continue to execute the step of generating the image generation code corresponding to the initial image according to the adjusted text description information, until the association between the initial image and the candidate image meets the preset association conditions, and then determine the target image according to the candidate image.
[0111] In an optional embodiment, the adjustment module 408 is further configured to: calculate the similarity between the initial image and the candidate image; and adjust the text description information if the similarity between the initial image and the candidate image is determined to be less than a preset similarity threshold.
[0112] In an optional embodiment, the adjustment module 408 is further configured to: determine the initial component included in the initial image, and determine the candidate component in the candidate image corresponding to the initial component; calculate the similarity between the initial component and the candidate component based on the initial component information of the initial component and the candidate component information of the candidate component; and adjust the text description information if the similarity between the initial component and the candidate component is determined to be less than the preset similarity threshold.
[0113] In an optional embodiment, the adjustment module 408 is further configured to: determine the initial text description information corresponding to the initial component from a plurality of candidate text description information; update the initial text description information according to the initial component information to obtain target text description information; and determine the target text description information as the adjusted text description information.
[0114] In an optional embodiment, the adjustment module 408 is further configured to: determine that the association between the initial image and the candidate image satisfies a preset association condition when the similarity between the initial component and the candidate component reaches the preset similarity threshold.
[0115] In an optional embodiment, the adjustment module 408 is further configured to: input the candidate image into the target detection model to obtain the candidate components included in the candidate image and the candidate component information of the candidate components output by the target detection model; and determine the candidate component corresponding to the initial component based on the candidate component information and the initial component information of the initial component.
[0116] In an optional embodiment, the initial component information includes the initial position information of the initial component, and the candidate component information includes the candidate position information of the candidate component.
[0117] The adjustment module 408 is further configured to: calculate the overlapping region between the initial component and the candidate component based on the initial position information and the candidate position information; and determine the candidate component as the candidate component corresponding to the initial component when the overlapping region reaches a preset overlap threshold.
[0118] In an optional embodiment, the apparatus further includes a training module configured to: determine a first sample image and sample components included in the first sample image; use the first sample image as a training sample and the sample component information of the sample components as training labels to train the target detection model to be trained until a target detection model that satisfies a first training stopping condition is obtained.
[0119] In an optional embodiment, the generation module 404 is further configured to: input the text description information into the code generation model to obtain the image generation code output by the code generation model corresponding to the initial image.
[0120] In an optional embodiment, the determining module 402 is further configured to: determine the initial image; input the initial image into an image processing model to obtain the text description information for the initial image output by the image processing model.
[0121] In an optional embodiment, the training module is further configured to: determine a second sample image and sample text description information corresponding to the second sample image; use the second sample image as a training sample and the second sample text description information as a training label to train the image processing model to be trained until an image processing model that meets the second training stopping condition is obtained.
[0122] One embodiment of this disclosure converts an initial image into text description information, generates image generation code corresponding to the initial image based on the text description information, runs the image generation code to obtain candidate images corresponding to the image generation code, adjusts the text description information based on the correlation between the initial image and the candidate images, and continues to iteratively execute the step of generating image generation code based on the adjusted text description information until the correlation between the initial image and the candidate images meets a preset correlation condition. Finally, a target image is determined based on the candidate images. By automatically adjusting the text description information, the image generation code is optimized, ensuring the consistency between the target image generated by the optimized image generation code and the initial image, and further improving the accuracy of converting the initial image into image generation code. This avoids the time and labor costs of manually adjusting the image generation code.
[0123] The above is an illustrative scheme of an image generation apparatus according to this embodiment. It should be noted that the technical solution of this image generation apparatus and the technical solution of the image generation method described above belong to the same concept. For details not described in detail in the technical solution of the image generation apparatus, please refer to the description of the technical solution of the image generation method described above.
[0124] Referring to Figure 5, Figure 5 shows a flowchart of a user interface image generation method according to an embodiment of the present disclosure, specifically including the following steps 502 to 508.
[0125] Step 502: Determine the text description information for the initial user interface image.
[0126] Step 504: Generate image generation code corresponding to the initial user interface image based on the text description information.
[0127] Step 506: Run the image generation code to obtain the candidate user interface image corresponding to the image generation code.
[0128] Step 508: Adjust the text description information according to the association between the initial user interface image and the candidate user interface image, and continue to execute the step of generating the image generation code corresponding to the initial user interface image according to the adjusted text description information, until the association between the initial user interface image and the candidate user interface image meets the preset association conditions, and then determine the target user interface image according to the candidate user interface image.
[0129] One embodiment of this disclosure converts an initial user interface image into text description information, generates image generation code corresponding to the initial image based on the text description information, runs the image generation code to obtain candidate user interface images corresponding to the image generation code, adjusts the text description information based on the association between the initial user interface image and the candidate user interface images, and continues to iteratively execute the step of generating image generation code based on the adjusted text description information until the association between the initial user interface image and the candidate user interface images meets a preset association condition. Finally, the target user interface image is determined based on the candidate user interface images. By automatically adjusting the text description information, the image generation code is optimized, ensuring the consistency between the target user interface image generated by the optimized image generation code and the initial user interface image. This further improves the accuracy of converting the initial user interface image into image generation code and avoids the time and labor costs of manually adjusting the image generation code.
[0130] The above is an illustrative scheme of a user interface image generation method according to this embodiment. It should be noted that the technical solution of this user interface image generation method belongs to the same concept as the technical solution of the image generation method described above. For details not described in detail in the technical solution of the user interface image generation method, please refer to the description of the technical solution of the image generation method described above.
[0131] Corresponding to the above method embodiments, this disclosure also provides an embodiment of a user interface image generation device. FIG6 shows a schematic diagram of the structure of a user interface image generation device provided in one embodiment of this disclosure. As shown in FIG6, the device includes a determining module 602, a generating module 604, a running module 606, and an adjusting module 608.
[0132] The determination module 602 is configured to determine textual description information for the initial user interface image.
[0133] The generation module 604 is configured to generate image generation code corresponding to the initial user interface image based on the text description information.
[0134] The running module 606 is configured to run the image generation code to obtain the candidate user interface image corresponding to the image generation code.
[0135] The adjustment module 608 is configured to adjust the text description information according to the association between the initial user interface image and the candidate user interface image, and continue to execute the step of generating the image generation code corresponding to the initial user interface image according to the adjusted text description information, until the association between the initial user interface image and the candidate user interface image meets the preset association conditions, and then determine the target user interface image according to the candidate user interface image.
[0136] One embodiment of this disclosure converts an initial user interface image into text description information, generates image generation code corresponding to the initial image based on the text description information, runs the image generation code to obtain candidate user interface images corresponding to the image generation code, adjusts the text description information based on the association between the initial user interface image and the candidate user interface images, and continues to iteratively execute the step of generating image generation code based on the adjusted text description information until the association between the initial user interface image and the candidate user interface images meets a preset association condition. Finally, the target user interface image is determined based on the candidate user interface images. By automatically adjusting the text description information, the image generation code is optimized, ensuring the consistency between the target user interface image generated by the optimized image generation code and the initial user interface image. This further improves the accuracy of converting the initial user interface image into image generation code and avoids the time and labor costs of manually adjusting the image generation code.
[0137] The above is an illustrative scheme of a user interface image generation device according to this embodiment. It should be noted that the technical solution of this user interface image generation device and the technical solution of the image generation method described above belong to the same concept. For details not described in detail in the technical solution of the user interface image generation device, please refer to the description of the technical solution of the image generation method described above.
[0138] Corresponding to the above method embodiments, this disclosure also provides an image generation system, including an edge device and a cloud device. The edge device is configured to determine an initial image and send the initial image to the cloud device. The cloud device is configured to determine text description information for the initial image; generate image generation code corresponding to the initial image based on the text description information; run the image generation code to obtain candidate images corresponding to the image generation code; adjust the text description information according to the association between the initial image and the candidate images, and continue to execute the step of generating image generation code corresponding to the initial image based on the adjusted text description information, until the association between the initial image and the candidate images meets a preset association condition; determine a target image based on the candidate images; and send the target image generation code corresponding to the target image to the edge device.
[0139] Specifically, one embodiment of this disclosure converts an initial image into text description information, generates image generation code corresponding to the initial image based on the text description information, runs the image generation code to obtain candidate images corresponding to the image generation code, adjusts the text description information based on the correlation between the initial image and the candidate images, and continues to iteratively execute the step of generating image generation code based on the adjusted text description information until the correlation between the initial image and the candidate images meets a preset correlation condition. Then, the target image is determined based on the candidate images. By automatically adjusting the text description information, the image generation code is optimized, ensuring the consistency between the target image generated by the optimized image generation code and the initial image. This further improves the accuracy of converting the initial image into image generation code and avoids the time and labor costs of manually adjusting the image generation code.
[0140] The above is an illustrative scheme of an image generation system according to this embodiment. It should be noted that the technical solution of this image generation system and the technical solution of the image generation method described above belong to the same concept. For details not described in detail in the technical solution of the image generation system, please refer to the description of the technical solution of the image generation method described above.
[0141] Figure 7 shows a structural block diagram of a computing device 700 according to an embodiment of the present disclosure. The components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and a database 750 is used to store data.
[0142] The computing device 700 also includes an access device 740, which enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 740 may include one or more of any type of wired or wireless network interface (e.g., a network interface controller (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0143] In one embodiment of this disclosure, the aforementioned components of the computing device 700, as well as other components not shown in FIG. 7, may be interconnected, for example, via a bus. It should be understood that the computing device block diagram shown in FIG. 7 is merely for illustrative purposes and is not intended to limit the scope of this disclosure. Those skilled in the art can add or replace other components as needed.
[0144] The computing device 700 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 700 can also be a mobile or stationary server.
[0145] The processor 720 is used to execute the following computer program / instructions, which, when executed by the processor, implement the steps of the above-described image generation method or user interface image generation method.
[0146] The various embodiments in this disclosure are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the computing device embodiments are basically similar to the image generation method or user interface image generation method embodiments, so the description is relatively simple; relevant parts can be referred to in the description of the image generation method or user interface image generation method embodiments.
[0147] An embodiment of this disclosure also provides a computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the above-described image generation method or user interface image generation method.
[0148] The various embodiments in this disclosure are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the computer-readable storage medium embodiments are relatively simple in description because they are substantially similar to the image generation method or user interface image generation method embodiments; relevant parts can be referred to in the description of the image generation method or user interface image generation method embodiments.
[0149] An embodiment of this disclosure also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described image generation method or user interface image generation method.
[0150] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product belongs to the same concept as the technical solution of the image generation method or user interface image generation method described above. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the image generation method or user interface image generation method described above.
[0151] The foregoing has described specific embodiments of this disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0152] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0153] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this disclosure are not limited to the described order of actions, because according to the embodiments of this disclosure, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments of this disclosure.
[0154] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0155] The preferred embodiments disclosed above are merely illustrative of this disclosure. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments of this disclosure. These embodiments are selected and specifically described in this disclosure to better explain the principles and practical applications of the embodiments of this disclosure, thereby enabling those skilled in the art to better understand and utilize this disclosure. This disclosure is limited only by the claims and their full scope and equivalents.
Claims
1. An image generation method comprising: determining text description information for an initial image; generating an image generation code corresponding to the initial image according to the text description information; running the image generation code to obtain a candidate image corresponding to the image generation code; adjusting the text description information according to a correlation between the initial image and the candidate image, and continuing to execute the step of generating the image generation code corresponding to the initial image according to the adjusted text description information, until the correlation between the initial image and the candidate image meets a preset correlation condition, and determining a target image according to the candidate image.
2. The image generation method of claim 1, before the adjusting the text description information according to the correlation between the initial image and the candidate image, further comprising: calculating a similarity between the initial image and the candidate image; the adjusting the text description information according to the correlation between the initial image and the candidate image comprises: adjusting the text description information in a case where the similarity between the initial image and the candidate image is less than a preset similarity threshold.
3. The image generation method of claim 2, the calculating the similarity between the initial image and the candidate image comprises: determining an initial component included in the initial image, and determining a candidate component corresponding to the initial component in the candidate image; calculating the similarity between the initial component and the candidate component according to initial component information of the initial component and candidate component information of the candidate component; the adjusting the text description information in a case where the similarity between the initial image and the candidate image is less than a preset similarity threshold comprises: adjusting the text description information in a case where the similarity between the initial component and the candidate component is less than the preset similarity threshold.
4. The image generation method of claim 3, the adjusting the text description information comprises: determining initial text description information corresponding to the initial component from a plurality of candidate text description information; updating the initial text description information according to the initial component information to obtain target text description information; after the obtaining target text description information, further comprising: determining the target text description information as adjusted text description information.
5. The image generation method of claim 3, after the continuing to execute the step of generating the image generation code corresponding to the initial image, further comprising: determining that the correlation between the initial image and the candidate image meets a preset correlation condition in a case where the similarity between the initial component and the candidate component reaches the preset similarity threshold.
6. The image generation method of claim 3, the determining a candidate component corresponding to the initial component in the candidate image comprises: inputting the candidate image into a target detection model to obtain a candidate component included in the candidate image and candidate component information of the candidate component output by the target detection model; determining the candidate component corresponding to the initial component according to the candidate component information and initial component information of the initial component.
7. The image generation method of claim 6, wherein the initial component information comprises initial position information of the initial component, and the candidate component information comprises candidate position information of the candidate component; and wherein determining the candidate component corresponding to the initial component according to the candidate component information and the initial component information of the initial component comprises: calculating an overlapping area between the initial component and the candidate component according to the initial position information and the candidate position information; and determining the candidate component as the candidate component corresponding to the initial component when the overlapping area reaches a preset overlapping threshold.
8. The image generation method of claim 6, wherein before inputting the candidate image into the target detection model, the method further comprises: determining a first sample image and a sample component included in the first sample image; and training a target detection model to be trained by taking the first sample image as a training sample and taking sample component information of the sample component as a training label until obtaining the target detection model satisfying a first training stop condition.
9. The image generation method of claim 1, wherein generating the image generation code corresponding to the initial image according to the text description information comprises: inputting the text description information into a code generation model to obtain the image generation code corresponding to the initial image output by the code generation model.
10. The image generation method of claim 1, wherein determining the text description information for the initial image comprises: determining the initial image; and inputting the initial image into an image processing model to obtain the text description information for the initial image output by the image processing model.
11. The image generation method of claim 10, wherein before inputting the initial image into the image processing model, the method further comprises: determining a second sample image and sample text description information corresponding to the second sample image; and training an image processing model to be trained by taking the second sample image as a training sample and taking the sample text description information as a training label until obtaining the image processing model satisfying a second training stop condition.
12. A user interface image generation method, comprising: determining text description information for an initial user interface image; generating image generation code corresponding to the initial user interface image according to the text description information; running the image generation code to obtain a candidate user interface image corresponding to the image generation code; and determining the candidate user interface image as the initial user interface image when the candidate user interface image satisfies a preset image generation condition. According to the association between the initial user interface image and the candidate user interface image, the text description information is adjusted, and according to the adjusted text description information, the step of generating the image generation code corresponding to the initial user interface image is continuously executed until the association between the initial user interface image and the candidate user interface image meets a preset association condition, and the target user interface image is determined according to the candidate user interface image.
13. An image generation system comprising an edge-side device and a cloud-side device, wherein, the edge-side device is configured to determine an initial image, and send the initial image to the cloud-side device; the cloud-side device is configured to determine text description information for the initial image, generate image generation code corresponding to the initial image according to the text description information, run the image generation code to obtain a candidate image corresponding to the image generation code, adjust the text description information according to the association between the initial image and the candidate image, and continuously execute the step of generating the image generation code corresponding to the initial image according to the adjusted text description information until the association between the initial image and the candidate image meets a preset association condition, and determine a target image according to the candidate image, and send target image generation code corresponding to the target image to the edge-side device.
14. A computing device comprising: a memory and a processor; the memory is configured to store computer programs / instructions, and the processor is configured to execute the computer programs / instructions, and the computer programs / instructions, when executed by the processor, implement the steps of the method of any one of claims 1 to 12.
15. A computer readable storage medium storing computer programs / instructions, and the computer programs / instructions, when executed by a processor, implement the steps of the method of any one of claims 1 to 12.
16. A computer program product comprising computer programs / instructions, and the computer programs / instructions, when executed by a processor, implement the steps of the method of any one of claims 1 to 12.
Citation Information
Patent Citations
Image generation method, image processing method, related equipment and medium
CN113835597A
Front-end code automatic generation method and system based on design interface screenshot
CN116841545A
Automated code generation
US20190250891A1
Text generation method and apparatus
WO2024046189A1