Virtual object generation method and apparatus, device, and storage medium
By acquiring body shape and appearance information and automatically generating virtual objects using a preset neural network, the problem of high cost and low efficiency in existing digital avatar production technologies is solved, achieving low-cost and high-efficiency virtual object generation.
Patent Information
- Application Number
- CN202310333211.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-04-08
- Filing Date
- 2023-03-30
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-03-30
AI Technical Summary
The creation of digital avatars in current technologies requires a large number of professionals and expensive equipment, and relies on neural networks with a large number of training samples, resulting in high costs and low efficiency.
By acquiring body shape and appearance information, virtual objects are automatically generated using a pre-set neural network, reducing reliance on prior information and training samples, and directly generating virtual objects that match body shape and appearance based on this information.
It enables the automatic and accurate generation of virtual objects, reducing the threshold and cost of creating digital avatars and improving the accuracy and generalization ability of the generation.
Smart Images

Figure CN116342770B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to, but is not limited to, the field of computer technology, and in particular to a method, apparatus, device, and storage medium for generating virtual objects. Background Technology
[0002] Digital avatars have become an important part of movies, games, virtual reality, and other scenarios. Their creation process includes creating the character's shape, drawing textures, assembling the skeleton, and using captured motion to drive the avatar. This process is often achieved by professionals using specialized software and equipment, or through neural networks trained on a large number of training samples. Summary of the Invention
[0003] This disclosure provides a method, apparatus, device, and storage medium for generating virtual objects.
[0004] The technical solution of this disclosure embodiment is implemented as follows:
[0005] This disclosure provides a method for generating virtual objects, the method comprising:
[0006] Obtain first prompt information and second prompt information, wherein the first prompt information represents the body shape information of the virtual object and the second prompt information represents the appearance information of the virtual object;
[0007] Based on the first prompt information, the first virtual model is determined;
[0008] The virtual object is generated based on the second prompt information and the first virtual model.
[0009] This disclosure provides a virtual object generation apparatus, the apparatus comprising:
[0010] The first determining module is used to obtain first prompt information and second prompt information, wherein the first prompt information represents the body shape information of the virtual object and the second prompt information represents the appearance information of the virtual object;
[0011] The second determining module is used to determine the first virtual model based on the first prompt information;
[0012] The first generation module is used to generate the virtual object based on the second prompt information and the first virtual model.
[0013] This disclosure provides an electronic device, including a processor and a memory, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the above-described virtual object generation method.
[0014] This disclosure provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described virtual object generation method.
[0015] In this embodiment, by acquiring first and second prompt information, where the first prompt information represents the body shape information of the virtual object and the second prompt information represents the appearance information of the virtual object; based on the first prompt information, a first virtual model is determined; and based on the second prompt information and the first virtual model, a virtual object is generated. In this way, based on the body shape and appearance information, a virtual object matching the body shape and appearance information can be automatically and accurately generated, thereby lowering the barrier to creating digital avatars. Furthermore, since virtual objects in related technologies are usually manually created by those skilled in the art based on prior information such as experience and actual application scenarios, or generated using neural networks trained with a large number of training samples, the virtual object generation method provided in this embodiment does not require prior information and / or additional training samples to train the neural network, reducing the cost of generating virtual objects.
[0016] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the specification, serve to illustrate the technical solutions of this disclosure.
[0018] Figure 1 A schematic diagram illustrating the implementation flow of a virtual object generation method provided in this embodiment of the disclosure;
[0019] Figure 2 A schematic diagram illustrating the implementation flow of a virtual object generation method provided in this embodiment of the disclosure;
[0020] Figure 3 A schematic diagram illustrating the implementation flow of a virtual object generation method provided in this embodiment of the disclosure;
[0021] Figure 4 This is a schematic diagram illustrating the implementation process of generating a target animation for a virtual object, as provided in an embodiment of this disclosure.
[0022] Figure 5A This is a schematic diagram of the composition structure of a virtual object generation system provided in an embodiment of the present disclosure;
[0023] Figure 5B This is a schematic diagram of a virtual object generation system provided in an embodiment of the present disclosure;
[0024] Figure 5CA schematic diagram illustrating the determination of a target body shape image provided in an embodiment of this disclosure;
[0025] Figure 5D A schematic diagram illustrating the generation process of a virtual object according to an embodiment of this disclosure;
[0026] Figure 5E A schematic diagram illustrating a target animation for generating a virtual object, provided in an embodiment of this disclosure;
[0027] Figure 5F A schematic diagram illustrating the determination of a first candidate pose image according to an embodiment of this disclosure;
[0028] Figure 5G A schematic diagram illustrating the determination of a second target loss value provided in an embodiment of this disclosure;
[0029] Figure 5H A schematic diagram of a pre-trained VAE network structure provided in an embodiment of this disclosure;
[0030] Figure 5I A schematic diagram illustrating the results of generating virtual objects based on various methods according to embodiments of this disclosure;
[0031] Figure 5J A schematic diagram illustrating the result of generating a first virtual model based on multiple methods according to an embodiment of this disclosure;
[0032] Figure 5K A schematic diagram illustrating the results of generating virtual objects based on various methods according to embodiments of this disclosure;
[0033] Figure 5L A schematic diagram illustrating the results of generating a target animation based on multiple methods according to embodiments of this disclosure;
[0034] Figure 6 This is a schematic diagram of the composition structure of a virtual object generation device provided in an embodiment of the present disclosure;
[0035] Figure 7 This is a schematic diagram of a hardware entity of an electronic device according to an embodiment of this disclosure. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of this disclosure clearer, the disclosure will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this disclosure. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0037] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0038] In the following description, the terms “first, second, third” are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that “first, second, third” may be interchanged in a specific order or sequence where permitted, so that the embodiments of this disclosure described herein can be implemented in an order other than that illustrated or described herein.
[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used herein is for the purpose of describing embodiments of this disclosure only and is not intended to be limiting of this disclosure.
[0040] In related technologies, digital avatars have become an important component in film, games, virtual reality, and other scenarios. Their creation process includes creating the character's shape, drawing textures, assembling the skeleton, and using captured motion to drive the avatar. Modeling and motion capture of digital avatars are crucial technologies for the film and game industries. However, these processes often require a large number of professionals using specialized software and expensive equipment, making them time-consuming and costly. Furthermore, existing neural networks are trained on large amounts of data and cannot be automatically generated based on natural language.
[0041] This disclosure provides a method for generating virtual objects. Based on body shape and appearance information, it can automatically and accurately generate virtual objects that match the body shape and appearance information, thereby lowering the barrier to creating digital avatars. Furthermore, it eliminates the need for prior information and / or additional training samples to train the neural network, reducing the cost of generating virtual objects. The virtual object generation method provided in this disclosure can be executed by an electronic device, such as a laptop, tablet, desktop computer, set-top box, mobile device (e.g., mobile phone, portable music player, personal digital assistant, dedicated messaging device, portable gaming device), or a server. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0042] The technical solutions in the embodiments of this disclosure will now be clearly and completely described with reference to the accompanying drawings.
[0043] Figure 1 This is a schematic diagram illustrating the implementation flow of a virtual object generation method provided in an embodiment of this disclosure, such as... Figure 1 As shown, the method includes steps S11 to S13:
[0044] Step S11: Obtain first prompt information and second prompt information. The first prompt information represents the body shape information of the virtual object, and the second prompt information represents the appearance information of the virtual object.
[0045] Here, the first and second prompts can be text prompts, voice prompts, etc. For example, the first prompt could be text or voice prompts describing body shape, such as tall, short, fat, thin, or cube. Similarly, the second prompt could be text or voice prompts describing appearance, such as "Avatar," "Iron Man," "Spider-Man," "rainbow," "tree," "girl in a skirt," "boy in a helmet," or "student with a backpack." The virtual object can be a two-dimensional model or a three-dimensional model. For example, a virtual object could be an Iron Man model.
[0046] In some implementations, the method for obtaining the first and second prompt information can be determined based on the actual application scenario. For example, it can be based on information input by the user through the input device of an electronic device. Alternatively, it can be based on information sent by other electronic devices. For instance, if a user inputs "tall and strong Iron Man" via a keyboard, the electronic device might parse and obtain the first prompt information as "tall and strong person" and the second prompt information as "Iron Man". In practice, those skilled in the art can determine the method for obtaining the first and second prompt information according to actual needs, and this disclosure does not limit the scope of the embodiments.
[0047] Step S12: Based on the first prompt information, determine the first virtual model.
[0048] Here, the first virtual model can be a two-dimensional model, a three-dimensional model, or a multi-dimensional model. Specifically, the first virtual model is the model that matches the first prompt information, and this first virtual model is a model with shape. For example, the first virtual model can be a three-dimensional human body model. Another example is that the first virtual model can be a two-dimensional rectangular model.
[0049] In some implementations, a body shape image matching the first prompt information can be determined, and the body shape image can be three-dimensionally modeled to obtain a first virtual model.
[0050] In some implementations, a first virtual model can be determined based on the first prompt information using a pre-set second neural network. The pre-set second neural network can be a neural network pre-trained based on a large number of training samples. These training samples can be the first prompt information. In implementation, those skilled in the art can select a suitable second neural network according to actual needs; this disclosure does not limit the scope of the implementation.
[0051] Step S13: Generate a virtual object based on the second prompt information and the first virtual model.
[0052] Here, the virtual object is a model that matches the second prompt. For example, the virtual object could be an Iron Man model. Or, for another example, it could be a shaded 3D house model.
[0053] In some implementations, a virtual object can be generated based on the second prompt information using a pre-defined third neural network. This pre-defined third neural network is used for geometric and texture rendering of the first virtual model. The pre-defined third neural network can be a neural network pre-trained based on a large number of training samples. These training samples can be body images or body models, etc. For example, the pre-defined third neural network can be a neural network optimized from the volume rendering model NeuS. NeuS is a neural network that combines the Signed Distance Function (SDF) and Neural Radiance Fields (NeRF). This optimization may include, but is not limited to, adding a random color network. Through this random color network, the texture and style of the first virtual model can be rendered more realistically. In implementation, those skilled in the art can select a suitable third neural network according to actual needs; the embodiments disclosed herein are not limited.
[0054] In this embodiment, by acquiring first and second prompt information, where the first prompt information represents the body shape information of the virtual object and the second prompt information represents the appearance information of the virtual object; based on the first prompt information, a first virtual model is determined; and based on the second prompt information and the first virtual model, a virtual object is generated. In this way, based on the body shape and appearance information, a virtual object matching the body shape and appearance information can be automatically and accurately generated, thereby lowering the barrier to creating digital avatars. Furthermore, since virtual objects in related technologies are usually manually created by those skilled in the art based on prior information such as experience and actual application scenarios, or generated using neural networks trained with a large number of training samples, the virtual object generation method provided in this embodiment does not require prior information and / or additional training samples to train the neural network, reducing the cost of generating virtual objects.
[0055] Figure 2 This is a schematic diagram illustrating the implementation flow of a virtual object generation method provided in an embodiment of this disclosure, such as... Figure 2 As shown, the method includes steps S21 to S24:
[0056] Step S21: Obtain first prompt information and second prompt information. The first prompt information represents the body shape information of the virtual object, and the second prompt information represents the appearance information of the virtual object.
[0057] The above step S21 corresponds to the aforementioned step S11. When implementing it, you can refer to the specific implementation method of the aforementioned step S11.
[0058] Step S22: Based on the preset first correspondence, determine the target body shape image that matches the first prompt information.
[0059] Here, the first correspondence represents the correspondence between the first prompt information and the body shape image.
[0060] In some implementations, a mapping table establishing the correspondence between the first prompt information and the body shape image can be pre-established and stored in an electronic device or other terminal. When the mapping table is stored in an electronic device, the electronic device determines the body shape image matching the first prompt information from the mapping table. When the mapping table is stored in another terminal, the electronic device sends the first prompt information to that terminal, causing the other terminal to determine the matching body shape image from the mapping table based on the first prompt information and return the corresponding body shape image to the electronic device.
[0061] In some implementations, a pre-defined fourth neural network can be used to establish the first correspondence.
[0062] The preset fourth neural network is a neural network pre-trained based on a large number of training samples, which are text-image pairs. For example, the preset fourth neural network can be a contrastive language-image pre-training (CLIP) model. In implementation, those skilled in the art can select a suitable fourth neural network according to actual needs, and the embodiments disclosed herein are not limited.
[0063] In some implementations, the pre-defined fourth neural network may include an image encoder E. I and a text encoder E T The encoder is trained by establishing a correspondence between pairs of images and text, and optimizing the network structure of the first model based on the loss value. The loss value can be calculated using the following formula (2-1):
[0064]
[0065] Where (·) represents the cosine distance, I represents the image, T represents the text prompt, and norm is a function used to regularize the input vector. This is achieved by minimizing... The generated image I matches the description in the text prompt T.
[0066] In some embodiments, step S22 includes steps S221 to S223, wherein:
[0067] Step S221: Determine the first distance between each body shape image in the first correspondence and the set standard body shape image.
[0068] Here, the preset standard body shape image can be input by the user or pre-stored in the electronic device. This preset standard body shape image corresponds to standard prompt information.
[0069] In some implementations, the first distance can be the similarity between the image features of the body shape image and the image features of the standard body shape image, or it can be the weighted similarity between the image features of the body shape image and the image features of the standard body shape image, or it can be determined based on a preset neural network image encoder. In implementation, those skilled in the art can choose the method for determining the first distance according to actual needs, and this disclosure does not limit this approach.
[0070] In some implementations, the first distance can be calculated using the following formula (2-2):
[0071]
[0072] Among them, M B [i] represents the image of the i-th individual, M n Represents a standard body shape image. E represents the mesh renderer. I This indicates an image encoder.
[0073] Step S222: Determine the second distance between the first prompt information and the standard prompt information corresponding to the standard body shape image.
[0074] In some implementations, the second distance can be the similarity between the text features of the first prompt message and the text features of the standard prompt message, or it can be the weighted similarity between the text features of the first prompt message and the text features of the standard prompt message, respectively. Alternatively, it can be determined by a text encoder based on a preset neural network. In practice, those skilled in the art can choose the method for determining the second distance according to actual needs, and this disclosure does not limit this approach.
[0075] In some implementations, the second distance can be calculated using the following formula (2-3):
[0076] Δf T =E T (t shape )-E T (t n (2-3);
[0077] Among them, t shape Indicates the first prompt message, t n E indicates the standard prompt message. T This indicates a text encoder.
[0078] Step S223: Determine the target body shape image based on each first distance and second distance.
[0079] In some implementations, each first distance can be scored based on a second distance to obtain at least one score, and the target body shape image can be determined based on this at least one score. For example, when the score represents the difference between the first distance and the second distance, the body shape image corresponding to the first distance with the smallest score is taken as the target body shape image. As another example, when the score represents the similarity between the first distance and the second distance, the body shape image corresponding to the first distance with the largest score is taken as the target body shape image. In implementation, those skilled in the art can use appropriate scoring rules to determine the target body shape image according to the actual situation, and the embodiments disclosed herein are not limited thereto.
[0080] In practice, the score can be calculated using the following formula (2-4):
[0081] s i =1-norm(Δf) I )·norm(Δf T (2-4);
[0082] Where (·) represents the cosine distance, and norm is a function used to regularize the input vector.
[0083] Step S23: Based on the target body shape image, perform 3D modeling to generate the first virtual model.
[0084] Here, the first virtual model can be a three-dimensional model of the target body shape image, or a three-dimensional model generated after converting the target body shape image.
[0085] In some implementations, a first virtual model can be generated by performing 3D modeling of the target body image based on a preset fifth neural network. This preset fifth neural network may include, but is not limited to, a skinned multi-person linear model (SMPL), SMPL-X, and generative adversarial networks (GANs). In practice, those skilled in the art can choose a suitable fifth neural network to perform 3D modeling of the target body image according to the actual situation; this disclosure does not impose limitations.
[0086] Step S24: Generate a virtual object based on the second prompt information and the first virtual model.
[0087] The above step S24 corresponds to the aforementioned step S13. When implementing it, you can refer to the specific implementation method of the aforementioned step S13.
[0088] In this embodiment, a target body shape image matching the body shape information is determined based on a first correspondence, and a three-dimensional model is generated based on the target body shape image to produce a first virtual model; a virtual object is generated based on the first virtual model and the appearance information. Thus, based on the first correspondence, a target body shape image matching the body shape information can be obtained, thereby further improving the accuracy of the virtual object; simultaneously, a pre-trained neural network is used to directly perform three-dimensional modeling on the target body shape image, achieving zero-sample generation capability. Compared to traditional methods, no prior information and / or additional training data are required to train the neural network, reducing overfitting to prior information and / or the learning during neural network training. This improves the ability to recognize body shape and appearance cues not considered in the prior information and / or body shape and appearance cues not involved in the neural network training process, thereby improving the generalization ability of body shape and appearance cues recognition.
[0089] Figure 3 This is a schematic diagram illustrating the implementation flow of a virtual object generation method provided in an embodiment of this disclosure, such as... Figure 3 As shown, the method includes steps S31 to S36:
[0090] Step S31: Obtain first prompt information and second prompt information. The first prompt information represents the body shape information of the virtual object, and the second prompt information represents the appearance information of the virtual object.
[0091] Step S32: Based on the first prompt information, determine the first virtual model.
[0092] Steps S31 to S32 above correspond to steps S11 to S12 above. When implementing them, you can refer to the specific implementation of steps S11 to S12 above.
[0093] Step S33: For each of the at least one first observation viewpoints, determine the first observation image of the first virtual model in the first observation viewpoint.
[0094] Here, at least one first observation viewpoint can be an observation viewpoint determined based on at least one camera. Each first observation image is an image obtained after observing the first virtual model from each observation viewpoint. The first observation image is a two-dimensional image that includes at least one pixel.
[0095] Step S34: For each first observation image, use a preset first neural network to update the first observation image at least once to obtain a second observation image.
[0096] Here, the first neural network can be a pre-trained neural network. For example, the pre-trained first neural network can be a neural network NeuS N′ optimized from NeuS. In some embodiments, the first neural network includes a distance neural network f(p), a first color network c(p), and a second color network c. c (p). Among them, c c (p) is a random color network. f(p) and c(p) are responsible for reconstructing the first virtual model. f(p) and c c (p) is responsible for rendering the textures and styles of the reconstructed model.
[0097] Step S35: Determine the first target loss value based on each second observation image and the second cue information.
[0098] In some implementations, the first target loss value can be determined based on the first observed image, the second observed image, and the second prompt information.
[0099] In some implementations, the second prompt information may include facial prompt information and back prompt information.
[0100] Step S36: If the first target loss value meets the first preset condition, render the first virtual model based on each second observation image to generate a virtual object.
[0101] Here, the first preset condition may include, but is not limited to, the first target loss value being less than a threshold, or the first target loss value converging. In implementation, those skilled in the art can determine the first preset condition independently according to actual needs; this disclosure does not impose such limitations.
[0102] In this embodiment, by acquiring first prompt information and second prompt information, where the first prompt information represents the body shape information of the virtual object and the second prompt information represents the appearance information of the virtual object; based on the first prompt information, a first virtual model is determined; for each of the at least one first observation viewpoint, a first observation image of the first virtual model is determined at the first observation viewpoint; for each first observation image, a preset first neural network is used to update the first observation image at least once to obtain a second observation image; based on each second observation image and the second prompt information, a first target loss value is determined; when the first target loss value satisfies a first preset condition, the first virtual model is rendered based on each second observation image to generate the virtual object. In this way, the first virtual model is reconstructed directly using a pre-trained first neural network, achieving zero-sample generation capability. Compared with traditional methods, it does not require prior information and / or additional training samples to train the model, reducing overfitting to prior information and / or learning during neural network training. This improves the ability to recognize prompts not considered in prior information and / or prompts not covered during neural network training, thereby improving the generalization ability of prompt recognition. At the same time, by using the optimized neural network to optimize the first virtual model based on appearance information, the uniformity of texture rendering can be improved, thereby further improving the accuracy of the generated virtual objects.
[0103] In some embodiments, the method further includes steps S37 to S39, wherein:
[0104] Step S37: If the first target loss value does not meet the first preset condition, update the network parameters of the first neural network based on the first target loss value.
[0105] Here, the network parameters of the first neural network may include, but are not limited to, the network parameters of the distance neural network, the first color network, and the second color network. In some embodiments, the method for updating the network parameters of the first neural network may be determined according to the actual situation, and may include, but is not limited to, at least one of gradient descent, Newton's momentum method, etc., and is not limited here.
[0106] Step S38: Using the updated first neural network, update each first observation image at least once to obtain the updated second observation image;
[0107] Step S39: Based on each updated second observation image and second cue information, determine the updated first target loss value.
[0108] Steps S38 to S39 above correspond to steps S34 to S35 above. When implementing them, you can refer to the specific implementation of steps S34 to S35 above.
[0109] In this embodiment of the disclosure, if the first target loss value does not meet the first preset condition, the network parameters of the first neural network can be updated again, and based on the first neural network after the next update, each first observation image can be updated at least once, so that the virtual object can be obtained more accurately through continuous iterative updates.
[0110] In some embodiments, the first observation viewpoint includes a first observation point and at least one first observation direction corresponding to the first observation point; the first observation image includes at least one first pixel; each first pixel corresponds to a first intersection point on the first virtual model; each first intersection point represents the first intersection point between a straight line extending from the first observation point along a first observation direction and the first virtual model; step S34 includes steps S341 to S343, wherein:
[0111] Step S341: Based on the first observation point and each first observation direction, determine at least one first spatial point corresponding to each first observation direction.
[0112] Here, the first spatial point is a spatial point on a ray along the first observation direction based on the first observation point.
[0113] Step S342: For each first spatial point in each first observation direction, use a preset first neural network to determine the first distance value between the first intersection point corresponding to the first observation direction where the first spatial point is located and the first spatial point, and determine the first color value obtained by observing the first virtual model in the first spatial point according to the first observation direction.
[0114] Here, each first distance value can be determined based on the distance neural network of the first neural network; each first color value can be determined based on the first color network of the first neural network. For example, each first distance value f(p(t)) can be determined based on f(p) in N′, and c in N′ can be determined based on f(p) in N′. c (p), determine each first color value c c (p(t),v).
[0115] Step S343: Based on the first distance value and the first color value corresponding to each first spatial point, update the first observation image at least once to obtain the second observation image.
[0116] In some implementations, for each first observation direction, the color value of the first pixel corresponding to the observation direction can be determined based on the first weight value and the first color value of each first spatial point in the first observation direction, and the first pixel can be updated based on the color value of the first pixel, so as to achieve at least one update of the first observation image.
[0117] In some implementations, the color value of the first pixel may include, but is not limited to, the cumulative value between each first weight value and each first color value, the cumulative value after weighting each first weight value and each first color value, the mean / variance of each first color value, and the mean / variance after weighting each first color value. In implementation, those skilled in the art can determine the color value of the first pixel according to actual needs, and this disclosure does not limit this method.
[0118] In some implementations, the color value of the first pixel can be calculated based on the following formula (3-1):
[0119]
[0120] Where o is the first observation point, v is the first observation direction, p(t) refers to the first spatial point, w(t) represents the first weight value of the first spatial point, and c c (p(t),v) represents the first color value of the first spatial point.
[0121] In some implementations, a first target loss value can be calculated based on a first distance value and a first color value, and the first observation image can be updated at least once based on the first target loss value and a first preset condition. If the first target loss value does not meet the first preset condition, the first observation image is updated at least once. If the first target loss value meets the first preset condition, the first virtual model is rendered based on the second observation image.
[0122] In some embodiments, step S343 includes steps S3431 to S3432, wherein:
[0123] Step S3431: For each first observation direction, determine the first weight value of each first spatial point based on the first distance value corresponding to each first spatial point in the first observation direction.
[0124] In some implementations, the first weight value may be the ratio between the first distance value of the first spatial point and the sum of the first distance values of all first spatial points along the first observation direction; it may also be the ratio between the first distance value of the first spatial point and the sum of the first distance values of all first spatial points along the first observation direction after weighting; or it may be the average of the first distance values of all first spatial points along the first observation direction, etc. In implementation, those skilled in the art can determine the first weight value according to actual needs, and this disclosure does not limit the specific method used.
[0125] In some implementations, the first weight value can be calculated based on the following formula (3-2):
[0126]
[0127] Where, φ s is the logistic density distribution, f is the distance neural network, and p(t) and p(u) refer to the first spatial point.
[0128] Step S3432: Based on the first weight value and the first color value of each first spatial point, update at least one first pixel in the first observation image to obtain the second observation image.
[0129] In some implementations, updating the first pixel may include, but is not limited to, updating the color value of the first pixel.
[0130] In some implementations, the color value of the first pixel may include, but is not limited to, the cumulative value of each first weight value and each first color value, the cumulative value of each first weight value and each first color value after weighting, the mean / variance of each first color value, the mean / variance of each first color value after weighting, the product of the cumulative value of the distance gradient between each first weight value and each first distance value and the first color value, or the product of the cumulative value of the distance gradient between each first weight value and each first distance value and the first color value after weighting, etc. In implementation, those skilled in the art can determine the method of color value of the first pixel according to actual needs, and the embodiments disclosed herein are not limited to this.
[0131] In some implementations, the color value of each first pixel can be calculated based on the following formula (3-3):
[0132] C shade (o,v)=A+D×n(o,v)·l·C c (o,v) (3-3);
[0133] in, It is randomly sampled from a uniform distribution, D is 1-A, which is the diffuse reflectance value, l represents the sampling illumination direction, and Cc (o,v) represents the first color value, and n(o,v) represents the distance gradient between each first spatial point p(t) and the first intersection point corresponding to the first observation direction v.
[0134] In some implementations, the distance gradient value can be calculated based on the following formula (3-4):
[0135]
[0136] in, Let f denote the gradient of the function f, and w(t) denote the first weight value.
[0137] In some embodiments, step S35 includes steps S351 to S353, wherein:
[0138] Step S351: For each first observation image, determine the first sub-loss value based on the second prompt information and the first observation image.
[0139] Here, the first sub-loss value can be determined based on parameters such as the first weight value, distance gradient value, and second prompt information for each first spatial point.
[0140] In some embodiments, step S351 includes steps S3511 to S3512, wherein:
[0141] Step S3511: Determine the third observation image based on the first observation image.
[0142] In some implementations, each first pixel in the first observation image can be updated based on the first weight value and distance gradient value of each first spatial point, and the updated first observation image can be used as the third observation image.
[0143] In some embodiments, step S3511 includes steps S361 to S362, wherein:
[0144] Step S361: For each first observation direction, determine the distance gradient value of each first spatial point based on the first distance value corresponding to each first spatial point in the first observation direction.
[0145] Here, the distance gradient value can be calculated using the above formula (3-4).
[0146] Step S362: Based on the first weight value and distance gradient value of each first spatial point, update at least one first pixel in the first observation image to obtain the third observation image.
[0147] In some implementations, updating the first pixel may include, but is not limited to, updating the color value of the first pixel.
[0148] In some implementations, the color value of the first pixel may include, but is not limited to, the cumulative value of each first weight value and each distance gradient value, or the weighted cumulative value of each first weight value and each distance gradient value. In practice, those skilled in the art can determine the method of the color value of the first pixel according to actual needs, and this disclosure does not limit such methods.
[0149] In some implementations, the color value of each first pixel can be calculated based on the following formulas (3-5):
[0150] C gray (o,v)=A+D×n(o,v)·l (3-5);
[0151] in, It is randomly sampled from a uniform distribution, D is 1-A, which is the diffuse reflectance value, l represents the sampling illumination direction, and n(o,v) represents the distance gradient value between each first spatial point p(t) and the first intersection point corresponding to the first observation direction v.
[0152] Step S3512: Determine the first sub-loss value based on the second prompt information and the third observed image.
[0153] In some implementations, the first sub-loss value can be the similarity between the text features of the second prompt message and the image features of the third observed image, or it can be the weighted similarity between the text features of the second prompt message and the image features of the third observed image. In implementation, those skilled in the art can determine the method of the first sub-loss value according to actual needs, and this disclosure does not limit this approach.
[0154] In some implementations, the first sub-loss value can be calculated using the following formulas (3-6):
[0155]
[0156] Among them, I g Represents the third observed image, t app This indicates the second prompt message. The similarity between the third observed image and the second prompt information can be calculated using the formula (2-1) above during implementation.
[0157] Step S352: For each second observation image, determine the second sub-loss value based on the second prompt information and the second observation image.
[0158] In some implementations, the second sub-loss value can be the similarity between the text features of the second prompt message and the image features of the second observed image, or it can be the weighted similarity between the text features of the second prompt message and the image features of the second observed image. In practice, those skilled in the art can determine the method of the second sub-loss value according to actual needs, and this disclosure does not limit this approach.
[0159] In some implementations, the second sub-loss value can be calculated using the following formula (3-7):
[0160] The similarity can be calculated using the formula (2-1) above during implementation.
[0161] Among them, I c Represents the second observed image, t app This indicates the second prompt message. Step S353, which represents the relationship between the second observed image and the second prompt information, involves determining the first target loss value based on each first sub-loss value and each second sub-loss value.
[0162] Here, the first target loss value may include, but is not limited to, the sum of each first sub-loss value and each second sub-loss value, or the sum after weighting each first sub-loss value and each second sub-loss value. In implementation, those skilled in the art can determine the method of the first target loss value according to actual needs, and the embodiments disclosed herein are not limited thereto.
[0163] In some implementations, the first loss value of the target can be calculated using the following formula (3-8):
[0164]
[0165] in, This represents the first sub-loss value. This represents the second sub-loss value.
[0166] In this embodiment, a target first loss value is determined based on a first sub-loss value and a second sub-loss value. This improves the accuracy of the target first loss value, facilitating the accurate identification of virtual objects that match the appearance cues.
[0167] In some implementations, the first target loss value further includes a first reconstruction loss value for reconstructing the first virtual model. This first reconstruction loss value may include, but is not limited to, color reconstruction loss, regularization loss, and masking loss.
[0168] In some implementations, the first reconstruction loss value may include, but is not limited to, the sum of the color reconstruction loss value, the regularization loss value, and the mask loss value, or the sum of the color reconstruction loss value, the regularization loss value, and the mask loss value after weighting them respectively. In implementation, those skilled in the art can determine the method of the first reconstruction loss value according to actual needs, and this disclosure does not limit this approach.
[0169] In some implementations, the first reconstruction loss value can be calculated using the following formula (3-9):
[0170]
[0171] in, It is image rendering and multi-view rendering. The color reconstruction loss value between. It is the regularization loss value of regularization f(p). It is a type of mask loss.
[0172] In some implementations, the color reconstruction loss value can be the average of the predicted color value and the actual measured color value of the ray corresponding to each observation direction, or the weighted average of the predicted color value and the actual measured color value of the ray corresponding to each observation direction. In practice, those skilled in the art can determine the method of color reconstruction loss value according to actual needs, and this disclosure does not limit such methods.
[0173] In some implementations, the following formula (3-10) can be used to calculate the result.
[0174]
[0175] in, It is a function. C represents the predicted color value for the k-th ray. k These are the color values obtained from actual measurements.
[0176] In some implementations, the predicted color values may include, but are not limited to, the cumulative value between each first weight value and each second color value, the cumulative value after weighting each first weight value and each second color value, the mean or variance of each second color value, and the mean or variance after weighting each second color value. The second color value may be determined by a second color network based on the first neural network. For example, each second color value c(p(t),v) is determined based on c(p) in N′. In implementation, those skilled in the art can determine the method of predicting color values according to actual needs, and this disclosure does not limit this approach.
[0177] In some implementations, the following formula (3-11) can be used to calculate the result.
[0178]
[0179] Where o is the first observation point, v is the first observation direction, p(t) refers to the first spatial point, c(p(t),v) represents the second color value at point p(t) from the observation perspective of v, and w(t) represents the first weight value of the first spatial point, which can be calculated by the above formula (3-2).
[0180] In some implementations, the regularization loss value can be the average of the gradient values at each sampling point on the ray corresponding to each observation direction, or it can be the weighted average of the gradient values at each sampling point on the ray corresponding to each observation direction. In implementation, those skilled in the art can determine the method of regularization loss value according to actual needs, and this disclosure does not limit such determination.
[0181] In some implementations, the following formula (3-12) can be used to calculate the result.
[0182]
[0183] in, This represents the gradient of the function f. Let f represent the gradient value of function f at the i-th sampling point on the k-th ray, where k represents the k-th ray, i represents the i-th sampling point on the k-th ray, n represents the sampling size, and m represents the sampling batch size.
[0184] In some implementations, the mask loss value can be the difference between the weights of all sampling points on the ray corresponding to each observation direction and a preset mask value, the weighted difference between the weights of all sampling points on the ray corresponding to each observation direction and the preset mask value, or the square of the difference between the weights of all sampling points on the ray corresponding to each observation direction and the preset mask value, etc. In implementation, those skilled in the art can determine the method of mask loss value according to actual needs, and this disclosure does not limit this method.
[0185] In some implementations, the following formula (3-13) can be used to calculate the result.
[0186]
[0187] in, M represents the sum of the weights of all sampling points on the k-th ray. k ∈{0,1} is an optional mask value.
[0188] In some implementations, the following formula (3-14) can be used to calculate the result.
[0189]
[0190] Where, φ s It is a logistic density distribution, f is a distance neural network, p(t) i ) represents the i-th sampling point.
[0191] In this embodiment, a target first loss value is determined based on a first reconstruction loss value, each first sub-loss value, and each second sub-loss value. This improves the accuracy of the target first loss value, enabling a more accurate acquisition of virtual objects that match the appearance cues.
[0192] In some embodiments, step S36 includes steps S371 to S372, wherein:
[0193] Step S371: Perform augmentation processing on each of the second observation images.
[0194] Here, the augmentation processing may include, but is not limited to, at least one of the following: background occlusion processing, scaling processing, cropping processing, size adjustment processing, filling processing, flipping processing, color dithering processing, grayscale processing, Gaussian blur processing, and random erasing processing of the second observed image. In implementation, those skilled in the art can apply appropriate augmentation processing to the first sub-image to obtain the second sub-image according to the actual situation, and the embodiments disclosed herein are not limited to this.
[0195] Step S372: Render the first virtual model based on each second observation image after augmentation to generate a virtual object.
[0196] In this embodiment of the disclosure, by performing augmentation processing on the second observation image, the fourth neural network can focus more on the foreground object and prevent the generation of random floating volumes, thereby further improving the robustness brought about by the optimization process.
[0197] Figure 4 This is a schematic diagram illustrating the implementation flow of a method for generating target animations of virtual objects according to an embodiment of this disclosure, as shown below. Figure 4 As shown, the method includes steps S41 to S45:
[0198] Step S41: Obtain first prompt information and second prompt information. The first prompt information represents the body shape information of the virtual object, and the second prompt information represents the appearance information of the virtual object.
[0199] Step S42: Based on the first prompt information, determine the first virtual model.
[0200] Step S43: Generate a virtual object based on the second prompt information and the first virtual model.
[0201] Steps S41 to S43 above correspond to steps S11 to S13 above. When implementing them, you can refer to the specific implementation of steps S11 to S13 above.
[0202] Step S44: Obtain the third prompt information, which represents the animation information of the virtual object.
[0203] Here, the third prompt can be text prompts, voice prompts, etc. For example, the third prompt could be text prompts indicating the animation such as running, sitting, or getting angry. Or, the third prompt could be voice prompts indicating the animation such as raising an arm, playing ball, or drinking water. The virtual object can be a two-dimensional model or a three-dimensional model. For example, a virtual object could be an Iron Man model.
[0204] In some implementations, the method for obtaining the third prompt information can be determined based on the actual application scenario. For example, it can be obtained based on information input by the user through the input device of the electronic device. Or, it can be obtained based on information sent by other electronic devices.
[0205] In some implementations, the first, second, and third prompt messages can be acquired simultaneously or separately.
[0206] For example, if a user enters "a tall and strong Iron Man is running" on the keyboard, the electronic device will interpret the input and obtain the following prompts: the first prompt is "a tall and strong person", the second prompt is "Iron Man", and the third prompt is "running".
[0207] For example, if a user first inputs the voice message "fat Spider-Man," the electronic device will parse it and obtain the first prompt as "fat person" and the second prompt as "Spider-Man." Then, if the user inputs "drink water" via the keyboard, the third prompt will be "drink water." In implementation, those skilled in the art can determine the method for obtaining the third prompt based on actual needs, and this disclosure does not limit this approach.
[0208] Step S45: Based on the third prompt information, generate the target animation of the virtual object.
[0209] Here, the target animation is the animation that matches the third cue message. For example, the target animation could be an animation of Iron Man running. Or, for another example, an animation of building a 3D house.
[0210] In some implementations, a target animation of a virtual object can be generated based on third prompt information using a preset sixth neural network. This preset sixth neural network can be a neural network pre-trained based on a large number of training samples. The training samples can be animations, etc. For example, the preset sixth neural network can be a variational autoencoder (VAE). In implementation, those skilled in the art can select a suitable sixth neural network according to actual needs; this disclosure does not limit the scope of the embodiments.
[0211] In some implementations, the sixth neural network includes a motion encoder (E). motion ), reparameterization module and motion decoder (D motion These three parts. Based on the trained sixth neural network, the target animation of the virtual object is generated.
[0212] In this embodiment, by acquiring first and second prompt information, where the first prompt information represents the body shape information of the virtual object and the second prompt information represents the appearance information of the virtual object; based on the first prompt information, a first virtual model is determined; based on the second prompt information and the first virtual model, a virtual object is generated; a third prompt information is acquired, where the third prompt information represents the animation information of the virtual object; and based on the third prompt information, a target animation of the virtual object is generated. In this way, based on the animation prompt information, a target animation matching the animation prompt information can be automatically and accurately generated, thereby lowering the threshold for creating digital animations; simultaneously, no prior information and / or additional training data are required to train the model, reducing the possibility of overfitting to prior information and / or learning during model training, thus improving the ability to recognize prompt information not considered in the prior information and / or animation prompt information not involved in the model training process, thereby improving the generalization ability of animation prompt information recognition.
[0213] In some implementations, the training process of the sixth neural network includes steps S471 to S474, wherein:
[0214] Step S471: Use the encoder of the sixth neural network to encode the animation samples to obtain the encoded animation.
[0215] In some implementations, encoder E motion Includes a projection layer (E) p ), a position embedding layer (φ), several transcoder layers (TransEncoder), and an output layer (E). o At this point, E can be defined using the following formula (4-1). motion :
[0216]
[0217] Where, Θ + It's an animation sample, E p It is a fully connected layer that elevates the original input to a higher dimension, where φ represents the position embedding operation.
[0218] TransEncoder comprises multiple converter encoder layers. Output layer E o Project the features into a low-dimensional space.
[0219] Step S472: Using the reparameterization module of the sixth neural network, generate a random latent code based on the encoded animation.
[0220] In some implementations, the reparameterization module is used to generate a Gaussian distribution, calculating the mean u and standard deviation σ of the Gaussian distribution, and applying this to the random latent code under the Gaussian distribution assumption. Sampling is performed. In practice, u and σ can be generated using the following formula (4-2):
[0221]
[0222] Among them, R u R σ It is a fully connected layer.
[0223] Step S473: Using the decoder of the sixth neural network, generate the target animation based on the random latent code.
[0224] In some implementations, a reparameterization module is used to generate the random latent code z. motion , by D motion For z motion Decode to obtain the target animation Θ * At this point, D can be defined using the following formula (4-3). m o ti o n :
[0225] Θ * =D motion (z motion ) = D o (TransDecoder(D p (z motion ),φ(0))) (4-3);
[0226] Among them, D p and D o It is a fully connected layer, and 0 is the zero vector. TransDecoder consists of several transformer-decoder layers.
[0227] Step S474: Based on the animation samples and the target animation, update the network parameters of the sixth neural network at least once to obtain the trained sixth neural network.
[0228] In some implementations, a third loss value can be calculated based on animation samples and the target animation, and the network parameters of the sixth neural network can be updated at least once based on this third loss value and a third preset condition. If the third loss value does not meet the third preset condition, the network parameters of the sixth neural network are updated, and the updated sixth neural network is trained using the animation samples. If the third loss value meets the third preset condition, this sixth neural network is used as the trained sixth neural network.
[0229] Here, the third preset condition may include, but is not limited to, the loss value being less than a threshold, or the loss value change converging. In implementation, those skilled in the art can determine the third preset condition independently according to actual needs, and this disclosure does not limit it.
[0230] In some implementations, the method for updating the network parameters of the sixth neural network can be determined according to the actual situation, and may include, but is not limited to, at least one of gradient descent, Newton's momentum method, etc.
[0231] In some implementations, the third loss value may include, but is not limited to, the random latent code loss value, the second reconstruction loss value, etc.
[0232] In some implementations, the third loss value can be the sum of the random latent code loss value and the second reconstruction loss value, or a weighted sum of the random latent code loss value and the second reconstruction loss value, etc. In implementation, those skilled in the art can determine the method of the third loss value according to actual needs, and this disclosure does not limit such methods.
[0233] In some implementations, the third loss value can be calculated using the following formula (4-4).
[0234]
[0235] Where λ5 is a hyperparameter. It is the loss value of the random latent code generated randomly in a Gaussian distribution. Using Θ + and Θ * The mean square error between the two values is used to represent the second reconstruction loss value.
[0236] In some implementations, the random latent code loss value can be calculated using the following formulas (4-5).
[0237]
[0238] Where u is the mean of the Gaussian distribution and σ is the standard deviation of the Gaussian distribution.
[0239] In some implementations, the second reconstruction loss value can be calculated using the following formulas (4-6).
[0240]
[0241] Where, Θ + It is an animation sample, Θ * It is the target animation.
[0242] In this embodiment of the disclosure, the overall network structure of the sixth neural network is trained by a large number of animation samples, thereby enhancing the robustness and performance of the sixth neural network, and enabling the target animation that matches the animation prompt information to be obtained based on the trained sixth neural network.
[0243] In some embodiments, step S45 includes steps S451 to S453, wherein:
[0244] Step S451: Based on the third prompt information, determine the first candidate pose image set.
[0245] Here, the first candidate pose image set includes at least one pose image, and each pose image is matched with the third cue information.
[0246] In some embodiments, step S451 includes steps S4511 to S4512, wherein:
[0247] Step S4511: Using the third prompt information, query the preset second correspondence to obtain at least one candidate pose image that matches the third prompt information.
[0248] Here, the second correspondence represents the correspondence between the third prompt information and the pose image.
[0249] In some implementations, a mapping table establishing the correspondence between the third prompt information and the pose image can be pre-established and stored in an electronic device or other terminal. When the mapping table is stored in an electronic device, the electronic device determines at least one pose image matching the third prompt information in the mapping table. When the mapping table is stored in another terminal, the electronic device sends the third prompt information to that terminal, causing the other terminal to determine at least one pose image matching the third prompt information in the mapping table and return at least one pose image to the electronic device.
[0250] For example, based on the third cue information, fuzzy matching can be performed from the second correspondence to obtain at least one pose image. Alternatively, based on the third cue information, precise matching can be performed from the second correspondence to obtain at least one pose image.
[0251] In some implementations, a fourth neural network can be used to establish the second correspondence. For example, the second correspondence can be established using CLIP.
[0252] Step S4512: Determine the first candidate pose image set based on each candidate pose image.
[0253] Here, each candidate pose image is used as a candidate pose image in the first candidate pose image set.
[0254] Step S452: Generate the first animation based on the preset first parameters.
[0255] Here, the first parameter can be preset by the user or randomly generated. In some implementations, the first parameter can be initialized to zero or obtained by random sampling based on a standard Gaussian distribution.
[0256] In some implementations, the first animation can be generated based on the first parameter using the decoder of the trained sixth neural network.
[0257] Step S453: Based on the first candidate pose image set and the first animation, update the first parameter to generate the target animation of the virtual object.
[0258] In some implementations, a second target loss value can be determined based on a first candidate pose image set and a first animation, and based on this second target loss value, it can be determined whether the first parameter needs to be updated. For example, the second target loss value is compared with a threshold; if the second target loss value is greater than the threshold, the first parameter is updated; if the second target loss value is not greater than the threshold, the first animation is determined as the target animation. As another example, the second target loss value is compared with the previous second target loss value; if the second target loss value is greater than the previous second target loss value, the first parameter is updated; if the second target loss value is substantially equal to the previous second target loss value, the first animation is determined as the target animation.
[0259] In some embodiments, step S453 includes steps S4531 to S4532, wherein:
[0260] Step S4531: Determine the second target loss value based on the first candidate pose image set and the first animation.
[0261] In some implementations, the second target loss value can be determined based on each pose image in the first candidate pose image set, each frame image in the first animation, two adjacent frames in the first animation, and third prompt information.
[0262] Step S4532: If the second target loss value meets the second preset condition, the first animation is used as the target animation.
[0263] Here, the second preset condition may include, but is not limited to, the second target loss value being less than a threshold, or the second target loss value converging. In implementation, those skilled in the art can determine the second preset condition independently according to actual needs; this disclosure does not impose any limitations.
[0264] In some embodiments, step S453 further includes steps S4533 to S4535, wherein:
[0265] Step S4533: If the second target loss value does not meet the second preset condition, the first parameter is updated to obtain the updated first parameter.
[0266] In some implementations, the first parameter can be updated based on the reparameterization module of the sixth neural network. In some implementations, the first parameter can be updated based on the first animation.
[0267] Step S4534: Generate the updated first animation based on the updated first parameters.
[0268] Step S4535: Determine the second target loss value based on the first candidate pose image set and the updated first animation.
[0269] Steps S4534 to S4535 above correspond to steps S4531 to S4532 above. In implementation, the specific implementation methods of steps S4531 to S4532 above can be referred to.
[0270] In this embodiment of the disclosure, if the second target loss value does not meet the second preset condition, the first parameter can be updated again, and a new first animation can be generated based on the updated first parameter. Thus, the virtual target animation can be obtained more accurately through continuous iterative updates.
[0271] In some embodiments, step S4531 includes steps S461 to S464, wherein:
[0272] Step S461: Determine the third sub-loss value based on the first candidate pose image set and each frame of the first animation.
[0273] In some implementations, the third sub-loss value may be the distance between each pose image and each frame of the first animation, the similarity between each pose image and each frame of the first animation, the weighted distance between each pose image and each frame of the first animation, or the weighted similarity between each pose image and each frame of the first animation, etc. In implementation, those skilled in the art can determine the method of the third sub-loss value according to actual needs, and this disclosure does not limit this method.
[0274] In some implementations, the third sub-loss value can be calculated using the following formula (4-7):
[0275] Where, λ pose Represents the hyperparameter coefficients, θ i Let Θ represent the i-th pose image in the first candidate pose image set, i∈{1,2,……,k}, where k represents the total number of pose images in the first candidate pose image set. j Let j represent the j-th frame of the first animation, where j∈{1,2,……,L} and L represents the total number of frames in the first animation.
[0276] In some implementations, the hyperparameter coefficients can be calculated using the following formula (4-8):
[0277]
[0278]
[0279] Where i∈{1,2,……,k}, k represents the total number of pose images in the first candidate pose image set.
[0280] Step S462: Determine the fourth sub-loss value based on the two adjacent frames in every two frames of the first animation.
[0281] In some implementations, the fourth sub-loss value can be the distance between any two adjacent frames in the first animation, the similarity between any two adjacent frames, the weighted distance between any two adjacent frames, or the weighted similarity between any two adjacent frames, etc. In implementation, those skilled in the art can determine the method of the fourth sub-loss value according to actual needs, and this disclosure does not limit this method.
[0282] In some implementations, the fourth sub-loss value can be calculated using the following formula (4-9):
[0283]
[0284] Where, Θ i Θ represents the i-th frame image in the first animation. i+1Let i represent the (i+1)th frame of the image, where i ∈ {1, 2, ..., L}, and L represents the total number of frames in the first animation.
[0285] Step S463: Determine the fifth sub-loss value based on the third prompt information and each frame of the first animation.
[0286] In some implementations, the fifth sub-loss value may be the distance between the third prompt information and each frame of the first animation, the similarity between the third prompt information and each frame of the first animation, the weighted distance between the third prompt information and each frame of the first animation, or the weighted similarity between the third prompt information and each frame of the first animation, etc. In implementation, those skilled in the art can determine the method of the fifth sub-loss value according to actual needs, and this disclosure does not limit this method.
[0287] In some implementations, the fifth sub-loss value can be calculated using the following formula (4-10):
[0288]
[0289] Where, λ clip (·) represents the hyperparameter function, L represents the total number of frames in the first animation, and s i Represents Θ i Similarity score between the information and the third prompt.
[0290] In some implementations, λ can be calculated using the following formula (4-11). clip (i):
[0291]
[0292] Where L represents the total number of frames in the first animation.
[0293] In some implementations, s can be calculated using the following formula (4-12). i :
[0294]
[0295] Where (·) represents the cosine distance, norm is a function used to regularize the input vector, and t motion This indicates the third prompt message, Θ i This represents the i-th frame image in the first animation.
[0296] Step S464: Determine the second target loss value based on the third sub-loss value, the fourth sub-loss value, and the fifth sub-loss value.
[0297] Here, the second target loss value may include, but is not limited to, the sum of the third, fourth, and fifth sub-loss values, or the sum of the third, fourth, and fifth sub-loss values after weighting them respectively. In implementation, those skilled in the art can determine the method of the second target loss value according to actual needs, and this disclosure does not limit this method.
[0298] In some implementations, the second loss value of the target can be calculated using the following formula (4-13):
[0299]
[0300] in, This represents the third sub-loss value. This represents the fourth sub-loss value. This represents the loss value of the fifth sub-sub.
[0301] In this embodiment, a target second loss value is determined based on the third, fourth, and fifth sub-loss values. This improves the accuracy of the target second loss value, facilitating the accurate acquisition of the target animation that matches the animation prompt information.
[0302] Figure 5A This is a schematic diagram of the composition structure of a virtual object generation system 50 provided in an embodiment of this disclosure, as shown below. Figure 5A As shown, the virtual object generation system 50 includes a first acquisition module 51, a body model generation module 52, and a virtual object generation module 53, wherein:
[0303] The first acquisition module 51 is used to acquire first prompt information and second prompt information, wherein the first prompt information represents the body shape information of the virtual object and the second prompt information represents the appearance information of the virtual object.
[0304] The body model generation module 52 is used to determine the first virtual model based on the first prompt information.
[0305] The virtual object generation module 53 is used to generate the virtual object based on the second prompt information and the first virtual model.
[0306] Figure 5B This is a schematic diagram of a virtual object generation system provided in an embodiment of the present disclosure, such as... Figure 5B As shown, the virtual object generation system determines the first virtual model M based on the first prompt information 501. t Based on the second prompt information 502 and the first neural network N′, the first virtual model M is... t Reconstruct the system and generate virtual object 503.
[0307] In some embodiments, the body shape model generation module 52 is further configured to: determine a target body shape image that matches the first prompt information based on a preset first correspondence relationship, wherein the first correspondence relationship represents the correspondence between the first prompt information and the body shape image; and perform three-dimensional modeling based on the target body shape image to generate the first virtual model.
[0308] In some embodiments, the body shape model generation module 52 is further configured to: determine a first distance between each body shape image in the first correspondence and a set standard body shape image; determine a second distance between the first prompt information and the standard prompt information corresponding to the standard body shape image; and determine the target body shape image based on each of the first distance and the second distance.
[0309] Figure 5C This is a schematic diagram illustrating the method of determining a target body shape image according to an embodiment of this disclosure, such as... Figure 5C As shown, the system first trains a shape VAE, constructs a first correspondence 504 based on the shape VAE, and determines the target body shape image from each body shape image 507 in the first correspondence 504 based on the first prompt information 501, the standard prompt information 505 and the standard body shape image 506.
[0310] In some embodiments, the virtual object generation module 53 is further configured to: determine a first observation image of the first virtual model in each of at least one first observation viewpoint; update the first observation image at least once using a preset first neural network to obtain a second observation image for each first observation image; determine a first target loss value based on each second observation image and the second prompt information; and render the first virtual model based on each second observation image to generate the virtual object when the first target loss value satisfies a first preset condition.
[0311] In some embodiments, the virtual object generation module 53 is further configured to: update the network parameters of the first neural network based on the first target loss value when the first target loss value does not meet the first preset condition; update each first observation image at least once using the updated first neural network to obtain an updated second observation image; and determine the updated first target loss value based on each updated second observation image and the second prompt information.
[0312] In some embodiments, the first observation view includes a first observation point and at least one first observation direction corresponding to the first observation point, the first observation image includes at least one first pixel, each first pixel corresponds to a first intersection point on the first virtual model, and each first intersection point represents the first intersection point between a straight line extending from the first observation point along a first observation direction and the first virtual model; the virtual object generation module 53 is further configured to: determine at least one first spatial point corresponding to each first observation direction based on the first observation point and each first observation direction; for each first spatial point in each first observation direction, use a preset first neural network to determine a first distance value between the first intersection point corresponding to the first observation direction where the first spatial point is located and the first spatial point, and determine a first color value obtained by observing the first virtual model at the first spatial point according to the first observation direction; and update the first observation image at least once based on the first distance value and the first color value corresponding to each first spatial point to obtain the second observation image.
[0313] In some embodiments, the virtual object generation module 53 is further configured to: for each first observation direction, determine a first weight value for each first spatial point based on a first distance value corresponding to each first spatial point in the first observation direction; and update at least one first pixel in the first observation image based on the first weight value and the first color value of each first spatial point to obtain the second observation image.
[0314] In some implementations, the virtual object generation module 53 is further configured to: for each first observation image, determine a first sub-loss value based on the second prompt information and the first observation image; for each second observation image, determine a second sub-loss value based on the second prompt information and the second observation image; and determine a first target loss value based on each first sub-loss value and each second sub-loss value.
[0315] In some implementations, the virtual object generation module 53 is further configured to: determine a third observation image based on the first observation image; and determine the first sub-loss value based on the second prompt information and the third observation image.
[0316] In some embodiments, the virtual object generation module 53 is further configured to: for each first observation direction, determine a distance gradient value for each first spatial point based on a first distance value corresponding to each first spatial point in the first observation direction; and update at least one first pixel in the first observation image based on a first weight value and a distance gradient value for each first spatial point to obtain the third observation image.
[0317] Figure 5D This is a schematic diagram illustrating the generation process of a virtual object according to an embodiment of the present disclosure, such as... Figure 5D As shown, the virtual object generation process includes: reconstructing the first virtual model using f(p) and c(p) in the first neural network N′, and using f(p) and c... c (p) Render the texture and style of the reconstructed model; optimize the network parameters in N′ based on the second cue information; generate virtual objects based on the optimized N′. Based on at least one camera 508, determine at least one viewing angle, wherein each viewing angle includes a first viewing point o and at least one first viewing direction v; determine the first viewing image of the first virtual model in each viewing angle and at least one corresponding first spatial point in each first viewing direction v; obtain the first distance value f(p(t)) of each first spatial point based on the f(p) network; based on c c (p) network, to obtain the first color value c of each first spatial point. c (p(t)); Based on the c(p) network, the second color value c(p(t)) of each first spatial point is obtained; Based on each first distance value, the first weight value w(t) and distance gradient value of each first spatial point are obtained. Based on c(p(t)) and w(t), each first pixel of the first observed image is updated to generate an image. Based on w(t) and Update each first pixel of the first observed image to generate image I. n Based on I n And with light ray l, update each first pixel of the first observed image to generate image I. g Based on I n Light rays l and c c (p(t)), update each first pixel of the first observed image to generate image I. c Based on images Determine the first reconstruction loss value Based on image I g Second prompt information 502, determine the first sub-loss value Based on image I cThe second prompt information 502 determines the second sub-loss value. Based on the first reconstruction loss value, the first sub-loss value, and the second sub-loss value, determine the first target loss value.
[0318] In some implementations, the virtual object generation system further includes a second acquisition module and a target animation generation module:
[0319] The second acquisition module is used to acquire third prompt information, wherein the third prompt information represents the animation information of the virtual object;
[0320] The target animation generation module is used to generate the target animation of the virtual object based on the third prompt information.
[0321] Figure 5E This is a schematic diagram illustrating a target animation for generating a virtual object, as provided in an embodiment of this disclosure. Figure 5E As shown, the system pre-initializes the animation of the virtual object generated based on N′ to generate M(θ); generates a first candidate pose image set 509 based on the third prompt information 508; generates a first animation 510 based on the first candidate pose image set 509; and generates a target animation 511 of the virtual object based on M(θ) and the first animation.
[0322] In some implementations, the target animation generation module is further configured to: determine a first candidate pose image set based on the third prompt information; generate a first animation based on preset first parameters; and determine the target animation of the virtual object based on the first candidate pose image set and the first animation.
[0323] In some implementations, the target animation generation module is further configured to: use the third prompt information to query a preset second correspondence relationship to obtain at least one candidate pose image that matches the third prompt information; the second correspondence relationship characterizes the correspondence between the third prompt information and the pose image; and determine the first candidate pose image set based on each of the candidate pose images.
[0324] Figure 5F This is a schematic diagram illustrating the determination of a first candidate pose image according to an embodiment of the present disclosure, such as... Figure 5F As shown, the system first trains a pose VAE, constructs a second correspondence 512 based on the pose VAE, and determines the first candidate pose image from each pose image R(Bθ[i]) of the second correspondence 512 based on the third prompt information 508.
[0325] In some implementations, the target animation generation module is further configured to: determine a second target loss value based on the first candidate pose image set and the first animation; and, if the second target loss value satisfies a second preset condition, use the first animation as the target animation.
[0326] In some implementations, the target animation generation module is further configured to: update the first parameter to obtain an updated first parameter when the second target loss value does not meet the second preset condition; generate an updated first animation based on the updated first parameter; and determine a second target loss value based on the first candidate pose image set and the updated first animation.
[0327] In some implementations, the target animation generation module is further configured to: determine a third sub-loss value based on the first candidate pose image set and each frame image in the first animation; determine a fourth sub-loss value based on every two adjacent frame images in the first animation; determine a fifth sub-loss value based on the third prompt information and each frame image in the first animation; and determine a second target loss value based on the third sub-loss value, the fourth sub-loss value, and the fifth sub-loss value.
[0328] Figure 5G This is a schematic diagram illustrating the determination of a second target loss value, as provided in an embodiment of the present disclosure. Figure 5G As shown, this system utilizes the pre-trained VAE decoder D motion For the first parameter z t Decode the image to generate the first animation 510; based on each pose image θ in the first candidate pose image set. i And each frame of the first animation 510 Θ j Determine the third sub-loss value Based on the adjacent frame images Θ of every two frames in the first animation 510 i and Θ i+1 Determine the fourth sub-loss value Based on the third prompt information 508 and each frame of the first animation 510. i Determine the fifth sub-loss value Based on the third sub-loss value Fourth sub-loss value and the fifth child loss value Determine the second target loss value
[0329] Figure 5H A schematic diagram of a pre-trained VAE network structure provided in an embodiment of this disclosure is shown below. Figure 5H As shown, the VAE includes encoder E motion Decoder Dmotion and reparameterization module 512. Among them, encoder E motion Contains a projection layer E p A location embedding layer φ, several transcoder layers (TransEncoder), and an output layer E o Decoder D motion Includes the location embedding layer φ and the fully connected layer D p Fully connected layer D o Several transformer-decoder layers, TransDecoder. Inputting 513 motion sequence samples, it converts them into animation samples Θ. + Using encoder E motion For Θ + After encoding, the encoded animation is obtained. After the fully connected layer R u R σ Then, the mean u and standard deviation σ of the Gaussian distribution are generated; the random latent code is then subjected to the Gaussian distribution. Sampling is performed using the random latent code z. motion Decoder D motion Further decoding generates animation Θ * The loss value is determined based on the mean u and standard deviation σ. Based on Θ + and Θ * Determine the loss value based on and Sure based on The network parameters of the VAE should be updated at least once. If the preset conditions are met, this VAE will be used as the trained VAE.
[0330] Compared with methods in related technologies, the method provided in this disclosure has at least the following improvements:
[0331] 1) In related technologies, virtual objects are generated based on text prompts using preset models. These preset models are trained on a large amount of training data and cannot be automatically generated based on natural language. Alternatively, professionals use specialized software and expensive equipment to generate virtual objects based on text prompts. However, this embodiment combines the power of a large-scale pre-trained model to achieve zero-shot generation capability. Furthermore, based on body shape and appearance prompts, it can automatically and accurately generate virtual objects that match the body shape and appearance prompts.
[0332] 2) In related technologies, target animations are generated based on animation prompts using preset models. These preset models are trained on a large amount of training data and cannot be automatically generated based on natural language. Alternatively, professional personnel use specialized software and expensive equipment to generate target animations based on animation prompts. However, this embodiment combines the power of a large-scale pre-trained model to achieve zero-shot generation capability. Furthermore, based on animation prompts, it can automatically and accurately generate target animations that match the animation prompts.
[0333] The method provided in this disclosure has at least the following beneficial effects: 1) Based on body shape cues, appearance cues, and motion cues, it can automatically generate target animations of virtual objects that conform to these three cues; 2) By combining the power of large-scale pre-trained models, it achieves zero-sample generation capability, and can robustly generate virtual objects with high-quality textures and geometric shapes, which are highly consistent with the corresponding input natural language; 3) Based on VAE, it achieves zero-learning, text-guided animation synthesis, and is highly consistent with the corresponding input natural language.
[0334] To better illustrate the beneficial effects of the embodiments of this disclosure, experimental data are compared and explained below with those of methods in related technologies.
[0335] (1) Initialization of some parameters
[0336] For the shape-based VAE, both the encoder and decoder use a two-layer MLP with a 16-dimensional latent space. 40,960 latent codes are then sampled from a Gaussian distribution and clustered to 2,048 centers using K-Means of the synthesized codebook.
[0337] For NeuS, the SDF network uses a 6-layer MLP, and the color network uses a 4-layer MLP. For each ray, we perform 32 uniform samplings and 32 importance samplings. A learning rate of 5 × 10⁻⁶ is used. -4 The Adam algorithm was optimized and iterated 30,000 times.
[0338] For the generation of the first candidate pose image set, 4096 cluster centroids were obtained from the AMASS dataset using K-Means, and the top 5 poses were selected.
[0339] For the preset VAE model, the transformer encoder layer and transformer decoder layer each contain 4 Transformer encoder layers and 4 Transformer decoder layers. The frame length is 60. A 5×10... -4 Adam optimizer with a learning rate of λ5 is 10. -5 During the optimization of the first parameter, Adam was 1×10 -2The learning rate was optimized through 5000 iterations. λ6 and λ7 were each set to 10. -3 and 5×10 -4 .
[0340] (2) Baseline
[0341] Two baselines were established: (i) direct interpolation between candidate poses; and (ii) unweighted interpolation. VAE.
[0342] (3) Experimental Results
[0343] 1) Comparison results between the virtual objects generated by the AvatarCLIP method provided in this embodiment and the baseline method
[0344] Figure 5I This is a schematic diagram illustrating the results of generating virtual objects based on various methods according to embodiments of this disclosure, such as... Figure 5I As shown, the first column contains virtual objects generated based on the baseline, the second column contains virtual objects generated based on the baseline plus background enhancement, the third column contains virtual objects generated based on the baseline plus textureless rendering, the fourth column contains virtual objects generated based on the baseline plus shadows on texture rendering, and the fifth column contains virtual objects generated based on AvatarCLIP. (Comparison) Figure 5I The first and second columns show that background enhancement has a significant impact on texture generation; without it, textures often appear very dark. (Comparison) Figure 5I The second and third columns, with added supervision of the textureless rendering, significantly improved the geometry quality. "Ablation 2" had many random bumps and dents, making the surface noisy, while "Ablation 3" had smooth geometry and could produce detailed clothing folds. (Comparison) Figure 5I The third and fourth columns, by adding random shadows to the texture rendering, help generate more uniform texture colors. However, without human semantic awareness, the first four ablation settings fail to generate accurate faces for the avatar. The last column further utilizes semantically aware cue enhancement, which works best in generating human faces—one of the most crucial parts of generating virtual objects.
[0345] 2) The method AvatarCLIP provided in this embodiment generates M using a baseline method. t Comparison results
[0346] Figure 5J A schematic diagram illustrating the result of generating a first virtual model based on multiple methods according to embodiments of this disclosure, such as... Figure 5J As shown, baseline (i) is a direct optimization in the SMPLβ space, and baseline (ii) is a direct optimization of the first parameter in the VAE. Figure 5JAs shown, neither of these two optimization methods can generate an M that is consistent with the description text. t Even contradictory textual guidance (such as "thin" and "overweight") will generate the same M. t In contrast, AvatarCLIP can robustly generate reasonable body shapes that are consistent with the input text.
[0347] 3) Comparison results of the virtual object generation method AvatarCLIP provided in this embodiment with the baseline method Text2Mesh
[0348] Figure 5K This is a schematic diagram illustrating the results of generating virtual objects based on various methods according to embodiments of this disclosure, such as... Figure 5K As shown, the first line presents the results of multiple runs using Text2Mesh with five different random seeds, and the second line presents the results of multiple runs using AvatarCLIP with five different random seeds. Figure 5K It can be seen that Text2Mesh mostly fails to generate virtual objects that match the input text, while AvatarCLIP outputs high-quality results that match the input text. This indicates that M... t It is unstable in neural network optimization, especially under weak supervision. Based on N′ to M t Optimization can help improve the robustness of the algorithm.
[0349] 4) Comparison results of the target animation generated by the AvatarCLIP method provided in this embodiment with the baseline method.
[0350] Figure 5L This is a schematic diagram illustrating the results of generating target animations based on various methods provided in embodiments of this disclosure, such as... Figure 5L As shown, the first column is the generation result based on baseline (i), where baseline (i) is generated by first ranking all candidate poses from candidate pose S according to their corresponding similarity scores si, and then performing direct interpolation on the latent codes between each pair of adjacent poses to generate the target animation. The second column is the generation result based on baseline (ii), where baseline (ii) is generated by directly calculating the reconstruction loss without reweighting. The third column shows the results generated based on AvatarCLIP. For example... Figure 5LAs shown, for "brushing teeth," baseline (i) incorrectly organizes the candidate poses into an unrelated sequence of motion fragments. Baseline (ii) fails to generate reasonable motion because it blindly focuses on reconstructing the disordered S. AvatarCLIP, by introducing a reweighting mechanism and two other losses, focuses not only on reconstruction but also on the reasonableness of the generated animation. For "kicking a soccer ball," the animations of baselines (i) and (ii) do not show drastic changes when the leg kicks out. This plays a crucial role in controlling the intensity of the movement. Regarding "raising both arms," it should generate a movement sequence from a neutral posture to the raised arms posture. However, the movement sequence from baseline (i) is the opposite of what was expected. Baseline (ii) introduces several unrelated movements. With its help, AvatarCLIP is able to generate motions in the correct order, while the entire sequence is more consistent with the given description.
[0351] Based on the above embodiments, this disclosure provides a virtual object generation apparatus. Figure 6 This is a schematic diagram of the composition structure of a virtual object generation device provided in an embodiment of this disclosure, such as... Figure 6 As shown, the virtual object generation device 60 includes a first acquisition module 61, a first determination module 62, and a first generation module 63.
[0352] The first acquisition module 61 is used to acquire first prompt information and second prompt information, wherein the first prompt information represents the body shape information of the virtual object and the second prompt information represents the appearance information of the virtual object;
[0353] The first determining module 62 is used to determine the first virtual model based on the first prompt information;
[0354] The first generation module 63 is used to generate the virtual object based on the second prompt information and the first virtual model.
[0355] In some implementations, the first determining module 62 is further configured to: determine a target body shape image that matches the first prompt information based on a preset first correspondence relationship, wherein the first correspondence relationship represents the correspondence between the first prompt information and the body shape image; and perform three-dimensional modeling based on the target body shape image to generate the first virtual model.
[0356] In some embodiments, the first determining module 62 is further configured to: determine a first distance between each body shape image in the first correspondence and a set standard body shape image; determine a second distance between the first prompt information and the standard prompt information corresponding to the standard body shape image; and determine the target body shape image based on each of the first distances and the second distances.
[0357] In some embodiments, the first generation module 63 is further configured to: determine a first observation image of the first virtual model in each of at least one first observation viewpoint; update the first observation image at least once using a preset first neural network for each first observation image to obtain a second observation image; determine a first target loss value based on each second observation image and the second prompt information; and render the first virtual model based on each second observation image to generate the virtual object when the first target loss value satisfies a first preset condition.
[0358] In some embodiments, the first generation module 63 is further configured to: update the network parameters of the first neural network based on the first target loss value when the first target loss value does not meet the first preset condition; update each first observation image at least once using the updated first neural network to obtain an updated second observation image; and determine the updated first target loss value based on each updated second observation image and the second prompt information.
[0359] In some embodiments, the first observation view includes a first observation point and at least one first observation direction corresponding to the first observation point; the first observation image includes at least one first pixel; each first pixel corresponds to a first intersection point on the first virtual model; each first intersection point represents the first intersection point of the first observation point with the first virtual model along a first observation direction; the first generation module 63 is further configured to: update the first observation image at least once using a preset first neural network to obtain a second observation image, including: determining at least one first spatial point corresponding to each first observation direction based on the first observation point and each first observation direction; for each first spatial point in each first observation direction, using a preset first neural network to determine a first distance value between the first intersection point corresponding to the first observation direction where the first spatial point is located and the first spatial point, and determining a first color value obtained by observing the first virtual model at the first spatial point according to the first observation direction; updating the first observation image at least once based on the first distance value and the first color value corresponding to each first spatial point to obtain the second observation image.
[0360] In some embodiments, the first generation module 63 is further configured to: for each first observation direction, determine a first weight value for each first spatial point based on a first distance value corresponding to each first spatial point in the first observation direction; and update at least one first pixel in the first observation image based on the first weight value and the first color value of each first spatial point to obtain the second observation image.
[0361] In some implementations, the first generation module 63 is further configured to: for each first observed image, determine a first sub-loss value based on the second prompt information and the first observed image; for each second observed image, determine a second sub-loss value based on the second prompt information and the second observed image; and determine a first target loss value based on each first sub-loss value and each second sub-loss value.
[0362] In some implementations, the first generation module 63 is further configured to: determine a third observation image based on the first observation image; and determine the first sub-loss value based on the second prompt information and the third observation image.
[0363] In some embodiments, the first generation module 63 is further configured to: for each first observation direction, determine a distance gradient value for each first spatial point based on a first distance value corresponding to each first spatial point in the first observation direction; and update at least one first pixel in the first observation image based on a first weight value and a distance gradient value for each first spatial point to obtain the third observation image.
[0364] In some embodiments, the apparatus further includes: a second acquisition module for acquiring third prompt information, the third prompt information representing animation information of the virtual object; and a second generation module for generating a target animation of the virtual object based on the third prompt information.
[0365] In some implementations, the second generation module is further configured to: determine a first candidate pose image set based on the third prompt information; generate a first animation based on preset first parameters; and determine a target animation for the virtual object based on the first candidate pose image set and the first animation.
[0366] In some implementations, the second generation module is further configured to: use the third prompt information to query a preset second correspondence relationship to obtain at least one candidate pose image that matches the third prompt information; the second correspondence relationship represents the correspondence between the third prompt information and the pose image; and determine the first candidate pose image set based on each of the candidate pose images.
[0367] In some implementations, the second generation module is further configured to: determine a second target loss value based on the first candidate pose image set and the first animation; and, if the second target loss value satisfies a second preset condition, use the first animation as the target animation.
[0368] In some implementations, the second generation module is further configured to: update the first parameter to obtain an updated first parameter when the second target loss value does not meet the second preset condition; generate an updated first animation based on the updated first parameter; and determine the second target loss value based on the first candidate pose image set and the updated first animation.
[0369] In some implementations, the second generation module is further configured to: determine a third sub-loss value based on the first candidate pose image set and each frame image in the first animation; determine a fourth sub-loss value based on every two adjacent frame images in the first animation; determine a fifth sub-loss value based on the third prompt information and each frame image in the first animation; and determine a second target loss value based on the third sub-loss value, the fourth sub-loss value, and the fifth sub-loss value.
[0370] The description of the above apparatus embodiments is similar to that of the above method embodiments, and has similar beneficial effects. For technical details not disclosed in the apparatus embodiments of this disclosure, please refer to the description of the method embodiments of this disclosure for understanding.
[0371] It should be noted that, in the embodiments of this disclosure, if the above methods are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this disclosure, or the parts that contribute to related technologies, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this disclosure are not limited to any specific hardware and software combination.
[0372] This disclosure provides an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the above-described method.
[0373] This disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method. The computer-readable storage medium can be transient or non-transient.
[0374] This disclosure provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the above-described method. This computer program product can be implemented specifically through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied as a computer storage medium; in another optional embodiment, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.
[0375] It should be noted that, Figure 7 This is a schematic diagram of a hardware entity of an electronic device in an embodiment of this disclosure, such as... Figure 7 As shown, the hardware entity of the electronic device 700 includes: a processor 701, a communication interface 702, and a memory 703, wherein:
[0376] The processor 701 typically controls the overall operation of the electronic device 700.
[0377] Communication interface 702 enables electronic devices to communicate with other terminals or servers via a network.
[0378] The memory 703 is configured to store instructions and applications executable by the processor 701, and can also cache data to be processed or already processed (e.g., image data, audio data, voice communication data, and video communication data) in the processor 701 and various modules in the electronic device 700. It can be implemented using flash memory or random access memory (RAM). Data transfer between the processor 701, the communication interface 702, and the memory 703 can be performed via bus 704.
[0379] It should be noted that the descriptions of the storage medium and device embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of this disclosure, please refer to the descriptions of the method embodiments of this disclosure for understanding.
[0380] It should be understood that the phrase "an embodiment" or "one embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this disclosure. Therefore, "in one embodiment" or "one embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this disclosure, the sequence numbers of the above-described processes do not imply a sequential 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 this disclosure. The sequence numbers of the above-described embodiments are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0381] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0382] In the several embodiments provided in this disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components may be combined, or integrated into another system, or some features may be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0383] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0384] In addition, each functional unit in the embodiments of this disclosure can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0385] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0386] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, or the part that contributes to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, magnetic disks, or optical disks.
[0387] The above description is merely an embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for generating virtual objects, characterized in that, The method includes: Obtain first prompt information and second prompt information, wherein the first prompt information represents the body shape information of the virtual object and the second prompt information represents the appearance information of the virtual object; Based on the first prompt information, the first virtual model is determined; The virtual object is generated based on the second prompt information and the first virtual model; The step of generating the virtual object based on the second prompt information and the first virtual model includes: For each of the at least one first observation viewpoints, a first observation image of the first virtual model in the first observation viewpoint is determined; wherein, the first observation viewpoint includes a first observation point and at least one first observation direction corresponding to the first observation point, the first observation image includes at least one first pixel, each first pixel corresponds to a first intersection point on the first virtual model, and each first intersection point represents the first intersection point between a straight line extending from the first observation point along a first observation direction and the first virtual model. For each first observation image, based on the first observation point and each first observation direction, at least one first spatial point corresponding to each first observation direction is determined; for each first spatial point in each first observation direction, using a preset first neural network, a first distance value between the first intersection point corresponding to the first observation direction where the first spatial point is located and the first spatial point is determined, and a first color value obtained by observing the first virtual model at the first spatial point according to the first observation direction is determined; based on the first distance value and the first color value corresponding to each first spatial point, the first observation image is updated at least once to obtain a second observation image; Based on each of the second observed images and the second prompt information, a first target loss value is determined; When the first target loss value meets the first preset condition, the first virtual model is rendered based on each second observation image to generate the virtual object.
2. The method according to claim 1, characterized in that, The step of determining the first virtual model based on the first prompt information includes: Based on a preset first correspondence, a target body image that matches the first prompt information is determined, wherein the first correspondence represents the correspondence between the first prompt information and the body image; Based on the target body shape image, a 3D model is created to generate the first virtual model.
3. The method according to claim 2, characterized in that, The step of determining the target body shape image that matches the first prompt information based on a preset first correspondence relationship includes: Determine the first distance between each body shape image in the first correspondence and the set standard body shape image; Determine a second distance between the first prompt message and the standard prompt message corresponding to the standard body shape image; The target body shape image is determined based on each of the first distance and the second distance.
4. The method according to claim 1, characterized in that, The step of generating the virtual object based on the second prompt information and the first virtual model further includes: If the first target loss value does not meet the first preset condition, the network parameters of the first neural network are updated based on the first target loss value. Using the updated first neural network, each first observation image is updated at least once to obtain an updated second observation image; Based on each of the updated second observation images and the second cue information, an updated first target loss value is determined.
5. The method according to claim 1, characterized in that, The step of updating the first observation image at least once based on the first distance value and the first color value corresponding to each first spatial point to obtain the second observation image includes: For each first observation direction, a first weight value for each first spatial point is determined based on the first distance value corresponding to each first spatial point in the first observation direction. Based on the first weight value and the first color value of each first spatial point, at least one first pixel in the first observation image is updated to obtain the second observation image.
6. The method according to claim 5, characterized in that, The step of determining the first target loss value based on each of the second observed images and the second prompt information includes: For each of the first observed images, a first sub-loss value is determined based on the second prompt information and the first observed image; For each of the second observed images, a second sub-loss value is determined based on the second prompt information and the second observed image; The first target loss value is determined based on each of the first sub-loss value and each of the second sub-loss values.
7. The method according to claim 6, characterized in that, The step of determining the first sub-loss value based on the second prompt information and the first observed image includes: Based on the first observed image, a third observed image is determined; Based on the second prompt information and the third observed image, the first sub-loss value is determined.
8. The method according to claim 7, characterized in that, Determining the third observation image based on the first observation image includes: For each first observation direction, a distance gradient value for each first spatial point is determined based on the first distance value corresponding to each first spatial point along the first observation direction. Based on the first weight value and distance gradient value of each first spatial point, at least one first pixel in the first observation image is updated to obtain the third observation image.
9. The method according to any one of claims 1 to 8, characterized in that, The method further includes: Obtain third prompt information, wherein the third prompt information represents the animation information of the virtual object; Based on the third prompt information, the target animation of the virtual object is generated.
10. The method according to claim 9, characterized in that, The step of generating the target animation of the virtual object based on the third prompt information includes: Based on the third prompt information, a first candidate pose image set is determined; Generate the first animation based on the preset first parameters; Based on the first candidate pose image set and the first animation, the target animation of the virtual object is determined.
11. The method according to claim 10, characterized in that, The step of determining the first candidate pose image set based on the third prompt information includes: Using the third prompt information, a preset second correspondence is queried to obtain at least one candidate pose image that matches the third prompt information; the second correspondence represents the correspondence between the third prompt information and the pose image. Based on each of the candidate pose images, the first candidate pose image set is determined.
12. The method according to claim 10 or 11, characterized in that, Determining the target animation of the virtual object based on the first candidate pose image set and the first animation includes: Based on the first candidate pose image set and the first animation, determine the second target loss value; If the second target loss value meets the second preset condition, the first animation is used as the target animation.
13. The method according to claim 12, characterized in that, The step of determining the target animation of the virtual object based on the first candidate pose image set and the first animation further includes: If the second target loss value does not meet the second preset condition, the first parameter is updated to obtain the updated first parameter; Generate the updated first animation based on the updated first parameters; The second target loss value is determined based on the first candidate pose image set and the updated first animation.
14. The method according to claim 13, characterized in that, The step of determining the second target loss value based on the first candidate pose image set and the first animation includes: Based on the first candidate pose image set and each frame of the first animation, a third sub-loss value is determined; The fourth sub-loss value is determined based on every two adjacent frame images in the first animation. Based on the third prompt information and each frame of the first animation, a fifth sub-loss value is determined; The second target loss value is determined based on the third sub-loss value, the fourth sub-loss value, and the fifth sub-loss value.
15. A virtual object generation device, characterized in that, The device includes: The first acquisition module is used to acquire first prompt information and second prompt information, wherein the first prompt information represents the body shape information of the virtual object and the second prompt information represents the appearance information of the virtual object; The first determining module is used to determine the first virtual model based on the first prompt information; A first generation module is configured to determine a first observation image of the first virtual model in each of at least one first observation viewpoint; wherein the first observation viewpoint includes a first observation point and at least one first observation direction corresponding to the first observation point, the first observation image includes at least one first pixel, each first pixel corresponds to a first intersection point on the first virtual model, and each first intersection point represents the first intersection point between a straight line extending from the first observation point along a first observation direction and the first virtual model; for each first observation image, at least one first spatial point corresponding to each first observation direction is determined based on the first observation point and each first observation direction; For each first spatial point along each first observation direction, a first distance value between the first intersection point of the first observation direction and the first spatial point is determined using a preset first neural network, and a first color value is determined at the first spatial point by observing the first virtual model along the first observation direction. Based on the first distance value and the first color value corresponding to each first spatial point, the first observation image is updated at least once to obtain a second observation image. Based on each second observation image and the second prompt information, a first target loss value is determined. When the first target loss value satisfies a first preset condition, the first virtual model is rendered based on each second observation image to generate the virtual object.
16. An electronic device comprising a processor and a memory, the memory storing a computer program executable on the processor, characterized in that, The processor is configured to execute the computer program to: Obtain first prompt information and second prompt information, wherein the first prompt information represents the body shape information of the virtual object and the second prompt information represents the appearance information of the virtual object; Based on the first prompt information, the first virtual model is determined; The virtual object is generated based on the second prompt information and the first virtual model; The step of generating the virtual object based on the second prompt information and the first virtual model includes: For each of the at least one first observation viewpoints, a first observation image of the first virtual model in the first observation viewpoint is determined; wherein, the first observation viewpoint includes a first observation point and at least one first observation direction corresponding to the first observation point, the first observation image includes at least one first pixel, each first pixel corresponds to a first intersection point on the first virtual model, and each first intersection point represents the first intersection point between a straight line extending from the first observation point along a first observation direction and the first virtual model. For each first observation image, based on the first observation point and each first observation direction, at least one first spatial point corresponding to each first observation direction is determined; for each first spatial point in each first observation direction, using a preset first neural network, a first distance value between the first intersection point corresponding to the first observation direction where the first spatial point is located and the first spatial point is determined, and a first color value obtained by observing the first virtual model at the first spatial point according to the first observation direction is determined; based on the first distance value and the first color value corresponding to each first spatial point, the first observation image is updated at least once to obtain a second observation image; Based on each of the second observed images and the second prompt information, a first target loss value is determined; When the first target loss value meets the first preset condition, the first virtual model is rendered based on each second observation image to generate the virtual object.
17. A computer-readable storage medium, characterized in that, It stores a computer program, which is executed by the processor to: Obtain first prompt information and second prompt information, wherein the first prompt information represents the body shape information of the virtual object and the second prompt information represents the appearance information of the virtual object; Based on the first prompt information, the first virtual model is determined; The virtual object is generated based on the second prompt information and the first virtual model; The step of generating the virtual object based on the second prompt information and the first virtual model includes: For each of the at least one first observation viewpoints, a first observation image of the first virtual model in the first observation viewpoint is determined; wherein, the first observation viewpoint includes a first observation point and at least one first observation direction corresponding to the first observation point, the first observation image includes at least one first pixel, each first pixel corresponds to a first intersection point on the first virtual model, and each first intersection point represents the first intersection point between a straight line extending from the first observation point along a first observation direction and the first virtual model. For each first observation image, based on the first observation point and each first observation direction, at least one first spatial point corresponding to each first observation direction is determined; for each first spatial point in each first observation direction, using a preset first neural network, a first distance value between the first intersection point corresponding to the first observation direction where the first spatial point is located and the first spatial point is determined, and a first color value obtained by observing the first virtual model at the first spatial point according to the first observation direction is determined; based on the first distance value and the first color value corresponding to each first spatial point, the first observation image is updated at least once to obtain a second observation image; Based on each of the second observed images and the second prompt information, a first target loss value is determined; When the first target loss value meets the first preset condition, the first virtual model is rendered based on each second observation image to generate the virtual object.
