Material generation method and device

By configuring shape similarity constraints in the shape generation model and adjusting the template shape to generate target visual materials that are similar to the initial shape but have different characteristics, the problem that traditional shape modeling methods cannot generate flexible shape materials is solved, and more efficient and high-quality shape material generation is achieved.

CN120070750APending Publication Date: 2025-05-30SHANGHAI BILIBILI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510130850.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-05
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

Traditional shape modeling methods cannot generate brand new shape materials and lack the flexibility required for actual scenarios. The shapes generated by shape material generation methods using artificial intelligence technology are difficult to apply to actual production scenarios.

Method used

By loading the initial shape data into a pre-trained shape generation model and configuring shape similarity constraints, the template shape is adjusted to generate target visual material similar to the initial shape but with different characteristics.

Benefits of technology

The visual similarity between the generated shape and the input shape is enhanced, the flexibility and quality of the material generation method is improved, and the generated shape is more suitable for actual production scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120070750A_ABST
    Figure CN120070750A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a material generation method and device, and belongs to the technical field of computers. The material generation method comprises the following steps: loading initial shape data into a pre-trained shape generation model, wherein the initial shape data corresponds to an initial shape; outputting a target visual material through the shape generation model; wherein the shape generation model is used for adjusting a template shape according to the initial shape so as to obtain a target visual material with a shape similar to that of the initial shape; the shape generation model is configured with a shape similarity constraint, and the shape similarity constraint is used for limiting that the similarity between the shape of the target visual material and the initial shape is greater than a preset threshold value. According to the technical scheme, the visual similarity between the generated shape and the input shape can be enhanced, so that the flexibility of the material generation method is enhanced, and the quality of the model generation material is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of computer technology, and in particular, to a method and apparatus for generating materials, a computer device, a computer-readable storage medium, and a computer program product. Background Art

[0002] In the field of 3D modeling, shape generation technology has evolved from traditional to intelligent. Modern modeling systems often integrate multiple technologies, while maintaining the accuracy of traditional methods, leveraging AI to improve modeling efficiency and creativity.

[0003] However, traditional shape modeling methods cannot generate entirely new shape materials and lack the flexibility required for actual scenarios. Shape material generation methods that use artificial intelligence technology generate shape materials that are difficult to apply to actual production scenarios.

[0004] It should be noted that the above content is not necessarily prior art and does not limit the scope of patent protection of the present application. Summary of the Invention

[0005] Embodiments of the present application provide a method and apparatus for generating materials, a computer device, a computer-readable storage medium, and a computer program product to solve or alleviate one or more of the above technical problems.

[0006] One aspect of the embodiments of the present application provides a method for generating materials, the method comprising: Loading initial shape data into a pre-trained shape generation model, the initial shape data corresponding to an initial shape; Outputting a target visual material through the shape generation model; wherein the shape generation model is used to adjust a template shape according to the initial shape to obtain a target visual material having a shape similar to the initial shape; the shape generation model is configured with a shape similarity constraint, and the shape similarity constraint is used to define that the similarity between the shape of the target visual material and the initial shape is greater than a preset threshold.

[0007] Optionally, adjusting the template shape according to the initial shape includes: Obtaining a plurality of initial rays and a plurality of standard rays according to a preset ray starting point; wherein the initial rays intersect with the initial shape, and the standard rays intersect with the template shape; Adjusting the plurality of standard rays according to the plurality of initial rays to obtain a plurality of adjusted rays intersecting with the similar shape; Adjusting the template shape according to the plurality of adjusted rays.

[0008] Optionally, according to the multiple initial rays, adjust the multiple standard rays to obtain multiple adjusted rays that intersect the similar shape, including: Determine multiple standard rays corresponding to the multiple initial rays, where one initial ray corresponds to one standard ray and they have the same length; According to the starting points and directions of the multiple initial rays respectively, adjust the starting points and directions of the corresponding standard rays one by one to obtain the multiple adjusted rays.

[0009] Optionally, the similarity between the similar shape and the initial shape is greater than a preset threshold and satisfies the following conditions: The distances between the starting points of the multiple adjusted rays and the starting point of the preset ray are all lower than a first preset value; and The angles between the directions of the multiple adjusted rays and the directions of their corresponding initial rays are all lower than a second preset value.

[0010] Optionally, the method further includes: Determine the gaps between the starting points of the multiple adjusted rays and the starting point of the preset ray; Determine the angles between the directions of the multiple adjusted rays and the directions of their corresponding initial rays; According to the gaps between the starting points of the multiple adjusted rays and the starting point of the preset ray, and the angles between the directions of the multiple adjusted rays and the directions of their corresponding initial rays, adjust the model parameters of the shape generation model.

