Texture generation method, device, equipment and computer readable storage medium

In the texture generation method through the attention mechanism, the query feature map, key feature map and value feature map are used to generate the target texture feature map, which solves the problem of inaccurate texture reconstruction in traditional technology, improves the authenticity of texture parameters, and provides three-dimensional Model rendering provides a more accurate texture base.

CN114565941BActive Publication Date: 2024-09-24SENSETIME INT PTE LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210179195.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-08-24
Filing Date
2022-02-25
Publication Date
2024-09-24
Estimated Expiration
2042-02-25

AI Technical Summary

Technical Problem

In traditional technology, it is difficult to accurately obtain the texture features of a three-dimensional model based on a single image, resulting in inaccurate texture reconstruction.

Method used

The attention mechanism is used to generate the target texture feature map by querying the feature map, key feature map and value feature map, taking into account the global information of the image to be converted, and improving the authenticity of the texture parameters.

Benefits of technology

Obtaining the target texture feature map through the attention mechanism can improve the authenticity of the texture parameters in the texture feature map on the basis of a single image, providing a more accurate texture basis for subsequent rendering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114565941B_ABST
    Figure CN114565941B_ABST
Patent Text Reader

Abstract

The present disclosure provides a texture generation method, apparatus, device and computer-readable storage medium; the method comprises: obtaining a query feature map, a key feature map and a value feature map of an image to be converted; the query feature map comprises a plurality of pixels to be queried in a texture space; the key feature map is used to characterize the semantic features of the image to be converted; the value feature map is used to determine the texture parameters of each pixel to be queried in combination with an attention feature map of each pixel to be queried; the attention feature map is determined by the query feature map and the key feature map; based on an attention mechanism, the query feature map, the key feature map and the value feature map are used to generate a target texture feature map.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to texture generation technology, and in particular to a texture generation method, device, equipment and computer-readable storage medium. Background Art

[0002] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. Among them, 3D object reconstruction is an important branch of artificial intelligence. In practical engineering applications, texture data needs to be generated to reconstruct a specific 3D model. It is difficult to obtain accurate texture features based on a single image in traditional technologies. Summary of the invention

[0003] The embodiments of the present disclosure provide a texture generation method, apparatus, device and computer-readable storage medium, which can improve the authenticity of texture parameters in a texture feature map.

[0004] The technical solution of the embodiment of the present disclosure is implemented as follows:

[0005] The present disclosure provides a texture generation method, comprising:

[0006] Acquire a query feature map, a key feature map and a value feature map of the image to be converted; the query feature map includes a plurality of pixels to be queried in the texture space; the key feature map is used to characterize the semantic features of the image to be converted; the value feature map is used to determine the texture parameters of each pixel to be queried in combination with the attention feature map of each pixel to be queried; the attention feature map is determined by the query feature map and the key feature map;

[0007] Based on the attention mechanism, the query feature map, the key feature map and the value feature map are used to generate a target texture feature map; the target texture feature map includes texture parameters corresponding to each pixel to be queried.

[0008] In some embodiments, the step of generating a target texture feature map from the query feature map, the key feature map, and the value feature map based on an attention mechanism includes:

[0009] Performing feature extraction processing of different scales on the input feature map of the attention mechanism to obtain input features corresponding to multiple scales; the input feature map includes the query feature map, the key feature map and the value feature map;

[0010] Inputting the input features corresponding to each of the scales into the corresponding conversion module to obtain the output features corresponding to each of the scales;

[0011] The output features corresponding to each of the scales are fused to obtain the target texture feature map.

[0012] In some embodiments, the feature extraction process of different scales is performed on the input feature map of the attention mechanism to obtain input features corresponding to multiple scales, including:

[0013] Performing multiple downsampling processes on the input feature map to obtain input features corresponding to a preset scale;

[0014] The input features corresponding to the preset scale are subjected to multiple upsampling processes to obtain input features corresponding to multiple scales; the number of the downsampling processes is the same as the number of the upsampling processes.

[0015] In some embodiments, inputting the input features corresponding to each scale into the corresponding conversion module to obtain the output features corresponding to each scale includes:

[0016] For each of the scales, fusing the query feature graph and the position encoding of the query feature graph to obtain a first input feature;

[0017] fusing the key feature map and the position encoding of the key feature map to obtain a second input feature;

[0018] Obtain an intermediate feature map based on the first input feature, the second input feature, and the value feature map;

[0019] An output feature corresponding to the scale is determined based on the intermediate feature map and the residual network.

[0020] In some embodiments, fusing the output features corresponding to each of the scales to obtain the target texture feature map includes:

[0021] Fusion of the output features corresponding to each of the scales to obtain multi-scale output features;

[0022] Based on the multi-scale output features, the target texture feature map is determined.

[0023] In some embodiments, fusing the output features corresponding to each of the scales to obtain multi-scale output features includes:

[0024] In the order from the largest scale to the smallest scale among the multiple scales, downsampling and fusion processing is performed on the output features corresponding to each scale in turn to obtain downsampling fusion features corresponding to each scale; the downsampling fusion processing is used to fuse the output features corresponding to the scale with the downsampling fusion features obtained by the previous downsampling fusion processing to obtain downsampling intermediate features, and downsampling processing is performed on the downsampling intermediate features to obtain downsampling fusion features corresponding to the scale;

[0025] In the order from the smallest scale to the largest scale among the multiple scales, upsampling and fusion processing is performed on the output features corresponding to each scale in turn to obtain upsampling and fusion features corresponding to each scale; the upsampling and fusion processing is used to upsample the upsampling and fusion features obtained by the previous upsampling and fusion processing to obtain upsampling intermediate features, and fuse the upsampling intermediate features with the output features corresponding to the scale to obtain upsampling and fusion features corresponding to the scale;

[0026] Among them, the upsampling fusion processing of the minimum scale is used to upsample the downsampling fusion features corresponding to the minimum scale, and fuse the output features corresponding to the minimum scale to obtain the upsampling fusion features corresponding to the minimum scale; the upsampling fusion features corresponding to the maximum scale are the multi-scale output features.

[0027] In some embodiments, when the multi-scale output feature includes a pixel feature map, the value feature map includes original pixel features of the image to be converted; and determining the target texture feature map based on the multi-scale output feature includes:

[0028] The pixel feature map is used as the target texture feature map.

[0029] In some embodiments, when the multi-scale output feature includes a texture flow feature map, the value feature map includes pixel distribution features of the image to be converted; and determining the target texture feature map based on the multi-scale output feature includes:

[0030] The target texture feature map is generated based on the texture flow feature map and the image to be converted.

[0031] In some embodiments, when the multi-scale output features include a pixel feature map, a texture flow feature map, and a confidence feature map, the value feature map includes original pixel features and pixel distribution features of the image to be converted; and determining the target texture feature map based on the multi-scale output features includes:

[0032] Based on the confidence feature map, confidence information of each pixel to be queried in the texture space is determined; the confidence information includes a first confidence of the pixel to be queried corresponding to the pixel feature map and a second confidence corresponding to the texture flow feature map;

[0033] Based on the first confidence and the second confidence of each pixel to be queried, the pixel feature map and the texture flow feature map are fused to obtain the target texture feature map.

[0034] In some embodiments, the step of fusing the pixel feature map and the texture flow feature map based on the first confidence level and the second confidence level of each pixel to be queried to obtain the target texture feature map includes:

[0035] Determine a first texture parameter corresponding to each pixel to be queried based on the pixel feature map;

[0036] Based on the texture flow feature map and the image to be converted, determining a second texture parameter corresponding to each pixel to be queried;

[0037] For each pixel to be queried, weighted fusion is performed on the first texture parameter and the second texture parameter based on the first confidence level and the second confidence level to obtain the texture parameter corresponding to the pixel to be queried.

[0038] In some embodiments, the texture generation method provided in the above embodiments is implemented by a trained texture generation model, and the training process of the texture generation model includes:

[0039] Acquire a sample image, input the sample image into a texture generation model to be trained, and obtain a predicted texture image corresponding to the sample image;

[0040] Rendering the predicted texture image corresponding to the sample image to obtain a predicted rendered image corresponding to the sample image;

[0041] Determining a loss value of the texture generation model to be trained based on the sample image and the predicted rendered image;

[0042] The parameters of the texture generation model to be trained are adjusted according to the loss value to obtain a trained texture generation model.

[0043] In some embodiments, the loss value of the texture generation model to be trained includes a first loss value;

[0044] The determining the loss value of the texture generation model to be trained based on the sample image and the predicted rendering image comprises: extracting the first person feature in the sample image and the second person feature in the predicted rendering image respectively based on a pedestrian re-identification model; determining the first loss value based on a feature distance between the first person feature and the second person feature;

[0045] The step of adjusting the parameters of the texture generation model to be trained according to the loss value to obtain the trained texture generation model includes: adjusting the parameters of the texture generation model to be trained based on at least the first loss value to obtain the trained texture generation model.

[0046] In some embodiments, the loss value of the texture generation model to be trained includes a second loss value;

[0047] The method of determining the loss value of the texture generation model to be trained based on the sample image and the predicted rendering image includes: extracting the first person feature in the sample image and the second person feature in the predicted rendering image respectively based on the pedestrian re-identification model; obtaining the first segmentation result corresponding to the sample image; the first segmentation result is used to characterize the first distribution information of each human body part in the sample image; obtaining the second segmentation result corresponding to the predicted rendering image; the second segmentation result is used to characterize the second distribution information of each human body part in the predicted rendering image; for each human body part, determining the part loss value corresponding to the human body part based on the feature distance between the first part feature and the second part feature of the human body part; the first part feature is determined based on the first person feature and the first subdivision information of the human body part, and the second part feature is determined based on the second person feature and the second subdivision information of the human body part; determining the second loss value based on the part loss value corresponding to each human body part;

