Example-based garment template automatic generation method and device

By constructing a semantic analysis system and graph neural network for 3D clothing models, the problem of low automation in clothing pattern generation has been solved, achieving efficient and accurate automatic generation of clothing patterns that meets the standards of the pattern-making industry.

CN120974894APending Publication Date: 2025-11-18ZHEJIANG SCI-TECH UNIV +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511057961.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Existing CAD systems have low automation in garment pattern generation, making it difficult to meet rapidly changing market demands. Furthermore, traditional manual methods are inefficient and lack accuracy, making it difficult to generate patterns that conform to pattern-making industry standards.

Method used

By constructing a semantic analysis system for 3D clothing models, and combining graph neural networks and sparse graph transformers, intelligent segmentation and flattening of clothing patterns are achieved. By integrating the principles of clothing structure and computer vision technology, patterns that meet pattern-making standards are generated.

Benefits of technology

It enables efficient and accurate automatic generation of garment patterns, shortens the design-to-production conversion cycle, improves designers' work efficiency, and reduces the correction costs caused by segmentation errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120974894A_ABST
    Figure CN120974894A_ABST
Patent Text Reader

Abstract

The invention relates to an example-based clothing template automatic generation method and device. The method comprises the following steps: firstly, constructing a standard clothing model database containing semantic tags based on a graph structure; constructing a graph neural network segmentation framework based on a surface adjacent graph, converting the triangular mesh model into graph structure data, and constructing a surface patch classification probability prediction model; then training the framework and semantic tag prediction, iteratively optimizing semantic tags by adopting a graph cut optimization algorithm, and clustering to form an independent cut piece set through a region growing algorithm based on the optimized tags; performing least square conformal parameterization on each cutting piece to obtain an initial two-dimensional sample plate, and constructing a geometric constraint energy function containing fabric characteristics and sample plate process requirements; and finally, solving a four-dimensional comprehensive optimization energy function containing physical characteristics and geometric constraints, and obtaining a final sample plate by minimizing the function. According to the method, highly-automatic end-to-end model generation is achieved, and the industrial platemaking standard is met more accurately.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the fields of computer-aided design, computer manufacturing, garment digitization, etc., and particularly relates to a garment template automatic generation method and device based on examples. BACKGROUND

[0002] In the current booming garment industry, garment production is undergoing a profound transformation from traditional manual mode to digital and intelligent mode. As the core link of garment production, the quality and efficiency of garment template directly affect the final quality of garment products and market competitiveness. The traditional manual template making method highly depends on the experience and skills of the pattern maker, which not only has long production cycle and low efficiency, but also is difficult to guarantee the consistency and accuracy of the template, and is difficult to meet the rapidly changing market demand of modern garment industry. With the rapid development of computer technology, computer-aided design (CAD) technology has been widely applied in the field of garment, which has improved the efficiency of template making to a certain extent. However, most of the existing CAD systems still need manual interaction operation such as line drawing and size marking, and the automation degree is low. When facing complex styles and variable design requirements, manual operation is prone to errors, and the design efficiency is difficult to further improve. At the same time, consumers' demand for personalized clothing is increasing, and small-batch and multi-variety production mode has become the mainstream. This requires garment enterprises to quickly respond to market changes and complete the whole process from design to production in a short time. Obviously, the traditional template making method cannot adapt to the fast-changing market rhythm, therefore, realizing the automatic generation of garment template has become an important problem to be solved in the garment industry.

[0003] The present application has technical advantages in the field of garment pattern generation, especially in accurately reproducing the flat patterns of various common clothing styles. Whether it is a skirt, T-shirt, or basic styles such as shirts and pants, the generated flat patterns are superior to traditional hand-made patterns and conventional digitization methods in terms of form restoration and process detail fidelity. Traditional methods often rely on manual experience, leading to error accumulation, or have limitations in balancing form accuracy and process feasibility. However, the present application achieves a breakthrough in pattern generation quality through innovative technical paths. The technical method used by the present application is based on a standardized pattern database as a reference, and through the construction of a semantic analysis system of three-dimensional garment models, it realizes intelligent segmentation and flattening optimization from three-dimensional modeling to flat patterns. This process is not a simple geometric transformation, but a deep synergy of garment structure principles and computer vision technology - the semantic analysis module can accurately identify different patterns, providing accurate decision-making basis for subsequent pattern segmentation. In the test verification of pattern segmentation performance, this method shows strong robustness: whether it is a specific brand's exclusive clothing dataset (containing customized styles with complex process details) or a public general clothing test dataset (covering a variety of styles and structures of ready-to-wear styles), it can achieve high recognition accuracy and significantly reduce the cost of pattern correction due to segmentation errors. It is particularly worth noting that the sparse graph transformer architecture used improves model training efficiency by optimizing feature extraction paths.