[0011] Optionally, the method further includes: Configure a shape identifier for the similar shape; wherein, the shape identifier is used to instruct the shape generation model to output the similar shape.

[0012] Optionally, the template shape is obtained through the following operations: Obtain multiple sample shape data, where the sample shape data corresponds to sample shapes; Select multiple similar sample shapes from the multiple sample shapes, and the similarity between the multiple similar sample shapes is higher than a preset value; Input the multiple sample shape data corresponding to the multiple similar sample shapes into the shape generation model to generate a template shape through the shape generation model.

[0013] Another aspect of the embodiments of the present application provides a material generation device, and the device includes: An input module, configured to load initial shape data into a pre-trained shape generation model, where the initial shape data corresponds to an initial shape; An output module, configured to output a target visual material through the shape generation model; Wherein, the shape generation model is configured to adjust a template shape according to the initial shape to obtain a target visual material having a shape similar to the initial shape; the shape generation model is configured with a shape similarity constraint, and the shape similarity constraint is used to define that the similarity between the shape of the target visual material and the initial shape is greater than a preset threshold.

[0014] Another aspect of the embodiments of the present application provides a computer device, including: At least one processor; and A memory communicatively connected to the at least one processor; Wherein: the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0015] Another aspect of the embodiments of the present application provides a computer-readable storage medium, in which computer instructions are stored, and when the computer instructions are executed by a processor, the method as described above is implemented.

[0016] Another aspect of the embodiments of the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, the method as described above is implemented.

[0017] The embodiments of the present application adopting the above technical solutions may include the following advantages: Adjust the template shape by using a model with similarity constraints to generate a target shape. Thereby, the visual similarity between the generated shape and the input shape can be enhanced, thereby enhancing the flexibility of the material generation method and improving the quality of the materials generated by the model. Description of the Drawings

[0018] The drawings exemplarily show embodiments and form a part of the specification, and are used together with the written description of the specification to explain the exemplary embodiments of the embodiments. The shown embodiments are only for illustrative purposes and do not limit the scope of the claims. In all the drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0019] Figure 1 Schematically shows an operating environment diagram of the material generation method according to Embodiment 1 of the present application; Figure 2 Schematically shows a flowchart of the material generation method according to Embodiment 1 of the present application; Figure 3 Schematically shows Figure 2 The sub-step flowchart of step S202 in; Figure 4 Schematically shows Figure 3 the sub-step flowchart of step S302 in Figure 5 Schematically shows the new flowchart of the material generation method according to Embodiment 1 of the present application; Figure 6 Schematically shows another new flowchart of the material generation method according to Embodiment 1 of the present application; Figure 7 Schematically shows the exemplary application flowchart of the material generation method according to Embodiment 1 of the present application; Figure 8 Schematically shows the flowchart of the material generation method according to Embodiment 1 of the present application; Figure 9 Schematically shows the effect schematic diagram of generating the template shape of the material generation method according to Embodiment 1 of the present application; Figure 10 Schematically shows the block diagram of the material generation device according to Embodiment 2 of the present application; and Figure 11 Schematically shows the hardware architecture schematic diagram of the computer device according to Embodiment 3 of the present application. Detailed implementation manners

[0020] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.

[0021] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments may be combined with each other, but it must be based on the fact that those of ordinary skill in the art can implement them. When the combination of the technical solutions results in contradictions or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the protection scope required by the present application.

[0022] In the description of the present application, it should be understood that the numerical labels before the steps do not identify the order of execution of the steps, but are only used to facilitate the description of the present application and distinguish each step, and thus cannot be understood as a limitation to the present application.

[0023] First, the term explanations involved in the present application are provided: Implicit representation: A method of mathematically describing a three-dimensional shape or surface by defining a multivariate function F(x, y, z) = 0 to implicitly represent the surface of the shape, rather than directly listing all the points or edges that make up the shape.

[0024] Explicit representation: A method of directly describing the geometric information of a three-dimensional shape or model by listing all the geometric elements (such as vertex coordinates, edge connection information, and patch data) that make up the shape.

[0025] Autoencoder: A neural network structure that combines an encoder and a decoder. It is used to learn an effective representation of the input data and can reconstruct the original input. The encoder compresses the input data into a low-dimensional feature representation, and the decoder then restores these features into an output similar to the original data.

[0026] Neural radiance field: A computer vision technique for generating high-quality three-dimensional reconstruction models. It uses deep learning techniques to extract the geometric and appearance information of an object from images taken from multiple viewpoints, enabling the rendering of scenes from any new viewpoint.