[0048] The step of adjusting the parameters of the texture generation model to be trained according to the loss value to obtain the trained texture generation model includes: adjusting the parameters of the texture generation model to be trained based on at least the second loss value to obtain the trained texture generation model.

[0049] In some embodiments, the loss value of the texture generation model to be trained includes a third loss value; the method further includes: obtaining a part texture image corresponding to the target human body part in the predicted texture image; obtaining a standard texture image corresponding to the target human body part; the standard texture image is a fusion image of part texture images of different characters under the target human body part; based on the structural similarity index between the part texture image and the standard texture image, determining the third loss value;

[0050] The step of adjusting the parameters of the texture generation model to be trained according to the loss value to obtain the trained texture generation model includes: adjusting the parameters of the texture generation model to be trained based on at least the third loss value to obtain the trained texture generation model.

[0051] The present disclosure provides a texture generation device, the device comprising:

[0052] An acquisition module, used to acquire a query feature map, a key feature map and a value feature map of the image to be converted; the query feature map includes a plurality of pixels to be queried in the texture space; the key feature map is used to characterize the semantic features of the image to be converted; the value feature map is used to determine the texture parameters of each pixel to be queried in combination with the attention feature map of each pixel to be queried; the attention feature map is determined by the query feature map and the key feature map;

[0053] A generation module is used to generate a target texture feature map based on an attention mechanism by combining the query feature map, the key feature map and the value feature map; the target texture feature map includes texture parameters corresponding to each pixel to be queried.

[0054] The present disclosure provides a texture generation device, including:

[0055] A memory for storing executable instructions;

[0056] The processor is used to implement the texture generation method provided by the embodiment of the present disclosure when executing the executable instructions stored in the memory.

[0057] The embodiment of the present disclosure provides a computer-readable storage medium storing executable instructions for causing a processor to execute and implement the texture generation method provided by the embodiment of the present disclosure.

[0058] The embodiments of the present disclosure have the following beneficial effects:

[0059] In the embodiment of the present disclosure, due to the use of the attention mechanism, in the process of obtaining the target texture feature map based on the query feature map, the key feature map and the value feature map, the texture parameters of each pixel to be queried in the target texture feature map can take into account the global information of the image to be converted, thereby improving the authenticity of the texture parameters in the texture feature map and providing a texture basis for the subsequent rendering of the corresponding three-dimensional network. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1A is an optional flowchart of the texture generation method provided by the embodiment of the present disclosure;

[0061] Figure 1Bis an optional feature relationship diagram of the attention mechanism provided by the embodiment of the present disclosure;

[0062] Figure 2A is an optional flowchart of the texture generation method provided by the embodiment of the present disclosure;

[0063] Figure 2B is a schematic diagram of the structure of an optional attention module provided in an embodiment of the present disclosure;

[0064] Figure 3 is an optional flowchart of the texture generation method provided by the embodiment of the present disclosure;

[0065] Figure 4 is an optional flowchart of the texture generation method provided by the embodiment of the present disclosure;

[0066] Figure 5 It is an optional flowchart of the training method of the texture generation model provided in the embodiment of the present application;

[0067] Figure 6 It is an optional flowchart of the first loss value acquisition method provided in the embodiment of the present application;

[0068] Figure 7 It is an optional flow chart of the second loss value acquisition method provided in the embodiment of the present application;

[0069] Figure 8 It is an optional flowchart of the third loss value acquisition method provided in the embodiment of the present application;

[0070] Fig. 9 is another optional flowchart of the texture generation model training method provided in the embodiment of the present application;

[0071] Fig.10 is a schematic diagram of a texture generation method based on CNN provided in an embodiment of the present disclosure;

[0072] Fig.11 is a schematic diagram of a model architecture of a texture generation model provided by an embodiment of the present disclosure;

[0073] Fig.12 is a schematic diagram of rendering results of different texture feature maps provided by an embodiment of the present disclosure;

[0074] Fig.13 is a schematic diagram of rendering results of different loss functions provided by an embodiment of the present disclosure;

[0075] Fig.14 A schematic diagram of the structure of a texture generating device provided by an embodiment of the present disclosure;

[0076] Fig.15 A hardware entity schematic diagram of a texture generation device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0077] The technical solution of the present disclosure will be described in detail below through embodiments and in conjunction with the accompanying drawings. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0078] It should be noted that in the examples of the present disclosure, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe the order or precedence of the objects. In addition, the technical solutions recorded in the embodiments of the present disclosure can be arbitrarily combined without conflict.

[0079] See also Figure 1A , Figure 1A is an optional flow chart of the texture generation method provided by the embodiment of the present disclosure, which is combined with Figure 1A The steps shown are explained.

[0080] S101. Obtain a query feature map, a key feature map and a value feature map of an image to be converted; the query feature map includes a plurality of pixels to be queried in a texture space; the key feature map is used to characterize the semantic features of the image to be converted; the value feature map is used to determine the texture parameters of each pixel to be queried in combination with an attention feature map of each pixel to be queried; the attention feature map is determined by the query feature map and the key feature map.

[0081] In some embodiments, the query feature map includes a plurality of to-be-queried pixels in the texture space, wherein each to-be-queried pixel corresponds to a vertex in the 3D human body mesh to be rendered. Figure 1B , Figure 1B is an optional feature relationship diagram of the attention mechanism provided by the embodiment of the present disclosure. Figure 1B Query features in Fig.11 The pixel point to be queried, taking the pixel point to be queried O1 marked with an asterisk in the figure as an example, the pixel point to be queried O1 corresponds to a vertex O2 in the three-dimensional human body mesh 16.

[0082] In some embodiments, the image to be converted may be semantically segmented using a two-dimensional semantic segmentation model to obtain a key feature map for representing the semantic features of the image to be converted. Figure 1B Key features in Fig.12 As shown, the key feature Fig.12 The semantic features of each region (pixel) in the image to be converted are included in , for example, Figure 1B Key features in Fig.12The image to be converted has been segmented into semantic parts such as head, torso, upper arm, arm, thigh and calf.

[0083] It should be noted that, based on the query feature map and the key feature map, the attention feature map corresponding to each pixel to be queried can be obtained. Figure 1B Attention features in Fig.13 As shown, taking the above-mentioned query pixel O1 as an example, after the correlation operation between the query feature map and the key feature map, the attention feature can be obtained. Fig.13 As shown in the attention distribution, since the query pixel O1 is located in the arm part of the 3D human body grid, the attention feature obtained is Fig.13 The attention features in are also mainly distributed in the area with the semantic feature “arm” in the key feature map.

[0084] In some embodiments, the value feature map is used to determine the texture parameter of each pixel to be queried in combination with the attention feature map of each pixel to be queried. Figure 1B , with value features Fig.14 Taking the image to be converted as an example, based on the attention feature Fig.13 The weight and value features corresponding to each pixel in Fig.14 The pixel value of each pixel in can obtain the target pixel value corresponding to the query pixel O1, and use the target pixel value as the target texture Fig.15 The texture parameters of the pixel O3 to be queried; where the target texture Fig.15 The pixel point O3 to be queried and the query feature Fig.11 The pixel to be queried corresponds to O1.

[0085] S102. Based on the attention mechanism, the query feature map, the key feature map and the value feature map are used to generate a target texture feature map; the target texture feature map includes texture parameters corresponding to each pixel to be queried.

[0086] In some embodiments, the query feature map is used as an attention mechanism The key feature map is used as the attention mechanism The value feature map is used as the attention mechanism After the attention mechanism, the target texture feature map is obtained Among them, (v, u) is the height and width of the output texture space (UV space), (h, w) is the height and width of the image to be converted, and d, c are the feature dimensions of K and V respectively.

[0087] In some embodiments, the texture parameter may be a pixel value.

[0088] In the disclosed embodiment, due to the use of the attention mechanism, in the process of obtaining the target texture feature map based on the query feature map, the key feature map and the value feature map, the texture parameters of each pixel to be queried in the target texture feature map can take into account the global information of the image to be converted, thereby improving the authenticity of the texture parameters in the texture feature map based on a single image, providing a texture basis for the subsequent rendering of the corresponding three-dimensional network.

[0089] See also Figure 2A , Figure 2A is an optional flow chart of a texture generation method provided by an embodiment of the present disclosure, based on Figure 1A , Figure 1A S102 in the above example may include S201 to S203, which will be combined with Figure 2A The steps shown are explained.

[0090] S201. Perform feature extraction processing at different scales on the input feature map of the attention mechanism to obtain input features corresponding to multiple scales; the input feature map includes the query feature map, the key feature map and the value feature map.

[0091] In some embodiments, in order to obtain the deep-level features of the query feature graph, the key feature graph and the value feature graph, at least two scales correspond to the query feature graph, the key feature graph and the value feature graph. Since the query feature graph, the key feature graph and the value feature graph of the same scale are all input features of the attention mechanism, for the convenience of description, the following embodiments will replace the query feature graph, the key feature graph and the value feature graph with the input feature graph. It should be noted that since the query feature graph is independent of the image to be converted, that is, the same query feature graph can be used for different images to be converted, therefore, the query feature graph corresponding to each scale can be pre-set, thereby avoiding repeated feature extraction of the query feature graph.

[0092] In some embodiments, the input feature map may be subjected to multiple downsampling processes in sequence to obtain input features corresponding to multiple scales, wherein each feature obtained by the downsampling process is an input feature corresponding to one scale.

[0093] In some embodiments, for input features corresponding to multiple scales, the embodiments of the present disclosure may use any number of downsampling processes, any number of upsampling processes, and any processing order, as long as the input features corresponding to the above multiple scales are obtained.

[0094] In some embodiments, S2011 can be used to implement the feature extraction processing of different scales on the input feature map of the attention mechanism to obtain input features corresponding to multiple scales:

[0095] S2011. Perform multiple downsampling processes on the input feature map to obtain input features corresponding to a preset scale; perform multiple upsampling processes on the input features corresponding to the preset scale to obtain input features corresponding to multiple scales; the number of downsampling processes is the same as the number of upsampling processes.