[0004] In the pattern flattening stage, the method achieves multiple aspects: under the premise of ensuring the overall pattern contour regularity, the physical property parameter model of the fabric is introduced to finely control the deformation of the fabric stretching. At the same time, the algorithm has built-in geometric constraint mechanisms such as symmetry and edge smoothness, so that the generated pattern not only meets the process standards of garment manufacturing, but also effectively shortens the conversion period from design to production. SUMMARY

[0005] To solve the problem that the 2D garment pattern generation result is difficult to fully meet the industry standard, the present application provides a garment pattern automatic generation method and device based on examples. It aims to provide a fast and convenient solution to automatically generate garment patterns. By performing semantic segmentation and flattening on the user input garment model, and generating a new garment pattern in an end-to-end manner, this process not only improves the designer's work efficiency, but also reduces the cumbersome operation steps, thereby realizing efficient and accurate automatic generation of garment patterns.

[0006] The technical purpose of the present application is achieved by the following technical scheme: a garment pattern automatic generation method based on examples, the method comprising the following steps:

[0007] Step one, constructing a standard garment model database containing semantic labels based on graph structure: design a kind of different types of garment mesh model, each type of garment contains b different style and style but uniform structure and sewing way of garment model, form garment model set Ω = {G0, G1,..., G n}, wherein G n represents the nth garment model; each garment model is defined by a triple G n = {V, F, L}, V represents the 3D coordinates of the model vertex, F represents the index of the mesh triangle face, and L represents the semantic label of the mesh triangle face; for each type of garment model, a graph structure based on the pattern topology graph G a = {V a , E a} is constructed, wherein the node V a represents the pattern of the garment, and the edge E a represents the sewing relationship between the patterns; the node V a = {P, B, S}, wherein P represents the index of the pattern, B represents the geometric attribute of the pattern, and S represents the symmetry attribute of the pattern;

[0008] Step two, constructing a graph neural network segmentation framework based on face adjacency graph: converting the triangular mesh model into graph structure data, and then mapping the obtained feature code to a unified high-dimensional embedding space through MLP, and constructing a face sheet classification probability prediction model based on the encoder-decoder framework of graph transformer; the framework includes a multi-dimensional feature extraction system, wherein the face-level features are represented by basic attributes and composite attributes, the basic geometric attributes include centroid coordinates, unit normal vector, triangular face area and vertex coordinates, and the composite geometric attributes include curvature, PCA features and context semantic labels; the edge-level features mainly include edge midpoint coordinates, edge Euclidean length and dihedral angle of adjacent face sheets;

[0009] Step three, training the graph neural network segmentation framework and semantic label prediction: for each garment model, construct a face adjacency graph G FA = {V FA , E FA}, V FA is each mesh triangle face node, and E FA is the edge connection of adjacent faces; train the semantic segmentation model with G FA as input, and output the semantic label L p of the mesh triangle face; use the graph cut optimization algorithm to iteratively optimize L p , which considers the label consistency and geometric continuity of adjacent face sheets. Based on the optimized semantic label L p ', an independent pattern set {G seg} is formed by region growing algorithm;

[0010] Step four, constructing energy function containing physical properties and geometric constraints: for each patch G seg Perform least square conformal parameterization (LSCM) to obtain initial two-dimensional template P G ; construct the following energy function for optimization:

[0011] E pattern = ω boundary (E straight +E curve ) + ω sym (E inner +E seam ) + ω stretch E stretch + ω rigid E rigid ,

[0012] In the formula: ω is the weight of each energy term, E straight is the straight line constraint energy term, E curve is the spline curve energy term, E inner is the internal symmetry energy term of the template, E seam is the symmetry energy term at the joint, E stretch is the stretching energy term, E rigid is the rigid body transformation energy term;

[0013] Step five, solving four-dimensional comprehensive optimization energy function containing physical properties and geometric constraints: based on the weight and expression of each energy term, solve the above energy function E pattern , by minimizing the energy function E pattern to obtain the final template output.

[0014] Further, in step one, the garment model and the prototype example can have differences in style, but need to maintain the consistency of structural features, including the number of patches, the way of sewing, the number of edges of each patch, and the curved and straight properties of each edge.

[0015] Further, in step one, the garment model includes a long skirt, a vest, a T-shirt, and jeans, and the 3D coordinates, indices, and labels corresponding to the facets of the model mesh triangle are collected as the input of semantic segmentation training.

[0016] Further, in step one, the geometric property B is constructed as an edge mapping function B: E→{0, 1}, E represents the set of edge indices of the patches, B(e) = 0 indicates that the e-th edge is a straight edge, and B(e) = 1 indicates that the e-th edge is a curved edge; the symmetry property S is constructed as a set of symmetry relations S = {(p1, e1, p2, e2) | p1, p2∈P, e1, e2∈E}, where (p1, e1) and (p2, e2) form a mirror pair of curved edges about the axis of symmetry, P is the patch index space, and E is the edge index space; for any (p1, e1, p2, e2) ∈ S, the following conditions are satisfied: (1) when p1 = p2, it indicates that there is an axisymmetric relation inside the patch p1, and the edges e1 and e2 are axisymmetric about the patch; (2) when p1 ≠ p2, it indicates a cross-patch seam symmetry relation, and the edges e1 and e2 form a reflection symmetry about the two patch seam lines.

