Method, device and electronic equipment for training a three-dimensional model modeling sequence generation network
By decomposing the 3D model and calculating the difference value, the modeling sequence is automatically determined, which solves the problem of low training efficiency of the 3D model modeling sequence generation network and improves training efficiency and model diversity.
Patent Information
- Application Number
- CN202511334690.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-09-18
AI Technical Summary
In existing technologies, the training efficiency of 3D model modeling sequence generation networks is low, and the lack of model diversity and robustness is due to the manual reproduction of models.
By decomposing the first model, the target sketch and operation information are determined, a modeling sequence is generated, and the sample images and modeling sequence are input into the 3D model modeling sequence generation network to calculate the difference value and adjust the parameters. The training is repeated until the termination condition is reached, and the modeling sequence is automatically determined.
It improves the training efficiency of the 3D model modeling sequence generation network, increases the diversity and generalization ability of the model, and avoids the process of manually reproducing the model.
Smart Images

Figure CN120832927B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to a training method and device of a three-dimensional model modeling sequence generation network and an electronic device. BACKGROUND
[0002] A three-dimensional model refers to a model with a three-dimensional stereoscopic effect in a three-dimensional space. The three-dimensional model corresponds to at least one two-dimensional image. Three-dimensional modeling refers to constructing a three-dimensional model with a three-dimensional stereoscopic effect in a virtual three-dimensional space according to at least one two-dimensional image. These three-dimensional models can be digital reproductions of objects in the real world and / or completely fictitious creative designs.
[0003] In related technologies, a neural network can be trained by using a modeling sequence of a three-dimensional model, at least one two-dimensional image corresponding to the three-dimensional model, and other related data. The neural network learns the features and structure of the three-dimensional model, thereby realizing generation or reconstruction of the three-dimensional model.
[0004] However, for each three-dimensional model, a person skilled in the art needs to manually reproduce the three-dimensional model in modeling software, and then determine the modeling sequence of the three-dimensional model in the process of reproducing the three-dimensional model, which leads to low efficiency of training the neural network. SUMMARY
[0005] Embodiments of the present application provide a training method and device of a three-dimensional model modeling sequence generation network and an electronic device to improve the efficiency of training the three-dimensional model modeling sequence generation network.
[0006] In a first aspect, a training method of a three-dimensional model modeling sequence generation network is provided, including:
[0007] obtaining a sample image and a first model, the sample image including a graphic object, and the first model being a model obtained by three-dimensional modeling of the graphic object;
[0008] decomposing the first model to obtain a modeling sequence corresponding to the first model, the modeling sequence including a target sketch and operation information corresponding to the target sketch, the operation information corresponding to the target sketch being used to indicate an operation when modeling the target sketch;
[0009] inputting the sample image and the modeling sequence into the three-dimensional model modeling sequence generation network to obtain a difference value between the first model and a second model, the second model being a model obtained by modeling according to the modeling sequence;
[0010] adjusting parameters of the three-dimensional model modeling sequence generation network according to the difference value to obtain a trained three-dimensional model modeling sequence generation network.
[0011] In a possible implementation, the first model is decomposed to obtain a modeling sequence corresponding to the first model, including:
[0012] The first model is converted to obtain a region map corresponding to the first model.
[0013] The first operation is performed, including: determining the i-th sketch and operation information corresponding to the i-th sketch according to the at least one modeling model and the region map; and modeling the i-th sketch according to the operation information corresponding to the i-th sketch to obtain the i-th modeling model; i is initially 1, and i is a positive integer greater than or equal to 1; wherein, when i = 1, the at least one modeling model is the first model; and when i > 1, the at least one modeling model includes the first model and the (i-1)-th modeling model.
[0014] When i is less than a preset number, and a volume intersection ratio of the i-th modeling model and the first model is less than a preset threshold, i is updated to i+1, and the first operation is repeatedly performed until i is greater than or equal to the preset number, and / or the volume intersection ratio of the i-th modeling model and the first model is greater than or equal to the preset threshold.
[0015] The target sketch includes the first i sketches.
[0016] In a possible implementation, the first model is converted to obtain a region map corresponding to the first model, including:
[0017] A reference model corresponding to the first model is determined according to size information of the first model.
[0018] At least one face to be expanded is determined in the first model.
[0019] The at least one face to be expanded is respectively expanded according to the size of the reference model and the type of each of the at least one face to be expanded to obtain the region map.
[0020] In a possible implementation, the i-th sketch and the operation information corresponding to the i-th sketch are determined according to the at least one modeling model and the region map, including:
[0021] At least one sketch and operation information corresponding to the at least one sketch are determined according to the at least one modeling model and the region map.
[0022] The i-th sketch is determined in the at least one sketch, and the operation information corresponding to the i-th sketch is determined in the operation information corresponding to the at least one sketch.
[0023] In a possible implementation, the at least one sketch and the operation information corresponding to the at least one sketch are determined according to the at least one modeling model and the region map, including:
[0024] determining a first plane, a second plane, and a region adjacent to the first plane in the region graph, wherein the first plane and the second plane are parallel;
[0025] determining at least one sketch in the first plane according to a positional relationship between the first model and the first plane;
[0026] for each sketch in the at least one sketch, determining an operation type corresponding to the sketch according to a relative positional relationship between the sketch and the first model;
[0027] determining an operation direction corresponding to the at least one sketch as a direction from the first plane to the second plane;
[0028] wherein the operation information corresponding to the sketch includes the operation type and the operation direction.
[0029] In a possible implementation, determining an i-th sketch in the at least one sketch includes:
[0030] for each sketch in the at least one sketch, performing M times of modeling operations according to the sketch, the operation information corresponding to the sketch, the first model, and the region graph to obtain M modeling models corresponding to the sketch; M is a positive integer;
[0031] determining the i-th sketch in the at least one sketch according to the first model and the M modeling models corresponding to the at least one sketch respectively.
[0032] In a possible implementation, performing M times of modeling operations according to the sketch, the operation information corresponding to the sketch, the first model, and the region graph to obtain M modeling models corresponding to the sketch includes:
[0033] for any one of the M times of modeling operations, performing the following steps:
[0034] performing modeling processing on the sketch according to the operation information corresponding to the sketch to obtain a first candidate modeling model;
[0035] in a case where the preset condition is not met, performing a second operation, the second operation including: generating at least one candidate sketch and operation information corresponding to the at least one candidate sketch according to the j-th candidate modeling model, the first model, and the region graph; performing modeling processing on a first candidate sketch according to the operation information corresponding to the first candidate sketch and the j-th candidate modeling model to obtain a (j+1)-th candidate modeling model; j is 1, 2, … in turn; the first candidate sketch is any one of the at least one candidate sketch;
[0036] in a case where the preset condition is met, determining the (j+1)-th candidate modeling model as the modeling model corresponding to the sketch;
[0037] The preset condition includes that j is greater than a preset number, and / or a volume intersection ratio of the jth candidate modeling model and the first model is greater than or equal to a preset threshold.
[0038] In a second aspect, an embodiment of the present application provides a training device of a three-dimensional model modeling sequence generation network, comprising:
[0039] The acquisition module is configured to acquire a sample image and a first model, the sample image comprising a graphic object, and the first model being a model obtained by three-dimensional modeling of the graphic object.
[0040] The processing module is configured to perform decomposition processing on the first model to obtain a modeling sequence corresponding to the first model, the modeling sequence comprising a target sketch and operation information corresponding to the target sketch, the operation information corresponding to the target sketch being used to indicate an operation when the target sketch is modeled.
[0041] The modeling module is configured to input the sample image and the modeling sequence into the three-dimensional model modeling sequence generation network to obtain a difference value between the first model and a second model, the second model being a model obtained by modeling according to the modeling sequence.
[0042] The parameter adjustment module is configured to adjust parameters of the three-dimensional model modeling sequence generation network according to the difference value to obtain a trained three-dimensional model modeling sequence generation network.
[0043] In a possible implementation, the processing module is specifically configured to:
[0044] perform conversion processing on the first model to obtain a region graph corresponding to the first model;
[0045] perform a first operation, the first operation comprising: determining an ith sketch and operation information corresponding to the ith sketch according to at least one modeling model and the region graph; and modeling the ith sketch according to the operation information corresponding to the ith sketch to obtain an ith modeling model; i being a positive integer greater than or equal to 1; wherein, when i = 1, the at least one modeling model is the first model; and when i > 1, the at least one modeling model comprises the first model and an (i-1)th modeling model.
[0046] when i is less than a preset number and a volume intersection ratio of the ith modeling model and the first model is less than a preset threshold, updating i to i+1 and repeating the first operation until i is greater than or equal to the preset number and / or the volume intersection ratio of the ith modeling model and the first model is greater than or equal to the preset threshold;
[0047] The target sketch comprises the first i sketches.
[0048] In a possible implementation, the processing module is specifically configured to:
[0049] According to the size information of the first model, a reference model corresponding to the first model is determined;
[0050] At least one face to be expanded is determined in the first model;
[0051] According to the size of the reference model and the type of each of the at least one face to be expanded, the at least one face to be expanded is respectively expanded to obtain a region map.
[0052] In a possible implementation, the processing module is specifically configured to:
[0053] According to the at least one modeling model and the region map, at least one sketch is determined, and operation information corresponding to the at least one sketch is determined;
[0054] An i-th sketch is determined in the at least one sketch, and operation information corresponding to the i-th sketch is determined in the operation information corresponding to the at least one sketch.
[0055] In a possible implementation, the processing module is specifically configured to:
[0056] A first plane, a second plane, and a region adjacent to the first plane are determined in the region map, and the first plane and the second plane are parallel;
[0057] According to a positional relationship between the first model and the first plane, at least one sketch is determined in the first plane;
[0058] For each sketch in the at least one sketch, according to a relative positional relationship between the sketch and the first model, an operation type corresponding to the sketch is determined;
[0059] A direction from the first plane to the second plane is determined as an operation direction corresponding to the at least one sketch;
[0060] The operation information corresponding to the sketch includes the operation type and the operation direction.
[0061] In a possible implementation, the processing module is specifically configured to:
[0062] For each sketch in the at least one sketch, according to the sketch, the operation information corresponding to the sketch, the first model, and the region map, M modeling operations are performed to obtain M modeling models corresponding to the sketch; M is a positive integer;
[0063] According to the first model and the M modeling models corresponding to each of the at least one sketch, an i-th sketch is determined in the at least one sketch.
[0064] In a possible implementation, the processing module is specifically configured to:
[0065] For any one of the M modeling operations, the following steps are performed:
[0066] According to the operation information corresponding to the sketch, the sketch is modeled to obtain a first candidate modeling model;
[0067] In the case where the preset condition is not met, a second operation is performed, the second operation including: generating at least one candidate sketch and operation information of each of the at least one candidate sketch according to the jth candidate modeling model, the first model and the region graph; modeling the first candidate sketch according to the operation information corresponding to the first candidate sketch and the jth candidate modeling model to obtain a (j+1)th candidate modeling model; j is 1, 2, … in turn; the first candidate sketch is any one of the at least one candidate sketch;
[0068] In the case where the preset condition is met, the (j+1)th candidate modeling model is determined as the modeling model corresponding to the sketch;
[0069] The preset condition includes that j is greater than a preset number, and / or the volume intersection ratio of the jth candidate modeling model and the first model is greater than or equal to a preset threshold.
[0070] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;
[0071] The memory stores computer execution instructions;
[0072] The processor executes the computer execution instructions stored in the memory, so that the processor executes the training method of the three-dimensional model modeling sequence generation network as in the first aspect, and / or any possible implementation manner in the first aspect.
[0073] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium stores computer execution instructions, the computer execution instructions are executed by the processor to implement the training method of the three-dimensional model modeling sequence generation network as in the first aspect, and / or any possible implementation manner in the first aspect.
[0074] The training method, device and electronic equipment of the three-dimensional model modeling sequence generation network provided by the embodiments of the present application first decompose the first model, determine the target sketch corresponding to the first model and the operation information corresponding to the target sketch, and the modeling sequence includes the target sketch and the operation information corresponding to the target sketch. Therefore, after the first model is decomposed, the modeling sequence corresponding to the first model is obtained. Then, the sample image of the first model and the modeling sequence corresponding to the first model are input into the three-dimensional model modeling sequence generation network. The three-dimensional model modeling sequence generation network processes the sample image and the three-dimensional model modeling sequence generation network, obtains the difference value between the first model and the second model, and adjusts the three-dimensional model modeling sequence generation network according to the difference value. After one or more rounds of training, the trained three-dimensional model modeling sequence generation network is obtained when the termination condition of the modeling training is reached. In the training method of the three-dimensional model modeling sequence generation network, the first model is decomposed before the three-dimensional model modeling sequence generation network is trained, the target sketch corresponding to the first model and the operation information corresponding to the target sketch are determined, and the modeling sequence corresponding to the first model is determined. The process of manually reproducing the first model in the modeling software to obtain the modeling sequence corresponding to the first model is avoided, and the efficiency of obtaining the modeling sequence is improved. Further, during the training process of the three-dimensional model modeling sequence generation network, the modeling sequence and the sample image need to be input into the three-dimensional model modeling sequence generation network to train the three-dimensional model modeling sequence generation network. Therefore, the training efficiency of the three-dimensional model modeling sequence generation network is improved by the three-dimensional model modeling sequence generation network training method provided by the present application. BRIEF DESCRIPTION OF DRAWINGS
[0075] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0076] Figure 1 An application scenario diagram provided by the embodiments of the present application;
[0077] Figure 2 A flowchart of a three-dimensional model modeling sequence generation network training method provided by the embodiments of the present application;
[0078] Figure 3 A flowchart of determining a modeling sequence corresponding to a first model provided by the embodiments of the present application;
[0079] Figure 4 A reference model diagram of a first model provided by the embodiments of the present application;
[0080] Figure 5A schematic diagram of each to be expanded surface after expansion provided by an embodiment of the present application;
[0081] Figure 6 A schematic diagram of an expanded model provided by an embodiment of the present application;
[0082] Figure 7 A flowchart of a process of determining a sketch and operation information corresponding to the sketch provided by an embodiment of the present application;
[0083] Figure 8 A structural schematic diagram of a training device of a three-dimensional model modeling sequence generation network provided by an embodiment of the present application;
[0084] Figure 9 A structural schematic diagram of an electronic device provided by an embodiment of the present application.
[0085] The above-described drawings have shown the specific embodiments of the present application, and the following will have a more detailed description. These drawings and the written description are not intended to limit the scope of the concept of the present application by any means, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0086] The exemplary embodiments will be described in detail herein with reference to the attached drawings. In the following description, the same numbers are used to indicate the same components in different drawings. The embodiments described in the following exemplary embodiments do not represent all the embodiments consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present application, as detailed in the appended claims.
[0087] It should be noted that, in the description of the present application, the term "comprise", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second" and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0088] First, the terms involved in the present application are explained:
[0089] Three-dimensional model: a digital representation of an object in a virtual three-dimensional space. The three-dimensional model can be a solid model, a surface model, etc. For example, the three-dimensional model can be a model of a mechanical part, a building, furniture, a car shell design, etc. It should be noted that the three-dimensional model involved in the present application at least includes a pair of parallel planes, for the convenience of description, a three-dimensional model is taken as a mechanical part in the shape of a cuboid, the front surface and the back surface of the mechanical part are a pair of parallel planes, the upper surface and the lower surface are a pair of parallel planes, and the left side surface and the right side surface are a pair of parallel planes. The three-dimensional modeling can be performed by manual modeling, scanning modeling, or a three-dimensional model modeling sequence generation network, etc. to obtain a three-dimensional model. Three-dimensional modeling refers to constructing a three-dimensional model with three-dimensional stereoscopic effect in a virtual three-dimensional space.
[0090] Sketch: a reference for three-dimensional modeling. At least one sketch can be modeled to obtain a three-dimensional model. For each sketch, the sketch can be a circle, a rectangle, a polygon, or an irregular two-dimensional closed figure.
[0091] Modeling sequence: an ordered step set for generating a three-dimensional model. The modeling sequence includes at least one sketch and operation information corresponding to the at least one sketch. It should be noted that the at least one sketch included in the modeling sequence is arranged in order, and the three-dimensional model can be gradually generated according to the order of the sketch in the modeling sequence and the operation information corresponding to the sketch.
[0092] Region map: a region map of a three-dimensional model is used to show specific region information in the three-dimensional model. Different region maps can be divided according to certain rules or requirements.
[0093] Three-dimensional model modeling sequence generation network: a neural network for constructing a three-dimensional model.
[0094] In order for those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0095] Figure 1 An application scenario of an embodiment of the present application is shown in Figure 1 , which includes a first model 11 and a server 12. The first model 11 can be an object with an actual physical form, and / or a surface shape of an object. For example, the first model 11 can be a mechanical part, furniture, a car shell design, etc. Figure 1 The first model 11 in the example is a mechanical part composed of a cylinder and a hemisphere. The server 12 runs a three-dimensional model modeling sequence generation network.
[0096] In actual application, the graphic object of the first model 11 and the modeling sequence of the first model 11 can be obtained by processing the first model 11. The graphic object of the first model 11 can include, for example, at least one graphic such as a front view, a top view, and a side view of the first model. The modeling sequence of the first model 11 includes at least one sketch and operation information corresponding to the at least one sketch. Then, the graphic object of the first model 11 and the modeling sequence of the first model 11 are input into the three-dimensional model modeling sequence generation network, the three-dimensional model modeling sequence generation network is trained, and the three-dimensional model modeling sequence generation network learns the features and structures of the first model 11, so that the trained three-dimensional model modeling sequence generation network has the ability to generate or reconstruct a three-dimensional model.
[0097] It should be noted that, Figure 1 Only one application scenario is shown in the form of an example, and is not limited to the application scenario.
[0098] In the related art, in the training process of the three-dimensional model modeling sequence generation network, the input of the three-dimensional model modeling sequence generation network includes the graphic object of the first model and the modeling sequence corresponding to the first model. Therefore, before training the three-dimensional model modeling sequence generation network, the graphic object of the first model and the modeling sequence corresponding to the first model need to be obtained. Specifically, the way to obtain the modeling sequence corresponding to the first model can be as follows: a person skilled in the art can model by a manual modeling method to obtain the first model, and determine the modeling sequence corresponding to the first model in the process of manual modeling. After obtaining the modeling sequence corresponding to the first model, the three-dimensional model modeling sequence generation network is trained. However, in the above method, the person skilled in the art needs to manually model to obtain the modeling sequence corresponding to the first model, and then train the three-dimensional model modeling sequence generation network, which leads to low training efficiency of the three-dimensional model modeling sequence generation network, limits the diversity of the first model, and leads to insufficient generalization ability of the three-dimensional model modeling sequence generation network. In addition, because the modeling habits and technical specifications of different technicians are different, the modeling sequences obtained by different technicians for the same first model can be different. Therefore, in the process of training the three-dimensional model modeling sequence generation network by the above method, the robustness of the three-dimensional model modeling sequence generation network can be poor.
[0099] To solve the above technical problems, the present application provides a training method of a three-dimensional model modeling sequence generation network. The method first decomposes a first model to determine a corresponding modeling sequence. Then, a sample image of the first model and the modeling sequence corresponding to the first model are input into the three-dimensional model modeling sequence generation network. The three-dimensional model modeling sequence generation network processes the sample image and the three-dimensional model modeling sequence generation network to obtain a difference value between the first model and a second model. The three-dimensional model modeling sequence generation network is adjusted according to the difference value. After one or more rounds of training, the trained three-dimensional model modeling sequence generation network is obtained when the termination condition of the modeling training is reached. In the training method of the three-dimensional model modeling sequence generation network, the first model is decomposed to determine the modeling sequence corresponding to the first model before the three-dimensional model modeling sequence generation network is trained. The modeling sequence is automatically determined according to the first model, which avoids the need to determine the modeling sequence during the process of manually restoring the first model, and improves the efficiency of obtaining the modeling sequence corresponding to the first model. Further, during the training process of the three-dimensional model modeling sequence generation network, the sample image and the modeling sequence are input into the three-dimensional model modeling sequence generation network to train the three-dimensional model modeling sequence generation network. Therefore, the training method of the three-dimensional model modeling sequence generation network improves the training efficiency of the three-dimensional model modeling sequence generation network. In addition, the modeling sequence is automatically determined according to the first model, which increases the diversity of the first model and improves the generalization ability of the trained three-dimensional model modeling sequence generation network.
[0100] The technical solutions of the present application and how the technical solutions solve the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can exist independently or in combination. The same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
[0101] Figure 2 A flowchart of a training method of a three-dimensional model modeling sequence generation network according to an embodiment of the present application is shown in FIG. 1. The method includes the following steps. Figure 2
[0102] S21, obtaining a sample image and a first model, the sample image including a graphic object, and the first model being a model obtained by three-dimensional modeling of the graphic object.
[0103] The execution subject of the present application can be a server, or a training device of a three-dimensional model modeling sequence generation network arranged in the server. The training device of the three-dimensional model modeling sequence generation network can be implemented by software, or by a combination of software and hardware.
[0104] The first model is any three-dimensional model, and the graphic object is a two-dimensional image corresponding to the first model. Therefore, the first model can be obtained by three-dimensional modeling on the graphic object of the first model. The graphic object may, for example, include at least one or more of a front view, a side view, and a top view of the first model.
[0105] It should be noted that, for the shape of the first model, the embodiments of the present application can be described in combination with regular models such as a cube, a cuboid, and a sphere.
[0106] The embodiments of the present application take a mechanical part as the first model for example. Three-dimensional modeling on the mechanical part facilitates a staff member to convert an abstract mechanical part into an intuitive three-dimensional model, and further facilitates a clearer understanding of the working principle of the machine. In addition, in mechanical assembly, the cooperation precision between mechanical parts is high. Three-dimensional modeling can facilitate accurate checking of whether the mechanical parts have faults.
[0107] For example, it is assumed that the first model is a mechanical part, which is a cuboid with a length of 10 cm, a width of 8 cm, and a height of 5 cm. The front view of the first model is a rectangle 1 with a length of 10 cm and a width of 5 cm. The side view of the first model is a rectangle 2 with a length of 8 cm and a width of 5 cm. The top view of the first model is a rectangle 3 with a length of 10 cm and a width of 8 cm. The graphic object includes at least one or more of the rectangle 1, the rectangle 2, and the rectangle 3.
[0108] In S22, the first model is decomposed to obtain a modeling sequence corresponding to the first model. The modeling sequence includes a target sketch and operation information corresponding to the target sketch. The operation information corresponding to the target sketch is used to indicate an operation when the target sketch is modeled.
[0109] Since the modeling sequence includes at least one sketch and operation information corresponding to each of the at least one sketch, the target sketch includes at least one sketch, and the operation information corresponding to the target sketch includes operation information corresponding to each of the at least one sketch.
[0110] The target sketch may include regular two-dimensional closed graphics such as a circle, a rectangle, and a polygon, or irregular two-dimensional closed graphics such as a free curve graphic. The operation information corresponding to the target sketch is information such as an operation type and an operation direction when the target sketch is operated, and the target sketch can be operated according to the operation information corresponding to the target sketch.
[0111] The target sketch included in the modeling sequence can be one or more, and the operation information corresponding to the target sketch included in the modeling sequence can also be one or more. The target sketch is modeled by the operation information corresponding to the target sketch in the modeling sequence, and the similarity between the modeling model obtained by modeling the target sketch by the operation information corresponding to the target sketch and the first model is greater than or equal to a preset threshold.
[0112] In the case where one target sketch is included in the modeling sequence, the operation information corresponding to the target sketch included in the modeling sequence can be used to model the target sketch to obtain a final modeling model, and the similarity between the modeling model and the first model is greater than or equal to a preset threshold.
[0113] In the case where multiple target sketches are included in the modeling sequence, the multiple target sketches and the operation information corresponding to each of the multiple target sketches are included in the modeling sequence, and the multiple target sketches in the modeling sequence are in order. The target sketch with an order of 1 can be selected according to the order of the multiple target sketches, and the target sketch is modeled according to the operation information corresponding to the target sketch to obtain a modeling model. Then, the target sketch with an order of 2 is selected, and the target sketch is modeled according to the modeling model and the operation information corresponding to the target sketch to obtain a modeling model. In this way, the last target sketch is modeled according to the modeling model and the operation information corresponding to the last target sketch to obtain a final modeling model, and the similarity between the modeling model and the first model is greater than or equal to a preset threshold.
[0114] For example, in the case where one target sketch is included in the modeling sequence, assuming that the modeling sequence is [target sketch A, operation information corresponding to target sketch A], the target sketch A is modeled according to the operation information corresponding to the target sketch A to obtain a modeling model a, and the similarity between the modeling model a and the first model is greater than or equal to a preset threshold.
[0115] In the case where multiple target sketches are included in the modeling sequence, assuming that the modeling sequence is [(target sketch B, operation information corresponding to target sketch B); (target sketch C, operation information corresponding to target sketch C); (target sketch D, operation information corresponding to target sketch D)], and the order of the target sketch B is 1, the order of the target sketch C is 2, and the order of the target sketch D is 3. The target sketch B is modeled according to the operation information corresponding to the target sketch B to obtain a modeling model b; the target sketch C is modeled according to the modeling model b and the operation information corresponding to the target sketch C to obtain a modeling model c; and the target sketch D is modeled according to the modeling model c and the operation information corresponding to the target sketch D to obtain a final modeling model d, and the similarity between the modeling model d and the first model is greater than or equal to a preset threshold.
[0116] S23, input the sample image and the modeling sequence into the three-dimensional model modeling sequence generation network to obtain a difference value between the first model and the second model, and the second model is a model obtained by modeling through the modeling sequence.
[0117] The three-dimensional model modeling sequence generation network refers to a neural network for constructing a three-dimensional model. The three-dimensional model modeling sequence generation network includes a feature encoding module, an information aggregation module, and a difference value determination module. The feature encoding module is mainly used for feature encoding of feature information in the first model to obtain feature encoding information of the first model. After the feature encoding information is input into the information aggregation module, the second model is obtained. The difference value is used to indicate the modeling accuracy of the modeling sequence. Therefore, in the model training process, the difference value determination module measures the difference between the first model and the second model according to the difference value.
[0118] The difference value may be, for example, a volume intersection over union between the first model and the second model. The volume intersection over union is the volume coverage rate between the first model and the second model, and is used to indicate the similarity between the first model and the second model. For example, assuming that the volume of the first model T is , the volume of the second model C is , and the volume of the intersection between the second model T and the first model C is , the calculation method of the volume intersection over union (IoU) between the first model T and the second model C is shown in formula (1):
[0119] (1)
[0120] S24, adjusting the parameters of the three-dimensional model modeling sequence generation network according to the difference value to obtain a trained three-dimensional model modeling sequence generation network.
[0121] In one process of training the three-dimensional model modeling sequence generation network, the server can input the sample image and the modeling sequence into the three-dimensional model modeling sequence generation network to obtain a difference value between the first model and the second model, and then adjust the parameters of the three-dimensional model modeling sequence generation network according to the difference value, thereby completing a round of training process.
[0122] The server can perform one or more rounds of training process on the three-dimensional model modeling sequence generation network until the three-dimensional model modeling sequence generation network training termination condition is reached, and the training process is stopped. The termination condition can be set according to actual needs, for example, the training termination condition can be set as the difference value being less than or equal to a preset difference value, for example, the training termination condition can be set as the training number reaching a preset number, etc. The trained three-dimensional model modeling sequence generation network has the ability to perform three-dimensional modeling on a graphical object.
[0123] In Figure 2 In the embodiment shown, after obtaining the sample image and the first model, the first model is first decomposed to determine the target sketch corresponding to the first model and the operation information corresponding to the target sketch. The target sketch and the operation information corresponding to the target sketch are included in the modeling sequence. Therefore, after the decomposition of the first model, the modeling sequence corresponding to the first model is obtained. Then, the sample image of the first model and the modeling sequence corresponding to the first model are input into the three-dimensional model modeling sequence generation network. The three-dimensional model modeling sequence generation network processes the sample image and the modeling sequence to obtain the difference value between the first model and the second model, and adjusts the three-dimensional model modeling sequence generation network according to the difference value. After one or more rounds of training, the trained three-dimensional model modeling sequence generation network is obtained when the termination condition of the modeling training is reached. In the training method of the three-dimensional model modeling sequence generation network, the first model is decomposed before the three-dimensional model modeling sequence generation network is trained to determine the target sketch corresponding to the first model and the operation information corresponding to the target sketch, thereby determining the modeling sequence corresponding to the first model. This avoids the need to determine the modeling sequence corresponding to the first model in the process of manually restoring the first model, thereby improving the efficiency of determining the modeling sequence. Further, in the process of training the three-dimensional model modeling sequence generation network, the modeling sequence and the sample image need to be input into the three-dimensional model modeling sequence generation network to train the three-dimensional model modeling sequence generation network. Therefore, the training efficiency of the three-dimensional model modeling sequence generation network is improved by the above method. In addition, the automatic determination of the modeling sequence according to the first model increases the diversity of the first model, thereby improving the generalization ability of the trained three-dimensional model modeling sequence generation network.
[0124] In Figure 2 Based on the embodiment shown in the above, the following will be combined with Figure 3 The process of decomposing the first model to obtain the modeling sequence corresponding to the first model in the embodiments of the present application will be further described.
[0125] Figure 3 A flowchart for determining the modeling sequence corresponding to the first model is provided in the embodiments of the present application. Please refer to Figure 3 The flowchart can include the following steps:
[0126] S31, converting the first model to obtain a region graph corresponding to the first model.
[0127] The first model can be transformed in the following way to obtain the region map corresponding to the first model: determine the reference model corresponding to the first model based on the size information of the first model; determine at least one surface to be expanded in the first model; expand the at least one surface to be expanded according to the size of the reference model and the type of each surface to be expanded to obtain the region map.
[0128] The size information of the first model is used to indicate the size of the first model in three-dimensional space. Taking a mechanical part with a cuboid as an example, the size information of the first model includes the length, width, and height of the first model; taking a mechanical part with a sphere as an example, the size information of the first model includes the diameter of the first model.
[0129] The reference model corresponding to the first model can be the circumscribed cube of the first model, which can be combined with... Figure 4 To understand, Figure 4 This is a schematic diagram of a reference model for a first model provided in an embodiment of this application. For example... Figure 4 As shown, the first model is a mechanical part, which is composed of a 4cm*4cm*4cm cube and a hemisphere with a diameter of 4cm. Therefore, the length, width, and height of the first model are 4cm, 4cm, and 4 + 4 / 2 = 6cm. Based on the dimensions of the first model, the reference model can be determined to be a 4cm*4cm*6cm cuboid, that is, a cuboid with a length of 4cm, a width of 4cm, and a height of 6cm.
[0130] At least one surface to be expanded includes the surface of the first model, such as a rectangle, square, sphere, or cylinder. This can be combined with... Figure 4 To understand this, the first model includes six surfaces of a cube and a spherical surface of a hemisphere with a diameter of 4cm. Each of the six surfaces of the cube is a 4cm x 4cm square. Therefore, at least one surface to be expanded in the first model consists of six 4cm x 4cm squares and one 4cm diameter hemisphere. It should be noted that at least one surface to be expanded does not include a freeform surface.
[0131] The types of surfaces to be expanded include: planes, spheres, cylinders, etc. The expansion method differs depending on the type of surface. For example, if the surface to be expanded is a plane, the expansion method is to expand its length and width; if the surface to be expanded is a sphere, the expansion method is to expand it into a complete sphere; if the surface to be expanded is a cylinder, the expansion method is to expand it along its zero curvature axis.
[0132] Based on the dimensions of the reference model and the type of each of the at least one surface to be expanded, the expansion process is performed on each surface to obtain the region map as follows: For each surface to be expanded, the expansion method is determined according to its type. Then, based on the dimensions of the reference model, the surface to be expanded is expanded within the reference model according to the expansion method.
[0133] Can be combined Figure 4 To understand this, in the first model, at least one surface to be expanded includes: six 4cm x 4cm squares and a hemisphere with a diameter of 4cm. The six 4cm x 4cm squares represent the front, back, top, bottom, left, and right surfaces of the cube in the first model. The reference model is a 4cm x 4cm x 6cm cuboid. Therefore, within the reference model, the front and back surfaces of the cube are expanded into 4cm x 6cm rectangles. Regarding the top, bottom, left, and right surfaces of the cube, since these surfaces are all connected to the reference model, they are not expanded. The hemisphere with a diameter of 4cm is expanded into a sphere with a diameter of 4cm.
[0134] After expanding each surface to be expanded, internal and external regions are obtained. The internal region includes the area inside the expanded model, and the external region includes the area inside the reference model and the area outside the expanded model. This can be combined with... Figure 5 To understand, Figure 5 Please refer to the schematic diagram provided in this application embodiment for an example of expanding each surface to be expanded. Figure 5 The first model is a mechanical part, which is composed of a 4cm*4cm*4cm cube and a hemisphere with a diameter of 4cm. The reference model for the first model is a 4cm*4cm*6cm cuboid. After expanding each part, the resulting internal regions include the internal region of the 4cm diameter hemisphere and the internal region of the 4cm*4cm*4cm cube. The internal region of the hemisphere is as follows: Figure 5 The horizontal striped area is shown; the internal region of the cube is as follows: Figure 5 The black area in the middle is shown. The resulting outer area is as follows. Figure 5 The white area in the middle is shown.
[0135] The expanded model includes at least one independent model. Therefore, the internal region can be divided into a first region and a second region. The first region includes areas within the at least one independent model that do not intersect with other independent models, while the second region includes areas where two independent models intersect. This can be combined... Figure 6 To understand, Figure 6 Please refer to the schematic diagram of an extended model provided in the embodiments of this application. Figure 6 The first model is a mechanical part, which is composed of a 4cm*4cm*4cm cube and a hemisphere with a diameter of 4cm. The expanded model includes at least one independent model, which is a sphere and a cube, respectively. The non-intersecting regions within the sphere with other independent models are as follows: Figure 6 As shown in the region with horizontal stripes, the regions within the cube that do not intersect with other independent models are as follows: Figure 6 As shown in the black area, the area where the sphere intersects with the cube is as follows. Figure 6 As shown in the medium grid region, the first region is determined to include... Figure 6 The area shown by the horizontal stripes and the black area, the second area is Figure 6 The area shown in the medium grid.
[0136] The region map corresponding to the first model includes a first region and a second region. Therefore, after transforming the first model, the first region and the second region can be determined to obtain the region map corresponding to the first model.
[0137] S32. Initialize i to 1.
[0138] S33. Based on at least one modeling model and a region map, determine the i-th sketch and the operation information corresponding to the i-th sketch.
[0139] i is a positive integer greater than or equal to 1. The i-th sketch is the target sketch in the modeling sequence. When the modeling sequence includes one target sketch, i=1 and the i-th sketch is the target sketch included in the modeling sequence. When the modeling sequence includes multiple target sketches, i>1 and the i-th sketch is the target sketch in the modeling sequence with the i-th order.
[0140] It should be noted that when i=1, at least one modeling model is the first model; when i>1, at least one modeling model includes the first model and the (i-1)th modeling model. The (i-1)th model is obtained by modeling the (i-1)th sketch using the operation information corresponding to the (i-1)th sketch.
[0141] Therefore, in the case of i = 1, the i th sketch and operation information corresponding to the i th sketch are determined according to the first model and the region graph; in the case of i > 1, the i th sketch and operation information corresponding to the i th sketch are determined according to the first model, the i-1 th modeling model and the region graph.
[0142] S34, modeling the i th sketch according to the operation information corresponding to the i th sketch to obtain the i th modeling model.
[0143] It should be noted that in the case of i = 1, the i th modeling model can be determined by modeling the i th sketch according to the operation information corresponding to the i th sketch, and the obtained modeling model is the i th modeling model; in the case of i > 1, the i th modeling model can be determined by modeling the i th sketch according to the operation information corresponding to the i th sketch, and the obtained modeling model is the i th modeling model.
[0144] For example, in the case of i = 1, the first modeling model is obtained by modeling the first sketch according to the operation information corresponding to the first sketch; in the case of i = 2, the second modeling model is obtained by modeling the second sketch according to the operation information corresponding to the second sketch, and then merging the obtained modeling model a with the first modeling model.
[0145] S35, judging whether the volume intersection ratio of the i th modeling model and the first model is greater than or equal to a preset threshold value.
[0146] In the case that the volume intersection ratio of the i th modeling model and the first model is greater than or equal to the preset threshold value, it indicates that the similarity of the i th modeling model and the first model is greater than or equal to the preset threshold value. At this time, it can be considered that the i th modeling model obtained by modeling is consistent with the first model.
[0147] For example, assuming that i = 5, the volume intersection ratio of the fifth modeling model and the first model is 90%, and the preset threshold value is 80%, it is determined that the volume intersection ratio of the fifth modeling model is greater than the preset threshold value, and at this time, it can be considered that the fifth modeling model obtained by modeling is consistent with the first model.
[0148] In the case that the volume intersection ratio of the i th modeling model and the first model is less than the preset threshold value, it indicates that the similarity of the i th modeling model and the first model is less than the preset threshold value. At this time, it can be considered that the i th modeling model obtained by modeling is inconsistent with the first model.
[0149] For example, assuming that i is 4, the volume intersection ratio of the fourth modeling model to the first model is 60%, and the preset threshold is 80%, it is determined that the volume intersection ratio of the fourth modeling model is less than the preset threshold, and it can be considered that the fourth modeling model obtained by modeling is inconsistent with the first model.
[0150] If yes, S38 is performed.
[0151] If no, S36 is performed.
[0152] S36, it is determined whether i is greater than or equal to a preset number.
[0153] In a case where i is greater than or equal to the preset number, it is indicated that the number of target sketches in the modeling sequence has reached a maximum value; in a case where i is less than the preset number, it is indicated that the number of target sketches in the modeling sequence has not reached the maximum value.
[0154] If yes, S38 is performed.
[0155] If no, S37 is performed.
[0156] S37, i is updated to i+1.
[0157] In a case where the volume intersection ratio of the i-th modeling model to the first model is less than the preset threshold and i is less than the preset number, it is indicated that the i-th modeling model is inconsistent with the first model, and the number of target sketches in the modeling sequence corresponding to the first model has not reached the maximum value. At this time, i is updated to i+1, and then S33 is performed to determine the i+1-th sketch in the modeling sequence.
[0158] S38, it is determined that the modeling sequence corresponding to the first model includes the first i sketches and operation information corresponding to the first i sketches.
[0159] In a case where the volume intersection ratio of the i-th modeling model to the first model is greater than or equal to the preset threshold, it is indicated that the i-th modeling model determined according to the first i sketches and operation information corresponding to the first i sketches is consistent with the first model. Therefore, it is not necessary to continue to determine the sketch and operation information corresponding to the sketch, and the first i sketches can be determined as the target sketch, i.e., the modeling sequence includes the first i sketches and operation information corresponding to the first i sketches.
[0160] In a case where i is greater than or equal to the preset number, it is indicated that the number of target sketches in the modeling sequence has reached the preset number. At this time, the first i sketches are determined as the target sketch, i.e., the modeling sequence includes the first i sketches and operation information corresponding to the first i sketches.
[0161] In summary, when the volume intersection-union ratio of the i-th model and the first model is greater than or equal to a preset threshold, and / or when i is greater than or equal to a preset number, the first i sketches are determined as target sketches, and the operation information corresponding to each of the first i sketches is determined as the operation information corresponding to the target sketches. That is, the modeling sequence corresponding to the first model is determined to include the first i sketches and the operation information corresponding to each of the first i sketches.
[0162] In some embodiments, after determining the modeling sequence of the first model, a first overlap rate and a second overlap rate corresponding to the i-th sketch can be determined based on the first model, the (i-1)-th modeling model, the i-th sketch, and the operation information corresponding to the i-th sketch. The first overlap rate is the overlap rate between the modeling model obtained by modeling the i-th sketch using the operation information corresponding to the i-th sketch and the first model. The first overlap rate is used to indicate the contribution of the i-th sketch and the operation information corresponding to the i-th sketch in the modeling sequence to the modeling. The larger the first overlap rate, the greater the contribution of the i-th sketch and the operation information corresponding to the i-th sketch to the modeling.
[0163] The second overlap rate is the overlap rate between the modeling model obtained by modeling the sketch using the operation information corresponding to the i-th sketch and the (i-1)-th modeling model. The second overlap rate is used to indicate the contribution of the operation information corresponding to the i-th sketch in the modeling sequence to the modeling, and the smaller the second overlap rate, the higher the contribution of the operation information corresponding to the i-th sketch to the modeling.
[0164] exist Figure 3 In the embodiment shown, the first model is first transformed to obtain the region map corresponding to the first model. When i=1, the i-th sketch and the operation information corresponding to the i-th sketch are determined according to the first model and the region map. Then, the i-th sketch is modeled according to the operation information corresponding to the i-th sketch to obtain the i-th modeling model.
[0165] When i > 1, based on the first model, the (i-1)th modeling model, and the region map, determine the i-th sketch and its corresponding operation information. Then, based on the operation information of the i-th sketch, model the i-th sketch, and combine the resulting model with the (i-1)th modeling model to obtain the i-th modeling model. If the volume intersection-union ratio (CIU) between the i-th modeling model and the first model is less than a preset threshold, and i is less than a preset number, continue to determine the (i+1)-th sketch and its corresponding operation information. If the CIU between the i-th modeling model and the first model is greater than or equal to a preset threshold, and / or i is greater than or equal to a preset number, determine the first i sketches as target sketches, i.e., the modeling sequence includes the first i sketches and their respective modeling information.
[0166] In the above manner of determining the modeling sequence, in the case of i>1, the i th sketch is determined according to the (i-1) th modeling model, the first model and the region map, and the operation information corresponding to the i th sketch. That is, in the case of i>1, the i th sketch is determined based on the first i-1 modeling models, so that the accuracy of determining the i th sketch is improved. Further, in the case of i>1, the i th modeling model is obtained by modeling the i th sketch according to the operation information corresponding to the i th sketch, and combining the obtained modeling model with the (i-1) th modeling model, so that the accuracy of determining the i th modeling model is improved, and the accuracy of determining the modeling sequence corresponding to the first model is further improved.
[0167] In addition, for each first model, the modeling sequence corresponding to the first model can be determined by the manner shown in the embodiments of the present application, which realizes the uniformity of determining the modeling sequence, so that when the three-dimensional model modeling sequence generation network is trained, the robustness of the three-dimensional model modeling sequence generation network is improved.
[0168] In Figure 3 On the basis of the embodiments shown in the embodiments of the present application, the following will be described in combination with Figure 7 The process of determining the i th sketch and the operation information corresponding to the i th sketch according to at least one modeling model and a region map provided by the embodiments of the present application will be further introduced.
[0169] Figure 7 A flowchart of determining a sketch and operation information corresponding to the sketch is provided in the embodiments of the present application. Please refer to Figure 7 The flowchart can include the following steps:
[0170] S71, determining at least one sketch and operation information corresponding to the at least one sketch according to at least one modeling model and a region map.
[0171] The manner of determining the at least one sketch and the operation information corresponding to the at least one sketch can be as follows: determining a first plane, a second plane and a region adjacent to the first plane in the region map, wherein the first plane and the second plane are parallel; determining at least one sketch in the first plane according to the positional relationship between the first model and the first plane; for each sketch in the at least one sketch, determining the operation type corresponding to the sketch according to the relative positional relationship between the sketch and the first model; determining the operation direction corresponding to the at least one sketch as the direction from the first plane to the second plane; wherein the operation information corresponding to the sketch includes the operation type and the operation direction.
[0172] The first plane and the second plane in the region map are surfaces of independent models in the region map, and the first plane is parallel to the second plane. The embodiments of the present application can be combined with Figure 4It is understood that Figure 4 The independent model in the region map includes a sphere and a cube, and thus the first plane can be determined as any surface in the cube and the second plane can be determined as a surface in the cube that is parallel to the first plane.
[0173] The region adjacent to the first plane includes a region that is connected to the first plane, and the first plane can be determined as Figure 4 It is understood that Figure 4 If the first plane is the upper surface of the square shown in the region map, the region adjacent to the first plane includes a cube and a hemisphere; and if the first plane is the front surface of the cube shown in the region map, the region adjacent to the first plane is a cube. Figure 4
[0174] In the case of i = 1, the positional relationship between the first model and the first plane can be determined according to the first plane and the region adjacent to the first plane, and the positional relationship between the first model and the first plane includes that the first plane is in the first model, the first plane is outside the first model, and the first plane intersects the first model.
[0175] The first plane is in the first model means that the region between the first plane and the second plane is in the first model; the first plane is outside the first model means that the region between the first plane and the second plane is outside the first model; and the first plane intersects the first model means that the region between the first plane and the second plane intersects the first model.
[0176] In the case that the positional relationship between the first model and the first plane is that the first plane is in the first model or the first plane is outside the first model, at least one sketch in the first plane is determined as the first plane.
[0177] In the case that the positional relationship between the first model and the first plane is that the first plane intersects the first model, there is a part of the region between the first plane and the second plane that is in the first model and a part of the region between the first plane and the second plane that is outside the first model, and at least one sketch in the first plane is determined as the first plane includes a plane in the first plane that is in the first model and a plane in the first plane that is outside the first model.
[0178] The operation type corresponding to the sketch is used to indicate the type of the modeling operation on the sketch, and the operation type corresponding to the sketch may, for example, include one or more of a stretching operation, a rotating operation, a chamfering operation, a curve trajectory scanning operation, etc.; in the embodiments of the present application, the operation type is taken as the stretching operation for example, and the stretching operation includes a stretching boss and a stretching cut. For each sketch in the at least one sketch, the operation type corresponding to the sketch can be determined according to the relative positional relationship between the sketch and the first model.
[0179] The relative position relationship between the sketch and the first model includes: the sketch is inside the first model and the sketch is outside the first model. In a case where the relative position relationship between the sketch and the first model is that the sketch is inside the first model, it is determined that the operation type corresponding to the sketch is a stretch boss.
[0180] In a case where i>1, the position relationship between the first plane and the first model and the i-1th model can be determined according to the first plane and the region adjacent to the first plane. The position relationship between the first plane and the first model and the i-1th model includes: the first plane is inside the first model but outside the i-1th model, the first plane is inside the i-1th model but outside the first model, the first plane intersects the first model and the i-1th model, and the first plane is outside the first model and outside the i-1th model.
[0181] The first plane is inside the first model but outside the i-1th model means that the region between the first plane and the second plane is inside the first model but outside the i-1th model.
[0182] The first plane is inside the i-1th model but outside the first model means that the region between the first plane and the second plane is inside the i-1th model but outside the first model.
[0183] The first plane intersects the first model and the i-1th model means that there is a partial region between the first plane and the second plane that is inside the first model but outside the i-1th model, a partial region between the first plane and the second plane that is outside the first model but inside the i-1th model, and a partial region between the first plane and the second plane that is outside the first model and outside the i-1th model.
[0184] The first plane is outside the first model and outside the i-1th model means that the region between the first plane and the second plane is outside the first model and outside the i-1th model.
[0185] In a case where the position relationship between the first plane and the first model and the i-1th model includes: the first plane is inside the first model but outside the i-1th model, the first plane is inside the i-1th model but outside the first model, and the first plane is outside the first model and outside the i-1th model, the at least one sketch is determined in the first plane as the first plane.
[0186] In a case where the position relationship between the first plane and the first model and the i-1th model is that the first plane intersects the first model and the i-1th model, the at least one sketch determined in the first plane includes: a plane inside the first model but outside the i-1th model, a plane outside the first model but inside the i-1th model, and a plane outside the first model and outside the i-1th model.
[0187] For each sketch in the at least one sketch, the relative positional relationship between the sketch and the first model and the i-1 models comprises: the sketch is in the first model but out of the i-1 models, the sketch is out of the first model but in the i-1 models, and the sketch is out of the first model and the i-1 models. In the case that the relative positional relationship between the sketch and the first model and the i-1 models is that the sketch is in the first model but out of the i-1 models, it is determined that the operation type corresponding to the sketch is stretching a boss. In the case that the relative positional relationship between the sketch and the first model and the i-1 models is that the sketch is out of the first model but in the i-1 models, it is determined that the operation type corresponding to the sketch is stretching a cutout.
[0188] The operation direction corresponding to the sketch is used to indicate the direction when the sketch is subjected to the modeling operation. For each sketch in the at least one sketch, the direction from the first plane to the second plane where the sketch is located is determined as the operation direction corresponding to the sketch.
[0189] In some embodiments, after the at least one sketch and the operation information corresponding to each of the at least one sketch are determined in the above manner, each of the at least one sketch is screened to obtain the final at least one sketch and the operation information corresponding to each of the final at least one sketch.
[0190] Specifically, for each sketch in the at least one sketch, it is determined whether there is a sketch in the at least one sketch which is identical to the sketch and the operation information corresponding to the sketch. If yes, the sketch in the at least one sketch which is identical to the sketch and the operation information corresponding to the sketch is deleted. If no, it is determined whether the modeling model obtained by modeling the sketch according to the operation information corresponding to the sketch intersects with the first model. In the case that the modeling model obtained by modeling the sketch according to the operation information corresponding to the sketch does not intersect with the first model, the sketch is deleted.
[0191] S72, an i-th sketch is determined in the at least one sketch, and operation information corresponding to the i-th sketch is determined in the operation information corresponding to the at least one sketch.
[0192] The i-th sketch can be determined in the at least one sketch in the following manner: for each sketch in the at least one sketch, M modeling operations are performed according to the sketch, the operation information corresponding to the sketch, the first model and the region graph to obtain M modeling models corresponding to the sketch; M is a positive integer; and the i-th sketch is determined in the at least one sketch according to the first model and the M modeling models corresponding to each of the at least one sketch.
[0193] For any one of the M modeling operations, the following steps are performed: according to the operation information corresponding to the sketch, the sketch is modeled to obtain a first candidate modeling model; in the case where the preset condition is not met, a second operation is performed, the second operation including: generating at least one candidate sketch and operation information corresponding to each of the at least one candidate sketch according to the jth candidate modeling model, the first model and the region graph; according to the operation information corresponding to the first candidate sketch and the jth candidate modeling model, the first candidate sketch is modeled to obtain a (j+1)th candidate modeling model; j is 1, 2, … in turn; the first candidate sketch belongs to the at least one candidate sketch; in the case where the preset condition is met, the (j+1)th candidate modeling model is determined as the modeling model corresponding to the sketch; wherein the preset condition includes: j is greater than a preset number, and / or the volume intersection ratio of the jth candidate modeling model and the first model is greater than or equal to a preset threshold.
[0194] The way of generating at least one candidate sketch and operation information corresponding to each of the at least one candidate sketch according to the jth candidate modeling model, the first model and the region graph is consistent with the way of determining at least one sketch and operation information corresponding to each of the at least one sketch according to at least one modeling model and the region graph in S71, which will not be described here.
[0195] It should be noted that the first candidate sketch is any one of the at least one candidate sketch, and one of the at least one candidate sketch can be randomly determined as the first candidate sketch.
[0196] The way of modeling the first candidate sketch according to the operation information corresponding to the first candidate sketch and the jth candidate modeling model to obtain the (j+1)th modeling model can be as follows: modeling the first candidate sketch according to the operation information corresponding to the first candidate sketch, and combining the obtained modeling model with the jth candidate modeling model to obtain the (j+1)th modeling model.
[0197] In the case where the volume intersection ratio of the jth candidate modeling model and the first model is greater than or equal to the preset threshold, it indicates that the similarity of the jth candidate modeling model and the first model is greater than or equal to the preset threshold. At this time, it indicates that the jth candidate modeling model is consistent with the first model.
[0198] In the case where j is greater than the preset number, it indicates that the number of candidate modeling models has reached the preset number.
[0199] Therefore, in a case that the jth candidate modeling model is inconsistent with the first model, and the number of candidate modeling models does not reach the preset number, the second operation is continuously performed until the j+1th candidate modeling model is consistent with the first model, or j+1 is greater than the preset number. At this time, the j+1th modeling model obtained is the candidate modeling model obtained by the first modeling operation.
[0200] For each sketch in the at least one sketch, M modeling operations are performed on the sketch to obtain M candidate modeling models corresponding to the sketch. For each candidate modeling model in the M candidate modeling models, a volume intersection ratio between the candidate modeling model and the first model is determined, and it is determined whether the volume intersection ratio between the candidate modeling model and the first model is greater than or equal to a preset threshold. According to the number of candidate modeling models in the M candidate modeling models whose volume intersection ratios with the first model are greater than or equal to the preset threshold, and M, a modeling success rate corresponding to the sketch is determined.
[0201] For example, assuming that M is 10, for the sketch Figure 1 , 10 modeling operations are performed to obtain 10 candidate modeling models, wherein 7 candidate modeling models have volume intersection ratios with the first model that are greater than or equal to the preset threshold. At this time, it can be determined that the modeling success rate corresponding to the sketch Figure 1 is 70%. Figure 1
[0202] In some embodiments, according to the modeling success rates corresponding to the at least one sketch respectively, the sketch with the highest modeling success rate in the at least one sketch can be determined as the ith sketch.
[0203] For example, assuming that the at least one sketch includes the sketch Figure 1 , the sketch Figure 2 , the sketch Figure 3 , the sketch Figure 4 , and the sketch Figure 5 , wherein the modeling success rate corresponding to the sketch Figure 1 is 70%, the modeling success rate corresponding to the sketch Figure 2 is 80%, the modeling success rate corresponding to the sketch Figure 3 is 40%, the modeling success rate corresponding to the sketch Figure 4 is 50%, and the modeling success rate corresponding to the sketch Figure 5 is 60%, the sketch Figure 2 with the highest modeling success rate is determined as the ith sketch.
[0204] In some embodiments, if the modeling success rates corresponding to the at least one sketch are all 0, for each sketch in the at least one sketch, a modeling model with the largest volume intersection ratio between the first model and the modeling model is determined from the M modeling models corresponding to the sketch, and the volume intersection ratio between the first model and the modeling model is determined as the target volume intersection ratio corresponding to the sketch. Then, the largest target volume intersection ratio is selected from the target volume intersection ratios corresponding to the at least one sketch, and the sketch corresponding to the target volume intersection ratio is determined as the i-th sketch.
[0205] Figure 7 In the illustrated embodiments, the at least one sketch and the operation information corresponding to the at least one sketch are determined according to the first model and the region map. Then, for each sketch in the at least one sketch, the sketch is subjected to M modeling operations to obtain M modeling models corresponding to the sketch. The modeling success rate corresponding to the sketch is determined according to the M modeling models corresponding to the sketch and the first model. Finally, the sketch with the highest modeling success rate is determined as the i-th sketch from the at least one sketch, and the operation information corresponding to the i-th sketch is determined from the operation information corresponding to the at least one sketch.
[0206] In the above-described manner of determining the i-th sketch and the operation information corresponding to the i-th sketch, for each sketch in the at least one sketch, the M modeling models corresponding to the sketch are determined, and the modeling success rate corresponding to the sketch is determined according to the M modeling models and the first model, and then the sketch with the highest modeling success rate is determined as the i-th sketch, which improves the accuracy of determining the i-th sketch from the at least one sketch, and further improves the accuracy of determining the modeling sequence. In addition, for each sketch in the at least one sketch, a first candidate sketch is randomly determined from the at least one candidate sketch during each modeling operation of the sketch. In this way, the first candidate sketch is determined from the at least one candidate sketch by traversal, which reduces the computational load of determining the i-th sketch and improves the efficiency of determining the i-th sketch.
[0207] In the above-described embodiments, after the modeling sequence corresponding to the first model is determined, the sample image and the modeling sequence are input into the three-dimensional model modeling sequence generation network for model training.
[0208] In some embodiments, the three-dimensional model modeling sequence generation network can be trained for one or more rounds. Specifically, each round of training of the three-dimensional model modeling sequence generation network can be performed as follows: inputting the sample image and the modeling sequence into the three-dimensional model modeling sequence generation network, and the three-dimensional model modeling sequence generation network determining a region map corresponding to the first model, the region map including a first region and a second region. For different first models, the size of the region map corresponding to the first model is different, so after determining the region map of the first model, the region map is scaled and placed in a unit cube. At the same time, in order to ensure the accuracy of modeling, the center coordinates of the original region map and the scaling amplitude when the original region map is scaled are recorded. It should be noted that in the process of scaling the region map, the region map is scaled at a constant ratio, so that the shape of the region map does not change.
[0209] The feature encoding module encodes the region map, specifically, the feature encoding module includes a region encoder and a UV unfolding encoder, and the feature encoding of the region map mainly includes two parts, one part is to encode the first region in the region map using the region encoder, and the other part is to encode the second region in the region map using the UV unfolding encoder.
[0210] The region encoder is a point cloud (pointnet++) network as the main network, including 3 sampling and aggregation (SA) layers and 3 fully connected layers. The way of encoding the first region using the region encoder can be as follows: for each first region in the region map, at least one feature point is selected on the surface of the first region according to a certain rule or algorithm, and the at least one feature point is determined as the geometric feature of the first region. Then, according to the modeling sequence and the geometric feature of the first region, the three-dimensional coordinates of each feature point in the first region, the surface vector, and the label corresponding to the first region are determined. Wherein, the three-dimensional coordinates of each feature point are used to represent the coordinates of the coordinate point in the three-dimensional space; the surface vector may be, for example, the normal vector, the outer normal vector, etc. of the coordinate point; the label corresponding to the first region includes whether the first region is in the first model, whether the first region is related to each target sketch, etc. Finally, the region encoder encodes the three-dimensional coordinates of each feature point, the surface vector, and the label corresponding to the first region to obtain the first region matrix vector.
[0211] The UV unfolding encoder is a two-dimensional convolutional neural network as the backbone network, including a pooling layer. The UV unfolding encoder encodes the features of the second region in the following manner: UV sampling is performed on the second region, which means that the second region is mapped to a two-dimensional plane, the mapped two-dimensional plane is uniformly sampled to obtain at least one sampling point, and then the at least one sampling point is mapped back to the second region to obtain the corresponding points of the at least one sampling point in the second region, and the corresponding points of the at least one sampling point in the second region are determined as the feature points of the second region. Then, each feature point of the second region is determined as a geometric feature of the second region, and the three-dimensional coordinates, surface vectors and labels corresponding to the second region of each feature point in the second region are determined according to the modeling sequence and the geometric features of the second region, wherein the labels corresponding to the second region may be, for example, mask information, used to indicate whether the second region exists in the first model. Finally, the UV unfolding encoder encodes the features according to the three-dimensional coordinates, surface vectors and labels of each feature point to obtain a matrix vector of the second region.
[0212] After completing the feature encoding, the matrix vector of the first region and the matrix vector of the second region are respectively input into the information aggregation module. The information aggregation module is a graph neural network as the backbone network, including a message passing network layer for graph data, and two consecutive fully connected layers, wherein the fully connected layers include a linear transformation layer, a batch normalization layer and an activation layer.
[0213] The input feature encoding can be processed in combination with the "message-aggregation" paradigm, and the processing manner can be as follows: the feature encoding of the first region and the feature encoding of the second region are spliced, and then two consecutive fully connected layers are used to generate a model representation corresponding to each first region. Then, for each first region, determine the first region adjacent to the first region, and then process the model representation of the first region adjacent to the first region and the model representation of the first region to update the model representation of the first region. Finally, the model representations of the first regions are linearly transformed by using a linear transformation layer to obtain a second model.
[0214] After obtaining the second model, the difference value determination module determines the difference value between the first model and the second model according to the first model and the second model.
[0215] The difference value between the first model and the second model can also include a first overlap rate and a second overlap rate.
[0216] The first overlap rate is an overlap rate between a modeling model obtained by modeling the sketch according to the operation information corresponding to the sketch and the first model. The first overlap rate is used to indicate a contribution degree of the sketch and the operation information corresponding to the sketch to modeling. The greater the first overlap rate is, the greater the contribution degree of the sketch and the operation information corresponding to the sketch to modeling is. It should be noted that the manner of determining the first overlap rate corresponding to the sketch is different according to different operation types corresponding to the sketch.
[0217] For example, for each sketch in the modeling sequence, it is assumed that a modeling model E is obtained by modeling the sketch according to the operation information corresponding to the sketch, and the volume of the modeling model E is V E. The volume of the modeling model E in the first model T is V T, and the volume of the modeling model E in the second model C is V C. The volume of the modeling model E in the first model T and outside the second model C is V T - V C, and the volume of the modeling model E outside the first model T and in the second model C is V C - V T. For example, the operation type corresponding to the sketch includes stretching a boss and stretching a cutout. The first overlap rate R 1 is calculated according to the following formula:
[0218] (2)
[0219] For each sketch in the modeling sequence, the second overlap rate is an overlap rate between a modeling model obtained by modeling the sketch according to the operation information corresponding to the sketch and a previous modeling model, the previous modeling model being a modeling model obtained by modeling a previous sketch of the sketch. Therefore, the smaller the second overlap rate is, the higher the contribution degree of the sketch and the operation information corresponding to the sketch to modeling is. It should be noted that the manner of determining the second overlap rate corresponding to the sketch is different according to different operation types corresponding to the sketch.
[0220] For example, for each sketch in the modeling sequence, it is assumed that a modeling model E is obtained by modeling the sketch according to the operation information corresponding to the sketch, and the volume of the modeling model E is V E. The volume of the modeling model E in the second model C is V C. For example, the operation type corresponding to the sketch includes stretching a boss and stretching a cutout. The second overlap rate R 2 is calculated according to the following formula:
[0221] (3)
[0222] According to the volume intersection ratio, the first overlap rate and the second overlap rate included in the difference value, the parameters of the three-dimensional model modeling sequence generation network are adjusted, and then the next round of training is performed according to the adjusted parameters. Until the training termination condition is reached, the trained three-dimensional model modeling sequence generation network is obtained.
[0223] Figure 8 A structural schematic diagram of a training device of a three-dimensional model modeling sequence generation network provided by an embodiment of the present application is shown in FIG. 8. As shown in FIG. 8, the training device 80 of the three-dimensional model modeling sequence generation network includes an acquisition module 81, a processing module 82, a modeling module 83, and a parameter adjustment module 84, wherein Figure 8
[0224] The acquisition module 81 is configured to acquire a sample image and a first model, the sample image including a graphic object, and the first model being a model obtained by three-dimensional modeling of the graphic object.
[0225] The processing module 82 is configured to perform decomposition processing on the first model to obtain a modeling sequence corresponding to the first model, the modeling sequence including a target sketch and operation information corresponding to the target sketch, the operation information corresponding to the target sketch being used to indicate an operation when modeling the target sketch.
[0226] The modeling module 83 is configured to input the sample image and the modeling sequence into a three-dimensional model modeling sequence generation network to obtain a difference value between the first model and a second model, the second model being a model obtained by modeling according to the modeling sequence.
[0227] The parameter adjustment module 84 is configured to adjust parameters of the three-dimensional model modeling sequence generation network according to the difference value to obtain a trained three-dimensional model modeling sequence generation network.
[0228] In a possible implementation, the processing module 82 is specifically configured to:
[0229] perform conversion processing on the first model to obtain a region map corresponding to the first model;
[0230] perform a first operation, the first operation including: determining an i-th sketch and operation information corresponding to the i-th sketch according to at least one modeling model and the region map; and modeling the i-th sketch according to the operation information corresponding to the i-th sketch to obtain an i-th modeling model; i being a positive integer greater than or equal to 1; wherein, when i = 1, the at least one modeling model is the first model; and when i > 1, the at least one modeling model includes the first model and an (i-1)-th modeling model.
[0231] when i is less than a preset number and a volume intersection ratio of the i-th modeling model and the first model is less than a preset threshold, updating i to i+1 and repeating the first operation until i is greater than or equal to the preset number and / or the volume intersection ratio of the i-th modeling model and the first model is greater than or equal to the preset threshold.
[0232] wherein the target sketch includes the first i sketches.
[0233] In a possible implementation, the processing module 82 is specifically configured to:
[0234] determine a reference model corresponding to the first model according to the size information of the first model;
[0235] determine at least one face to be expanded in the first model;
[0236] perform expansion processing on the at least one face to be expanded respectively according to the size of the reference model and the type of each of the at least one face to be expanded, to obtain a region map.
[0237] In a possible implementation, the processing module 82 is specifically configured to:
[0238] determine at least one sketch and operation information corresponding to the at least one sketch according to the at least one modeling model and the region map;
[0239] determine an i-th sketch in the at least one sketch, and determine operation information corresponding to the i-th sketch in the operation information corresponding to the at least one sketch.
[0240] In a possible implementation, the processing module 82 is specifically configured to:
[0241] determine a first plane, a second plane, and a region adjacent to the first plane in the region map, where the first plane and the second plane are parallel;
[0242] determine at least one sketch in the first plane according to a positional relationship between the first model and the first plane;
[0243] for each sketch in the at least one sketch, determine an operation type corresponding to the sketch according to a relative positional relationship between the sketch and the first model;
[0244] determine an operation direction corresponding to the at least one sketch as a direction from the first plane to the second plane;
[0245] wherein the operation information corresponding to the sketch includes the operation type and the operation direction.
[0246] In a possible implementation, the processing module 82 is specifically configured to:
[0247] for each sketch in the at least one sketch, perform M times of modeling operations according to the sketch, the operation information corresponding to the sketch, the first model and the region map, to obtain M modeling models corresponding to the sketch; M is a positive integer;
[0248] determine an i-th sketch in the at least one sketch according to the first model and the M modeling models corresponding to each of the at least one sketch.
[0249] In a possible implementation, the processing module 82 is specifically configured to:
[0250] For any one of the M modeling operations, the following steps are performed:
[0251] According to the operation information corresponding to the sketch, the sketch is modeled to obtain a first candidate modeling model;
[0252] If the preset condition is not met, a second operation is performed, the second operation including: generating at least one candidate sketch and operation information of each of the at least one candidate sketch according to the jth candidate modeling model, the first model and the region graph; modeling the first candidate sketch according to the operation information corresponding to the first candidate sketch and the jth candidate modeling model to obtain a (j+1)th candidate modeling model; j is 1, 2, … in turn; the first candidate sketch is any one of the at least one candidate sketch;
[0253] If the preset condition is met, the (j+1)th candidate modeling model is determined as the modeling model corresponding to the sketch;
[0254] The preset condition includes: j is greater than a preset number, and / or the volume intersection ratio of the jth candidate modeling model and the first model is greater than or equal to a preset threshold.
[0255] The training device of the three-dimensional model modeling sequence generation network provided in the embodiment can execute the training method of the three-dimensional model modeling sequence generation network provided in the above method embodiment, and has similar implementation principles and technical effects. Therefore, the training device of the three-dimensional model modeling sequence generation network is not described here.
[0256] Figure 9 A structural schematic diagram of an electronic device provided in an embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, the electronic device 90 provided in the embodiment of the present application includes a memory 91 and a processor 92. Figure 9
[0257] The memory 91 stores computer execution instructions.
[0258] The processor 92 executes the computer execution instructions stored in the memory 91, so that the processor 92 executes the training method of the three-dimensional model modeling sequence generation network provided in the above method embodiment. The training device of the three-dimensional model modeling sequence generation network has similar implementation principles and technical effects. Therefore, the training device of the three-dimensional model modeling sequence generation network is not described here.
[0259] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in combination with the application can be directly embodied as hardware processor execution, or executed by a combination of hardware and software modules in the processor.
[0260] The memory can include a random access memory (RAM), and can also include a non-volatile memory (NVM), such as at least one disk memory.
[0261] The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.
[0262] The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the training method of the three-dimensional model modeling sequence generation network.
[0263] The present application also provides a computer readable storage medium, which stores computer execution instructions, and when the processor executes the computer execution instructions, the training method of the three-dimensional model modeling sequence generation network is implemented.
[0264] The above readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0265] An exemplary readable storage medium is coupled to the processor, so that the processor can read information from the readable storage medium, and can write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the device.
[0266] The division of units is only a logical function division, and in actual implementation, there can be another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0267] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0268] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0269] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the part of the present application that essentially contributes to the prior art or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the embodiments of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0270] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The foregoing program can be stored in a computer readable storage medium. The program executes to perform the steps of the above-mentioned method embodiments; and the foregoing storage medium includes various media capable of storing program codes, such as ROM, RAM, magnetic disk, or optical disk.
[0271] Finally, it should be noted that other embodiments of the present application will readily occur to those skilled in the art upon consideration of the specification and practice of the present application disclosed herein. The present application is intended to include all such variations as fall within the general scope of the application, and includes the generic principles disclosed and the best mode known to the inventors to be currently practiced as well as variations thereof, without departing from the scope of the present application as defined by the claims. The specification and examples give the best application of the present application as known to at least one of the inventors at the time of the filing of this application. It is to be understood that since numerous modifications and changes will readily occur to those skilled in the art, the application is not to be limited to the exact construction and operation as illustrated and described. Accordingly, all such variations are intended to be included within the scope of the present application as defined in the claims. The application is to be limited only by the claims.
Claims
1. A training method for a three-dimensional modeling sequence generation network, characterized in that, include: Acquire a sample image and a first model, wherein the sample image includes a graphic object and the first model is a model obtained by performing a three-dimensional modeling of the graphic object; The first model is decomposed to obtain the modeling sequence corresponding to the first model. The modeling sequence includes a target sketch and operation information corresponding to the target sketch. The operation information corresponding to the target sketch is used to indicate the operations when modeling the target sketch; The sample image and the modeling sequence are input into a 3D model modeling sequence generation network to obtain the difference value between the first model and the second model, where the second model is a model obtained by modeling through the modeling sequence. Based on the difference value, the parameters of the 3D model modeling sequence generation network are adjusted to obtain a trained 3D model modeling sequence generation network. The step of decomposing the first model to obtain the modeling sequence corresponding to the first model includes: The first model is transformed to obtain the region map corresponding to the first model; Perform a first operation, which includes: determining the i-th sketch and its corresponding operation information based on at least one modeling model and the region map; modeling the i-th sketch based on the operation information corresponding to the i-th sketch to obtain the i-th modeling model; i is initially 1 and is a positive integer greater than or equal to 1; wherein, when i=1, the at least one modeling model is the first model; when i>1, the at least one modeling model includes the first model and the (i-1)-th modeling model; If i is less than a preset number and the volume intersection-union ratio of the i-th model and the first model is less than a preset threshold, update i to i+1 and repeat the first operation until the following conditions are met: i is greater than or equal to the preset number, and / or the volume intersection-union ratio of the i-th model and the first model is greater than or equal to the preset threshold. The target sketch includes the first i sketches.
2. The method according to claim 1, characterized in that, The process of transforming the first model to obtain the region map corresponding to the first model includes: Based on the size information of the first model, determine the reference model corresponding to the first model; In the first model, at least one surface to be expanded is determined; Based on the size of the reference model and the type of each of the at least one surface to be expanded, the at least one surface to be expanded is expanded to obtain the region map.
3. The method according to claim 1 or 2, characterized in that, The step of determining the i-th sketch and the corresponding operation information based on at least one modeling model and the region map includes: Based on the at least one modeling model and the region map, determine at least one sketch and corresponding operation information for the at least one sketch; The i-th sketch is determined in the at least one sketch, and the operation information corresponding to the i-th sketch is determined in the operation information corresponding to the at least one sketch.
4. The method according to claim 3, characterized in that, The step of determining at least one sketch and corresponding operation information for the at least one sketch based on the at least one modeling model and the region map includes: In the region map, a first plane, a second plane, and a region adjacent to the first plane are defined, wherein the first plane and the second plane are parallel. Based on the positional relationship between the first model and the first plane, at least one sketch is determined in the first plane; For each sketch in the at least one sketch, the operation type corresponding to the sketch is determined according to the relative positional relationship between the sketch and the first model; The direction from the first plane to the second plane is determined as the operation direction corresponding to the at least one sketch; The operation information corresponding to the sketch includes the operation type and the operation direction.
5. The method according to claim 3, characterized in that, Determining the i-th sketch in the at least one sketch includes: For each of the at least one sketches, M modeling operations are performed based on the sketch, the operation information corresponding to the sketch, the first model, and the region map to obtain M modeling models corresponding to the sketch; where M is a positive integer. Based on the first model and the M modeling models corresponding to each of the at least one sketch, the i-th sketch is determined in the at least one sketch.
6. The method according to claim 5, characterized in that, The step involves performing M modeling operations based on the sketch, the corresponding operation information of the sketch, the first model, and the region map to obtain M modeling models corresponding to the sketch, including: For any one of the M modeling operations, perform the following steps: Based on the operation information corresponding to the sketch, the sketch is modeled to obtain the first candidate modeling model; If the preset conditions are not met, a second operation is performed, which includes: generating at least one candidate sketch and operation information for each of the at least one candidate sketch based on the j-th candidate modeling model, the first model, and the region map; performing modeling processing on the first candidate sketch based on the operation information corresponding to the first candidate sketch and the j-th candidate modeling model to obtain the (j+1)-th candidate modeling model; where j is 1, 2, ...; and the first candidate sketch is any one of the at least one candidate sketches. Under the condition that the preset conditions are met, the (j+1)th candidate modeling model is determined as the modeling model corresponding to the sketch; The preset conditions include: j is greater than a preset number, and / or the volume intersection-union ratio of the j-th candidate modeling model with the first model is greater than or equal to the preset threshold.
7. A training device for a three-dimensional model modeling sequence generation network, characterized in that, include: An acquisition module is used to acquire a sample image and a first model, wherein the sample image includes a graphic object and the first model is a model obtained by performing a three-dimensional modeling of the graphic object. The processing module is used to decompose the first model to obtain the modeling sequence corresponding to the first model. The modeling sequence includes a target sketch and operation information corresponding to the target sketch. The operation information corresponding to the target sketch is used to indicate the operations when modeling the target sketch; The modeling module is used to input the sample image and the modeling sequence into the 3D model modeling sequence generation network to obtain the difference value between the first model and the second model, wherein the second model is a model obtained by modeling through the modeling sequence. The parameter tuning module is used to adjust the parameters of the 3D model modeling sequence generation network according to the difference value, so as to obtain a trained 3D model modeling sequence generation network. The processing module is specifically used for: The first model is transformed to obtain the region map corresponding to the first model; Perform a first operation, which includes: determining the i-th sketch and its corresponding operation information based on at least one modeling model and the region map; modeling the i-th sketch based on the operation information corresponding to the i-th sketch to obtain the i-th modeling model; i is initially 1 and is a positive integer greater than or equal to 1; wherein, when i=1, the at least one modeling model is the first model; when i>1, the at least one modeling model includes the first model and the (i-1)-th modeling model; If i is less than a preset number and the volume intersection-union ratio of the i-th model and the first model is less than a preset threshold, update i to i+1 and repeat the first operation until the following conditions are met: i is greater than or equal to the preset number, and / or the volume intersection-union ratio of the i-th model and the first model is greater than or equal to the preset threshold. The target sketch includes the first i sketches.
8. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Three-dimensional human body multi-gesture modeling method by adopting free-hand sketches
CN102831638A
Freehand sketch-based three-dimensional model generation and assembly method and system
CN116071501A