[0096] In some embodiments, each feature obtained by the upsampling process is an input feature corresponding to a scale.

[0097] For example, when the multiple downsampling processes are 3 downsampling processes and the multiple upsampling processes are 3 upsampling processes, for the input features of the original scale (D0), after the first downsampling process, the features of the D1 scale are obtained; for the features of the D1 scale, after the second downsampling process, the features of the D2 scale are obtained; for the features of the D2 scale, after the third downsampling process, the features of the D3 scale are obtained, that is, the input features corresponding to the above preset scales; for the features of the D3 scale, after the first upsampling process, the features of the U2 scale are obtained; for the features of the U2 scale, after the second upsampling process, the features of the U1 scale are obtained; for the features of the U1 scale, after the third upsampling process, the features of the U0 scale are obtained. Among them, the features of the U2 scale, the features of the U1 scale and the features of the U0 scale are the input features corresponding to the three scales.

[0098] It should be noted that the D0 scale and the U0 scale, the D1 scale and the U1 scale, and the D2 scale and the U2 scale may be completely identical, partially identical, or completely different. In the case of being completely identical, when the number of downsampling processes and the number of upsampling processes are both N, the scale change amount of the nth downsampling process is the same as the scale change amount of the (N-n+1)th upsampling process.

[0099] S202: Input the input features corresponding to each scale into the corresponding conversion module to obtain the output features corresponding to each scale.

[0100] In some embodiments, for each scale, the query feature map of the current scale is used as Q, the key feature map is used as K, and the value feature map is used as V, which are input into the conversion module corresponding to the current scale, and O output by the conversion module is used as the output feature corresponding to the scale.

[0101] In some embodiments, S2021 may be used to implement the above-mentioned input feature corresponding to each scale into a corresponding conversion module to obtain an output feature corresponding to each scale:

[0102] S2021. For each of the scales, fuse the query feature map and the position encoding of the query feature map to obtain a first input feature; fuse the key feature map and the position encoding of the key feature map to obtain a second input feature; obtain an intermediate feature map based on the first input feature, the second input feature and the value feature map; determine the output feature corresponding to the scale based on the intermediate feature map and the residual network.

[0103] Among them, the above output characteristics can be expressed as formula (1-1):

[0104] O∈f res-MLP (f Attn (Q+E Q , K+E K , V)) Formula (1-1);

[0105] Among them, O is the output feature, Q is the query feature map, and E Q is the position encoding of the query feature map, (Q+E Q ) is the first input feature, K is the key feature map, E K is the position encoding of the key feature map, (K+E K ) is the second input feature, V is the value feature map, f Attn is the attention module, f res-MLP It is a residual network.

[0106] See also Figure 2B , which shows a schematic diagram of the structure of an attention module, wherein the attention module can be based on the value feature map V, the first input feature (Q+E Q ) and the second input feature (K+E) of the positional encoding of the fused key feature map K ), an intermediate feature map is obtained, and then the intermediate feature is fused with the intermediate feature processed by the multi-layer perceptron (MLP), that is, the output feature O corresponding to the current scale is obtained through the residual network.

[0107] S203: Fusing the output features corresponding to each scale to obtain the target texture feature map.

[0108] In some embodiments, when the value feature map includes the original pixel features of the image to be converted, based on the attention mechanism, the output features corresponding to each scale obtained also include pixel features. Therefore, after fusing the output features corresponding to each scale, the target texture feature map can be obtained.

[0109] In some embodiments, when the value feature map includes pixel distribution features of the image to be converted, based on the attention mechanism, the output features corresponding to each scale obtained also include pixel distribution features. Therefore, after fusing the output features corresponding to each scale, it is necessary not only to fuse the output features corresponding to each scale to obtain multi-scale output features, but also to combine the multi-scale output features and the image to be converted to determine the target texture feature map. That is, the above-mentioned fusion of the output features corresponding to each scale can be achieved through S2031 to S2032 to obtain the target texture feature map.

[0110] S2031. Fusing the output features corresponding to each scale to obtain multi-scale output features.

[0111] S2032: Determine the target texture feature map based on the multi-scale output features.

[0112] In some embodiments, when the multi-scale output features include a pixel feature map, the value feature map includes original pixel features of the image to be converted; and determining the target texture feature map based on the multi-scale output features includes: using the pixel feature map as the target texture feature map.

[0113] In some embodiments, when the multi-scale output features include a texture flow feature map, the value feature map includes pixel distribution characteristics of the input image; determining the target texture feature map based on the multi-scale output features includes: generating the target texture feature map based on the texture flow feature map and the image to be converted.

[0114] In some embodiments, the multi-scale output feature may include the above-mentioned pixel feature map and texture flow feature map at the same time. For example, the multi-scale output feature is v*u*C, where (v, u) is the height and width of the output texture space (UV space), and C is the feature corresponding to each pixel point to be queried in the texture space. The disclosed embodiment may divide C into C1 and C2 to obtain a pixel feature map of v*u*C1 and a texture flow feature map of v*u*C2. Afterwards, the corresponding first texture feature map to be fused is obtained through the pixel feature map, and the corresponding second texture feature map to be fused is obtained through the texture flow feature map, and based on the preset fusion weight, the first texture feature map to be fused and the second texture feature map to be fused are fused to obtain the target texture feature map.

[0115] In the embodiments of the present disclosure, by obtaining input features of different scales (including query feature maps, key feature maps, and value feature maps) and combining corresponding conversion modules to obtain output features corresponding to each scale, the feature distribution of each feature map at different scales can be obtained, and the target texture feature map obtained based on the output features corresponding to the above-mentioned different scales can more accurately reflect the real texture information.

[0116] See also Figure 3 , Figure 3 is an optional flow chart of a texture generation method provided by an embodiment of the present disclosure, based on Figure 2A , Figure 2A S2031 in the above example may include S301 to S302, which will be combined with Figure 3 The steps shown are explained.

[0117] S301 , in the order from the largest scale to the smallest scale among the multiple scales, down-sample and fuse the output features corresponding to each scale in turn to obtain down-sample and fuse features corresponding to each scale.

[0118] In some embodiments, the downsampling fusion processing is used to fuse the output features corresponding to the scale with the downsampling fusion features obtained by the previous downsampling fusion processing to obtain downsampling intermediate features, and downsampling processing is performed on the downsampling intermediate features to obtain downsampling fusion features corresponding to the scale.

[0119] S302. In the order from the smallest scale to the largest scale among the multiple scales, upsample and fuse the output features corresponding to each scale in turn to obtain upsample and fuse features corresponding to each scale; the upsample and fuse features corresponding to the largest scale are the multi-scale output features.

[0120] In some embodiments, the upsampling fusion processing is used to perform upsampling processing on the upsampling fusion features obtained by the previous upsampling fusion processing to obtain upsampling intermediate features, and fuse the upsampling intermediate features with the output features corresponding to the scale to obtain upsampling fusion features corresponding to the scale.

[0121] In some embodiments, the upsampling fusion processing of the minimum scale is used to upsample the downsampling fusion features corresponding to the minimum scale, and fuse the output features corresponding to the minimum scale to obtain the upsampling fusion features corresponding to the minimum scale; the upsampling fusion features corresponding to the maximum scale are the multi-scale output features.

[0122] Taking the multiple scales including a first scale, a second scale and a third scale as an example, wherein, in order from the largest scale to the smallest scale, the first scale>the second scale>the third scale, the execution process of the above S301 includes: firstly performing downsampling and fusion processing on the output features corresponding to the first scale, then performing downsampling and fusion processing on the output features corresponding to the second scale, and finally performing downsampling and fusion processing on the output features corresponding to the third scale.

[0123] Among them, in the process of downsampling and fusing the output features corresponding to the first scale, since the first scale is the largest scale, there is no need to fuse the downsampling fusion features obtained by the previous downsampling fusion process. It is only necessary to downsample the output features of the first scale to obtain the downsampling fusion features corresponding to the first scale.

[0124] In the process of downsampling and fusing the output features corresponding to the second scale, the downsampling and fusion features corresponding to the first scale and the output features corresponding to the second scale are fused to obtain the downsampling intermediate features of the second scale, and then the downsampling intermediate features are downsampled to obtain the downsampling and fusion features corresponding to the second scale. Similarly, in the process of downsampling and fusing the output features corresponding to the second scale, the downsampling and fusion features corresponding to the third scale can be obtained.

[0125] At this point, S301 has completed the step of upsampling and fusing the output features corresponding to each of the scales in turn to obtain the upsampling fusion features corresponding to each of the scales, and passing the downsampling fusion features corresponding to the minimum scale (third scale) to S302.

[0126] The execution process of the above S302 includes: firstly performing upsampling and fusion processing on the output features corresponding to the third scale, then performing upsampling and fusion processing on the output features corresponding to the second scale, and finally performing upsampling and fusion processing on the output features corresponding to the first scale.

[0127] Among them, in the process of upsampling and fusing the output features corresponding to the third scale, since the third scale is the smallest scale, it is necessary to upsample the downsampled fusion features corresponding to the smallest scale (third scale) obtained in S301 to obtain the upsampled fusion features corresponding to the third scale.

[0128] In the process of upsampling and fusing the output features corresponding to the second scale, upsampling and fusing the upsampling and fusing features corresponding to the third scale is performed to obtain upsampling intermediate features corresponding to the second scale, and the upsampling intermediate features and the output features corresponding to the second scale are fused to obtain upsampling and fusing features corresponding to the second scale. Similarly, in the process of upsampling and fusing the output features corresponding to the first scale, upsampling and fusing features corresponding to the first scale can be obtained.

[0129] At this point, S302 has completed the step of performing upsampling and fusion processing on the output features corresponding to each of the scales in turn to obtain upsampling and fusion features corresponding to each of the scales, and taking the upsampling and fusion features corresponding to the maximum scale (first scale) as the multi-scale output features.