[0017] Further, in step three, the graph neural network segmentation framework includes a lightweight attention architecture of learnable virtual nodes (Virtual Nodes): the virtual nodes are initially empty feature vectors, serving as global communication hubs and establishing bidirectional connections with all real nodes; after training, the virtual nodes learn global features Z g , which are used to update the features of the real nodes. n The attention weights are calculated through a learnable parameter matrix W, and the adaptive feature representation is generated after normalization by a softmax function.

[0018] Further, in step four, the Lagrange multiplier method is used to optimize the spline curve: a constrained energy minimization problem is constructed for the data points and the control points, a Lagrange multiplier is introduced to form an augmented function, the control points P and the Lagrange multiplier λ are derived and set to zero, and the KKT equation set is derived, and the curve fitting result satisfying the geometric constraint condition and the physical characteristics is obtained by solving the equation set.

[0019] Further, in step five, the sample boundary constraint includes:

[0020] Straight line boundary: a straight line equation is fitted using all the vertices (x i ,y i ) of the boundary, and the coefficients m and c of the straight line equation are obtained:

[0021]

[0022] A straight line constraint is constructed according to the fitted straight line equation, an energy function is defined as the sum of the squares of the distances from all boundary vertices to the target straight line, and the straight line fitting is realized by minimizing the energy function;

[0023]

[0024] Curve boundary: 3-order 2-degree B-spline curve (k=3) is used for boundary fitting, the length of node vector T is set to 5, the middle node position is determined by calculating the curvature peak value of the curve, and the other nodes are determined by the midpoint of the line segment; considering the open node vector characteristics, the number of repeated nodes at the beginning and end needs to match the order k of the B-spline, therefore, 2 repeated nodes are added at the beginning and end of the node vector T; after completing the construction of the node vector, the boundary vertex set Q is used for interpolation fitting to solve the control points P of the B-spline curve; by constructing and minimizing an energy function which comprehensively considers the smoothness of the curve and the vertex fitting error, the positions of the control points and the boundary vertices are optimized to achieve accurate fitting:

[0025]

[0026] wherein, N(t i ) represents the base function of B-spline; the constraint terms related to the first and second derivatives of the curve are introduced in the energy function to further improve the smoothness of the curve, and the energy of the spline curve is comprehensively expressed in the following form:

[0027]

[0028] wherein, α and β are adjustable weight terms, r (1) (t) and r (2) (t) correspond to the first derivative and the second derivative of the B-spline curve respectively.

[0029] Further, in step five, the sample plate symmetry constraint includes:

[0030] Axial symmetry constraint inside a single sample plate: the two end points of the straight line boundary are strictly symmetrical, and the remaining vertices are symmetrically distributed through the straight line constraint condition; the spline curve boundary is realized by the symmetry constraint of the control points; the energy function is:

[0031]

[0032] wherein, and are the key nodes on the two boundaries that need to be symmetrical; R represents the symmetrical point of X about the symmetry axis;

[0033] Reflection symmetry between the joints of multiple sample plates: for the reflection symmetry constraint between the joints, the reflection transformation matrix M of the best fitting is calculated by analyzing the geometric characteristics of the joint line. For the two groups of key point sets X i 1 and X i 2 , X i 1 can be mapped to X i 1 by applying the transformation M to the point set Xi 2 position, i.e. satisfying MX i 1 = X i 2 ; likewise, by applying the inverse transform of M to X i 2 , we get X i 2 back to the position of X i 1 , i.e. M -1 X i 2 = X i 1 ; when X i 1 and X i 2 cannot be accurately mapped by the transform M and its inverse, it indicates that there is a deviation or asymmetry in the position of the key points at the seam, and the following formula is used to update and optimize the position information of the key points X i 1 and X i 2 :

[0034]

[0035] The symmetry energy function at the seam is defined as follows:

[0036]

[0037] where X i 1′ and X i 2′ are the reflection symmetric points of X i 1 and X i 2 , respectively.

[0038] Further, in step five, the physical energy constraints include:

[0039] Stretch energy: when the mapping maintains the isometric property, the projection length of the standard frame should be strictly equal to the theoretical value in the parameter domain, and the stretch energy term constructed therefrom can be expressed as:

[0040]

[0041] The total stretch energy is the sum of each triangle sub-item.

[0042] In the formula: s u , s vis derived from the column vector of the standard unit frame based on the Jacobian matrix analysis, and G is the UV coordinate of the corresponding auxiliary point;

[0043] Rigid transformation energy: In terms of shear and rigid deformation modeling, directly constraining the parameterized tangent angle will lead to a highly nonlinear optimization problem. Based on the ARAP parameterization idea, the shear deformation is implicitly controlled by minimizing the projection difference of edge vectors in the parameter domain and three-dimensional space, and the energy function is defined as follows:

