Software generation method and device, storage medium and electronic equipment
Generating high-poly images from low-poly images and text labels, combined with diffusion models and visual programming resources, solves the problem of long visual programming delivery cycles in the smart cockpit field and achieves efficient software delivery.
Patent Information
- Application Number
- CN202410862990.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-01
AI Technical Summary
The visual programming delivery cycle in the field of smart cockpit is long, resulting in high design and development costs and extended delivery cycle.
Generate high-resolution images through low-resolution images and text labels, identify components and attribute information, and combine diffusion models and visual programming resources to generate target software to shorten the delivery cycle.
It effectively shortens the visual programming delivery cycle, reduces design and development costs, and improves delivery efficiency.
Smart Images

Figure CN118733016A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of automation, and more specifically, to a method and device for generating software, a storage medium, and an electronic device. Background Art
[0002] At present, visual programming in the field of smart cockpits refers to HMI software, including programming Android applications using the layout editor in Android Studio; programming 3D / 2D real-time scene applications using Unity Hub or Kanzi studio. The usual process of these implementations is to first carry out UE low-fidelity interaction design, UE high-fidelity interaction design, UI layout design, UI pictures, models, fonts and other designs. In this process, repeated software iterations are carried out on visual programming to finally reach the deliverable state of HMI software. Especially in the concept verification stage, this process requires more iterations, resulting in relatively high personnel communication, design and development costs and a long delivery cycle.
[0003] This shows that the problem of long delivery cycle of visual programming in related technologies has not yet been effectively solved. Summary of the invention
[0004] The embodiments of the present application provide a method and device for generating software, a storage medium, and an electronic device to at least solve the problem of long delivery cycle of visual programming in related technologies.
[0005] According to one embodiment of the present application, a method for generating software is provided, comprising: generating a high-poly image based on a low-poly image and a first text label, wherein the first text label is used to indicate component information of different areas in the low-poly image; determining multiple components in the high-poly image and attribute information of the multiple components; generating visual programming resources based on the multiple components and the attribute information of the multiple components, and inputting the visual programming resources into a target tool to generate target software.
[0006] In an exemplary embodiment, a high-poly image is generated based on a low-poly image and a first text label, including: acquiring an image dataset of a target resolution and a second text label for each image in the image dataset; performing noise processing on each image step by step to obtain a plurality of noise images corresponding to each image; training an initial diffusion model based on the plurality of noise images corresponding to each image and the second text label corresponding to each image to obtain a trained diffusion model; and inputting the low-poly image and the first text label into the trained diffusion model so that the trained diffusion model generates the high-poly image based on the low-poly image and the first text label.
[0007] In an exemplary embodiment, the low-poly image and the first text label are input into the trained diffusion model so that the trained diffusion model generates a high-poly image based on the low-poly image and the first text label, including: when N is equal to 1, the low-poly image and the first text label are input into the Nth layer network structure of the diffusion model so that the Nth layer network structure generates a first intermediate image based on the low-poly image and the first text label; when N is not equal to 1, the N-1th intermediate image output by the N-1th layer network structure of the diffusion model is input into the Nth layer network structure of the diffusion model so that the Nth layer network structure upsamples the N-1th intermediate image to generate the Nth intermediate image, wherein N is a positive integer; and the image output by the last layer network structure of the diffusion model is obtained, and the image output by the last layer network structure is determined to be the high-poly image, wherein the diffusion model includes a multi-layer network structure, and different network structures have different resolutions of generated images.
[0008] In an exemplary embodiment, visual programming resources are generated based on the multiple components and the attribute information of the multiple components, including: defining elements in a file of a target type based on the attribute information of the multiple components; establishing a mapping relationship between the multiple components and the attribute information of the multiple components and corresponding elements; and controlling a target editor to generate a file of the target type based on the mapping relationship.
[0009] In an exemplary embodiment, after controlling the target editor to generate the file of the target type based on the mapping relationship, the method further includes: determining whether the file of the target type conforms to a preset file pattern; if the file of the target type conforms to the preset file pattern, inputting the visual programming resources into the target tool to generate the target software; if the file of the target type does not conform to the preset file pattern, controlling the target editor to generate the file of the target type again based on the mapping relationship.
[0010] In an exemplary embodiment, determining multiple components in the high-polygon image and attribute information of the multiple components includes: identifying edges of the multiple components in the high-polygon image through an edge detection algorithm; determining the multiple components in the high-polygon image through a target detection algorithm and the edges of the multiple components; determining feature vectors of the multiple components, and determining attribute information of the multiple components based on the feature vectors of the multiple components.
[0011] According to another embodiment of the present application, a software generation device is provided, including: a first generation module, used to generate a high-poly image based on a low-poly image and a first text label, wherein the first text label is used to indicate component information of different areas in the low-poly image; a determination module, used to determine multiple components in the high-poly image and attribute information of the multiple components; a second generation module, used to generate visual programming resources based on the multiple components and the attribute information of the multiple components, and input the visual programming resources into a target tool to generate target software.
[0012] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned software generation method when running.
[0013] According to another aspect of an embodiment of the present application, there is also provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for generating the software through the computer program.
[0014] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, wherein the computer program is executed by a processor to generate the software.
[0015] Through the embodiment of the present application, a high-poly image is generated based on a low-poly image and a first text label, wherein the first text label is used to indicate component information of different areas in the low-poly image; multiple components in the high-poly image and attribute information of the multiple components are determined; visual programming resources are generated based on the multiple components and the attribute information of the multiple components, and the visual programming resources are input into the target tool to generate the target software, that is, a high-resolution image is generated by combining a low-resolution image with a text label, and then visual programming resources and corresponding software are generated by identifying the components of the high-resolution image and the attribute information of the components. Through the above technical solution, the problem of long delivery cycle of visual programming in related technologies is solved, and the delivery cycle is shortened. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a hardware structure block diagram of a computer terminal of a method for generating software according to an embodiment of the present application;
[0017] Figure 2 is a flowchart of a method for generating software according to an embodiment of the present application (I);
[0018] Figure 3 is a flowchart (II) of a method for generating software according to an embodiment of the present application;
[0019] Figure 4 is a flow chart of generating a diffusion model according to an embodiment of the present application;
[0020] Figure 5 is a schematic diagram of generating a high-poly model design according to an embodiment of the present application;
[0021] Figure 6 is a computer program schematic diagram of a method for generating a file according to an embodiment of the present application;
[0022] Figure 7 It is a structural block diagram of a software generation device according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices; "plurality" means two or more.
[0025] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or similar computing device or cloud platform or independent physical server or software platform, wherein the above software platform is run through one or more servers. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal of a software generation method according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1Only one is shown in the figure) processor 102 and memory 104 for storing data. In an exemplary embodiment, the computer terminal may also include a transmission device 106 for communication functions and an input and output device 108, wherein the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. A person skilled in the art can understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 A different configuration with more features is shown.
[0026] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the methods in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, the above-mentioned methods are implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0027] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0028] In this embodiment, a method for generating software is provided, which is applied to the above-mentioned computer terminal. Figure 2 1 is a flowchart of a method for generating software according to an embodiment of the present application (I), the process comprising the following steps:
[0029] Step S202, generating a high-poly image according to the low-poly image and a first text label, wherein the first text label is used to indicate component information of different regions in the low-poly image;
[0030] It should be noted that the above low-polygon images can be understood as images with low precision, focusing on basic shapes and contours, while the above high-polygon images can be understood as images with high precision, focusing on image details and textures. Figure 5 The left image in the figure is a low-poly image, and the right image is a high-poly image.
[0031] Step S204, determining a plurality of components in the high-polygon image and attribute information of the plurality of components;
[0032] It should be noted that the above attribute information can be understood as the position information, size, color depth, etc. of the component in the low-poly image.
[0033] Step S206: generating visual programming resources according to the plurality of components and the attribute information of the plurality of components, and inputting the visual programming resources into a target tool to generate target software.
[0034] The above visual programming resources can be understood as files in XML format.
[0035] Through the embodiment of the present application, a high-poly image is generated based on a low-poly image and a first text label, wherein the first text label is used to indicate component information of different areas in the low-poly image; multiple components in the high-poly image and attribute information of the multiple components are determined; visual programming resources are generated based on the multiple components and the attribute information of the multiple components, and the visual programming resources are input into the target tool to generate the target software, that is, a high-resolution image is generated by combining a low-resolution image with a text label, and then visual programming resources and corresponding software are generated by identifying the components of the high-resolution image and the attribute information of the components. Through the above technical solution, the problem of long delivery cycle of visual programming in related technologies is solved, and the delivery cycle is shortened.
[0036] Optionally, there are multiple implementation methods for the above-mentioned step S202. An embodiment of the present application provides an implementation method, including: obtaining an image data set of target resolution, and a second text label for each image in the image data set; gradually performing noise processing on each image to obtain a plurality of noise images corresponding to each image; training an initial diffusion model according to the plurality of noise images corresponding to each image and the second text label corresponding to each image to obtain a trained diffusion model; inputting the low-poly image and the first text label into the trained diffusion model, so that the trained diffusion model generates the high-poly image based on the low-poly image and the first text label.
[0037] That is to say, before generating a high-modulus image based on the diffusion model, the initial diffusion model needs to be trained. Specifically, a high-resolution (i.e., the target resolution mentioned above) image dataset is collected, and the text label of each image in the high-resolution image dataset is obtained. Noise is gradually added to each image, and then the initial diffusion model is trained so that the trained model can reduce noise and restore the high-resolution image.
[0038] Optionally, each of the above images is gradually added with noise, including at least one of the following:
[0039] 1. Adding Gaussian noise: This is done by adding a random value from a Gaussian distribution with a mean of 0 to each pixel value of the image. The variance of the noise can be adjusted to control the intensity of the noise.
[0040] 2. Add salt and pepper noise: Randomly select some pixels in the image and set their values to the maximum or minimum pixel value to simulate salt and pepper noise.
[0041] 3. Add Fluctuation Noise: Simulates fluctuation noise by applying random fluctuations to the pixel values of the image, making the image look more blurred and distorted.
[0042] 4. Add Motion Blur: Make the image look blurry and fuzzy, simulating motion noise by applying a motion blur filter on it.
[0043] 5. Add quantization noise: By reducing the gray levels of the image, it makes the image look like noise caused by quantization error.
[0044] Optionally, the low-poly image and the first text label are input into the trained diffusion model so that the trained diffusion model generates a high-poly image based on the low-poly image and the first text label, including: when N is equal to 1, the low-poly image and the first text label are input into the Nth layer network structure of the diffusion model so that the Nth layer network structure generates a first intermediate image based on the low-poly image and the first text label; when N is not equal to 1, the N-1th intermediate image output by the N-1th layer network structure of the diffusion model is input into the Nth layer network structure of the diffusion model so that the Nth layer network structure upsamples the N-1th intermediate image to generate the Nth intermediate image, wherein N is a positive integer; and the image output by the last layer network structure of the diffusion model is obtained, and the image output by the last layer network structure is determined to be the high-poly image, wherein the diffusion model includes a multi-layer network structure, and different network structures have different resolutions of generated images.
[0045] In an embodiment of the present application, based on the network structure corresponding to each scale, the resolution of the image is gradually increased, and then the newly generated pixels are filled by an interpolation method; that is, starting from the lowest resolution, interpolation and pixel enhancement are gradually performed upward until the required high resolution is reached.
[0046] Based on the implementation method in the embodiment of the present application, by gradually increasing the image resolution to generate a high-resolution image, it is possible to generate an image with richer details and clearer clarity; and in the multi-scale generation process, the model refines the image at different scales, which helps to gradually improve the image quality and make the generated image more realistic.
[0047] Optionally, visual programming resources are generated based on the multiple components and the attribute information of the multiple components, including: defining elements in a file of a target type based on the attribute information of the multiple components; establishing a mapping relationship between the multiple components and the attribute information of the multiple components and corresponding elements; and controlling a target editor to generate a file of the target type based on the mapping relationship.
[0048] That is, a mapping relationship between components and attribute information of components and elements in an image is established, and then the mapping relationship can be controlled to generate an XML file in a target editor (eg, a large model).
[0049] Before generating an XML file through the big model, the big model needs to be fine-tuned. For example, the big model needs to be controlled to learn the properties of key elements of existing rules and visual programming tools, such as the key element property, and the big language model needs to be told what the element represents.
[0050] Optionally, after controlling the target editor to generate the file of the target type based on the mapping relationship, the method further includes: determining whether the file of the target type conforms to a preset file pattern; if the file of the target type conforms to the preset file pattern, inputting the visual programming resources into the target tool to generate the target software; if the file of the target type does not conform to the preset file pattern, controlling the target editor to generate the file of the target type again based on the mapping relationship.
[0051] It should be noted that you need to select the target file mode before writing the XML file. Therefore, after writing, use the XML validator to check the correctness and structure of the XML file to ensure that all required elements exist and are in the correct format, for example: each element must have a start tag and an end tag.
[0052] Optionally, determining multiple components in the high-polygon image and attribute information of the multiple components includes: identifying edges of the multiple components in the high-polygon image through an edge detection algorithm; determining the multiple components in the high-polygon image through a target detection algorithm and the edges of the multiple components; determining feature vectors of the multiple components, and determining attribute information of the multiple components based on the feature vectors of the multiple components.
[0053] Optionally, before identifying the edges of the plurality of components in the high-polygon image by using an edge detection algorithm, the method further includes:
[0054] Use filters (such as Gaussian filters) to remove image noise; convert color images to grayscale images to reduce processing time and complexity, and resize images to suit algorithm requirements.
[0055] In order to better understand the process of the method for generating the above-mentioned software, the method for generating the above-mentioned software is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0056] The present application embodiment provides a method for generating software. Figure 3 is a flowchart (II) of a method for generating software according to an embodiment of the present application, such as Figure 3 As shown, the specific steps are as follows:
[0057] Step S301: obtaining a low-poly design (equivalent to the low-poly image in the above embodiment) and a prompt text corresponding to the low-poly design (equivalent to the first text label in the above embodiment);
[0058] Step S302: inputting the low-poly model and the prompt text corresponding to the low-poly model into the diffusion model;
[0059] Step S303: the diffusion model outputs a high-modulus design (equivalent to the high-modulus image in the above embodiment);
[0060] It should be noted that the diffusion model outputs high-mode design, which requires the diffusion model to be trained. Figure 4 is a flow chart of generating a diffusion model according to an embodiment of the present application, such as Figure 4 As shown, specifically:
[0061] Step 1: Collect a high-quality image dataset; obtain the corresponding text labels for each image in the image dataset;
[0062] Step 2: Preprocess each image;
[0063] Step 3: gradually add noise to each image through destructive process;
[0064] Step 4: Generate noise images in multiple stages from low noise to high noise;
[0065] Step 5: Train the diffusion model to gradually remove noise and increase details to generate the final high-definition image;
[0066] Step 6: Evaluate and optimize the trained diffusion model until a trained model is obtained.
[0067] like Figure 5 As shown, Figure 5 The left image is a low-poly design, and the right image is a high-poly design. The low-poly design is input into the diffusion model to generate the high-poly design.
[0068] Step S304: large model self-learning visual programming business logic;
[0069] Specifically: Learn the properties of key elements of existing rules and visual programming tools, such as the key element property, and tell the big language model what this element represents.
[0070] Step S305: Generate visual programming resources based on the visual programming business logic and high-level model design;
[0071] The corresponding XML file is generated by using the chatgpt large language model combined with the above high-modulus design, for example, placing an ADAS picture at a height of 740.
[0072] Specific computer programs such as Figure 6 shown.
[0073] Step S306: Generate HMI software based on visual programming resources.
[0074] Optionally, merge the XML file into Unity Hub or Kanzi studio project to generate deliverable HMI software.
[0075] The embodiment of the present application adopts diffusion model technology and visual programming self-learning, generates high-fidelity UE / UI design through low-fidelity design of UE / UI combined with text, and performs automated iteration of HMI software through self-learning visual programming business logic, so as to finally achieve the delivery of the concept verification stage and even the final delivery. The embodiment of the present application not only does not need to increase costs, but also shortens the delivery cycle, especially the introduction of large language models, which can bring users a stronger sense of technology.
[0076] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0077] The present application also provides a structural block diagram of a software generation device. Figure 7 is a structural block diagram of a software generation device according to an embodiment of the present application; Figure 7 As shown, including:
[0078] A first generating module 72, configured to generate a high-poly image according to the low-poly image and a first text label, wherein the first text label is used to indicate component information of different regions in the low-poly image;
[0079] A determination module 74, configured to determine a plurality of components in the high-polygon image and attribute information of the plurality of components;
[0080] The second generating module 76 is used to generate visual programming resources according to the multiple components and the attribute information of the multiple components, and input the visual programming resources into the target tool to generate the target software.
[0081] Through the above device, a high-poly image is generated based on a low-poly image and a first text label, wherein the first text label is used to indicate component information of different areas in the low-poly image; multiple components in the high-poly image and attribute information of the multiple components are determined; visual programming resources are generated based on the multiple components and attribute information of the multiple components, and the visual programming resources are input into the target tool to generate the target software, that is, a high-resolution image is generated by combining a low-resolution image with a text label, and then visual programming resources and corresponding software are generated by identifying the components of the high-resolution image and the attribute information of the components. Through the above technical solution, the problem of long delivery cycle of visual programming in related technologies is solved, and the delivery cycle is shortened.
[0082] In an exemplary embodiment, the first generation module 72 is used to obtain an image data set of a target resolution and a second text label for each image in the image data set; gradually perform noise processing on each image to obtain a plurality of noise images corresponding to each image; train an initial diffusion model according to the plurality of noise images corresponding to each image and the second text label corresponding to each image to obtain a trained diffusion model; input the low-poly image and the first text label into the trained diffusion model so that the trained diffusion model generates the high-poly image based on the low-poly image and the first text label.
[0083] In an exemplary embodiment, the first generation module 72 is used to input the low-polygon image and the first text label into the Nth layer network structure of the diffusion model when N is equal to 1, so that the Nth layer network structure generates a first intermediate image based on the low-polygon image and the first text label; when N is not equal to 1, input the N-1th intermediate image output by the N-1th layer network structure of the diffusion model into the Nth layer network structure of the diffusion model, so that the Nth layer network structure upsamples the N-1th intermediate image to generate the Nth intermediate image, wherein N is a positive integer; obtain the image output by the last layer network structure of the diffusion model, and determine that the image output by the last layer network structure is the high-polygon image, wherein the diffusion model includes a multi-layer network structure, and the resolutions of the generated images of different network structures are different.
[0084] In an exemplary embodiment, the second generation module 76 is used to define elements in a target type file according to the attribute information of the multiple components; establish a mapping relationship between the multiple components and the attribute information of the multiple components and the corresponding elements; and control the target editor to generate the target type file based on the mapping relationship.
[0085] In an exemplary embodiment, the second generation module 76 is used to determine whether the file of the target type conforms to the preset file pattern; if the file of the target type conforms to the preset file pattern, the visual programming resources are input into the target tool to generate the target software; if the file of the target type does not conform to the preset file pattern, the target editor is controlled to generate the file of the target type again based on the mapping relationship.
[0086] In an exemplary embodiment, the determination module 74 is used to identify the edges of multiple components in the high-polygon image through an edge detection algorithm; determine the multiple components in the high-polygon image through a target detection algorithm and the edges of the multiple components; determine the feature vectors of the multiple components, and determine the attribute information of the multiple components based on the feature vectors of the multiple components.
[0087] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0088] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0089] S1, generating a high-poly image according to a low-poly image and a first text label, wherein the first text label is used to indicate component information of different regions in the low-poly image;
[0090] S2, determining a plurality of components in the high-polygon image and attribute information of the plurality of components;
[0091] S3, generating visual programming resources according to the multiple components and the attribute information of the multiple components, and inputting the visual programming resources into a target tool to generate target software.
[0092] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0093] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0094] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0095] S1, generating a high-poly image according to a low-poly image and a first text label, wherein the first text label is used to indicate component information of different regions in the low-poly image;
[0096] S2, determining a plurality of components in the high-polygon image and attribute information of the plurality of components;
[0097] S3, generating visual programming resources according to the multiple components and the attribute information of the multiple components, and inputting the visual programming resources into a target tool to generate target software.
[0098] An embodiment of the present application further provides a computer program product, including a computer program, which is used by a processor to execute the steps in any of the above method embodiments.
[0099] Optionally, in this embodiment, the computer program product may be executed by a processor to perform the following steps:
[0100] S1, generating a high-poly image according to a low-poly image and a first text label, wherein the first text label is used to indicate component information of different regions in the low-poly image;
[0101] S2, determining a plurality of components in the high-polygon image and attribute information of the plurality of components;
[0102] S3, generating visual programming resources according to the multiple components and the attribute information of the multiple components, and inputting the visual programming resources into a target tool to generate target software.
[0103] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0104] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0105] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0106] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for generating software, characterized in that: include: Generating a high-poly image according to the low-poly image and the first text label, wherein the first text label is used to indicate component information of different regions in the low-poly image; Determining a plurality of components in the high-polygon image and attribute information of the plurality of components; Visual programming resources are generated according to the multiple components and the attribute information of the multiple components, and the visual programming resources are input into a target tool to generate target software.
2. The software generation method according to claim 1, characterized in that: Generate a high-polygon image according to the low-polygon image and the first text label, including: Acquire an image dataset of target resolution and a second text label for each image in the image dataset; Stepwise noise addition processing is performed on each of the images to obtain a plurality of noise images corresponding to each of the images; Training the initial diffusion model according to the multiple noise images corresponding to each image and the second text label corresponding to each image to obtain a trained diffusion model; The low-poly image and the first text label are input into the trained diffusion model, so that the trained diffusion model generates the high-poly image based on the low-poly image and the first text label.
3. The method for generating software according to claim 2, characterized in that: Inputting the low-polygon image and the first text label into the trained diffusion model so that the trained diffusion model generates a high-polygon image based on the low-polygon image and the first text label, comprising: When N is equal to 1, the low-polygon image and the first text label are input into an N-th layer network structure of a diffusion model, so that the N-th layer network structure generates a first intermediate image based on the low-polygon image and the first text label; When N is not equal to 1, inputting the N-1th intermediate image output by the N-1th layer network structure of the diffusion model into the Nth layer network structure of the diffusion model, so that the Nth layer network structure upsamples the N-1th intermediate image to generate the Nth intermediate image, wherein N is a positive integer; An image output by a last layer of the network structure of the diffusion model is obtained, and the image output by the last layer of the network structure is determined to be the high-polygon image, wherein the diffusion model includes a multi-layer network structure, and different network structures generate images with different resolutions.
4. The software generation method according to claim 1, characterized in that: Generating visual programming resources according to the plurality of components and the attribute information of the plurality of components includes: Defining elements in a file of a target type according to the attribute information of the plurality of components; Establishing a mapping relationship between the plurality of components and the attribute information of the plurality of components and corresponding elements; The target editor is controlled to generate a file of the target type based on the mapping relationship.
5. The method for generating software according to claim 4, characterized in that: After controlling the target editor to generate a file of the target type based on the mapping relationship, the method further includes: Determine whether the target type of file conforms to a preset file mode; In the case where the file of the target type conforms to the preset file mode, inputting the visual programming resource into a target tool to generate target software; In the case that the file of the target type does not conform to the preset file mode, the target editor is controlled to generate the file of the target type again based on the mapping relationship.
6. The software generation method according to claim 1, characterized in that: Determining a plurality of components in the high polyhedron image and attribute information of the plurality of components includes: Identifying edges of multiple components in the high-polygon image using an edge detection algorithm; Determine multiple components in the high-polygon image by using an object detection algorithm and edges of the multiple components; Determine feature vectors of the plurality of components, and determine attribute information of the plurality of components according to the feature vectors of the plurality of components.
7. A software generating device, characterized in that: include: A first generating module, configured to generate a high-poly image according to the low-poly image and a first text label, wherein the first text label is used to indicate component information of different regions in the low-poly image; A determination module, used to determine a plurality of components in the high-polygon image and attribute information of the plurality of components; The second generating module is used to generate visual programming resources according to the multiple components and the attribute information of the multiple components, and input the visual programming resources into the target tool to generate the target software.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of any one of the methods of claims 1 to 6 when executed by a processor.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that The computer program is used by a processor to execute the method described in any one of claims 1 to 6.