[0130] In the embodiment of the present disclosure, during the fusion process, the upsampling fusion processing or downsampling fusion processing for the current scale not only takes into account the output features obtained in the previous fusion process, but also fuses the original output features of the current scale, thereby improving the feature fusion effect, and the obtained multi-scale output features can include feature information of the output features of each scale.

[0131] See also Figure 4 , Figure 4 is an optional flow chart of a texture generation method provided by an embodiment of the present disclosure, based on Figure 2A , Figure 2A S2032 in may include S401 to S402, which will be combined Figure 4 The steps shown are explained.

[0132] S401. Based on the confidence feature map, determine the confidence information of each pixel to be queried in the texture space; the confidence information includes a first confidence of the pixel to be queried corresponding to the pixel feature map and a second confidence corresponding to the texture flow feature map.

[0133] In some embodiments, the multi-scale fusion features include not only pixel feature maps and texture flow feature maps, but also confidence feature maps that carry confidence information for each pixel to be queried. Based on the above embodiments, the multi-scale output feature is v*u*C, where (v, u) is the height and width of the output texture space (UV space), and C is the feature corresponding to each pixel to be queried in the texture space. The disclosed embodiment can divide C into C1, C2, and C3 to obtain a pixel feature map of v*u*C1, a texture flow feature map of v*u*C2, and a confidence feature map of v*u*C3.

[0134] In some embodiments, for any pixel to be queried, the confidence information of the pixel to be queried can be expressed as (K1, K2), where K1 is the first confidence of the pixel feature map corresponding to the pixel to be queried, and the higher the first confidence, the more accurate the texture parameters of the pixel to be queried restored in the pixel feature map; K2 is the second confidence of the texture flow feature map corresponding to the pixel to be queried, and the higher the second confidence, the more accurate the texture parameters of the pixel to be queried restored in the texture flow feature map.

[0135] S402: Based on the first confidence and the second confidence of each pixel to be queried, fuse the pixel feature map and the texture flow feature map to obtain the target texture feature map.

[0136] In some embodiments, for each pixel to be queried, the first confidence and the second confidence can be compared, and the texture parameters of the pixel to be queried can be determined based on the feature map (pixel feature map or texture flow feature map) corresponding to the larger confidence, and then the texture parameters of all pixels to be queried can be obtained, that is, the target texture feature map.

[0137] In some embodiments, the input feature corresponding to each scale may be input into a corresponding conversion module to obtain an output feature corresponding to each scale through S4021 to S4023:

[0138] S4021. Determine a first texture parameter corresponding to each pixel to be queried based on the pixel feature map.

[0139] S4022: Determine a second texture parameter corresponding to each pixel to be queried based on the texture flow feature map and the image to be converted.

[0140] S4023. For each pixel to be queried, perform weighted fusion on the first texture parameter and the second texture parameter based on the first confidence level and the second confidence level, respectively, to obtain a texture parameter corresponding to the pixel to be queried.

[0141] Taking the texture parameter as the pixel value as an example, for any pixel to be queried, the confidence information of the pixel to be queried is (K1, K2). Based on the pixel feature map, it can be determined that the first texture parameter corresponding to the pixel to be queried is P1. Based on the texture flow feature map and the image to be converted, it can be determined that the first texture parameter corresponding to the pixel to be queried is P2. The texture parameter corresponding to the pixel to be queried can be expressed as P=K1*P1+K2*P2.

[0142] It should be noted that the texture parameter may also be other texture data used to render the three-dimensional model, for example, at least one of brightness, material or hardness.

[0143] In the embodiment of the present disclosure, since the first texture parameter determined by the pixel feature map and the second texture parameter determined by the texture flow feature map are fused based on the first confidence and the second confidence of the pixel to be queried, the authenticity of the texture parameters of each pixel to be queried can be improved.

[0144] See also Figure 5 , Figure 5 is an optional flow chart of the training method of the texture generation model provided in the embodiment of the present application. The texture generation method in the above embodiment can be implemented by a trained texture generation model. The training process of the texture generation model can be implemented through S501 to S504. Figure 5 The steps shown are explained.

[0145] S501 , obtaining a sample image, inputting the sample image into a texture generation model to be trained, and obtaining a predicted texture image corresponding to the sample image.

[0146] S502: Render the predicted texture image corresponding to the sample image to obtain a predicted rendered image corresponding to the sample image.

[0147] S503: Determine a loss value of the texture generation model to be trained based on the sample image and the predicted rendering image.

[0148] The loss value of the texture generation model to be trained can be determined by at least one of the first loss value, the second loss value and the third loss value. The following will describe methods for obtaining different loss values.

[0149] In some embodiments, see Figure 6 , Figure 6 It is an optional flow chart of the first loss value acquisition method provided in the embodiment of the present application, including:

[0150] S601 , extracting first person features in the sample image and second person features in the predicted rendering image respectively based on a person re-identification model.

[0151] S602: Determine the first loss value based on a feature distance between the first character feature and the second character feature.

[0152] In some embodiments, see Figure 7 , Figure 7 It is an optional flow chart of the second loss value acquisition method provided in the embodiment of the present application, including:

[0153] S701 . Extract first person features in the sample image and second person features in the predicted rendered image based on a person re-identification model.

[0154] S702, obtaining a first segmentation result corresponding to the sample image; the first segmentation result is used to characterize the first distribution information of each human body part in the sample image; obtaining a second segmentation result corresponding to the predicted rendering image; the second segmentation result is used to characterize the second distribution information of each human body part in the predicted rendering image.

[0155] S703. For each of the human body parts, determine the part loss value corresponding to the human body part based on the characteristic distance between the first part feature and the second part feature of the human body part; the first part feature is determined based on the first character feature and the first subdivision information of the human body part, and the second part feature is determined based on the second character feature and the second subdivision information of the human body part.

[0156] S704: Determine the second loss value based on the part loss value corresponding to each of the human body parts.

[0157] In some embodiments, see Figure 8 , Figure 8 It is an optional flow chart of the third loss value acquisition method provided in the embodiment of the present application, including:

[0158] S801, obtaining a part texture image corresponding to a target human body part in the predicted texture image.

[0159] S802, obtaining a standard texture image corresponding to the target human body part; the standard texture image is a fusion image of texture images of parts of different people under the target human body part.

[0160] S803: Determine the third loss value based on a structural similarity index between the part texture image and the standard texture image.

[0161] S804. Adjust the parameters of the texture generation model to be trained according to the loss value to obtain a trained texture generation model.

[0162] In some embodiments, the loss value of the texture generation model to be trained can be determined based on the first loss value, the second loss value and the third loss value. The texture generation model trained by the loss function can output a texture feature map that can not only retain the detail information of the image to be converted, but also reduce the probability of artifacts. For human body parts with complex structures, a texture feature map that conforms to human characteristics can be generated.

[0163] See also Fig. 9 , Fig. 9 is another optional flow chart of the training method of the texture generation model provided in the embodiment of the present application. The texture generation method in the above embodiment can be implemented by a trained texture generation model. The training process of the texture generation model can also be implemented through S901 to S904. Fig. 9 The steps shown are explained.

[0164] S901. Obtain a sample image, input the sample image into a texture generation model to be trained, and obtain a predicted texture image corresponding to the sample image.

[0165] S902: Render the predicted texture image corresponding to the sample image to obtain a predicted rendered image corresponding to the sample image.

[0166] S903, determining a first loss value, a second loss value, and a third loss value based on the sample image, the predicted rendering image, and a standard texture image corresponding to the target human body part;

[0167] S904. Determine a total loss value of the texture generation model to be trained based on weight parameters corresponding to the first loss value, the second loss value, and the third loss value, respectively.

[0168] S905. Adjust the parameters of the texture generation model to be trained according to the total loss value to obtain a trained texture generation model.

[0169] In the disclosed embodiment, since the loss value of the texture generation model to be trained is determined based on the first loss value, the second loss value and the third loss value in the process of training the texture generation image to be trained using the sample image, the texture generation model trained by the loss function can output a texture feature map that can not only retain the detail information of the image to be converted, but also reduce the probability of artifacts. For human body parts with complex structures, a texture feature map that conforms to human characteristics can be generated.

[0170] Below, an exemplary application of the embodiment of the present disclosure in a practical application scenario will be described. For ease of understanding, the following description will be made using a human body as a three-dimensional model (mesh) to be rendered, and the present application can also be applied to other objects such as animals, buildings, and vehicles.

[0171] The disclosed embodiments can estimate 3D human body texture from a monocular image, play a key role in completing 3D human body reconstruction based on a single image, and have wide applications in virtual and augmented reality, the film industry, games, and biometrics.

[0172] In a related solution, a deep convolutional neural network (CNN) can be used to predict 3D human body texture (i.e., UV texture map) from an input image (corresponding to the image to be converted in the above embodiment). Although the related solution can obtain certain prediction results, the inventors have found through research that its network architecture has an inherent disadvantage: the convolution layer is designed as a local operation, and it is difficult to focus on the critical global information in the process of processing 3D human body texture estimation. More specifically, the input and output in this solution do not have a strictly aligned spatial correspondence, and may even have completely different shapes, such as Fig.10 As shown, the input of this scheme is Fig.10 The input image in is, and the output is Fig.10 From the texture image in the image, it can be seen that the input and output of the scheme are different not only in image size, but also in the relative positions of the human body parts in the input image and the relative positions of the human body parts in the texture image. Therefore, the present disclosure introduces global information in the process of extracting texture data, thereby obtaining a better 3D human body texture reconstruction effect.

[0173] In some embodiments, the disclosed embodiments provide a transformer module for 3D human body texture estimation based on a single image. The core of the transformer module is an attention module, which involves three input features: a query feature map, a key feature map, and a value feature map.