[0027] Convolutional neural network: A deep learning model that automatically and adaptively learns hierarchical spatial structure features by using convolutional layers. These convolutional layers can capture local patterns in images, such as edges and textures. It usually includes multiple convolutional layers, pooling layers to reduce the feature dimension, fully connected layers for classification or regression, and non-linear activation functions such as ReLU to introduce non-linearity.

[0028] Generative adversarial network: A deep learning model consisting of two competing neural networks: a generator and a discriminator. The goal of the generator is to create realistic data samples to deceive the discriminator, while the discriminator tries to distinguish between the fake samples generated by the generator and the real samples. Through this adversarial training process, the generator continuously optimizes the quality of the data it generates, making it increasingly difficult for the discriminator to recognize, and ultimately being able to generate high-quality samples indistinguishable from real data.

[0029] Shape feature points: Points in a geometric shape that have special significance or saliency and are used to describe and identify the key attributes of the shape, such as corner points, edge intersection points, curvature extreme points, etc.

[0030] Secondly, to facilitate the understanding of the technical solutions provided in the embodiments of the present application by those skilled in the art, the related technologies are described below: In the field of 3D modeling, shape generation technology has evolved from traditional to intelligent. In the early days, it mainly relied on traditional methods such as parametric surface and mesh modeling, constructing models through mathematical descriptions and geometric operations. Subsequently, 3D reconstruction technologies based on scanning emerged, including laser scanning and optical reconstruction. Procedural generation technologies create shapes in batches through algorithmic rules, such as noise functions for terrain generation. In recent years, significant breakthroughs have been brought about by artificial intelligence technologies. Methods such as generative adversarial networks, diffusion models, and neural radiance fields can generate complex shapes from text descriptions or a small number of images. In addition, interactive modeling technologies such as sketch-to-3D are also continuously integrating machine learning methods. Modern modeling systems often integrate multiple technologies, while maintaining the accuracy of traditional methods, leveraging AI to improve modeling efficiency and creativity. This field is still developing rapidly, with various new neural network architectures emerging continuously.

[0031] However, the shape modeling methods known to the present inventors cannot generate completely new shape materials and lack the flexibility required in actual scenarios. Most of the shape material generation methods using artificial intelligence technology are based on the stable diffusion algorithm. The generated shapes lack visual relevance, and the generated shape materials are random, making it difficult to apply them to actual production scenarios.

[0032] Therefore, the embodiments of this application provide a technical solution for material generation. In this technical solution, (1) by adding shape similarity constraints and combining the theory of equivalence relations, it is ensured that the shapes generated by this method have a strong visual similarity relationship, avoiding the appearance of significantly different shape materials; (2) using a neural network model and indirectly expressing the shape surface using the method of shape implicit representation, which can overcome the monotonicity of traditional shape modeling and can generate high-precision shape materials; (3) assigning a unique identifier to each shape, thereby enabling the repeatable generation of shape materials. See the following text for details.

[0033] Finally, for ease of understanding, an exemplary operating environment is provided below.

[0034] As Figure 1 shown, the operating environment diagram includes a server 2, a network 4, and a client 6, where: The server 2 can be composed of a single or multiple computing devices. These multiple computing devices can include virtualized computing instances. The virtualized computing instances can include virtual machines, such as emulations of computer systems, operating systems, servers, etc. The computing devices can load virtual machines based on virtual images and / or other data that define specific software (e.g., operating systems, dedicated applications, servers) for emulation. As the demand for different types of processing services changes, different virtual machines can be loaded and / or terminated on one or more computing devices. A hypervisor can be implemented to manage the use of different virtual machines on the same computing device.

[0035] Server 2 can be configured to communicate with client 6 etc. via network 4. Network 4 includes various network devices such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices and / or the like. Network 4 can include physical links such as coaxial cable links, twisted pair cable links, fiber optic links and combinations thereof, etc., or wireless links such as cellular links, satellite links, Wi-Fi links, etc.

[0036] Server 2 can provide services such as storage, reading, writing, querying, deleting, etc., such as providing a shape material generation service for the client.

[0037] Client 6 can be an electronic device running an operating system such as Windows, Android™ or iOS, such as a smart phone, tablet device, laptop computer, virtual reality device, game device, set-top box, vehicle terminal, smart TV. Based on the above operating systems, various application programs can be run, such as a shape data upload program, a shape material receiving program, etc.

[0038] Client 6 can provide / configure a user access page for controlling Server 2 or uploading objects, etc.