[0044] E rigid (ABC)=ω rigid ∑(u e -u e′ ) 2 +(v e -v e′ ) 2

[0045] In the formula: e represents one side of triangle ABC, e' is the corresponding side of triangle (A'B'C'), and M represents the optimal rigid alignment transformation obtained by Procrustes analysis. Although this energy term mixes shear and isotropic stretching, its good numerical stability and optimization convergence has been verified in experiments. The total rigid energy is obtained by accumulating all the triangle sub-items, and the stretching energy together constitutes a complete physical constraint system.

[0046] On the other hand, the technical scheme of the present application also provides a kind of based on sample's garment template automatic generation device, comprising:

[0047] At least one processor;

[0048] At least one memory for storing at least one program;

[0049] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned one kind of based on sample's garment template automatic generation method.

[0050] The main advantages of the present application include:

[0051] (a) a highly automated end-to-end model generation process is realized;

[0052] (b) compared with existing methods, the present application generates a template according to a 3D garment model provided by a user, and more accurately meets industry plate making standards. BRIEF DESCRIPTION OF DRAWINGS

[0053] Figure 1 Flow chart of one kind of based on sample's garment template automatic generation method in an embodiment of the present application;

[0054] Figure 2 A phase diagram of a sample-based garment pattern automatic generation method in an embodiment of the present application;

[0055] Figure 3 A construction schematic diagram of a garment sample cutting topology obtained by the present application;

[0056] Figure 4 A schematic diagram of a processor, a memory, a network interface, and a non-volatile memory;

[0057] Figure 5 A T-shirt and dress pattern generated by the present application from a 3D garment model provided by a user. DETAILED DESCRIPTION

[0058] The present application will be further described below in connection with specific embodiments. It should be understood that these embodiments are only used to illustrate the present application and not used to limit the scope of the present application.

[0059] It should be noted that in the claims and specification of the present patent, relationship terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms “include”, “contain” or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the element defined by the statement “including one” does not exclude the presence of another identical element in the process, method, article or device including the element.

[0060] The present application proposes a sample-based garment pattern automatic generation method, which first constructs a 3D garment model database containing semantic labels, ensures that each garment type has a unified structure and sewing method; then establishes a standard cutting pattern sewing topology for each type of garment, describes the connection relationship between the cutting patterns and their geometric symmetry properties; then performs semantic segmentation on the 3D garment model by constructing a face adjacency graph and combining a graph neural network, identifies each cutting pattern, and uses a GraphCut optimization algorithm to improve the semantic consistency of the cutting pattern boundary; finally, based on the least squares conformal parameterization, an initial two-dimensional pattern is generated, the physical properties and geometric constraints are fused for nonlinear optimization, and a garment pattern meeting the production requirements is obtained.

[0061] Figure 1is a sample-based garment template automatic generation method in an embodiment of the present application. The method comprises the following steps: step 101, constructing a garment model database containing semantic labels; step 102, training a graph neural network for semantic segmentation; step 103, performing semantic segmentation according to the predicted labels; step 104, obtaining a sub-model through 3D garment model pattern recognition; step 105, performing LSCM to generate an initial garment template; and step 106, optimizing the target energy to obtain a final version.

[0062] Specifically, in one Figure 2 embodiment, the present application provides a sample-based garment template automatic generation method, which comprises the following steps:

[0063] Step one, constructing a standard garment model database containing semantic labels based on graph structure: designing two different types of garment models (taking T-shirt and dress standard garment styles as examples), wherein each type covers 20 different style models with unified structure and sewing method, constituting a garment model set Ω = {G0, G1,..., G 19}, wherein Ω is a garment model G n set, and the nth model is denoted as G n ; each garment model is defined by a triple G n = {V, F, L}, wherein V represents a 3D coordinate set (x, y, z) of the model vertex, F is the index i (0 <= i < 10000) of the grid triangle face, and L corresponds to the semantic label of the triangle face (such as T-shirt front pattern, back pattern, left sleeve, right sleeve, front collar and back collar, etc.); in the process of garment model design and adjustment, differences in style between the garment model and the prototype example are allowed on the premise of keeping the consistency of structural features; for each type of garment model, a pattern sewing topological graph G a = {V a ,E a} based on graph structure is constructed, wherein G a represents the a-th garment type, the node V a represents each pattern in the garment template, and the edge E a represents the sewing relationship between the patterns; the node V a={P,B,S}, wherein P represents the index of the patch, B represents the geometric attribute of the patch, and S represents the symmetry attribute of the patch; on this basis, the geometric attribute B is constructed as an edge mapping function B: E -> {0, 1}, wherein E represents a set of patch edge indexes, B(e) = 0 represents that the e-th edge is a straight line edge, and B(e) = 1 represents a curved edge; the symmetry attribute S is constructed as a set of symmetry relations S = {(p1, e1, p2, e2) | p1, p2 element-of P, e1, e2 element-of E}, wherein (p1, e1) and (p2, e2) constitute a curved edge mirror image pair about the symmetry axis, P is a patch index space, and E is an edge index space;