[0174] Among them, the size of the query feature map in the embodiment of the present disclosure is the same as the size of the output UV texture map. For example, when the size of the query feature map is 256*256*Q, the size of the corresponding UV texture map is 256*256*T, that is, the number of pixels included in the query feature map and the UV texture map is the same. Each pixel of the query feature map corresponds to a vertex of the 3D human body mesh. The value feature map includes all source pixels in the image to be converted. The key feature map includes the semantic category of each pixel in the image to be converted. For a pixel, if the semantic category of the pixel is head, the mapping relationship of the pixel from the image space to the UV space is determined, that is, it corresponds to the head area in the output UV texture map. The key feature map can be a two-dimensional segmented image obtained by segmenting the image to be converted based on the semantic segmentation model.

[0175] To understand the relationship between these three input features more intuitively, see Figure 1B , Figure 1B The basic workflow of the conversion module is shown in FIG. Figure 1BThe individual pixels marked as stars in the image are first used to associate with the key feature (Key) to generate an attention map. Based on the attention map, the source information in the value feature (Value) is effectively aggregated through weighted averaging to generate the corresponding pixels in the target texture image (UV map). Based on this conversion module, the global information of the input image can be utilized without losing details. It should be noted that for ease of understanding, Figure 1B The embodiments provided are simplified.

[0176] See also Fig.11 ,Should Fig.11 A schematic diagram of a model architecture of a texture generation model is shown. It can be seen that the input of the texture generation model includes query features B1, key features B2 and value features B3, and the output is a target texture image B4. In the texture generation model, a feature extraction module B5, a feature conversion module B6 and a feature fusion module B7 are included.

[0177] In some embodiments, the query feature B1 is a coded feature of the output UV space, and each pixel in the query feature B1 corresponds to a vertex in the three-dimensional human body mesh. To this end, the present disclosure uses the 3D coordinates of each vertex of the standard human body mesh from the SMPL model (Skinned Multi-Person Linear Model, a texture-based multi-person linear model) as the color code. The color value of each pixel in the query feature B1 can be obtained in the following manner: first, the 3D coordinates of each vertex of the standard human body mesh are mapped to the UV space, and then the coordinates are interpolated to obtain the color value of each pixel in the query feature B1. It should be noted that the query feature B1 is predetermined before network training, and the same query feature B1 is used for all input images, that is, the same UV space color coding is used.

[0178] In some embodiments, the key feature B2 is used to associate the query feature B1 and generate a corresponding attention map, which is essential for connecting the image space and the UV space. In the disclosed embodiment, the two-dimensional segmentation image of the input image (corresponding to the key feature map in the above embodiment) can be used as a key feature to characterize the mapping relationship between the input image and the UV texture map. It should be noted that, similar to the scheme of performing semantic segmentation on the converted image through a two-dimensional semantic segmentation model in the above embodiment, the above-mentioned two-dimensional segmentation image can be obtained by the semantic segmentation model in the related art.

[0179] In some embodiments, in addition to the semantic features corresponding to each pixel in the image space, the key feature B2 also uses the input image as an additional channel to provide contextual features. For example, when the size of the input image is h*w, the two-dimensional segmented image corresponding to the input image can be obtained by the semantic segmentation model, which can be h*w*Y, and used as the key feature of the input image; in other embodiments, the input image can also be added to the key feature, that is, the key feature obtained is h*w*(Y+M), where M is the image feature of the input image at each pixel, which can include position features (coordinates) and pixel features.

[0180] In some embodiments, the value feature B3 is used to represent the source information indexed by the key feature, combined with the attention map and aggregated into the UV space to generate the output. The value feature B3 may include the following cases:

[0181] (1) When the above texture generation model is used to directly output an RGB UV texture map, the value feature B3 may include the RGB feature of the input image.

[0182] (2) When the model first generates texture flow features and then generates a UV texture map by sampling the input image and the predicted flow, the value feature B3 may include the flow field of the input image, i.e., the 2D coordinates of each pixel.

[0183] In some embodiments, the value feature B3 may include both RGB features and texture flow features, that is, the fusion feature of the RGB features and the texture flow features is used as the value feature B3. Accordingly, the texture generation model may generate predicted RGB features and texture flow features simultaneously.

[0184] Transformer cannot directly use the original forms of query features, key features, and value features. For the comparison process in the attention module, the original forms of query features and key features cannot be directly used. For example, if the original form of the query feature is vu×D1 and the original form of the key feature is hw×D2, when the feature dimension D1 of the query feature is different from the feature dimension D2 of the key feature, the attention module cannot complete the above query feature and key feature calculation process (i.e., QK T ), so the query feature and the key feature should have the same feature dimension. Therefore, the embodiment of the present disclosure inputs the above query feature, key feature and value feature into the feature extraction module B5 to convert them into feature space to obtain The obtained features are then sent to the feature conversion module B6, which generates output features Where (v,u) is the height and width of the output UV texture map, (h,w) is the height and width of the input image, and d,c are the feature dimensions of K and V respectively.

[0185] It should be noted that the scheme of query features being input to the feature extraction module B5 for conversion to feature space is only for indicating the input features of the feature conversion module B6 at different scales and is only needed during the training phase. During model deployment, the scheme of query features being input to the feature extraction module B5 for conversion to feature space can be removed by pre-calculating feature encodings.

[0186] In some embodiments, the feature conversion module is the core module of the texture generation model, through which the image features can be effectively distributed to the appropriate positions of the UV texture map, and the global information exchange between the input space and the output space can be realized. Specifically, it can be written as formula (2-1):

[0187] O∈f res-MLP (f Attn (Q+E Q , K+E K , V)) Formula (2-1);

[0188] Among them, f Attn is the multi-head attention module, f res-MLP is a two-layer MLP with residual connections between its input and output. Q and E K are the sinusoidal position encodings of the query feature and key feature, respectively.

[0189] In some embodiments, the multi-head attention module f Attn Based on the single-head attention module, as shown in formula (2-2):

[0190]

[0191] in,

[0192] An important problem with the common attention formulation is the high memory complexity This makes it impossible to train with ordinary GPUs. To solve this problem, the embodiment of the present disclosure uses a low-rank strategy that removes the softmax function in formula (2-2) and approximates attention through pure matrix multiplication, which allows more efficient calculation by manipulating the order of matrix multiplication, that is, calculating Recombination Get the output result of the attention mechanism. In this way, the memory usage can be greatly reduced to Make training more feasible.

[0193] In some embodiments, the texture generation model adopts a multi-scale feature fusion solution. That is, the output features are calculated through a three-level feature pyramid instead of applying the feature conversion module B6 at a single scale. Fig.11 Taking the application of the feature conversion module B6 at three scales as an example, the texture generation model can further include a feature conversion module B61 corresponding to the first scale, a feature conversion module B62 corresponding to the second scale, and a feature conversion module B63 corresponding to the third scale, wherein the third scale is larger than the second scale, and the second scale is larger than the first scale. Accordingly, for the first two scales with larger feature spaces (i.e., the second scale and the third scale), the disclosed embodiment uses the above-mentioned low-rank strategy to reduce memory overhead; for the third scale with smaller feature space (i.e., the first scale), the disclosed embodiment uses an ordinary softmax-based attention module. Then, the obtained multi-scale output feature O is fused by the feature fusion module B7. i , i = 1, 2, 3 for fusion. This multi-scale feature fusion scheme enables the feature conversion module B6 to better utilize context information and predict high-quality human body textures in invisible areas (i.e., occluded texture areas or texture areas with complex structures).