[0039] It should be noted that the above devices are exemplary, and in different scenarios or according to different requirements, the number and types of devices can be adjusted.

[0040] The following takes Server 2 as the execution entity and introduces the technical solutions of this application through multiple embodiments. It should be noted that these embodiments can be implemented in various different forms and should not be construed as being limited only to the embodiments described herein.

[0041] Embodiment 1 Figure 2 A flowchart of a material generation method according to Embodiment 1 of this application is schematically shown.

[0042] As Figure 2 shown, the material generation method may include steps S200 to S202, where: Step S200, loading initial shape data into a pre-trained shape generation model, where the initial shape data corresponds to an initial shape.

[0043] Step S202, outputting a target visual material through the shape generation model; wherein, the shape generation model is used to adjust a template shape according to the initial shape to obtain a target visual material having a shape similar to the initial shape; the shape generation model is configured with a shape similarity constraint, and the shape similarity constraint is used to define that the similarity between the shape of the target visual material and the initial shape is greater than a preset threshold.

[0044] The material generation method provided in this embodiment uses a model with similarity constraints to adjust the template shape to generate the target shape. Thereby, the visual similarity between the generated shape and the input shape can be enhanced, so as to control the surface spatial position of the shape and improve the quality of the materials generated by the model.

[0045] The following combines Figure 2 , and elaborates on each step in steps S200 to S202 and other optional steps in detail.

[0046] Step S200 , load the initial shape data into a pre-trained shape generation model, and the initial shape data corresponds to the initial shape.

[0047] The initial shape data can be the data of the shape material obtained from the website, or the data of any shape material defined by the user. The initial shape can be any 2D or 3D shape, and the initial shape data can express the initial shape in the form of implicit expression or explicit expression.

[0048] The shape generation model can be trained through neural network architectures such as convolutional neural network (CNN), generative adversarial network (GAN), or autoencoder. According to the actual situation, a third-party open-source neural network model can also be used as the shape generation model.

[0049] Step S202 , output the target visual material through the shape generation model; wherein, the shape generation model is used to adjust the template shape according to the initial shape to obtain the target visual material with a shape similar to the initial shape; the shape generation model is configured with a shape similarity constraint, and the shape similarity constraint is used to limit that the similarity between the shape of the target visual material and the initial shape is greater than a preset threshold.

[0050] The template shape can be any 2D or 3D shape, such as a circle, a sphere, etc. For example, when the template shape is a circle and the initial shape is a pentagon, the shape of the target visual material output by the shape generation model may be a hexagon or an octagon.

[0051] The similarity of the shape can be the visual similarity obtained based on the neural network, or the distance-based metric or feature-based metric calculated according to a specific mathematical model or algorithm. The constraint parameters of the model can also be adjusted according to the user's feedback to improve the effect of the shape similarity constraint. In specific implementation, there can be multiple template shapes, and according to the characteristics of the initial shape, a template shape with a higher similarity to the initial shape can be selected from multiple template shapes.

[0052] Multiple target visual materials can be generated each time so that users can select from multiple target visual materials according to their needs. The flowchart of the material generation method in this embodiment is as follows Figure 8 shown.

[0053] In this embodiment, a target shape (i.e., the shape of the target material) is generated by a shape generation model configured with a shape similarity constraint. Thus, the similarity between the generated target shape and the initial shape can be improved, the flexibility and generality of material generation are enhanced, and the quality of the generated materials is improved. At the same time, since multiple generated target shapes are all adjusted from the template shape, the multiple target shapes are all similar to the template shape, so that the target shapes can be similar to each other. Thus, a strong similarity relationship can be constrained among the generated shapes, and shape materials with large differences can be avoided.

[0054] There are various ways to adjust the template shape according to the initial shape. An exemplary way is provided below.

[0055] In an alternative embodiment, as shown in Figure 3 shown, step S202 includes: S300, obtaining a plurality of initial rays and a plurality of standard rays according to a preset ray starting point; wherein, the initial rays intersect with the initial shape, and the standard rays intersect with the template shape.

[0056] S302, adjusting the plurality of standard rays according to the plurality of initial rays to obtain a plurality of adjusted rays that intersect with the similar shape.

[0057] S304, adjusting the template shape according to the plurality of adjusted rays.

[0058] The preset ray starting point can be set according to the geometric center, centroid or specific feature point of the initial shape. The directions of the initial rays and the standard rays can be in any direction, or can be specified within a certain range so that most rays can intersect with the shape. The density of the rays can also be adjusted according to the complexity of the shape and the required accuracy. In the complex area or key features of the shape, the number of rays can be increased.