[0064] Step two, constructing a graph neural network segmentation framework based on a face adjacency graph: converting a triangular mesh model into graph structure data, then mapping the obtained feature code into a unified high-dimensional embedding space through an MLP, and constructing a face classification probability prediction model on the basis of an encoder-decoder framework of a graph transformer in the feature space; the application constructs a multi-dimensional feature extraction system according to a geometric attribute adjacency graph framework; for the representation of geometric information, the application designs a hierarchical geometric feature description method, wherein the face-level feature is represented by a double representation of basic attributes and composite attributes, wherein the basic geometric attributes include basic geometric attributes such as centroid coordinates, unit normal vector, triangular face area and vertex coordinates, and the composite geometric attributes include curvature, PCA features and context semantic labels, wherein the dimensions of the features are set as follows: the dimension of the face centroid is set to 3, the dimension of the face unit normal vector is set to 3, the dimension of the area is set to 1, the dimension of the three vertex coordinates of the face is set to 9, the dimension of the face curvature is set to 2, the dimension of the PCA feature value and the feature vector is set to 12, and the dimension of the context label is set to 5; the edge-level feature mainly includes edge midpoint coordinates, edge Euclidean length and dihedral angle of adjacent faces, wherein the dimensions of the features are set as follows: the dimension of the edge midpoint coordinates is set to 3, the dimension of the edge length is set to 1, the dimension of the two vertex coordinates of the edge is set to 6, the dimension of the edge concave-convex property is set to 3, the dimension of the edge dihedral angle is set to 1, and the dimension of the edge to the geometric center distance is set to 1.