[0194] In some embodiments, there are two possible options for the output of the texture generation model: (1) directly generating RGB texture T RGB (corresponding to the pixel feature map in the above embodiment); (2) predicting the texture flow F that can be used to generate the final texture by sampling from the input image I (corresponding to the texture flow feature map in the above embodiment). Fig.12 As shown, both strategies have their own advantages and limitations: direct synthesis of T RGB Visually pleasing 3D human textures can be reconstructed, but detail information is often lost ( Fig.12 On the other hand, texture streaming can preserve the details of the input image, but there may be serious artifacts ( Fig.12 Texture streaming rendering results in ).

[0195] In order to solve the above problems, the embodiment of the present disclosure adopts a mask fusion solution to combine the advantages of the above RGB texture map and texture stream. Therefore, the output of the feature conversion module in the embodiment of the present disclosure includes not only the RGB texture map and texture stream F, but also the mask feature (corresponding to the confidence feature map in the above embodiment), such as Fig.11 As shown in FIG. 1 , the feature fusion module B7 can not only use multiple downsampling processes and multiple upsampling processes to fuse the outputs of multiple scales output by the feature conversion module, but also perform fusion on the fused RGB texture map, texture flow and mask features. Operation is performed to obtain the final texture map (corresponding to the target texture feature map in the above embodiment). The feature fusion module B7 can execute the formula (2-3): Operation process:

[0196] T=M⊙f sample (F,I)+(1-M)⊙T RGB Formula (2-3);

[0197] Among them, f sample is a bilinear sampling function, the f sample It is used to sample from the input image I based on the texture flow F to obtain the corresponding first texture map. ⊙ represents element-by-element multiplication. The final texture T is obtained by weighted summation. RGB and f sample (F,I) is calculated. Fig.12 As shown in the mask fusion rendering results in , the mask fusion method can significantly reduce visual artifacts while preserving fine details.

[0198] In addition, learning through observation Fig.12 The inventors found that the texture generation model tends to use the sampled texture samples (F, I) as visible areas (such as human chest) and use the synthetic texture T RGB As invisible areas such as the back of a person and other areas with complex structures such as face and hands.

[0199] For the texture generation model, the embodiments of the present disclosure provide the following multiple loss functions to improve the texture generation effect of the texture generation model.

[0200] In some embodiments, the embodiments of the present disclosure may perform rendering based on the obtained target texture image to obtain a corresponding rendered texture image f r (T,D), where f r is a differentiable rendering function, and D represents the 3D human mesh and camera parameters predicted by the relevant algorithm; that is, the target texture image is rendered into a 3D human model corresponding to the human posture in the input image, and the corresponding projection image is generated through a virtual camera, and the projection image is used as the above-mentioned rendering texture image. After that, the rendering image f r (T) and the similarity between the input image I to train the texture generation model. Please note that for the sake of simplicity, the following embodiments will use f r (T) replace f r (T,D).

[0201] Therefore, in order to strengthen f r (T) and I, the embodiment of the present disclosure provides a first loss function (l ReID), as shown in formula (2-4):

[0202]

[0203] Among them, φ v Represents the vth layer of the person re-identification (ReID) network. represents L2-normalization, l ReID Corresponding to the first loss value in the above embodiment.

[0204] The inventors have found through research that although the first loss function can restore the texture information in the input image to a certain extent, the reconstructed texture usually has obvious color differences from the input image, such as Fig.13 As shown in the ReID rendering results in , this is mainly due to the normalization operation in formula (2-4). One way to solve this problem is to remove the normalization operation and use the unnormalized features as the first loss function. However, this strategy usually leads to serious artifacts in the reconstructed human texture, such as Fig.13 As shown in the denormalized ReID rendering results in , there are unnatural textures on the face and arms of the reconstructed human body. After some experiments, the inventors found that the above problem is due to the fact that the 3D human body mesh predicted by the relevant algorithm is not always accurate. The 3D human body mesh is not well aligned with the input image. Therefore, simply using the similarity between the rendered human body and the input image as the loss value for model training may have a negative impact on the training process.

[0205] To solve this problem, the disclosed embodiment also provides a second loss function based on the observation that the 2D part segmentation results are usually more accurate than the 3D part segmentation results and are better aligned with the input image. Specifically, the disclosed embodiment determines the similarity between the rendered human body and the input image for each body part, which can solve the misalignment problem caused by inaccurate 3D mesh prediction.

[0206] However, the areas of the same body part in different segmentation maps usually have different sizes and shapes. The segmentation map obtained based on three-dimensional grid rendering and the segmentation map obtained based on two-dimensional input image also have different sizes and shapes for the same body part. Therefore, the loss value calculation method of the above formula (2-4) cannot be used. The embodiment of the present disclosure determines the second loss value through a Gram matrix, wherein the Gram matrix does not need to be of the same size and shape during the calculation process. Different from the scheme of calculating the similarity of the Gram matrix based on the overall image, the embodiment of the present disclosure calculates the similarity of the Gram matrix corresponding to each body part separately for each body part, and obtains the second loss function (lStyle ), as shown in formula (2-5):

[0207]

[0208] Where M and M′ are the human body segmentation results from the 3D mesh and the 2D human body parsing model, respectively. Here, p represents the pth body part and G is the Gram matrix. The second loss value (l Style ), so that the second loss function can better focus on the low-level colors of the reconstructed texture.

[0209] like Fig.13 As shown in the ReID+Style rendering result, combined with the first loss value (l ReID ) and the second loss value (l Style ), which can achieve a color appearance closer to the input image without introducing unpleasant artifacts.

[0210] In some embodiments, although the scheme based on the first loss value and the second loss value can well reconstruct the 3D texture of most areas of the human body, it is still challenging for the texture of parts of the human body with complex structures (such as human faces). In the related art, the facial texture can be obtained by encouraging the facial texture to be close to the average facial texture of the human data set. However, this usually causes the facial color to be inconsistent with other skin, resulting in an unnatural situation. In order to solve this problem, the embodiment of the present disclosure proposes a facial structure loss l by analyzing and improving the original structural similarity index (SSIM, Structural Similarity). face As the third loss function, the third loss function can effectively promote the generation of reasonable facial texture while keeping the color of the facial texture the same as the color of the input human body.

[0211] Based on the above embodiment, the overall loss function of the above texture generation model includes the above first loss function, the second loss function and the third loss function. In some embodiments, the overall loss function can be shown as formula (2-6):

[0212] l=w1*l ReID +w2*l Style +w3*l face Formula (2-6);

[0213] Wherein, w1, w2 and w3 are hyperparameters. In some embodiments, w1=5000, w2=0.4, w3=0.01.

[0214] Fig.14 A schematic diagram of the structure of a texture generating device provided in an embodiment of the present disclosure is shown in FIG. Fig.14 As shown, the texture generating device 1400 includes:

[0215] Acquisition module 1401, used to acquire a query feature map, a key feature map and a value feature map of the image to be converted; the query feature map includes a plurality of pixels to be queried in the texture space; the key feature map is used to characterize the semantic features of the image to be converted; the value feature map is used to determine the texture parameters of each pixel to be queried in combination with the attention feature map of each pixel to be queried; the attention feature map is determined by the query feature map and the key feature map;

[0216] The generation module 1402 is used to generate a target texture feature map based on the attention mechanism by using the query feature map, the key feature map and the value feature map; the target texture feature map includes texture parameters corresponding to each pixel point to be queried.

[0217] In some embodiments, the generating module 1402 is further used to:

[0218] Performing feature extraction processing of different scales on the input feature map of the attention mechanism to obtain input features corresponding to multiple scales; the input feature map includes the query feature map, the key feature map and the value feature map;

[0219] Inputting the input features corresponding to each of the scales into the corresponding conversion module to obtain the output features corresponding to each of the scales;

[0220] The output features corresponding to each of the scales are fused to obtain the target texture feature map.

[0221] In some embodiments, the generating module 1402 is further used to:

[0222] Performing multiple downsampling processes on the input feature map to obtain input features corresponding to a preset scale;

[0223] The input features corresponding to the preset scale are subjected to multiple upsampling processes to obtain input features corresponding to multiple scales; the number of the downsampling processes is the same as the number of the upsampling processes.

[0224] In some embodiments, the generating module 1402 is further used to:

[0225] For each of the scales, fusing the query feature graph and the position encoding of the query feature graph to obtain a first input feature;

[0226] fusing the key feature map and the position encoding of the key feature map to obtain a second input feature;

[0227] Obtain an intermediate feature map based on the first input feature, the second input feature, and the value feature map;

[0228] An output feature corresponding to the scale is determined based on the intermediate feature map and the residual network.

[0229] In some embodiments, the generating module 1402 is further used to:

[0230] Fusion of the output features corresponding to each of the scales to obtain multi-scale output features;

[0231] Based on the multi-scale output features, the target texture feature map is determined.

[0232] In some embodiments, the generating module 1402 is further used to:

[0233] In the order from the largest scale to the smallest scale among the multiple scales, downsampling and fusion processing is performed on the output features corresponding to each scale in turn to obtain downsampling fusion features corresponding to each scale; the downsampling fusion processing is used to fuse the output features corresponding to the scale with the downsampling fusion features obtained by the previous downsampling fusion processing to obtain downsampling intermediate features, and downsampling processing is performed on the downsampling intermediate features to obtain downsampling fusion features corresponding to the scale;

[0234] In the order from the smallest scale to the largest scale among the multiple scales, upsampling and fusion processing is performed on the output features corresponding to each scale in turn to obtain upsampling and fusion features corresponding to each scale; the upsampling and fusion processing is used to upsample the upsampling and fusion features obtained by the previous upsampling and fusion processing to obtain upsampling intermediate features, and fuse the upsampling intermediate features with the output features corresponding to the scale to obtain upsampling and fusion features corresponding to the scale;

[0235] Among them, the upsampling fusion processing of the minimum scale is used to upsample the downsampling fusion features corresponding to the minimum scale, and fuse the output features corresponding to the minimum scale to obtain the upsampling fusion features corresponding to the minimum scale; the upsampling fusion features corresponding to the maximum scale are the multi-scale output features.

[0236] In some embodiments, when the multi-scale output feature includes a pixel feature map, the generating module 1402 is further configured to:

[0237] The pixel feature map is used as the target texture feature map.

[0238] In some embodiments, when the multi-scale output feature includes a texture flow feature map, the generating module 1402 is further configured to:

[0239] The target texture feature map is generated based on the texture flow feature map and the image to be converted.

[0240] In some embodiments, when the multi-scale output features include a pixel feature map, a texture flow feature map, and a confidence feature map, the value feature map includes original pixel features and pixel distribution features of the input image; the generating module 1402 is further used to:

[0241] Based on the confidence feature map, confidence information of each pixel to be queried in the texture space is determined; the confidence information includes a first confidence of the pixel to be queried corresponding to the pixel feature map and a second confidence corresponding to the texture flow feature map;

[0242] Based on the first confidence and the second confidence of each pixel to be queried, the pixel feature map and the texture flow feature map are fused to obtain the target texture feature map.

[0243] In some embodiments, the generating module 1402 is further used to:

[0244] Determine a first texture parameter corresponding to each pixel to be queried based on the pixel feature map;

[0245] Based on the texture flow feature map and the image to be converted, determining a second texture parameter corresponding to each pixel to be queried;

[0246] For each pixel to be queried, weighted fusion is performed on the first texture parameter and the second texture parameter based on the first confidence level and the second confidence level to obtain the texture parameter corresponding to the pixel to be queried.

[0247] In some embodiments, the texture generation method provided in the above embodiments is implemented by a trained texture generation model, and the texture generation device further includes a training module, and the training module is used to:

[0248] Acquire a sample image, input the sample image into a texture generation model to be trained, and obtain a predicted texture image corresponding to the sample image;

[0249] Rendering the predicted texture image corresponding to the sample image to obtain a predicted rendered image corresponding to the sample image;

[0250] Determining a loss value of the texture generation model to be trained based on the sample image and the predicted rendered image;

[0251] The parameters of the texture generation model to be trained are adjusted according to the loss value to obtain a trained texture generation model.

[0252] In some embodiments, the loss value of the texture generation model to be trained includes a first loss value;

[0253] The training module is also used to: extract the first person feature in the sample image and the second person feature in the predicted rendering image respectively based on the pedestrian re-identification model; determine the first loss value based on the feature distance between the first person feature and the second person feature; and adjust the parameters of the texture generation model to be trained based at least on the first loss value to obtain a trained texture generation model.

[0254] In some embodiments, the loss value of the texture generation model to be trained includes a second loss value; the training module is also used to: extract the first person feature in the sample image and the second person feature in the predicted rendering image respectively based on the pedestrian re-identification model; obtain the first segmentation result corresponding to the sample image; the first segmentation result is used to characterize the first distribution information of each human body part in the sample image; obtain the second segmentation result corresponding to the predicted rendering image; the second segmentation result is used to characterize the second distribution information of each of the human body parts in the predicted rendering image; for each of the human body parts, determine the part loss value corresponding to the human body part based on the feature distance between the first part feature and the second part feature of the human body part; the first part feature is determined based on the first person feature and the first sub-information of the human body part, and the second part feature is determined based on the second person feature and the second sub-information of the human body part; determine the second loss value based on the part loss value corresponding to each of the human body parts; adjust the parameters of the texture generation model to be trained at least based on the second loss value to obtain a trained texture generation model.

[0255] In some embodiments, the loss value of the texture generation model to be trained includes a third loss value; the training module is also used to: obtain a part texture image corresponding to the target human body part in the predicted texture image; obtain a standard texture image corresponding to the target human body part; the standard texture image is a fusion image of part texture images of different characters under the target human body part; determine the third loss value based on the structural similarity index between the part texture image and the standard texture image; and adjust the parameters of the texture generation model to be trained at least based on the third loss value to obtain a trained texture generation model.

[0256] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present disclosure, please refer to the description of the method embodiment of the present disclosure for understanding.

[0257] It should be noted that in the embodiments of the present disclosure, if the above-mentioned texture generation method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present disclosure can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a device to execute all or part of the methods of each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiments of the present disclosure are not limited to any combination of hardware and software of any target.

[0258] Fig.15 A hardware entity diagram of a texture generation device provided by an embodiment of the present disclosure, such as Fig.15 As shown, the hardware entity of the texture generation device 1500 includes: a processor 1501 and a memory 1502, wherein the memory 1502 stores a computer program that can be run on the processor 1501, and the processor 1501 implements the steps in the method of any of the above embodiments when executing the program. In some implementations, the device 1500 for collecting game coins on the game table can be the detection device described in any of the above embodiments.

[0259] The memory 1502 stores a computer program that can be run on the processor. The memory 1502 is configured to store instructions and applications executable by the processor 1501. It can also cache data to be processed or processed by the processor 1501 and each module in the texture generation device 1500 (for example, image data, audio data, voice communication data, and video communication data). This can be achieved through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0260] When the processor 1501 executes the program, the steps of any of the above texture generation methods are implemented. The processor 1501 generally controls the overall operation of the texture generation device 1500.