[0059] In this embodiment, using rays to determine the position of the shape surface can improve the parsing accuracy of the initial shape and the material accuracy of the generated shape materials. At the same time, all generated similar shapes are adjusted from the template shape. Combining with the shape similarity constraint, a strong visual similarity relationship can be constrained among the generated shapes, and shape materials with large differences can be avoided.

[0060] There are various ways to adjust the standard rays to obtain the adjusted rays. The following is an exemplary adjustment method.

[0061] In an alternative embodiment, as Figure 4 shown, step S302 includes: S400, determining a plurality of standard rays corresponding to the plurality of initial rays, one of the initial rays corresponding to one of the standard rays and having the same length as the latter.

[0062] S402, adjusting the starting point and direction of the corresponding standard ray one by one according to the starting point and direction of each of the plurality of initial rays to obtain the plurality of adjusted rays.

[0063] It should be noted that the length of the ray here refers to the length between the ray and the intersection with the shape. In specific implementation, according to the accuracy requirements of the material generation, the lengths of the initial ray and the corresponding standard ray may not be exactly the same, but approximately equal.

[0064] For example, there is an initial ray A with its starting point at Q1, direction to the right, and length t1. Correspondingly, there is a standard ray B with its starting point at Q1, direction 30 degrees to the lower right, and length also t1. Then B can be adjusted to have a starting point at Q2 and a direction 10 degrees to the lower right without changing its length.

[0065] In this embodiment, the standard ray having the same length as the initial ray is adjusted to obtain the adjusted ray. Thus, it can be ensured that the positional relationship and direction characteristics between the adjusted ray and the initial ray are consistent, thereby achieving precise adjustment of the template shape to keep it highly visually similar to the initial shape, improving the accuracy and efficiency of shape adjustment.

[0066] To constrain the similarity between the similar shape and the initial shape to be greater than a preset threshold, multiple judgment conditions can be set. For example, when the following two conditions are met simultaneously, it can be determined that the similarity between the similar shape and the initial shape meets the requirements.

[0067] Condition 1: The distance between the starting point of each of the plurality of adjusted rays and the starting point of the preset ray is lower than the first preset value.

[0068] Condition 2: The angle between the direction of each of the plurality of adjusted rays and the direction of the corresponding initial ray is lower than the second preset value.

[0069] The first preset value and the second preset value can be fixed values or can be adaptively set according to the characteristics and accuracy requirements of the initial shape. For example, the first preset value can be set to 3 unit lengths and the second preset value to 10 degrees.

[0070] In this embodiment, restricting the adjustment range of the starting point and direction of the adjustment ray can ensure that the generated similar shapes are consistent with the initial shape in terms of spatial position, thereby effectively controlling the range of shape changes to meet the similarity requirements and improving the reliability and accuracy of shape generation.

[0071] After the model generates similar shapes, the model can also be adjusted according to the actual effects of the generated shapes so that the model can output more similar shapes that meet the similarity requirements after adjustment. There are various methods for adjusting the model, and an exemplary method is provided below.

[0072] In an alternative embodiment, as Figure 5 shown, the method further includes: S500, determining the distances between the starting points of the respective adjustment rays and the preset ray starting point.

[0073] S502, determining the angles between the directions of the respective adjustment rays and the directions of their corresponding initial rays.

[0074] S504, adjusting the model parameters of the shape generation model according to the distances between the starting points of the respective adjustment rays and the preset ray starting point, and the angles between the directions of the respective adjustment rays and the directions of their corresponding initial rays.

[0075] In the specific adjustment process, it can be adjusted according to the generation result each time after generating a similar shape each time. It can also be adjusted according to the average value, median or standard deviation, etc. of the starting point differences and direction angles after generating multiple similar shapes. It can also allocate different weights according to the importance of the angles in different directions for the influence of the shape on the shape generation model to adjust more precisely.

[0076] In this embodiment, the model is adjusted according to the error between the adjustment ray and the initial ray. Thus, through continuous iterative optimization, the model can generate more precisely matched similar shapes, improving the accuracy and consistency of the generated shapes.

[0077] In an alternative embodiment, the method further includes: Configuring a shape identifier for the similar shape; wherein the shape identifier is used to indicate that the shape generation model outputs the similar shape.

[0078] The shape identifier can be a code uniquely corresponding to each similar shape, and the code can include numbers, letters or symbols, etc. According to actual needs, it can also be an information-storable identifier form such as a two-dimensional code or a bar code.