[0065] Step three, training the graph neural network segmentation framework and the semantic label prediction: constructing a face adjacency graph G FA ={V FA ,E FA} for each garment model, wherein V FA represents that each mesh triangular face of the garment model is a node of the graph, E FA represents that an edge connection is established between adjacent faces; taking the face adjacency graph G FA as the input of the graph neural network and training a semantic segmentation model, and outputting semantic labels L p , each semantic label corresponding to a mesh triangular face; an optimization algorithm based on GraphCut is adopted to optimize Lp Iterative optimization is performed, comprehensively considering the label consistency and geometric continuity of adjacent facets in the energy function. The optimized semantic label L is finally obtained. p Furthermore, the region growing algorithm is used to cluster spatially adjacent triangular facets with the same label to form an independent set of cutout pieces {G} with complete geometric structure. seg In this architecture, individual fabric pieces are divided into parts with unique meanings (such as the front and back pieces, left and right sleeves, front and back collars, etc.) based on their geometric properties, material properties, and semantic tags. A lightweight attention architecture based on learnable virtual nodes is then constructed. Each virtual node starts with an empty feature vector and acts as a global communication hub, establishing bidirectional connections with all real nodes to form a central-radial interactive topology. Through training, this virtual node can learn the global feature Z. g and with graph node features Z n The fusion is performed; attention weights for the two types of features are calculated using the learnable parameter matrix W, and normalization is achieved using the softmax function to obtain: [A] n A g ] = softmax([Z n Z g Finally, an adaptive feature representation is generated through weighted fusion.

[0066] Z = A n Z n +A g Z g

[0067] Among them, Z g It is a learnable global feature, Z n A is a graph node feature. n A g These are the corresponding normalized results of the softmax function;

[0068] Step 4: Construct an energy function that includes physical properties and geometric constraints: for each piece G seg Perform least-squares conformal parameterization (LSCM) to obtain the initial two-dimensional template P. G By introducing Lagrange multipliers and incorporating geometric constraints into the optimization objective function, a four-dimensional comprehensive optimization energy function that includes both physical properties and geometric constraints is constructed.

[0069]

[0070] In the formula: ω is the weight of each energy term, and the specific values ​​of each weight are set as follows: ω boundary Take 5, ω sym Take 5, ωstretch Take 5, ω rigid Take 1; E straight is the straight line constraint energy term, E curve is the spline curve energy term, E inner is the internal symmetry energy term, E seam is the seam symmetry energy term, E stretch is the stretch energy term, E rigid is the rigid body transformation energy term. First, the initial two-dimensional pattern P G is subjected to fabric stretch constraints and rigid body transformation constraints to obtain the physically modified pattern P G ’; then based on the standard pattern topology G a of the garment type, its boundary geometric features B and symmetry axis information S are extracted, and boundary constraints and symmetry constraints are superimposed on P G ’ to finally generate a two-dimensional pattern P G ” that meets production requirements through nonlinear optimization.

[0071] Step five, solve the four-dimensional comprehensive optimization energy function containing physical properties and geometric constraints: the comprehensive optimization energy function includes E straight , E curve , E inner , E seam , E stretch , E rigid , according to their corresponding energy term weights and specific expressions, input the program for solving. Among them:

[0072]

[0073] According to the formula:

[0074]

[0075] Solve to get the m, c elements corresponding to each x, y pair to return the energy E straight (x, y).

[0076]

[0077] In the formula, N(t i ) represents the basis function of the B-spline; for the curve boundary, a 3rd order 2nd B-spline curve (k = 3) is used for boundary fitting, the length of the node vector T is set to 5, the middle node position is determined by calculating the curvature peak value of the curve, and the other nodes are determined by the midpoint of the line segment; the constraint term related to the first and second derivatives of the curve is introduced in the energy function, further improving the smoothness of the curve, and the energy of the spline curve is comprehensively represented in the following form:

[0078]

[0079] where a and b are adjustable weight terms, set to 0.5, respectively, and r (1) (t) and r (2) (t) correspond to the first and second derivatives of the B-spline curve, respectively.

[0080]

[0081] where, and are the key nodes on the two boundaries that need to be symmetrical; R represents the symmetrical point of X about the symmetry axis; for the reflection symmetry constraint between the seams, analyze the geometric characteristics of the seam line, and calculate the best fitting reflection transformation matrix M. For the two groups of key point sets X i 1 and X i 2 , the transformation M can be applied to the point set X i 1 to map X i 1 to the position of X i 2 , that is, MX i 1 = X i 2 ; similarly, by applying the inverse transformation of M to X i 2 , X i 2 returns to the position of X i 1 , that is, M -1 X i 2 = X i 1 ; when X i 1 and X i 2 cannot be accurately mapped by the transformation M and its inverse, it indicates that there is a deviation or asymmetry in the position of the key points at the seam, and the following formula is used to update and optimize the position information of the seam key points X i 1 and X i 2 :

[0082]

[0083] The symmetry energy function at the seam is defined as follows:

[0084]

[0085] where X i1′ and X i 2′ respectively, X i 1 and X i 2 the reflection symmetry point.

[0086]

[0087] where s u , s v are the stretch factors of the longitude and latitude directions derived based on the column vectors of the standard unit frame of the Jacobian matrix, and G is the UV coordinate representation of the corresponding auxiliary point. According to s u =||G u ′-G′|| and s v =||G v ′-G′||, the complex calculation of the inverse of the Jacobian matrix in the traditional parameterization method is avoided, wherein:

[0088] G u = G+(1,0)

[0089] G v = G+(0,1)

[0090] The three-dimensional relationship is established in combination with the barycentric coordinates G(αX,βX,γX):

[0091] G′=α G A′+β G B′,γ G C′

[0092]

[0093] Substituting the original formula can obtain E stretch,u (ABC) and E stretch,v (ABC).

[0094] Again by:

[0095]

[0096] wherein e represents one side of the triangle ABC, e’ is the corresponding side of the triangle (A’B’C’), and M represents the optimal rigid alignment transformation obtained by Procrustes analysis, and the comprehensive optimization energy function E pattern is obtained.

[0097] Finally, the final plane template can be obtained by minimizing the energy function, i.e. formula (1).

[0098] The embodiment of the sample-based garment template automatic generation device provided by the application can be applied to any device with data processing capability, which can be a device or apparatus such as a computer. The device embodiment can be realized by software, hardware or a combination of software and hardware. Taking software realization as an example, as a logical device, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory and running by the processor of the device with data processing capability. From the hardware level, as shown in Figure 4 The embodiment of the sample-based garment template automatic generation device provided by the application can be applied to any device with data processing capability, which can be a device or apparatus such as a computer. The device embodiment can be realized by software, hardware or a combination of software and hardware. Taking software realization as an example, as a logical device, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory and running by the processor of the device with data processing capability. From the hardware level, as shown in Figure 4 In addition to the processor, memory, network interface and non-volatile memory shown in the figure, the device with data processing capability in the embodiment can also include other hardware according to the actual function of the device with data processing capability, which will not be described here.

[0099] The implementation process of the functions and roles of each unit in the above device is specifically described in the implementation process of the corresponding steps in the above method, which will not be described here.

[0100] For the device embodiment, since it basically corresponds to the method embodiment, the relevant part can refer to the part of the method embodiment. The above described device embodiment is only schematic, and the units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, that is, they can be located in one place or distributed on multiple network units. According to the actual needs, part or all of the modules can be selected to realize the purpose of the application scheme. Those skilled in the art can understand and implement without creative labor.

[0101] The embodiment of the application further provides a computer readable storage medium, which stores a program, and the program is executed by a processor to realize the high-aesthetic garment sample automatic generation method in the above embodiment.

[0102] The computer-readable storage medium can be an internal storage unit of any data processing device as described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device of any data processing device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units and external storage devices of any data processing device. The computer-readable storage medium is used to store the computer program and other programs and data required by the data processing device, and can also be used to temporarily store data that has been output or will be output.

[0103] This invention also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the aforementioned method for automatically generating aesthetically pleasing clothing samples.

[0104] Although the invention has been illustrated and described with reference to certain preferred embodiments thereof, those skilled in the art will understand that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.

Claims

1. A method for automatically generating a garment pattern based on a sample, characterized by, The method comprises the following steps: Step one, constructing a standard garment model database containing semantic labels based on graph structure: design a kind of different types of garment mesh model, each garment type contains b different style and style but uniform structure and sewing way of garment model, form garment model set Ω = {G0, G1,..., G n}, wherein G n Represents the nth garment model; each garment model is defined by a triple G n ={V, F, L}, V represents the 3D coordinates of the model vertex, F represents the index of the mesh triangle face, and L represents the semantic label of the mesh triangle face; for each type of garment model, construct a graph-based pattern topology graph G a ={V a ,E a}, wherein the node V a represents the pattern of the garment template, and the edge E a represents the sewing relationship between the patterns; the node V a ={P, B, S}, wherein P represents the index of the pattern, B represents the geometric attribute of the pattern, and S represents the symmetry attribute of the pattern; Step two, constructing a graph neural network segmentation framework based on a face adjacency graph: converting a triangular mesh model into graph structure data, then mapping the obtained feature encoding to a unified high-dimensional embedding space through an MLP, and constructing a face classification probability prediction model based on an encoder-decoder framework of a graph transformer; the framework comprises a multi-dimensional feature extraction system, wherein the face-level features are represented by basic attributes and composite attributes, the basic geometric attributes include the centroid coordinates, the unit normal vector, the triangular face area, and the vertex coordinates, and the composite geometric attributes include the curvature, the PCA features, and the context semantic labels; the edge-level features mainly include the edge midpoint coordinates, the edge Euclidean length, and the dihedral angle of adjacent faces; Step three, training the graph neural network segmentation framework and semantic label prediction: construct a face adjacency graph G for each garment model FA = {V FA ,E FA}, V FA is each mesh triangle face node, E FA is the edge connection of adjacent faces; train the semantic segmentation model with G FA as input, and output the semantic label L p of the mesh triangle face; use the graph cut optimization algorithm to iteratively optimize L p , and the energy function comprehensively considers the label consistency and geometric continuity of adjacent faces. Based on the optimized semantic label L p ', the region growing algorithm is used to cluster to form an independent pattern set {G seg} Step four, construct the energy function containing physical properties and geometric constraints: for each patch G seg Perform least squares conformal parameterization to obtain the initial two-dimensional template P G ; construct the following energy function for optimization: E pattern = ω boundary (E straight + E curve )+ ω sym (E inner + E seam )+ ω stretch E stretch + ω rigid E rigid , where ω is the weight of each energy term, E straight is the straight line constraint energy term, E curve is the spline curve energy term, E inner is the internal symmetry energy term, E seam is the joint symmetry energy term, E stretch is the stretch energy term, E rigid is the rigid body transformation energy term; Step five, solving the four-dimensional comprehensive optimization energy function containing physical properties and geometric constraints: solving the above energy function E based on the weight and expression of each energy term pattern , by minimizing the energy function E pattern to obtain the final template output.

2. The method of claim 1, wherein, In step one, the garment model and the prototype example may differ in style, but the structural features, including the number of patterns, the sewing method, the number of edges of each pattern, and the curved or straight properties of each edge, need to be consistent.

3. The method of claim 1, wherein the method further comprises: In step one, the garment model includes a long skirt, a vest, a T-shirt, and jeans, and the 3D coordinates, indices, and labels of the triangular faces of the model mesh need to be collected as the input for semantic segmentation training.

4. The method of claim 1, wherein the method further comprises: In step one, the geometric attribute B is constructed as an edge mapping function B: E→{0,1}, E represents the set of pattern edge indices, B(e) = 0 indicates that the e-th edge is a straight edge, and B(e) = 1 indicates that the e-th edge is a curved edge; the symmetry attribute S is constructed as a set of symmetry relations S = {(p1, e1, p2, e2) | p1, p2∈P, e1, e2∈E}, where (p1, e1) and (p2, e2) form a mirror image pair of curved edges about the axis of symmetry, P is the pattern index space, and E is the edge index space; for any (p1, e1, p2, e2) ∈ S, the following conditions are satisfied: (1) when p1 = p2, there is an axisymmetric relationship inside the pattern p1, and the edges e1 and e2 are axisymmetric about the pattern; (2) when p1 ≠ p2, there is a cross-pattern seam symmetry relationship, and the edges e1 and e2 form a reflection symmetry about the two pattern seam lines.

5. The method of claim 1, wherein the method further comprises: In step three, the graph neural network segmentation framework includes a lightweight attention architecture of learnable virtual nodes: the virtual nodes are initially blank feature vectors, serving as global communication hubs and establishing bidirectional connections with all real nodes; after training, the virtual nodes learn global features Z g The graph node features Z n The attention weights are calculated through a learnable parameter matrix W, and the adaptive feature representation is generated after normalization by the softmax function.

6. The method of claim 1, wherein the method further comprises: In step four, the Lagrange multiplier method is used to optimize the spline curve: a constrained energy minimization problem is constructed for the data points and the control points, a Lagrange multiplier is introduced to form an augmented function, the control points P and the Lagrange multiplier λ are differentiated and set to zero, and the KKT equation set is derived, and the curve fitting result that satisfies the geometric constraint conditions and the physical characteristics is obtained by solving the equation set.

7. The method of claim 1, wherein the method further comprises: In step five, the sample boundary constraint includes: Straight line boundary: fit a straight line equation using all the vertices (x i ,y i ) of the boundary to get the coefficients m and c of the straight line equation: According to the fitted straight line equation, a straight line constraint is constructed, an energy function is defined as the sum of the squares of the distances from all boundary vertices to the target straight line, and the straight line fitting is realized by minimizing the energy function; Curve boundary: 3-order 2-degree B-spline curve (k=3) is used for boundary fitting, the length of node vector T is set to 5, the middle node position is determined by calculating the curvature peak value of the curve, and the other nodes are determined by the midpoint of the line segment; considering the open node vector characteristics, the number of repeated nodes at the beginning and end needs to match the order k of the B-spline, so 2 repeated nodes are added at the beginning and end of the node vector T; after completing the construction of the node vector, the boundary vertex set Q is used for interpolation fitting to solve the control points P of the B-spline curve; by constructing and minimizing an energy function which comprehensively considers the smoothness of the curve and the vertex fitting error, the positions of the control points and the boundary vertices are optimized to achieve accurate fitting: where N(t i ) represents the base function of B-spline; the constraint term related to the first and second derivatives of the curve is introduced into the energy function, which further improves the smoothness of the curve. The energy of the spline curve is comprehensively expressed in the following form: where a and β are adjustable weight terms, r (1) (t) and r (2) (t) correspond to the first and second derivatives of a B-spline curve, respectively.

8. The method of claim 1, wherein the method further comprises: In step five, the sample plate symmetry constraint includes: Axisymmetric constraint inside a single sample plate: the two end points of a straight line boundary are strictly symmetrical, and the other vertices are symmetrically distributed through the straight line constraint condition; the axisymmetric constraint of the spline curve boundary is realized through the symmetry of the control points; the energy function a is: wherein and respectively are the key nodes on the two boundaries that need to be symmetrical; R represents the symmetry point of X about the symmetry axis; Reflection symmetry between multi-piece template joints: for the reflection symmetry constraint between joints, analyze the geometric characteristics of the joint line, and calculate the best fitting reflection transformation matrix M. For the two sets of key point sets X i 1 and X i 2 , X i 1 can be mapped to X i 1 by applying the transformation M to the point set X i 2 , that is, MX i 1 = X i 2 ; similarly, by applying the inverse transformation of M to X i 2 , X i 2 returns to X i 1 , that is, M -1 X i 2 = X i 1 ; when X i 1 and X i 2 cannot be accurately mapped by the transformation M and its inverse transformation, it indicates that there is a deviation or asymmetry in the position of the key points at the joint, and the following formula is used to update and optimize the position information of the joint key points X i 1 and X i 2 : The symmetric energy function at the joint is defined as follows: wherein X i 1′ and X i 2′ are respectively X i 1 and X i 2 points of reflection symmetry.

9. The method of claim 1, wherein the method further comprises: In step five, the physical energy constraint includes: Stretching energy: when the mapping maintains the equidistance characteristic, the projection length of the standard frame should be strictly equal to the theoretical value in the parameter domain, and the stretching energy term constructed therefrom can be expressed as: The total stretching energy is the sum of each triangular part; where s u s v are derived based on the column vectors of the Jacobian matrix analyzing the standard unit frame, and G is the UV coordinate representation of the corresponding auxiliary point. Rigid transformation energy: in terms of shear and rigid deformation modeling, directly constraining the parameterized tangent angle will lead to a highly nonlinear optimization problem. Based on the ARAP parameterization idea, the shear deformation is implicitly controlled by minimizing the projection difference of the edge vector in the parameter domain and the three-dimensional space, and the energy function is defined as follows: E rigid (ABC) = ω rigid ∑(u e -u e′ ) 2 +(v e -v e′ ) 2 In the formula: e represents one side of triangle ABC, e' is the corresponding side of triangle (A'B'C'), and M represents the optimal rigid alignment transformation obtained through Procrustes analysis. Although this energy term mixes shear and isotropic stretching, its good numerical stability and optimization convergence has been verified in experiments. The total rigid energy is obtained by accumulating all triangular parts, and the stretching energy together constitutes a complete physical constraint system.

10. A sample-based garment pattern automatic generation device characterized by comprising: Comprise: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the sample-based garment pattern automatic generation method of any one of claims 1-9.

Citation Information

Cited By

  • Multi-modal sewing model generation method based on large garment model

    CN122221335A