[0261] An embodiment of the present disclosure provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the texture generation method in any of the above embodiments.

[0262] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of the present disclosure, please refer to the description of the method embodiments of the present disclosure for understanding.

[0263] The processor may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is understandable that the electronic device that implements the functions of the processor may also be other, which is not specifically limited in the embodiments of the present disclosure.

[0264] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and the like; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0265] It should be understood that the "one embodiment" or "an embodiment" or "an embodiment of the present disclosure" or "the aforementioned embodiments" or "some embodiments" mentioned throughout the specification means that the target features, structures or characteristics related to the embodiment are included in at least one embodiment of the present disclosure. Therefore, "in one embodiment" or "in an embodiment" or "an embodiment of the present disclosure" or "the aforementioned embodiments" or "some embodiments" appearing in various places throughout the specification do not necessarily refer to the same embodiment. In addition, the features, structures or characteristics of these targets may be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present disclosure, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure. The serial numbers of the above-mentioned embodiments of the present disclosure are for description only and do not represent the advantages and disadvantages of the embodiments.

[0266] Unless otherwise specified, the detection device executes any step in the embodiments of the present disclosure, and the processor of the detection device may execute the step. Unless otherwise specified, the embodiments of the present disclosure do not limit the order in which the detection device executes the following steps. In addition, the methods used to process data in different embodiments may be the same method or different methods. It should also be noted that any step in the embodiments of the present disclosure can be independently executed by the detection device, that is, when the detection device executes any step in the above embodiments, it may not rely on the execution of other steps.

[0267] In the several embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0268] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0269] In addition, all functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may be separately configured as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0270] The methods disclosed in several method embodiments provided in the present disclosure can be arbitrarily combined without conflict to obtain new method embodiments.

[0271] The features disclosed in several product embodiments provided in the present disclosure can be arbitrarily combined without conflict to obtain new product embodiments.

[0272] The features disclosed in several method or device embodiments provided in the present disclosure may be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0273] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.

[0274] Alternatively, if the above-mentioned integrated unit of the present disclosure is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present disclosure can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a detection device, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0275] In the embodiments of the present disclosure, the descriptions of the same steps and the same contents in different embodiments can refer to each other. In the embodiments of the present disclosure, the term "and" does not affect the sequence of the steps.

[0276] The above is only an embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A texture generation method, characterized in that: include: Obtaining a query feature map, a key feature map, and a value feature map of the image to be converted; the query feature map includes a plurality of pixels to be queried in the texture space; The key feature map is used to represent the semantic features of the image to be converted; The value feature map is used to determine the texture parameter of each pixel to be queried in combination with the attention feature map of each pixel to be queried; the attention feature map is determined by the query feature map and the key feature map; Performing feature extraction processing of different scales on the input feature map of the attention mechanism to obtain input features corresponding to multiple scales; the input feature map includes the query feature map, the key feature map and the value feature map; For each of the scales, fusing the query feature graph and the position encoding of the query feature graph to obtain a first input feature; fusing the key feature map and the position encoding of the key feature map to obtain a second input feature; Obtain an intermediate feature map based on the first input feature, the second input feature, and the value feature map; Determine the output feature corresponding to the scale based on the intermediate feature map and the residual network; Fusion of the output features corresponding to each of the scales to obtain multi-scale output features; Based on the multi-scale output features, a target texture feature map is determined; the target texture feature map includes texture parameters corresponding to each pixel to be queried; Wherein, in the case where the multi-scale output features include a pixel feature map, a texture flow feature map and a confidence feature map, the value feature map includes original pixel features and pixel distribution features of the image to be converted; and determining a target texture feature map based on the multi-scale output features includes: Based on the confidence feature map, confidence information of each pixel to be queried in the texture space is determined; the confidence information includes a first confidence of the pixel to be queried corresponding to the pixel feature map and a second confidence corresponding to the texture flow feature map; Determine a first texture parameter corresponding to each pixel to be queried based on the pixel feature map; Based on the texture flow feature map and the image to be converted, determining a second texture parameter corresponding to each pixel to be queried; For each pixel to be queried, weighted fusion is performed on the first texture parameter and the second texture parameter based on the first confidence level and the second confidence level to obtain the texture parameter corresponding to the pixel to be queried.

2. The method according to claim 1, characterized in that The step of performing feature extraction processing of different scales on the input feature map of the attention mechanism to obtain input features corresponding to multiple scales includes: Performing multiple downsampling processes on the input feature map to obtain input features corresponding to a preset scale; The input features corresponding to the preset scale are subjected to multiple upsampling processes to obtain input features corresponding to multiple scales; the number of the downsampling processes is the same as the number of the upsampling processes.

3. The method according to claim 1, characterized in that The fusing the output features corresponding to each of the scales to obtain multi-scale output features includes: In the order from the largest scale to the smallest scale among the multiple scales, downsampling and fusion processing is performed on the output features corresponding to each scale in turn to obtain downsampling fusion features corresponding to each scale; the downsampling fusion processing is used to fuse the output features corresponding to the scale with the downsampling fusion features obtained by the previous downsampling fusion processing to obtain downsampling intermediate features, and downsampling processing is performed on the downsampling intermediate features to obtain downsampling fusion features corresponding to the scale; In the order from the smallest scale to the largest scale among the multiple scales, upsampling and fusion processing is performed on the output features corresponding to each scale in turn to obtain upsampling and fusion features corresponding to each scale; the upsampling and fusion processing is used to upsample the upsampling and fusion features obtained by the previous upsampling and fusion processing to obtain upsampling intermediate features, and fuse the upsampling intermediate features with the output features corresponding to the scale to obtain upsampling and fusion features corresponding to the scale; Among them, the upsampling fusion processing of the minimum scale is used to upsample the downsampling fusion features corresponding to the minimum scale, and fuse the output features corresponding to the minimum scale to obtain the upsampling fusion features corresponding to the minimum scale; the upsampling fusion features corresponding to the maximum scale are the multi-scale output features.

4. The method according to claim 1, characterized in that: In the case where the multi-scale output feature includes a pixel feature map, the value feature map includes original pixel features of the image to be converted; and determining the target texture feature map based on the multi-scale output feature includes: The pixel feature map is used as the target texture feature map.

5. The method according to claim 1, characterized in that In the case where the multi-scale output feature includes a texture flow feature map, the value feature map includes pixel distribution features of the image to be converted; and determining the target texture feature map based on the multi-scale output feature includes: The target texture feature map is generated based on the texture flow feature map and the image to be converted.

6. The method according to any one of claims 1 to 5, characterized in that: The method is implemented by a trained texture generation model, and the training process of the texture generation model includes: Acquire a sample image, input the sample image into a texture generation model to be trained, and obtain a predicted texture image corresponding to the sample image; Rendering the predicted texture image corresponding to the sample image to obtain a predicted rendered image corresponding to the sample image; Determining a loss value of the texture generation model to be trained based on the sample image and the predicted rendered image; The parameters of the texture generation model to be trained are adjusted according to the loss value to obtain a trained texture generation model.