[0079] In this embodiment, a unique identifier is assigned to each shape, thereby enabling the reproducible generation of shape materials and improving the efficiency and accuracy of shape material management.

[0080] In specific implementation, the template shape can be a user-defined shape or a shape generated by some available methods. The following provides an exemplary method for generating a template shape.

[0081] In an alternative embodiment, as Figure 6 shown, the template shape is obtained through the following operations: S600, obtain a plurality of sample shape data, where the sample shape data corresponds to sample shapes.

[0082] S602, select a plurality of similar sample shapes from the plurality of sample shapes, and the similarity between the plurality of similar sample shapes is higher than a preset value.

[0083] S604, input the plurality of sample shape data corresponding to the plurality of similar sample shapes into the shape generation model to generate a template shape through the shape generation model.

[0084] The sample shape data can be the data of existing shape materials obtained from a website or the data of any shape materials customized by the user through methods such as 3D scanning and computer-aided design (CAD) models. The sample shape can be any 2D or 3D shape, and the sample shape data can express the sample shape in the form of implicit expression or explicit expression.

[0085] The similarity of similar sample shapes can be identified by methods such as graph-based clustering, spectral clustering, or deep learning-based clustering methods. The preset value can be a fixed value or can be adaptively adjusted according to the user's accuracy requirements for the generated materials.

[0086] The shape generation model can generate a template shape by fitting a plurality of similar sample shapes. After obtaining the template shape by fitting, operations such as smoothing, simplifying, or enhancing the template shape can also be performed. The schematic diagram of the effect of generating the template shape in this embodiment is as Figure 9 shown.

[0087] In this embodiment, using a plurality of similar sample shapes to generate a template shape can improve the representativeness and generality of the template shape, thereby improving the quality and applicability of the materials generated by the model.

[0088] To make the present application easier to understand, the following provides an exemplary application in combination with Figure 7 where: S11, obtain a plurality of sample shapes D1 to D6, and select similar sample shapes D1 to D4 with a similarity higher than 90% from them; S12. Input the similar sample shapes D1 - D4 into the shape generation model, and fit to obtain a template shape M which is circular. S13. Load the data of the initial shape F (i.e., the initial shape data) into the shape generation model, where the initial shape F is hexagonal. S14. The shape generation model emits multiple rays from the preset ray starting point P to the initial shape F to obtain multiple initial rays L1 - L5, and emits multiple rays from the preset ray starting point P to the template shape M to obtain multiple standard rays BL1 - BL5. The lengths of L1 - L5 and BL1 - BL5 correspond to each other in sequence. S15. The shape generation model adjusts the starting points and directions of BL1 - BL5 in sequence according to the directions of L1 - L5 to obtain adjusted rays TL1 - TL5, and the distance between the starting point of each adjusted ray TL1 - TL5 and the starting point of the corresponding ray in the initial rays L1 - L5 is within 3 unit lengths, and the included angle of the directions is within 10 degrees. S16. Adjust the template shape M according to the adjusted rays TL1 - TL5 to obtain a similar shape S which is octagonal.

[0089] Embodiment 2 Figure 10 Schematically shows a block diagram of a material generation device according to Embodiment 2 of the present application. The device can be divided into one or more program modules. One or more program modules are stored in a storage medium and executed by one or more processors to complete the embodiments of the present application. The program modules referred to in the embodiments of the present application refer to a series of computer program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment. As Figure 10 shown, the device 1000 may include: an input module 1100, an output module 1200, where: The input module 1100 is configured to load the initial shape data into a pre - trained shape generation model, and the initial shape data corresponds to the initial shape. The output module 1200 is configured to output the target visual material through the shape generation model. Wherein, the shape generation model is used to adjust the template shape according to the initial shape to obtain a target visual material having a similar shape to the initial shape; the shape generation model is configured with a shape similarity constraint, and the shape similarity constraint is used to limit that the similarity between the shape of the target visual material and the initial shape is greater than a preset threshold.

[0090] As an optional embodiment, the output module 1200 is further configured to: Obtain a plurality of initial rays and a plurality of standard rays according to a preset ray starting point; wherein, the initial rays intersect with the initial shape, and the standard rays intersect with the template shape; Adjust the plurality of standard rays according to the plurality of initial rays to obtain a plurality of adjusted rays that intersect with the similar shape; Adjust the template shape according to the plurality of adjusted rays.

[0091] As an optional embodiment, the output module 1200 is further configured to: Determine a plurality of standard rays corresponding to the plurality of initial rays, where one initial ray corresponds to one standard ray and they have the same length; Adjust the starting point and direction of the corresponding standard ray one by one according to the starting point and direction of each of the plurality of initial rays to obtain the plurality of adjusted rays.

[0092] As an optional embodiment, the similarity between the similar shape and the initial shape is greater than a preset threshold and satisfies the following conditions: The distance between the starting point of each of the plurality of adjusted rays and the preset ray starting point is lower than a first preset value; and The angle between the direction of each of the plurality of adjusted rays and the direction of the corresponding initial ray is lower than a second preset value.

[0093] As an optional embodiment, the apparatus 1000 further includes a model adjustment module for: Determine the gap between the starting point of each of the plurality of adjusted rays and the preset ray starting point; Determine the angle between the direction of each of the plurality of adjusted rays and the direction of the corresponding initial ray; Adjust the model parameters of the shape generation model according to the gap between the starting point of each of the plurality of adjusted rays and the preset ray starting point, and the angle between the direction of each of the plurality of adjusted rays and the direction of the corresponding initial ray.

[0094] As an optional embodiment, the apparatus 1000 further includes an identification configuration module for: Configure a shape identifier for the similar shape; wherein, the shape identifier is used to indicate that the shape generation model outputs the similar shape.

[0095] As an optional embodiment, the apparatus 1000 further includes a template generation module for: Obtain a plurality of sample shape data, where the sample shape data corresponds to a sample shape; Select a plurality of similar sample shapes from the plurality of sample shapes, and the similarity between the plurality of similar sample shapes is higher than a preset value; Input the multiple sample shape data corresponding to the multiple similar sample shapes into the shape generation model to generate a template shape through the shape generation model.

[0096] Embodiment III Figure 11 Schematically shown is a hardware architecture diagram of a computer device 10000 suitable for implementing a material generation method according to Embodiment III of the present application. In some embodiments, the computer device 10000 may be a terminal device such as a smart phone, a wearable device, a tablet computer, a personal computer, a vehicle-mounted terminal, a game console, a virtual device, a workbench, a digital assistant, a set-top box, a robot, etc. In other embodiments, the computer device 10000 may be a rack server, a blade server, a tower server, or a cabinet server (including a stand-alone server or a server cluster composed of multiple servers), etc. As Figure 11 shown, the computer device 10000 includes, but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can be communicatively linked to each other through a system bus. Among them: The memory 10010 includes at least one type of computer-readable storage medium. The readable storage medium includes flash memory, a hard disk, a multimedia card, a card-type memory (such as an SD or DX memory), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 10010 may be an internal storage module of the computer device 10000, such as the hard disk or memory of the computer device 10000. In other embodiments, the memory 10010 may also be an external storage device of the computer device 10000, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc., equipped on the computer device 10000. Of course, the memory 10010 may also include both the internal storage module and the external storage device of the computer device 10000. In this embodiment, the memory 10010 is generally used to store the operating system and various application software installed on the computer device 10000, such as the program code of the material generation method. In addition, the memory 10010 may also be used to temporarily store various data that have been output or will be output.

[0097] The processor 10020 can be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor, or other chips in some embodiments. The processor 10020 is generally used to control the overall operation of the computer device 10000, such as performing control and processing related to data interaction or communication with the computer device 10000. In this embodiment, the processor 10020 is used to run the program code stored in the memory 10010 or process data.

[0098] The network interface 10030 may include a wireless network interface or a wired network interface. The network interface 10030 is generally used to establish a communication link between the computer device 10000 and other computer devices. For example, the network interface 10030 is used to connect the computer device 10000 to an external terminal through a network, and establish a data transmission channel and a communication link between the computer device 10000 and the external terminal. The network can be an enterprise intranet (Intranet), the Internet, the Global System of Mobile communication (GSM for short), Wideband Code Division Multiple Access (WCDMA for short), 4G network, 5G network, Bluetooth, Wi-Fi and other wireless or wired networks.

[0099] It should be noted that Figure 11 Only the computer device with components 10010 - 10030 is shown, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented.

[0100] In this embodiment, the material generation method stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (such as the processor 10020) to complete the embodiments of the present application.

[0101] Embodiment 4 The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the material generation method in the embodiment are implemented.

[0102] In this embodiment, the computer-readable storage medium includes flash memory, hard disks, multimedia cards, card-type memories (e.g., SD or DX memories, etc.), random access memories (RAM), static random access memories (SRAM), read-only memories (ROM), electrically erasable programmable read-only memories (EEPROM), programmable read-only memories (PROM), magnetic memories, magnetic disks, optical discs, etc. In some embodiments, the computer-readable storage medium may be an internal storage unit of a computer device, such as the hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc., equipped on the computer device. Of course, the computer-readable storage medium may also include both the internal storage unit and the external storage device of the computer device. In this embodiment, the computer-readable storage medium is generally used to store the operating system installed on the computer device and various application software, such as the program code of the material generation method in the embodiment. In addition, the computer-readable storage medium can also be used to temporarily store various data that have been output or will be output.