7. The method according to claim 6, characterized in that The loss value of the texture generation model to be trained includes a first loss value; The determining the loss value of the texture generation model to be trained based on the sample image and the predicted rendering image comprises: extracting the first person feature in the sample image and the second person feature in the predicted rendering image respectively based on a pedestrian re-identification model; determining the first loss value based on a feature distance between the first person feature and the second person feature; The step of adjusting the parameters of the texture generation model to be trained according to the loss value to obtain the trained texture generation model includes: adjusting the parameters of the texture generation model to be trained based on at least the first loss value to obtain the trained texture generation model.

8. The method according to claim 6, characterized in that The loss value of the texture generation model to be trained includes a second loss value; The method of determining the loss value of the texture generation model to be trained based on the sample image and the predicted rendering image includes: extracting the first person feature in the sample image and the second person feature in the predicted rendering image respectively based on the pedestrian re-identification model; obtaining the first segmentation result corresponding to the sample image; the first segmentation result is used to characterize the first distribution information of each human body part in the sample image; obtaining the second segmentation result corresponding to the predicted rendering image; the second segmentation result is used to characterize the second distribution information of each human body part in the predicted rendering image; for each human body part, determining the part loss value corresponding to the human body part based on the feature distance between the first part feature and the second part feature of the human body part; the first part feature is determined based on the first person feature and the first subdivision information of the human body part, and the second part feature is determined based on the second person feature and the second subdivision information of the human body part; determining the second loss value based on the part loss value corresponding to each human body part; The step of adjusting the parameters of the texture generation model to be trained according to the loss value to obtain the trained texture generation model includes: adjusting the parameters of the texture generation model to be trained based on at least the second loss value to obtain the trained texture generation model.

9. The method according to claim 6, characterized in that The loss value of the texture generation model to be trained includes a third loss value; the method further includes: obtaining a part texture image corresponding to the target human body part in the predicted texture image; obtaining a standard texture image corresponding to the target human body part; the standard texture image is a fusion image of part texture images of different characters under the target human body part; based on the structural similarity index between the part texture image and the standard texture image, determining the third loss value; The step of adjusting the parameters of the texture generation model to be trained according to the loss value to obtain the trained texture generation model includes: adjusting the parameters of the texture generation model to be trained based on at least the third loss value to obtain the trained texture generation model.

10. A texture generating device, characterized in that: include: An acquisition module, used to acquire a query feature map, a key feature map and a value feature map of the image to be converted; the query feature map includes a plurality of pixels to be queried in the texture space; the key feature map is used to characterize the semantic features of the image to be converted; The value feature map is used to determine the texture parameter of each pixel to be queried in combination with the attention feature map of each pixel to be queried; the attention feature map is determined by the query feature map and the key feature map; A generation module is used to perform feature extraction processing of different scales on the input feature map of the attention mechanism to obtain input features corresponding to multiple scales; the input feature map includes the query feature map, the key feature map and the value feature map; for each scale, the query feature map and the position code of the query feature map are fused to obtain a first input feature; The key feature map and the position encoding of the key feature map are fused to obtain a second input feature; an intermediate feature map is obtained based on the first input feature, the second input feature and the value feature map; and an output feature corresponding to the scale is determined based on the intermediate feature map and a residual network; Fusion of the output features corresponding to each of the scales to obtain multi-scale output features; In the case where the multi-scale output features include a pixel feature map, a texture flow feature map, and a confidence feature map, the value feature map includes original pixel features and pixel distribution features of the image to be converted; Based on the confidence feature map, confidence information of each pixel to be queried in the texture space is determined; the confidence information includes a first confidence of the pixel to be queried corresponding to the pixel feature map and a second confidence corresponding to the texture flow feature map; based on the pixel feature map, a first texture parameter corresponding to each pixel to be queried is determined; based on the texture flow feature map and the image to be converted, a second texture parameter corresponding to each pixel to be queried is determined; for each pixel to be queried, the first texture parameter and the second texture parameter are weightedly fused based on the first confidence and the second confidence, respectively, to obtain the texture parameter corresponding to the pixel to be queried.

11. The device according to claim 10, characterized in that Also includes training modules; The training module is used to obtain a sample image, input the sample image into the texture generation model to be trained, and obtain a predicted texture image corresponding to the sample image; Rendering the predicted texture image corresponding to the sample image to obtain a predicted rendered image corresponding to the sample image; Determining a loss value of the texture generation model to be trained based on the sample image and the predicted rendered image; The parameters of the texture generation model to be trained are adjusted according to the loss value to obtain a trained texture generation model.

12. A texture generating device, characterized in that: include: A memory for storing executable instructions; A processor for executing the executable instructions stored in the memory to Obtaining a query feature map, a key feature map and a value feature map of the image to be converted; the query feature map includes a plurality of pixels to be queried in the texture space; the key feature map is used to characterize the semantic features of the image to be converted; The value feature map is used to determine the texture parameter of each pixel to be queried in combination with the attention feature map of each pixel to be queried; the attention feature map is determined by the query feature map and the key feature map; Performing feature extraction processing of different scales on the input feature map of the attention mechanism to obtain input features corresponding to multiple scales; the input feature map includes the query feature map, the key feature map and the value feature map; For each of the scales, fusing the query feature graph and the position encoding of the query feature graph to obtain a first input feature; fusing the key feature map and the position encoding of the key feature map to obtain a second input feature; Obtain an intermediate feature map based on the first input feature, the second input feature, and the value feature map; Determine the output feature corresponding to the scale based on the intermediate feature map and the residual network; Fusion of the output features corresponding to each of the scales to obtain a multi-scale output feature; wherein, when the multi-scale output feature includes a pixel feature map, a texture flow feature map, and a confidence feature map, the value feature map includes the original pixel features and pixel distribution features of the image to be converted; Based on the confidence feature map, confidence information of each pixel to be queried in the texture space is determined; the confidence information includes a first confidence of the pixel to be queried corresponding to the pixel feature map and a second confidence corresponding to the texture flow feature map; Determine a first texture parameter corresponding to each pixel to be queried based on the pixel feature map; Based on the texture flow feature map and the image to be converted, determining a second texture parameter corresponding to each pixel to be queried; For each pixel to be queried, weighted fusion is performed on the first texture parameter and the second texture parameter based on the first confidence level and the second confidence level to obtain the texture parameter corresponding to the pixel to be queried.

13. A computer-readable storage medium, characterized in that: Executable instructions are stored, wherein the executable instructions are used when executed by the processor to: Acquire a query feature map, a key feature map and a value feature map of the image to be converted; the query feature map includes a plurality of pixels to be queried in the texture space; the key feature map is used to characterize the semantic features of the image to be converted; the value feature map is used to determine the texture parameters of each pixel to be queried in combination with the attention feature map of each pixel to be queried; the attention feature map is determined by the query feature map and the key feature map; Performing feature extraction processing of different scales on the input feature map of the attention mechanism to obtain input features corresponding to multiple scales; the input feature map includes the query feature map, the key feature map and the value feature map; For each of the scales, fusing the query feature graph and the position encoding of the query feature graph to obtain a first input feature; fusing the key feature map and the position encoding of the key feature map to obtain a second input feature; Obtain an intermediate feature map based on the first input feature, the second input feature, and the value feature map; Determine the output feature corresponding to the scale based on the intermediate feature map and the residual network; Fusion of the output features corresponding to each of the scales to obtain a multi-scale output feature; wherein, when the multi-scale output feature includes a pixel feature map, a texture flow feature map, and a confidence feature map, the value feature map includes the original pixel features and pixel distribution features of the image to be converted; Based on the confidence feature map, confidence information of each pixel to be queried in the texture space is determined; the confidence information includes a first confidence of the pixel to be queried corresponding to the pixel feature map and a second confidence corresponding to the texture flow feature map; Determine a first texture parameter corresponding to each pixel to be queried based on the pixel feature map; Based on the texture flow feature map and the image to be converted, determining a second texture parameter corresponding to each pixel to be queried; For each pixel to be queried, weighted fusion is performed on the first texture parameter and the second texture parameter based on the first confidence level and the second confidence level to obtain the texture parameter corresponding to the pixel to be queried.

14. A computer program, characterized in that The invention comprises a computer readable code, and when the computer readable code is executed in an electronic device, a processor in the electronic device is used to: Obtaining a query feature map, a key feature map and a value feature map of the image to be converted; the query feature map includes a plurality of pixels to be queried in the texture space; the key feature map is used to characterize the semantic features of the image to be converted; The value feature map is used to determine the texture parameter of each pixel to be queried in combination with the attention feature map of each pixel to be queried; the attention feature map is determined by the query feature map and the key feature map; Performing feature extraction processing of different scales on the input feature map of the attention mechanism to obtain input features corresponding to multiple scales; the input feature map includes the query feature map, the key feature map and the value feature map; For each of the scales, fusing the query feature graph and the position encoding of the query feature graph to obtain a first input feature; fusing the key feature map and the position encoding of the key feature map to obtain a second input feature; Obtain an intermediate feature map based on the first input feature, the second input feature, and the value feature map; Determine the output feature corresponding to the scale based on the intermediate feature map and the residual network; Fusion of the output features corresponding to each of the scales to obtain a multi-scale output feature; wherein, when the multi-scale output feature includes a pixel feature map, a texture flow feature map, and a confidence feature map, the value feature map includes the original pixel features and pixel distribution features of the image to be converted; Based on the confidence feature map, confidence information of each pixel to be queried in the texture space is determined; the confidence information includes a first confidence of the pixel to be queried corresponding to the pixel feature map and a second confidence corresponding to the texture flow feature map; Determine a first texture parameter corresponding to each pixel to be queried based on the pixel feature map; Based on the texture flow feature map and the image to be converted, determining a second texture parameter corresponding to each pixel to be queried; For each pixel to be queried, weighted fusion is performed on the first texture parameter and the second texture parameter based on the first confidence level and the second confidence level to obtain the texture parameter corresponding to the pixel to be queried.