[0103] Embodiment 5 The embodiment of the present application further provides a computer program product, including a computer program, which when executed by a processor implements the method in the above embodiment.

[0104] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the embodiments of the present application can be implemented by a general computer device. They can be concentrated on a single computer device or distributed on a network composed of multiple computer devices. Optionally, they can be implemented by program codes executable by the computer device, so that they can be stored in a storage device and executed by the computer device. And in some cases, the steps shown or described can be executed in a different order than here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module to implement. Thus, the embodiments of the present application are not limited to any specific combination of hardware and software.

[0105] It should be noted that the above are only the preferred embodiments of the present application, and do not limit the patent protection scope of the present application. Any equivalent structural or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, are equally included in the patent protection scope of the present application.

Claims

1. A material generation method, characterized in that: The method comprises: Loading initial shape data into a pre-trained shape generation model, the initial shape data corresponding to the initial shape; Outputting target visual material through the shape generation model; Among them, the shape generation model is used to adjust the template shape according to the initial shape to obtain a target visual material with a similar shape to the initial shape; the shape generation model is configured with a shape similarity constraint, and the shape similarity constraint is used to limit the similarity between the shape of the target visual material and the initial shape to be greater than a preset threshold.

2. The method according to claim 1, characterized in that Adjusting the template shape according to the initial shape includes: According to the preset ray starting point, a plurality of initial rays and a plurality of standard rays are obtained; wherein the initial rays intersect with the initial shape, and the standard rays intersect with the template shape; According to the plurality of initial rays, adjusting the plurality of standard rays to obtain a plurality of adjusted rays intersecting with the similar shape; The template shape is adjusted according to the plurality of adjustment rays.

3. The method according to claim 2, characterized in that According to the plurality of initial rays, adjusting the plurality of standard rays to obtain a plurality of adjusted rays intersecting with the similar shape comprises: Determine a plurality of standard rays corresponding to the plurality of initial rays, wherein one initial ray corresponds to one standard ray and the two have the same length; According to the respective starting points and directions of the plurality of initial rays, the starting points and directions of the corresponding standard rays are adjusted one by one to obtain the plurality of adjusted rays.

4. The method according to claim 3, characterized in that The similarity between the similar shape and the initial shape is greater than a preset threshold and satisfies the following conditions: The distances between the starting points of the plurality of adjustment rays and the starting point of the preset ray are all lower than a first preset value; and The angles between the directions of the plurality of adjustment rays and the directions of the corresponding initial rays are all lower than a second preset value.

5. The method according to any one of claims 2 to 4, characterized in that: The method further comprises: Determine the distance between the starting point of each of the plurality of adjustment rays and the starting point of the preset ray; Determine the angles between the directions of the plurality of adjustment rays and the directions of the respective corresponding initial rays; The model parameters of the shape generation model are adjusted according to the gap between the starting point of each of the plurality of adjustment rays and the starting point of the preset ray, and the angle between the direction of each of the plurality of adjustment rays and the direction of the corresponding initial ray.

6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: A shape identifier is configured for the similar shape; wherein the shape identifier is used to instruct the shape generation model to output the similar shape.

7. The method according to any one of claims 1 to 4, characterized in that: The template shape is obtained by the following operations: Acquire a plurality of sample shape data, wherein the sample shape data corresponds to a sample shape; Selecting a plurality of similar sample shapes from the plurality of sample shapes, wherein the similarity between the plurality of similar sample shapes is higher than a preset value; The plurality of sample shape data corresponding to the plurality of similar sample shapes are input into the shape generation model, so as to generate a template shape through the shape generation model.

8. A material generation device, characterized in that: The device comprises: An input module, for loading initial shape data into a pre-trained shape generation model, wherein the initial shape data corresponds to an initial shape; An output module, used for outputting target visual materials through the shape generation model; Among them, the shape generation model is used to adjust the template shape according to the initial shape to obtain a target visual material with a similar shape to the initial shape; the shape generation model is configured with a shape similarity constraint, and the shape similarity constraint is used to limit the similarity between the shape of the target visual material and the initial shape to be greater than a preset threshold.

9. A computer device, characterized in that: include: at least one processor; and a memory communicatively coupled to the at least one processor; wherein: The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.