Action generation method, device, electronic device and storage medium
By combining the temporal and spatial correlations of audio features and action features, the target action feature sequence is generated, which solves the problem of inconsistent rhythm and unsmoothness in music-generated actions in the existing technology, and achieves higher consistency and fluency.
Patent Information
- Application Number
- CN202210463597.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-04-28
AI Technical Summary
When generating movements based on music, the existing technology has problems of inconsistent rhythm and unsmooth movements, making it difficult to produce satisfactory movements.
Generate a predicted action feature sequence by obtaining audio features, match quantified action features from the preset action feature library, and combine the temporal and spatial correlations of action features to generate a target action feature sequence.
The standardization of the target action feature sequence and the consistency of the beat and audio rhythm are improved, and the generated actions are more smooth and consistent with the music rhythm.
Smart Images

Figure CN114741561B_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Singapore patent application No. 10202202011P filed with the Intellectual Property Office of Singapore on February 28, 2022, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present disclosure relates to the field of computer information technology, and relates to but is not limited to an action generation method, device, electronic device and storage medium. Background Art
[0004] At present, there is a demand for simulating movements according to music in some scenarios, for example, in virtual scenes such as games or animations, simulating movements such as dance or rhythmic gymnastics following the currently playing music. However, in the prior art, the movements generated according to the given music are inconsistent with the rhythm of the music, and the generated movements are not smooth, which makes it difficult to produce satisfactory movements. Summary of the invention
[0005] The present disclosure provides an action generation method, device, electronic device and storage medium.
[0006] According to a first aspect of an embodiment of the present disclosure, there is provided an action generation method, comprising: obtaining a sequence of predicted action features associated in time sequence; wherein the predicted action feature sequence is generated at least based on audio features; determining, from a preset action feature library, quantized action features that match each predicted action feature in the predicted action feature sequence; determining a spatial association relationship between each predicted action feature in the predicted action feature sequence; and combining quantized action features that match each predicted action feature according to the spatial association relationship between each predicted action feature and the temporal association relationship between each predicted action feature to obtain a target action feature sequence.
[0007] According to a second aspect of an embodiment of the present disclosure, there is provided an action generation device, comprising: an acquisition module, configured to acquire a sequence of predicted action features associated in time sequence; wherein the predicted action feature sequence is generated at least based on audio features; a first determination module, configured to determine, from a preset action feature library, quantized action features that match each predicted action feature in the predicted action feature sequence; a second determination module, configured to determine a spatial association relationship between each predicted action feature in the predicted action feature sequence; and a combination module, configured to combine quantized action features that match each predicted action feature according to the spatial association relationship between each predicted action feature and the temporal association relationship between each predicted action feature, to obtain a target action feature sequence.
[0008] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising a processor and a memory for storing a computer program that can be run on the processor; wherein the processor is used to run the computer program to execute any one of the above-mentioned action generation methods.
[0009] According to a fourth aspect of an embodiment of the present disclosure, there is provided a computer storage medium on which a computer program is stored, and when the computer program is executed by a processor, any one of the above-mentioned action generation methods is implemented.
[0010] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0011] In the embodiments of the present disclosure, it is possible to determine, from a preset action feature library, quantized action features that match various predicted action features that are mutually correlated in time series, and, according to the spatial correlation relationship between each predicted action feature and the temporal correlation relationship between each predicted action feature, combine the quantized action features that match each predicted action feature to obtain a target action feature sequence.
[0012] In the process of generating the target action feature sequence, the temporal correlation and spatial correlation of each predicted action feature can be taken into account, thereby improving the standardization of the generated target action feature sequence and improving the consistency between the target action feature sequence and the audio rhythm in terms of beat.
[0013] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0015] Figure 1 The present invention is a flowchart of an action generation method shown in an embodiment of the present invention.
[0016] Figure 2 A schematic diagram of an action generation method shown in an embodiment of the present disclosure.
[0017] Figure 3 A schematic diagram of a feature processing method shown in an embodiment of the present disclosure.
[0018] Figure 4 A schematic diagram of an action prediction method shown in an embodiment of the present disclosure.
[0019] Figure 5a A schematic diagram of a method for determining a degree of association according to an embodiment of the present disclosure Figure 1 .
[0020] Figure 5b A schematic diagram of a method for determining a degree of association according to an embodiment of the present disclosure Figure 2 .
[0021] Figure 5c A schematic diagram of a method for determining a degree of association according to an embodiment of the present disclosure Figure 3 .
[0022] Figure 6 A schematic diagram of a reward determination method shown in an embodiment of the present disclosure.
[0023] Figure 7 A schematic diagram of a target action shown in an embodiment of the present disclosure.
[0024] Figure 8 The present invention is a schematic diagram of the structure of a target action device according to an embodiment of the present invention.
[0025] Fig. 9 The present invention is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0027] The disclosed embodiment provides an action generation method, which can be applied to electronic devices, where the electronic devices may include: terminal devices, such as mobile terminals, fixed terminals or vehicle-mounted terminals, etc. Among them, mobile terminals may include: mobile phones, tablet computers, laptops or wearable devices, and may also include smart home devices, such as smart speakers, etc. Fixed terminals may include: desktop computers or smart TVs, etc. The vehicle-mounted terminal may include the front-end device of the vehicle monitoring management system, which may also be called a telematics control unit (TCU), such as a vehicle terminal, etc. The functions implemented by the method can be applied to a computer system composed of a terminal and / or a server. Here, the terminal may be a thin client, a thick client, a handheld or laptop device, a microprocessor-based system, a set-top box, a programmable consumer electronic product, a network personal computer, a small computer system, etc., and the server may be a server computer system, a small computer system, a large computer system, and a distributed cloud computing technology environment including any of the above systems.
[0028] Figure 1 is a flow chart of an action generation method according to an exemplary embodiment. Figure 1 As shown, it mainly includes the following steps:
[0029] In step 101, a sequence of predicted action features associated in time sequence is obtained; wherein the predicted action feature sequence is generated at least according to audio features;
[0030] In step 102, a quantized motion feature matching each predicted motion feature in the predicted motion feature sequence is determined from a preset motion feature library;
[0031] In step 103, determining the spatial correlation between the predicted action features in the predicted action feature sequence;
[0032] In step 104, according to the spatial correlation relationship between the predicted action features and the temporal correlation relationship between the predicted action features, the quantized action features that match the predicted action features are combined to obtain a target action feature sequence.
[0033] In the embodiments of the present disclosure, action features can be understood as data used to characterize action attributes, and action features may include: three-dimensional coordinates of each joint point of the object (such as a virtual character) that generates the action, or action vectors that characterize the action, etc. One action feature corresponds to one action, and the action feature can be represented in the form of a vector or an index value. In some embodiments, the electronic device can set corresponding index values in advance according to different actions, for example: the index value corresponding to the hand-raising action is 1, the index value corresponding to the kicking action is 2, the index value corresponding to the squatting action is 3, etc., which is not limited in the present disclosure. Different action features can represent different actions, for example: the first action feature can represent standing at attention, the second action feature can represent at ease, the third action feature can represent standing at attention, etc.
[0034] An action feature sequence can be understood as a collection of multiple action features. For example, an action feature sequence includes three action features. The first action feature is raising the hand, the second action feature is bending over, and the third action feature is lifting the foot. Temporal association can be understood as the association of various action features based on the time sequence. Each action feature in the action feature sequence can have an association relationship in time sequence. For example, the action represented by the first action feature occurs first, the action represented by the second action feature occurs after the action represented by the first action feature occurs, and the action represented by the third action feature occurs after the action represented by the second action feature occurs, etc.
[0035] In the disclosed embodiment, the electronic device can at least generate a predicted action feature sequence based on the audio feature. The audio feature can be understood as data used to characterize the audio attribute, and the audio feature can include one or more of the data such as sampling frequency, bit rate, number of channels and frame rate. The predicted action feature sequence can be understood as an action feature sequence corresponding to the audio feature and other information generated based on the audio feature and other information. The electronic device can generate a predicted action feature sequence through an action prediction model, and the action prediction model can be understood as a trained neural network, which inputs the audio feature to obtain the corresponding predicted action feature sequence. For example: the electronic device can generate a predicted action feature sequence corresponding to the virtual teacher based on the audio features of the knowledge point content, which can improve the diversity of the teaching content and stimulate students' interest in learning. The electronic device can also generate a predicted action feature sequence matching the music information based on the audio features of the music information, and control the virtual anchor to show the dance moves corresponding to the predicted action feature sequence, which can reduce the manpower cost of maintaining the virtual anchor.
[0036] In a possible embodiment, the electronic device may also generate a predicted action feature sequence based on audio features and initial action features. The initial action feature may be understood as a preset action feature, which may include one action feature or multiple action features. The electronic device may also generate a predicted action feature sequence based on data such as audio features and scene features. The scene feature may be understood as a usage scenario of the predicted action feature sequence, such as a teaching scenario, a customer service scenario, or a navigation scenario. The present disclosure does not limit the manner in which the electronic device obtains a temporally associated predicted action feature sequence.
[0037] In the disclosed embodiment, after the electronic device obtains the predicted action feature sequence, it can determine the quantized action features that match each predicted action feature in the predicted action feature sequence from the preset action feature library. The preset action feature library can be understood as a collection of multiple quantized action features. The electronic device can summarize and quantize the collected multiple standard and reasonable actions into limited, sparse, indexable quantized action features in advance, and store them in the preset action feature library.
[0038] In some embodiments, the electronic device can learn the action feature library in an unsupervised manner to obtain a preset action feature library after training. Each quantized action feature in the preset action feature library can correspond to an action, for example: the preset action feature library includes quantized action features represented by 512 different actions. Quantized action features can be understood as high-dimensional features with sparse constraints. The electronic device can determine the matching relationship between the predicted action feature and the quantized action feature by determining the similarity between the predicted action feature and the quantized action feature. For example: there are 3 quantized action features in the action feature library, and the electronic device determines that the similarity between the first predicted action feature and the 3 quantized action features is 0.5 (corresponding to the first quantized action feature), 0.9 (corresponding to the second quantized action feature) and 0.4 (corresponding to the third quantized action feature) through a preset similarity calculation strategy, and the similarity between the second predicted action feature and the 3 quantized action features is 0.3 (corresponding to the first quantized action feature), 0.6 (corresponding to the second quantized action feature) and 0.85 (corresponding to the third quantized action feature). Taking the matching between the predicted action feature and the quantized action feature with the greatest similarity as an example, the electronic device can determine that the first predicted action feature matches the second quantized action feature, the second predicted action feature matches the third quantized action feature, and so on.
[0039] In a possible embodiment, the electronic device may determine a quantized action feature that matches the predicted action feature from a preset action feature library. The corresponding relationship between the number of predicted action features and the matched quantized action features may include: one predicted action feature corresponds to one quantized action feature, or one predicted action feature corresponds to at least two quantized action features, etc. The temporal correlation between the predicted action features may be the same as or different from the temporal correlation between the quantized action features.
[0040] In the disclosed embodiment, after determining the quantized motion feature that matches the predicted motion feature, the spatial correlation between the predicted motion features in the predicted motion feature sequence can be determined. The spatial correlation can be understood as the correlation between positions, the correlation between moving distances, and the correlation between moving directions, etc. For example, the spatial correlation between the first predicted motion feature and the second predicted motion feature can be a mirror image relationship, etc. The electronic device can determine the spatial correlation between the predicted motion features through the quantized motion features that match the predicted motion features.
[0041] For example: the electronic device analyzes the first quantitative action feature to determine the generated object of the action represented by the first quantitative action feature, and determines that the three-dimensional coordinates of each joint point of the object's body part are {(1,2,3),...}, analyzes the second quantitative action feature to determine the generated object of the action represented by the second quantitative action feature, and determines that the three-dimensional coordinates of each joint point of the object's body part are {(4,5,6),...}, and the relationship between the three-dimensional coordinates of each joint point can be determined through the relationship between the three-dimensional coordinates of each joint point. Here, the relationship between the three-dimensional coordinates of each joint point can be understood as the relationship between the same joint points in different quantitative action features, for example: the three-dimensional coordinates of the elbow joint represented by the first quantitative action feature are (1,2,3), and the three-dimensional coordinates of the elbow joint represented by the second quantitative action feature are (4,6,7), and the relationship between the three-dimensional coordinates of each joint point can be the relationship between the three-dimensional coordinates of the elbow joint represented by different quantitative action features.
[0042] In the disclosed embodiment, after the electronic device determines the spatial correlation between each predicted action feature, it can combine the quantized action features that match each predicted action feature according to the spatial correlation between each predicted action feature and the temporal correlation between each predicted action feature to obtain a target action feature sequence. The target action feature sequence can be understood as the optimal action feature sequence to be generated by the object. The size of the target action feature sequence can be the same as or different from the size of the predicted action feature sequence, which is not limited by the present disclosure. For example: the electronic device determines the spatial correlation between each predicted action feature (such as the relationship between the three-dimensional coordinates of the joint points of the action generation object in the predicted action feature), the temporal correlation between each predicted action feature (such as the relationship between the generation time of each predicted action feature, etc.), wherein the generation time of the predicted action feature can be the time when the predicted action feature is obtained.
[0043] The electronic device can combine the quantized action features that match each predicted action feature. For example: the electronic device determines the generation time of the first predicted action feature as the first moment, determines the generation time of the second predicted action feature as the second moment, and determines that the first moment and the second moment are adjacent in time sequence. The electronic device determines the first quantized action feature that matches the first predicted action feature and the second quantized action feature that matches the second predicted action feature, and respectively determines the first set of three-dimensional coordinates of the joint points of the action generation object in the first quantized action feature and the second set of three-dimensional coordinates of the joint points of the action generation object in the second quantized action feature. The electronic device determines the information such as the moving distance and moving direction in space between the same joint points in the first set of three-dimensional coordinates and the second set of three-dimensional coordinates, and then determines the action of the action generation object from the first moment to the second moment. The electronic device can control the action generation object to smoothly transition from the action of the first moment to the action of the second moment, for example: the action generated at the first moment (such as the 5th second moment) is to raise the hand to a height of 1.1m, and the action generated at the second moment (such as the 7th second moment) is to raise the hand to a height of 1.2m, then it can be determined that the action generated at the 6th second moment can be to raise the hand to a height of 1.15m, etc.
[0044] In a possible embodiment, a pre-trained neural network can be used to determine the target action feature sequence based on the audio features and the initial action features. Figure 2 As shown in FIG. 1 , it is a schematic diagram of an action generation method according to an exemplary embodiment. Figure 2As shown, audio features (Music features) m and initial action features (Starting pose codes) p0 can be input. The initial action feature p0 can be composed of at least two parts, for example: an initial action feature characterizing an upper body action and an initial action feature characterizing a lower body action. The initial action feature can be represented by an index number, for example: the initial action feature is (14, 13), which can represent upper body actions and lower body actions, respectively. Then, the target action prediction model (Actor-Critic Motion GPT) 201 is used to generate a predicted action feature sequence (Pose codesequence), and the predicted action feature sequence may include: p0 is (14, 13), p1 is (27, 68), ... pk is (0, 7), etc., where k is a positive integer. Then, according to the predicted action feature sequence, a quantized action feature sequence (Quantized features) matching each predicted action feature in the predicted action feature sequence can be determined from the preset action feature library 202. Among them, the preset action feature library can refer to a dance memory codebook (Choreographic Memory Codebook). The preset action feature library may include N groups of quantized action features 0 to (N-1), and each group of quantized action features may represent upper body actions and lower body actions respectively. Then, a convolutional neural network decoder (CNN Decoders) 203 may be used to generate a target action feature sequence based on the quantized action feature sequence, wherein the target action feature sequence may refer to a generated dance (Generateddance) or the like.
[0045] In the disclosed embodiment, it is possible to determine the quantized action features that match the various predicted action features that are correlated in time sequence from the preset action feature library, and combine the quantized action features that match the various predicted action features according to the spatial correlation relationship of the various predicted action features and the temporal correlation relationship of the various predicted action features to obtain a target action feature sequence. In the process of generating the target action feature sequence, it is possible to take into account the temporal correlation relationship and spatial correlation relationship of the various predicted action features, thereby improving the standardization of the generated target action feature sequence and improving the consistency between the target action feature sequence and the audio rhythm in terms of beat.
[0046] In some embodiments, determining, from a preset action feature library, a quantized action feature that matches each predicted action feature in the predicted action feature sequence includes:
[0047] Performing dimensionality reduction processing on each of the predicted action features to obtain a coding feature; wherein the dimension of the coding feature is the same as the dimension of each quantized action feature in the preset action feature library;
[0048] According to the distance between the encoding feature and each quantized motion feature in the preset motion feature library, a quantized motion feature matching each of the predicted motion features is determined from the preset motion feature library.
[0049] In the disclosed embodiment, the electronic device can perform dimensionality reduction processing on each predicted action feature to obtain a coding feature, and the dimension of the coding feature is the same as the dimension of each quantized action feature in the preset action feature library. In this way, the dimension of the coding feature can be made the same as the dimension of the quantized action feature, so that comparison, calculation and other processing can be performed. At the same time, by reducing the dimension of the feature, the subsequent processing can reduce the amount of calculation, improve the calculation efficiency, etc. For example: the dimension of the predicted action feature sequence can be (T×(J×3)), where T can represent the number of predicted action features (that is, the sequence length of the predicted action feature sequence), J can represent the number of joints of the object's body part, and 3 can represent the three-dimensional coordinates of each joint. The dimension of the quantized action feature sequence can be (T′×C), where T′ can represent the number of quantized action features (that is, the sequence length of the quantized action feature sequence), and C can represent the dimension of the quantized action feature.
[0050] In the disclosed embodiment, after the electronic device obtains the coding feature, it can determine the quantized action feature that matches each predicted action feature from the preset action feature library according to the distance between the coding feature and each quantized action feature in the preset action feature library. The distance between the coding feature and the quantized action feature can be understood as the similarity or degree of association between the features, etc., which can be achieved by determining the vector distance between different features. For example: the electronic device can determine the similarity between different features by determining the vector distances such as the Euclidean distance, Manhattan distance, Chebyshev distance, and Mahalanobis distance between the coding feature and the quantized action feature. For example: the electronic device determines that the distances between the first coding feature and each quantized action feature in the preset action feature library are 1, 2, and 3, respectively, and the distances between the second coding feature and each quantized action feature in the preset action feature library are 3, 4, and 5, respectively. Taking the minimum distance as an example of the rule for matching between different features, it can be determined that the first coding feature matches the first quantized action feature in the preset action feature library, and the second coding feature matches the third quantized action feature in the preset action feature library.
[0051] In the disclosed embodiment, by performing dimensionality reduction processing on each predicted action feature respectively, a coding feature with the same dimension as the quantized action feature is obtained, and then based on the distance between the coding feature and each quantized action feature in the preset action feature library, the quantized action feature that matches each predicted action feature can be simply and accurately determined from the preset action feature library, thereby improving the computational efficiency and converting the predicted action feature into a pre-trained quantized action feature with sparse constraints.
[0052] In some embodiments, determining, from the preset action feature library, a quantized action feature that matches each of the predicted action features according to the distance between the encoding feature and each quantized action feature in the preset action feature library, comprises:
[0053] Determine the distance between the coding feature to be processed and each quantized action feature in the preset action feature library;
[0054] Sorting the distances corresponding to the coding features to be processed to obtain a sorting result;
[0055] Determine, according to the sorting result, a quantized action feature corresponding to the coding feature to be processed;
[0056] According to the quantized action features corresponding to the respective coding features to be processed, quantized action features matching the respective predicted action features are determined.
[0057] In the disclosed embodiment, the electronic device can determine the distance between the coding feature to be processed and each quantized action feature in the preset action feature library. For example: the coding feature sequence includes 3 coding features, and the preset action feature library includes 10 quantized action features. The electronic device can first determine the distance between the first coding feature and the 10 quantized action features, such as 3, 5, 2, ..., etc., and then determine the distance between the second coding feature and the 10 quantized action features, such as 7, 4, 6, ..., etc., and finally determine the distance between the third coding feature and the 10 quantized action features, such as 1, 4, 3, ..., etc.
[0058] After the electronic device determines the distance between the coding feature to be processed and each quantized action feature in the preset action feature library, it can sort the distances corresponding to the coding feature to be processed, and determine the quantized action feature corresponding to the coding feature to be processed according to the sorting result. For example: by sorting the distances of the same coding feature in ascending order, it can be determined that the first coding feature corresponds to (2, 3, 5, ...), the second coding feature corresponds to (4, 6, 7, ...), and the third coding feature corresponds to (1, 3, 4, ...). Taking the minimum distance as a matching condition as an example, it can be determined that the first coding feature corresponds to the third quantized action feature in the preset action feature library, the second coding feature corresponds to the second quantized action feature in the preset action feature library, and the third coding feature corresponds to the first quantized action feature in the preset action feature library.
[0059] After the electronic device determines the quantized action feature corresponding to the coding feature to be processed, it can determine the quantized action feature that matches each predicted action feature according to the quantized action feature corresponding to each coding feature to be processed. For example: the electronic device determines that the first coding feature corresponds to the third quantized action feature, the second coding feature corresponds to the second quantized action feature, the third coding feature corresponds to the first quantized action feature, etc. The electronic device can determine the quantized action feature that matches the predicted action feature according to the corresponding relationship between the predicted action feature and the coding feature. The corresponding relationship between the predicted action feature and the coding feature can be one predicted action feature corresponding to one coding feature, or multiple predicted action features corresponding to one coding feature, etc. For example: the first predicted action feature corresponds to the first coding feature, and the second predicted action feature corresponds to the second coding feature, then the first predicted action feature corresponds to the third quantized action feature, and the second predicted action feature corresponds to the second quantized action feature, etc.
[0060] In the disclosed embodiment, by determining the distance between the coding feature to be processed and each quantized action feature in a preset action feature library, the distances corresponding to the coding feature to be processed are sorted, and then the quantized action features corresponding to the coding feature to be processed can be determined based on the sorting result, so that each predicted action feature can be simply and accurately converted into a quantized action feature based on the quantized action features corresponding to each coding feature to be processed.
[0061] In some embodiments, determining the spatial correlation between the predicted action features in the predicted action feature sequence includes:
[0062] According to each of the quantified action features, relative position information between each key point of the target character and a preset standard point and displacement information of the target character are determined; wherein the predicted action feature sequence is generated according to the audio feature and the initial action feature of the target character;
[0063] The spatial correlation relationship between the predicted motion features is determined according to the relative position information and the displacement information.
[0064] In the disclosed embodiment, the electronic device determines the relative position information between each key point of the target character and the preset standard point and the displacement information of the target character according to each quantized action feature. The electronic device can generate a predicted action feature sequence according to the audio feature and the initial action feature of the target character, the audio feature can include at least one rhythm, the initial action feature can include at least one beat (also called rhythm), and an audio rhythm can correspond to at least one action beat. The electronic device can customize the initial action feature, and when it is necessary to generate a predicted action feature sequence according to the initial action feature, a random action feature is selected from the initial action feature set as the initial action feature. The target character can be understood as an object for generating an action, and can include a virtual image such as a virtual teacher. The electronic device can control the target character to perform an action display according to the target action feature sequence. The electronic device can use the joint points of each joint of the target character's body as the key points for characterizing the action attributes, such as: shoulder joints, hip joints and knee joints. The electronic device can use the movement information between the preset standard points as the displacement information of the target character, and the preset standard point can be understood as any one of the key points, for example: the key point corresponding to the hip joint can be used as the preset standard point.
[0065] In a possible embodiment, the electronic device can obtain the relative position information between each key point and the preset standard point by inputting the quantized action feature into the first decoder. The relative position information can be understood as the three-dimensional coordinate information between the key points. For example: the first key point is located at 30 degrees from the preset standard point, and the distance is 10 cm; the second key point is located at 60 degrees from the preset standard point, and the distance is 12 cm, etc. The electronic device can obtain the displacement information of the target character by inputting the quantized action feature into the second decoder, and the displacement information can be understood as the movement attributes between the actions represented by different quantized action features, etc. For example: the action represented by the second quantized action feature is relative to the action represented by the first quantized action feature, and is expressed as moving 20 cm to the left, etc. That is, the spatial correlation relationship between each predicted action feature can be expressed as the relative position information between each key point of the target character and the preset standard point and the displacement information of the target character, etc.
[0066] In a possible embodiment, a pre-trained neural network (i.e., a target feature processing model) can be used to determine, from a preset action feature library, a quantized action feature that matches each predicted action feature in a predicted action feature sequence, and to determine a spatial correlation between each predicted action feature in the predicted action feature sequence. Figure 3 As shown in FIG. 1 , it is a schematic diagram of a feature processing method according to an exemplary embodiment. Figure 3 As shown, a predicted action feature sequence can be input, and the predicted action feature sequence can include upper body actions and lower body actions. The predicted action features in the predicted action feature sequence can be represented by P, and the dimension of the predicted action feature sequence can be T×(J×3), where T can represent the length of the sequence, J can represent the number of joints of the body part of the object generating the action, and 3 can represent the three-dimensional coordinates of each joint. Then, a pose encoder (Pose Encoder) E 301 is used to perform dimensionality reduction processing on each predicted action feature to obtain an encoding feature sequence (Encoding features), and the encoding feature can be represented by e. The dimension of the encoding feature sequence can be T'×C, where T' can represent the length of the sequence, and C can represent the dimension of the feature. Then, according to the encoding feature sequence, a quantized action feature sequence (Quantized features) matching each predicted action feature in the predicted action feature sequence can be determined from the preset action feature library (Choreographic Memory Codebook) 302, and the quantized action feature can be represented by eq, and the dimension of the quantized action feature sequence can be T'×C. Then, according to the quantized action feature sequence, the pose decoder (Pose Decoder) Dp 303 and the speed decoder (Global Velocity Decoder) Dv 304 are used to determine the relative position information between each key point of the target character and the preset standard point (which can be used Represents) and the displacement information of the target character (can be used Represented), the dimension of the vector feature of the relative position information can be T×(J×3), the dimension of the vector feature of the displacement information can be T×3, and so on.
[0067] In the disclosed embodiment, the relative position information between each key point of the target character and the preset standard point and the displacement information of the target character are determined according to each quantified action feature, wherein a predicted action feature sequence is generated according to audio features and the initial action features of the target character, so that the spatial correlation between each predicted action feature can be quickly and accurately determined according to the relative position information and the displacement information.
[0068] In some embodiments, the method further comprises:
[0069] Obtaining a sample action feature sequence;
[0070] According to each of the sample action features in the sample action feature sequence and the preset spatial association relationship between each of the sample action features, the model parameters of the initial feature processing model and the quantized action features in the initial action feature library of the initial feature processing model are updated to obtain an update result;
[0071] Obtaining a target feature processing model having the preset action feature library based on the update result;
[0072] The step of determining, from a preset action feature library, a quantized action feature that matches each predicted action feature in the predicted action feature sequence comprises:
[0073] From the preset action feature library of the target feature processing model, a quantized action feature matching each predicted action feature in the predicted action feature sequence is determined.
[0074] In the disclosed embodiment, the sample motion feature sequence can be understood as an artificially marked motion feature sequence, which can be used to train the initial feature processing model. The model parameters in the initial feature processing model can be set randomly. During the training process, the loss value can be calculated according to a predefined loss function to update the model parameters. The electronic device can crawl the sample motion feature sequence from the Internet, or select the sample motion feature sequence from a preset data set (such as a dance movement data set). The preset association relationship between each sample motion feature in space can be understood as the association relationship between each sample motion feature manually marked. The initial motion feature library can be understood as an untrained motion feature library. The initial motion feature library can be a part of the initial feature processing model, or it can refer to two different parts, which can jointly realize the processing of determining the association relationship between each predicted motion feature in space according to the predicted motion feature sequence. Each motion feature in the initial motion feature library can be customized, and the process of updating the model parameters of the initial feature processing model also includes updating each motion feature.
[0075] The electronic device can update the model parameters of the initial feature processing model and the quantized action features in the initial action feature library of the initial feature processing model according to each sample action feature in the sample action feature sequence and the preset spatial correlation between each sample action feature, and then obtain the target feature processing model with the preset action feature library based on the update result. The target feature processing model can be understood as a trained feature processing model, and the preset action feature library can be understood as a trained action feature library. After the electronic device obtains the target feature processing model with the preset action feature library, in the actual use of the model, it can determine the quantized action features that match each predicted action feature in the predicted action feature sequence from the preset action feature library of the target feature processing model, and use the target feature processing model to determine the spatial correlation between each predicted action feature.
[0076] In the disclosed embodiment, by obtaining a sample action feature sequence, the model parameters of the initial feature processing model and the quantized action features in the initial action feature library of the initial feature processing model can be updated according to each sample action feature in the sample action feature sequence and the preset spatial correlation between each sample action feature. This allows the initial feature processing model to be quickly and accurately trained into a target feature processing model, thereby improving the efficiency and accuracy of model training.
[0077] In some embodiments, the updating of the model parameters of the initial feature processing model and the quantized action features in the initial action feature library of the initial feature processing model according to each of the sample action features in the sample action feature sequence and the preset spatial association relationship between each of the sample action features to obtain the update result includes:
[0078] Using the initial feature processing model, obtaining a predicted correlation relationship between each of the sample action features in space;
[0079] Determining a first loss value according to the predicted association relationship in space and the preset association relationship in space;
[0080] Performing dimensionality reduction processing on each of the sample action features to obtain sample coding features;
[0081] Determining a second loss value according to the sample encoding feature;
[0082] Obtaining a first target loss value according to the first loss value and the second loss value;
[0083] The model parameters of the initial feature processing model and the quantized action features in the initial action feature library of the initial feature processing model are updated using the first target loss value to obtain the updated result.
[0084] In the disclosed embodiment, during the training process of the initial feature processing model, the electronic device may use the initial feature processing model to obtain the predicted association relationship of each sample action feature in space. The predicted association relationship may be understood as an association relationship obtained according to preset model parameters. The electronic device may determine the first loss value according to the predicted association relationship and the preset association relationship, for example: the electronic device may determine the first loss value according to the difference between the predicted association relationship and the preset association relationship through the calculation strategy of the preset first loss function. The electronic device may perform dimensionality reduction processing on each sample action feature to obtain a sample coding feature, and the sample coding feature may be understood as a coding feature obtained according to the preset model parameters. The electronic device may process the sample coding feature according to the calculation strategy of the preset second loss function to determine the second loss value, for example: the electronic device may determine the norm value corresponding to the sample coding feature, and use the obtained norm value as the second loss function, etc.
[0085] After the electronic device determines the first loss value and the second loss value, it can obtain the first target loss value based on the first loss value and the second loss value. The first target loss value can be understood as the loss value determined in the process of training the initial feature processing model once. For example: the electronic device determines the first target loss value based on weighted summation of the first loss value and the second loss value, or based on the ratio between the first loss value and the second loss value. After the electronic device determines the first target loss value, it can use the first target loss value to update the model parameters of the initial feature processing model and the action features in the initial action feature library of the initial feature processing model. For example: adjust the model parameters from t1 to t2, adjust the action features from e1 to e2, etc.
[0086] In the disclosed embodiments, different loss values can be obtained according to different calculation strategies, so that the target loss value can be accurately determined, the efficiency and accuracy of model training can be improved, etc.
[0087] In some embodiments, determining the second loss value according to the sample encoding feature includes:
[0088] Determining, from the initial action feature library, a quantized action feature that matches the sample action feature according to the sample coding feature;
[0089] The second loss value is determined according to the sample coding feature and the quantized action feature matching the sample action feature.
[0090] In the disclosed embodiment, the electronic device may determine the quantized action feature that matches the sample action feature from the initial action feature library based on the sample coding feature. The electronic device may determine the distance between the sample coding feature and the quantized action feature in the initial action feature library, thereby determining the quantized action feature that matches the sample action feature. For example: the first sample coding feature matches the first quantized action feature in the initial action feature library, the second sample coding feature matches the second quantized action feature in the initial action feature library, etc.
[0091] After the electronic device determines the quantized motion feature that matches the sample motion feature from the initial motion feature library, it can determine the second loss value based on the sample coding feature and the quantized motion feature that matches the sample motion feature. For example, the electronic device can determine the distance between the sample coding feature and the quantized motion feature, and use the distance as the second loss value. The present disclosure does not limit the method of determining the second loss value based on the sample coding feature and the quantized motion feature that matches the sample motion feature.
[0092] In the disclosed embodiment, the second loss value is determined by using the sample coding feature and the quantized action feature that matches the sample action feature, so that the model parameters can be updated quickly and accurately.
[0093] In some embodiments, determining the second loss value according to the sample coding feature and a quantized action feature matching the sample action feature includes:
[0094] Determining a first sub-loss value according to a difference between the sample encoding feature and the sample quantization action feature;
[0095] Determine a second sub-loss value according to the inverse of a difference between the sample encoding feature and the sample quantized motion feature;
[0096] The second loss value is determined according to the first sub-loss value, the second sub-loss value and a preset weight coefficient.
[0097] In the disclosed embodiment, the electronic device may determine a first sub-loss value according to the difference between the sample coding feature and the sample quantization action feature, and determine a second sub-loss value according to the inverse of the difference between the sample coding feature and the sample quantization action feature. For example: the difference between the sample coding feature and the sample quantization action feature is 2, the inverse of the difference between the sample coding feature and the sample quantization action feature is -2, etc. The electronic device determines the second loss value according to the first sub-loss value, the second sub-loss value, and a preset weight coefficient. For example: the preset weight coefficient corresponding to the first sub-loss value is 0.3, and the preset weight coefficient corresponding to the second sub-loss value is 0.7. According to the preset calculation strategy, the weighted first sub-loss value and the second sub-loss value are processed to obtain the second loss value.
[0098] In a possible embodiment, the electronic device determines, from a preset action feature library, a calculation formula for a quantized action feature that matches each predicted action feature in a predicted action feature sequence as follows:
[0099]
[0100] In formula (1), e j can represent the predicted action features, z j It can represent the quantitative action features in the preset action feature library, e q,j It can represent the quantized action feature that matches the predicted action feature. Z can represent the preset action feature library, j can represent the number of the current predicted action feature, and argmin|||| can represent the minimum distance between the predicted action feature and the quantized action feature.
[0101] In a possible embodiment, the electronic device may determine a calculation formula for the first loss value according to the predicted association relationship and the preset association relationship as follows:
[0102]
[0103] In formula (2), L rec can represent the first loss value, can represent predicted associations, and p can represent preset associations. and p' can represent the first-order derivative, and p″ can represent the second-order derivative, ||||1 can represent the distance between features, and α1 and α2 can represent custom parameters.
[0104] In a possible embodiment, the calculation formula for the electronic device to determine the first target loss value may be as follows:
[0105]
[0106] In formula (3), L VQ It can represent the first target loss value, L rec can represent the first loss value, e can represent the sample encoding feature, e qIt can represent sample quantization action features. Sg[] can represent stop gradient, which can be understood as the need to calculate the gradient during the forward propagation of the model training process, but not during the backward propagation. |||| can represent the distance between features. By setting the distance between the sample coding feature and the sample quantization action feature, the purpose is to make the sample coding feature close to the sample quantization action feature, and at the same time, the sample quantization action feature close to the sample coding feature, thereby improving the training efficiency. β can represent a custom parameter. In a possible embodiment, L can be used VQ The first item in , that is, the first loss value (also called reconstruction loss), is used to train the encoder and decoder in the neural network; L VQ The second term in , also called codebook loss, is used to train the initial action feature library in the neural network; L VQ The third term in , also called commitment loss, is used to train the encoder in the neural network to prevent the encoder output from frequently jumping back and forth between the quantized motion features of each sample. The target feature processing model can also be called the Choreographic Memory model. The target feature processing model can be understood as a neural network trained based on the Vector Quantized Variational AutoEncoder (VQ-VAE) framework.
[0107] In the disclosed embodiment, the second sub-loss value is determined by using the information of the difference between the sample coding feature and the sample quantized action feature, which can improve the similarity between the sample coding feature and the quantized action feature, making the standard action in the preset action feature library more in line with actual specifications, etc.
[0108] In some embodiments, the obtaining of a temporally associated sequence of predicted action features includes:
[0109] According to each sub-audio feature in the audio feature and the initial action feature of the target character, determining a predicted action feature aligned with each sub-audio feature in time sequence; wherein each sub-audio feature is associated in time sequence;
[0110] The predicted action feature sequence is obtained according to each of the predicted action features.
[0111] In the disclosed embodiment, the electronic device may segment the audio feature to obtain at least two sub-audio features. For example, the electronic device may segment the audio feature according to a preset tone level, timbre range or time interval to obtain various sub-audio features that are associated in time sequence. For example, the first sub-audio feature is the first frame of audio, the second sub-audio feature is the second frame of audio, etc. The electronic device may generate a first predicted action feature based on the first sub-audio feature and the initial action feature, and then generate a second predicted action feature based on the second sub-audio feature and the first predicted action feature, etc., so that the generated predicted action features have an associated relationship in time sequence. In a possible embodiment, the electronic device may also generate a first predicted action feature based on the first sub-audio feature and the initial action feature, and then generate a second predicted action feature based on the first sub-audio feature, the second sub-audio feature, the initial action feature and the first predicted action feature, etc.
[0112] After the electronic device obtains the predicted action feature that is determined to be aligned with the sub-audio feature in time sequence, it obtains all the predicted action features corresponding to all the sub-audio features, and can combine at least two predicted action features according to the correlation relationship between the sub-audio features in time sequence and the alignment relationship between the predicted action feature and the sub-audio feature to obtain a predicted action feature sequence. For example: the predicted action feature in the first column of the predicted action feature sequence is the predicted action feature corresponding to the first sub-audio feature, and the predicted action feature in the second column of the predicted action feature sequence is the predicted action feature corresponding to the second sub-audio feature, etc.
[0113] In the disclosed embodiment, predicted action features that are aligned in time sequence with each sub-audio feature are determined through each sub-audio feature and the initial action feature, so that a predicted action feature sequence can be obtained based on each predicted action feature, and the predicted action feature sequence can be obtained accurately and quickly.
[0114] In some embodiments, determining, based on each sub-audio feature in the audio feature and the initial action feature of the target character, a predicted action feature aligned in time sequence with each sub-audio feature includes:
[0115] According to the part information of the target character, the initial action feature is split to obtain at least two sub-initial action features;
[0116] Determining the degree of association between each of the sub-audio features and each of the sub-initial action features; wherein the degree of association at least represents the degree of association between the sub-audio features and each of the sub-initial action features in terms of content and timing;
[0117] The predicted action feature is determined according to the correlation degree between each of the sub-audio features and each of the sub-initial action features.
[0118] In the disclosed embodiment, the electronic device can split the initial action feature according to the part information of the target character to obtain at least two sub-initial action features. The part information can be understood as the information of the part where the target character performs the action. For example, if the target character is a virtual character, the part information can be the whole body, that is, the initial action feature represents the whole body action. Since the whole body action can be split into upper body action and lower body action, or facial action and limb action, etc. The electronic device can split the initial action feature to obtain at least two sub-initial action features, for example, the first sub-initial action feature represents the upper body action, and the second sub-initial action feature represents the lower body action, etc. In this way, it is helpful to accurately generate more detailed whole body actions in the subsequent process, so that more diverse actions can be combined.
[0119] After the electronic device obtains at least two sub-initial motion features, it can determine the degree of association between each sub-audio feature and each sub-initial motion feature, wherein the degree of association includes at least the degree of association between the sub-audio feature and each sub-initial motion feature in terms of content and timing. In the process of generating predicted motion features, the generated predicted motion features can be made smoother and the consistency with the audio rhythm can be improved based on the association between each sub-audio feature and itself, the association between each sub-audio feature and each sub-initial motion feature, and the association between each sub-initial motion feature and itself. For example: there are 10 sub-audio features, and the sub-initial motion features include: 3 upper body initial motion features and 3 lower body initial motion features, etc., and one upper body initial motion feature and one lower body initial motion feature are combined into a complete set of initial motion features.
[0120] In a possible embodiment, the electronic device may determine the degree of association of the first sub-audio feature according to the degree of association between the first sub-audio feature and the first sub-audio feature itself, the corresponding association relationship between the first sub-audio feature and the first upper body initial motion feature, and the corresponding association relationship between the first sub-audio feature and the first lower body initial motion feature. The degree of association may include feature information of the sub-audio feature and the sub-initial motion feature itself, and information such as the positional relationship between the sub-audio feature and the sub-initial motion feature. The electronic device may determine the degree of association of the second sub-audio feature according to the degree of association between the second sub-audio feature and the second sub-audio feature itself, the degree of association between the second sub-audio feature and the first sub-audio feature itself, and the corresponding association relationship between the second sub-audio feature and the second upper body initial motion feature, the corresponding association relationship between the second sub-audio feature and the first upper body initial motion feature, the corresponding association relationship between the second sub-audio feature and the second lower body initial motion feature, and the association relationship between the second sub-audio feature and the first lower body initial motion feature. The manner of determining the degree of association of the second upper body initial motion feature, the second lower body initial motion feature, etc. is the same as the manner of determining the degree of association of the second sub-audio feature.
[0121] After the electronic device determines the degree of association between each sub-audio feature and each sub-initial action feature, it can determine the predicted action feature according to the degree of association between each sub-audio feature and each sub-initial action feature. For example, the electronic device can determine the degree of association according to a preset natural language processing layer (Transformer), thereby determining the predicted action feature.
[0122] In a possible embodiment, a pre-trained neural network (ie, a target action prediction model) may be used to determine a predicted action feature sequence based on audio features and initial action features. Figure 4 FIG. 1 is a schematic diagram of an action prediction method according to an exemplary embodiment. Figure 4 As shown in FIG. 1 , the audio features and the initial action features can be concatenated by feature embedding to obtain a concatenated feature sequence. The initial action features can include upper body actions and lower body actions (Upper / lower half-body sequence). For example, the first upper body initial action is The second upper body initial movement is The first lower body initial movement is The second lower body initial movement is Etc. The part representing the audio feature in the spliced feature sequence can be represented by m, the part representing the features represented by the upper body movements can be represented by u, the part representing the features represented by the lower body movements can be represented by l, etc. The dimension of the spliced feature can be 3×T'. Then the positional embedding is combined with the spliced feature, where the positional feature can represent the position information of each item in the spliced feature, and then the combined result is input into the state network f s In 401, a state feature sequence (S) is obtained, wherein the second part of the state feature sequence can represent the state feature corresponding to the upper body movement, and the third part can represent the state feature corresponding to the upper body movement.
[0123] In one possible embodiment, a policy making network may then be used to a 402, obtain a candidate action feature sequence and a probability value (Action probability) corresponding to each candidate action feature. The dimension of the feature sequence (a) of the probability value may be (3×T′)×N, where the candidate action feature corresponding to the upper body action may be represented as a u , the candidate action features corresponding to the lower body action can be expressed as a l Then, we can use the selector (top-1 selection) to determine the predicted sample action features from multiple candidate action feature sequences, such as the first upper body initial action is The second upper body initial movement is The first lower body initial movement is The second lower body initial movement is After determining the predicted sample motion feature sequence, the quantized motion feature sequence (Quantized features) matching each predicted motion feature in the predicted motion feature sequence can be determined from the preset motion feature library (Choreographic Memory Codebook) 404, and the target motion feature sequence (Generated dance) can be generated according to the quantized motion feature sequence using the convolutional neural network decoder (CNNDecoders) 405.
[0124] In a possible embodiment, after obtaining the state feature sequence, a value evaluation network (criticvalue network, f v )403, determine the critic values corresponding to each state feature, where the dimension of the feature sequence represented by the critic value can be (3×T′)×1, V urepresents the critical value corresponding to the features represented by the upper body movements, V l Indicates the critical value corresponding to the characteristics represented by the lower body action. u and V l Combined, the critical value (V) of the overall action. A consistency reward processing (Beat Align / Half-body Consistency Reward) 406 can be performed based on the target action feature sequence and the music beats to determine the reward value (reward) R. Based on the reward value and the critical value, the time difference error (TD-error) ε is determined. The cross-entropy loss (cross-entropy loss) L can be determined based on the probability value. CE , according to the probability value and the time difference error, determine the actor evaluation loss (Actor-criticloss) L AC , and determine the value loss L according to the time difference error V Finally, the neural network can be initialized and trained according to the cross entropy loss, actor evaluation loss and value loss to obtain a trained neural network (i.e., the target action prediction model). The target action prediction model can also be called the dance action generation model (actor-criticGenerative Pre-trained Transformer, GPT), which can be understood as a neural network trained by the GPT framework based on reinforcement learning.
[0125] In a possible embodiment, the state network includes multiple layers of natural language processing layers (TransformerLayer), and the natural language processing layers in the state network may include: horizontal normalization layer (Layer Normalization), cross conditional causal attention layer (Cross Conditional Causal Attention), fully connected layer (Linear), activation layer (GELU), filter layer (Dropout), etc. The decision network includes multiple layers of natural language processing layers and linear layers (Linear) or regression layers (Softmax), etc., and the value evaluation network includes multiple layers of natural language processing layers and linear layers, etc.
[0126] like Figure 5a , Figure 5b and Figure 5c As shown in FIG. 1 , it is a schematic diagram of a method for determining different degrees of association according to an exemplary embodiment. Figure 5a As shown in , it can represent the full attention mode (Full attention), and each feature determines the degree of association with all the features in the sequence. Figure 5bAs shown in the area, it can represent causal attention. The first feature in the feature sequence determines the degree of association with the first feature, the second feature determines the degree of association with the first and second features, and the third feature determines the degree of association with the first, second and third features, etc. Figure 5c As shown in the area, a cross-conditional causal attention method can be represented. For the music features in the feature sequence, the first music feature determines the degree of association with the first music feature, the first upper body action feature and the first lower body action feature, and the second music feature determines the degree of association with the first music feature, the second music feature, the first upper body action feature, the second upper body action feature, the first lower body action feature and the second lower body action feature, etc. For different types of features such as upper body action features and lower body action features in the feature sequence, the method of determining the association relationship is the same. This embodiment can use a cross-conditional causal attention method to determine the degree of association between features, so that both upper body actions and lower body actions can be taken into account in the process of determining the association relationship, so that the inconsistency of the upper and lower body actions will not occur.
[0127] In the disclosed embodiment, the initial action feature is split according to the part information of the target character to obtain at least two sub-initial action features, and then the degree of correlation between each sub-audio feature and each sub-initial action feature can be determined. Thus, the predicted action feature can be determined based on the degree of correlation between each sub-audio feature and each sub-initial action feature, which can improve the accuracy of generating the predicted action feature.
[0128] In some embodiments, the method further comprises:
[0129] Obtaining sample audio features and sample initial action features of a sample character;
[0130] Splitting the sample initial action feature according to the part information of the sample character to obtain at least two sub-sample initial action features;
[0131] Determine a predicted sample action feature sequence according to each sub-sample audio feature in the sample audio feature and each sub-sample initial action feature;
[0132] The initial motion prediction model is trained based on each prediction sample motion feature and each preset sample motion feature in the prediction sample motion feature sequence to obtain a target motion prediction model;
[0133] The step of obtaining a temporally associated predicted action feature sequence includes:
[0134] The target action prediction model is used to obtain a temporally associated predicted action feature sequence.
[0135] In the disclosed embodiment, the sample audio feature can be understood as manually labeled audio information, the action represented by the sample initial action feature is generated by the sample character, and the sample initial action feature can be understood as a manually labeled action feature sequence, which can be used to train the initial action prediction model. The model parameters in the initial action prediction model can be set randomly, and during the training process, the model parameters can be updated according to the loss value determined by the predefined loss function. The electronic device can crawl the sample audio features and the sample initial action features corresponding to the sample audio features from the Internet. The electronic device can split the sample initial action features according to the part information of the sample character to obtain at least two sub-sample initial action features. For example: split the sample initial action features into: sub-sample initial action features representing upper body actions and sub-sample initial action features representing lower body actions, etc.
[0136] In a possible embodiment, the electronic device may use the initial action prediction model to determine a sequence of predicted sample action features according to each sub-sample audio feature and each sub-sample initial action feature. The electronic device determines a loss value corresponding to a preset loss function according to each predicted sample action feature and each preset sample action feature, and then updates the model parameters of the initial action prediction model according to the loss value to obtain a trained target action prediction model. After the electronic device obtains the trained target action prediction model, it may use the target action prediction model to obtain a sequence of predicted action features associated in time sequence according to the audio features and the initial action features.
[0137] In the disclosed embodiment, by obtaining sample audio features and sample initial action features of a sample character, the sample initial action features can be split to obtain at least two sub-sample initial action features, and then a predicted sample action feature sequence is determined. Thus, the initial action prediction model can be trained based on each predicted sample action feature and each preset sample action feature to obtain a target action prediction model, thereby improving the accuracy of model training.
[0138] In some embodiments, the training of the initial motion prediction model based on each predicted sample motion feature and each preset sample motion feature in the predicted sample motion feature sequence to obtain the target motion prediction model includes:
[0139] According to the audio features of each sub-sample and the initial action features of each sub-sample, a candidate action feature and a probability value corresponding to each of the candidate action features are obtained; wherein the probability value is used to determine the predicted sample action feature from the candidate action features;
[0140] determining a third loss value according to the number of the sub-sample audio features, the preset sample action features and the probability value;
[0141] determining a fourth loss value according to the number of the sub-sample audio features, the predicted sample action features and the probability value;
[0142] Obtaining a second target loss value according to the third loss value and the fourth loss value;
[0143] The model parameters of the initial action prediction model are updated using the second target loss value to obtain the target action prediction model.
[0144] In the disclosed embodiment, during the training of the target action prediction model, the electronic device can obtain candidate action features and probability values corresponding to each of the candidate action features based on the sub-sample audio features and the sub-sample initial action features, wherein the probability values are used to determine the predicted sample action features from the candidate action features. The candidate action features can be understood as multiple action features that can be selected later based on the current sub-sample audio features and the sub-sample initial action features, each of which may be used as a predicted sample action feature. In order to make the audio rhythm consistent with the action beat, it is necessary to determine the candidate action feature with the highest probability of making the audio rhythm consistent with the action beat from multiple candidate action features. For example: when generating the current predicted sample action feature, the probability value corresponding to the first candidate action feature is 0.8, the probability value corresponding to the second candidate action feature is 0.3, and the probability value corresponding to the third candidate action feature is 0.7, then the electronic device can use the first candidate action feature as the current predicted sample action feature.
[0145] After the electronic device determines the probability value corresponding to the candidate action feature, it can determine the third loss value based on the number of sub-sample audio features, the preset sample action features and the probability value. The third loss value can be understood as a part of the loss value of the initial action prediction model calculated according to the determination strategy of the preset third loss function, and can be understood as the difference between the predicted sample action features of the initial action prediction model and the preset sample action features. The electronic device can determine the fourth loss value based on the number of sub-sample audio features, the predicted sample action features and the probability value. The fourth loss value can be understood as a part of the loss value of the initial action prediction model calculated according to the determination strategy of the preset fourth loss function, and can be understood as the reward when the initial action prediction model selects the predicted sample action features.
[0146] The electronic device determines that a second target loss value can be obtained based on the third loss value and the fourth loss value, and the model parameters of the initial motion prediction model are updated using the second target loss value to obtain the target motion prediction model. For example, the electronic device can obtain the second target loss value by performing weighted addition processing on the third loss value and the fourth loss value.
[0147] In the disclosed embodiment, candidate action features and probability values corresponding to each candidate action feature are obtained based on sub-sample audio features and sub-sample initial action features. Then, a third loss value can be determined based on the number of sub-sample audio features, preset sample action features and probability values. Also, a fourth loss value can be determined based on the number of sub-sample audio features, predicted sample action features and probability values. Thus, a second target loss value is obtained, and the model parameters of the initial action prediction model are updated. This can accurately determine the target loss value, thereby improving the efficiency and accuracy of model training.
[0148] In some embodiments, determining the third loss value according to the number of the sub-sample audio features, the preset sample action features and the probability value includes:
[0149] Determine the difference between the vector feature of the probability value and the preset sample action feature;
[0150] The third loss value is determined according to the difference between the vector feature of the probability value and the preset sample action feature and the number of the sub-sample audio features.
[0151] In the disclosed embodiment, the electronic device may determine the difference between the vector feature of the probability value and the preset sample action feature, and then determine the third loss value according to the difference between the vector feature of the probability value and the preset sample action feature and the number of sub-sample audio features. For example: in the process of the electronic device successively determining the predicted sample action features, the difference between the vector feature of the probability value and the preset sample action features is 2, 1, 3, 4, 2... Then, when determining the predicted sample action feature corresponding to the third sub-sample audio feature, the first difference, the second difference and the third difference may be accumulated to obtain the third loss value when determining the predicted sample action feature corresponding to the current sub-sample audio feature.
[0152] In the disclosed embodiment, by determining the difference between the vector feature of the probability value and the preset sample action feature, the third loss value can be quickly and accurately determined based on the difference between the vector feature of the probability value and the preset sample action feature and the number of sub-sample audio features, thereby improving the efficiency and accuracy of model training.
[0153] In some embodiments, determining the fourth loss value according to the number of the sub-sample audio features, the predicted sample action features and the probability value comprises:
[0154] Determine the difference between the predicted sample action feature and the vector feature of the probability value;
[0155] Determining the orientation features of the sample characters according to the initial action features of each sub-sample;
[0156] The fourth loss value is determined according to the number of the sub-sample audio features, the difference between the predicted sample action features and the vector features of the probability values, and the orientation features.
[0157] In the disclosed embodiment, the electronic device can determine the difference between the predicted sample action feature and the vector feature of the probability value, and determine the orientation feature of the sample character according to the initial action features of each sub-sample, and the difference between the predicted sample action feature and the vector feature of the probability value can be understood as the distance difference between different features. The orientation feature can be understood as the direction information of the action generated by the sample character when the sample character generates the action, for example: the orientation feature of the whole body action can be characterized as facing the right front, the orientation feature of the upper body action can be characterized as facing the left, and the orientation feature of the lower body action can be characterized as facing the right, etc.
[0158] After the electronic device determines the difference between the predicted sample action feature and the vector feature of the probability value, as well as the orientation feature of the sample character, the fourth loss value can be determined according to the number of sub-sample audio features, the difference between the predicted sample action feature and the vector feature of the probability value, and the orientation feature. For example: in the process of the electronic device successively determining the predicted sample action feature, the difference between the vector feature of the probability value and the predicted sample action feature is 3, 5, 6, 2, 4..., respectively, and the orientation features can be expressed as: the upper body movement is consistent with the lower body movement, the upper body movement is inconsistent with the lower body movement... Then, when determining the predicted sample action feature corresponding to the third sub-sample audio feature, the difference can be fused with the orientation feature (e.g., multiplication), and then the first fusion result, the second fusion result, and the third fusion result are accumulated to obtain the fourth loss value when determining the predicted sample action feature corresponding to the current sub-sample audio feature.
[0159] In the disclosed embodiment, by determining the difference between the vector features of the predicted sample action features and the probability values, as well as the orientation features of the sample character, the fourth loss value can be quickly and accurately determined based on the number of sub-sample audio features, the difference between the vector features of the predicted sample action features and the probability values, and the orientation features, thereby improving the efficiency and accuracy of model training.
[0160] In a possible embodiment, the electronic device obtains the candidate action features and the calculation formula corresponding to each candidate action feature according to the sub-sample audio feature and the sub-sample initial action feature, which can be as follows:
[0161]
[0162] In formula (4), It can represent the probability value corresponding to the candidate action feature determined by the upper body action, It can represent the probability value corresponding to the candidate action feature determined by the lower body action, and P() can represent the probability distribution. and can represent the quantized action features corresponding to the upper body action and the lower body action respectively, k can represent multiple candidate action features determined, and m 1-t Can represent audio features. It can represent the initial action characteristics corresponding to the upper body action. It can represent the initial action features corresponding to the lower body action, argmax k |||| can represent the predicted action features corresponding to the maximum reward value.
[0163] In a possible embodiment, the electronic device determines the calculation formula of the third loss value according to the number of sub-sample audio features, the preset sample action features and the probability value as follows:
[0164]
[0165] In formula (5), L CE It can represent the third loss value, which can also be called the cross entropy loss value, and T′ can represent the number of sub-sample audio features. can represent the probability value, h can represent the upper body action u or the lower body action l, and t can represent the number of the current processing. It can represent the preset sample action features, and CrossEntropy() can represent the distance between different features.
[0166] In a possible embodiment, the electronic device determines the calculation formula of the fourth loss value according to the number of sub-sample audio features, the predicted sample action features and the probability value as follows:
[0167] v=v u +v l =f v (s) T′:2T′-1 +f v (s) 2T′:3T′-1 (6);
[0168] ε 0:T′-2 =r0:T′-2 +sg[v 1:T′-1 ]-v 0:T′-2 (7);
[0169]
[0170]
[0171]
[0172]
[0173] In formulas (6), (7), (8), (9), (10) and (11), v can represent the critical value corresponding to the predicted sample action feature, v u and v l It can represent the critical value corresponding to the predicted sample action features represented by the upper body action and the lower body action, respectively, v (s) can represent the value evaluation network. ε0 can represent the time difference error, r=R can represent the reward value, and Sg[] can represent the stop gradient, which can be understood as the gradient needs to be calculated during forward propagation, but not during reverse propagation. L AC It can represent the fourth loss value, which can also be called the actor evaluation loss, T′ can represent the number of sub-sample audio features, can represent the probability value, h can represent the upper body action u or the lower body action l, and t can represent the number of the current processing. It can be used to predict sample action features, and CrossEntropy() can be used to obtain the distance between different features. b () can represent the first reward, also known as the beat-align reward, R c () can represent the second reward, which can also be called compositional consistency reward, inf{} can represent the infimum, It can represent the reference reward corresponding to the second reward, and The orientation characteristics of the upper body movements and lower body movements relative to the xz plane can be respectively represented.
[0174] In a possible embodiment, the calculation formula of value loss can be as follows:
[0175]
[0176] In formula (12), L vCan represent value loss, T′ can represent the number of sub-sample audio features, ε can represent time difference error, and || ||2 can represent the norm formula.
[0177] In a possible embodiment, Figure 6 As shown, it is a schematic diagram of a reward determination method according to an exemplary embodiment. As shown in area (a), it can represent the first reward, d can represent the duration corresponding to the sub-sample audio feature, the vertical dotted line can represent the music rhythm (music beat), the curve can represent the trend of movement change, and the solid point can represent the action beat (dance beat). In the case where there are music rhythm points and action beat points within the duration corresponding to the sub-sample audio feature, the first reward is 1; if there are music rhythm points and no action beat points within the duration corresponding to the sub-sample audio feature, or if there are no music rhythm points within the duration corresponding to the sub-sample audio feature, the first reward is -1. As shown in Figure (b), the second reward can be represented. The orientation feature n of the upper body movement can be determined respectively based on the predicted sample action features corresponding to the upper body action and the predicted sample action features corresponding to the lower body action. u () and the orientation characteristics of the lower body movements l (), then the orientation features corresponding to the xz plane can be obtained and In position features and orientation features If the angle between them does not belong to the same side, the second reward is 1. and orientation features When the angles between the two features belong to the same side, the second reward is the angle between the features in different orientations.
[0178] In a possible embodiment, Figure 7 , is a schematic diagram of a target action according to an exemplary embodiment. p0 and p1 may represent predicted action features. In the decoded target action sequence, when there are continuous repeated codes of the predicted action features (e.g., p0 and p0 in the first row, and p1 and p1 in the second row), the generated target action remains static, and when there are continuous different codes of the predicted action features (e.g., p0 and p1 in the first row), the generated target actions are smoothly transitioned.
[0179] In some embodiments, the action generation method in the embodiment of the present disclosure can be used to generate dance actions. For example, a target dance action can be generated according to the target music and the initial action of the target character. Generating the target dance action may include the following steps:
[0180] Acquire the audio features of the target music and the initial action features of the target character;
[0181] Generate a temporally associated predicted action feature sequence according to the audio features of the target music and the initial action features of the target character; wherein the predicted action feature sequence includes predicted dance action features;
[0182] Determining, from a preset action feature library, a quantized action feature that matches each of the predicted dance action features;
[0183] Determining the spatial correlation between the predicted dance movement features in the predicted movement feature sequence;
[0184] According to the spatial correlation relationship of each of the predicted dance movement features and the temporal correlation relationship of each of the predicted dance movement features, the quantized movement features that match each of the predicted dance movement features are combined to obtain a target movement feature sequence corresponding to the target character;
[0185] The target character is controlled to perform a target dance action corresponding to the target action feature sequence.
[0186] In the disclosed embodiment, the target music may include music of different styles such as pop, classical, jazz, rock or folk songs, and the initial action features of the target character may be determined by pre-set default action features, or may be determined according to the current instructions of the user. The electronic device may take the audio features of the target music and the initial action features of the target character as input, and obtain the target action feature sequence corresponding to the target character according to the audio features of the target music and the initial action features of the target character, and then control the target character to perform the target dance action corresponding to the target action feature sequence. The target dance action may be understood as a dance action that matches the form of the target music, and the target dance may include dances such as floor dance (Breaking), ballet jazz (Ballet jazz), free dance (House dance) or hip-hop (Middle hip-hop). Different forms of target music may correspond to different types of target dance actions, for example: inputting the target music and initial action features in the form of folk songs, and the target character may be controlled to perform the dance action of the folk dance type, etc.
[0187] Based on the action generation method proposed in the above-mentioned embodiment, the embodiment of the present disclosure further proposes an action generation device.
[0188] Figure 8 is a schematic diagram of the structure of the action generation device according to an embodiment of the present disclosure, such as Figure 8 As shown, the device may include:
[0189] The acquisition module 801 is configured to acquire a predicted action feature sequence associated in time sequence; wherein the predicted action feature sequence is generated at least according to the audio feature;
[0190] The first determination module 802 is configured to determine, from a preset action feature library, quantized action features that match each predicted action feature in the predicted action feature sequence; the second determination module 803 is configured to determine the spatial association relationship between each predicted action feature in the predicted action feature sequence; the combination module 804 is configured to combine the quantized action features that match each predicted action feature according to the spatial association relationship between each predicted action feature and the temporal association relationship between each predicted action feature to obtain a target action feature sequence.
[0191] In some embodiments, the first determination module 802 is configured to: perform dimensionality reduction processing on each of the predicted action features respectively to obtain a coding feature; wherein the dimension of the coding feature is the same as the dimension of each quantized action feature in the preset action feature library; and determine, from the preset action feature library, a quantized action feature that matches each of the predicted action features based on the distance between the coding feature and each quantized action feature in the preset action feature library.
[0192] In some embodiments, the first determination module 802 is configured to: determine the distance between the coding feature to be processed and each quantized action feature in the preset action feature library; sort the distances corresponding to the coding feature to be processed to obtain a sorting result; determine the quantized action feature corresponding to the coding feature to be processed based on the sorting result; and determine the quantized action feature that matches each predicted action feature based on the quantized action features corresponding to each of the coding features to be processed.
[0193] In some embodiments, the second determination module 803 is configured to: determine the relative position information between each key point of the target character and the preset standard point and the displacement information of the target character according to each of the quantified action features; wherein the predicted action feature sequence is generated according to the audio features and the initial action features of the target character; and determine the spatial correlation between each of the predicted action features according to the relative position information and the displacement information.
[0194] In some embodiments, the device 800 also includes: a third determination module, configured to obtain a sample action feature sequence; an update module, configured to update the model parameters of the initial feature processing model and the quantized action features in the initial action feature library of the initial feature processing model according to each of the sample action features in the sample action feature sequence and the preset spatial association relationship between each of the sample action features, to obtain an update result; a fourth determination module, configured to obtain a target feature processing model with the preset action feature library based on the update result; the first determination module 802 is configured to: determine the quantized action features that match each predicted action feature in the predicted action feature sequence from the preset action feature library of the target feature processing model.
[0195] In some embodiments, the update module is configured to: use the initial feature processing model to obtain the predicted spatial correlation relationship between each of the sample action features; determine a first loss value based on the predicted spatial correlation relationship and the preset spatial correlation relationship; perform dimensionality reduction processing on each of the sample action features to obtain a sample coding feature; determine a second loss value based on the sample coding feature; obtain a first target loss value based on the first loss value and the second loss value; use the first target loss value to update the model parameters of the initial feature processing model and the quantized action features in the initial action feature library of the initial feature processing model to obtain the update result.
[0196] In some embodiments, the update module is configured to: determine, from the initial action feature library, a quantized action feature that matches the sample action feature based on the sample coding feature; and determine the second loss value based on the sample coding feature and the quantized action feature that matches the sample action feature.
[0197] In some embodiments, the update module is configured to: determine a first sub-loss value based on the difference between the sample coding feature and the sample quantization action feature; determine a second sub-loss value based on the inverse of the difference between the sample coding feature and the sample quantization action feature; determine the second loss value based on the first sub-loss value, the second sub-loss value and a preset weight coefficient.
[0198] In some embodiments, the acquisition module 801 is configured to: determine, based on each sub-audio feature in the audio feature and the initial action feature of the target character, a predicted action feature that is aligned in time sequence with each sub-audio feature; wherein each sub-audio feature is associated in time sequence; and obtain the predicted action feature sequence based on each predicted action feature.
[0199] In some embodiments, the acquisition module 801 is configured to: split the initial action feature according to the part information of the target character to obtain at least two sub-initial action features; determine the degree of association between each of the sub-audio features and each of the sub-initial action features; wherein the degree of association at least characterizes the degree of association between the sub-audio features and each of the sub-initial action features in terms of content and timing; determine the predicted action feature based on the degree of association between each of the sub-audio features and each of the sub-initial action features.
[0200] In some embodiments, the device 800 also includes: a fifth determination module, configured to obtain sample audio features and sample initial action features of a sample character; a splitting module, configured to split the sample initial action features according to the part information of the sample character to obtain at least two sub-sample initial action features; a sixth determination module, configured to determine a predicted sample action feature sequence based on each sub-sample audio feature and each sub-sample initial action feature in the sample audio features; a seventh determination module, configured to train an initial action prediction model based on each predicted sample action feature and each preset sample action feature in the predicted sample action feature sequence to obtain a target action prediction model; the acquisition module 801 is configured to: use the target action prediction model to obtain a predicted action feature sequence that is associated in time series.
[0201] In some embodiments, the seventh determination module is configured as follows: according to the sub-sample audio features and the sub-sample initial action features, obtain candidate action features and probability values corresponding to each of the candidate action features; wherein the probability values are used to determine the predicted sample action features from the candidate action features; determine a third loss value according to the number of the sub-sample audio features, the preset sample action features and the probability values; determine a fourth loss value according to the number of the sub-sample audio features, the predicted sample action features and the probability values; obtain a second target loss value according to the third loss value and the fourth loss value; and use the second target loss value to update the model parameters of the initial action prediction model to obtain the target action prediction model.
[0202] In some embodiments, the seventh determination module is configured to: determine the difference between the vector feature of the probability value and the preset sample action feature; determine the third loss value based on the difference between the vector feature of the probability value and the preset sample action feature and the number of sub-sample audio features.
[0203] In some embodiments, the seventh determination module is configured to: determine the difference between the predicted sample action feature and the vector feature of the probability value; determine the orientation feature of the sample character based on the initial action features of each sub-sample; determine the fourth loss value based on the number of sub-sample audio features, the difference between the predicted sample action feature and the vector feature of the probability value, and the orientation feature.
[0204] In some embodiments, the device 800 also includes: an eighth determination module, configured to obtain the audio features of the target music and the initial action features of the target character; a generation module, configured to generate a temporally associated predicted action feature sequence based on the audio features of the target music and the initial action features of the target character; wherein the predicted action feature sequence includes predicted dance action features; a ninth determination module, configured to determine, from a preset action feature library, quantified action features that match each of the predicted dance action features; a tenth determination module, configured to determine the spatial association relationship between each of the predicted dance action features in the predicted action feature sequence; an eleventh determination module, configured to combine the quantified action features that match each of the predicted dance action features according to the spatial association relationship between each of the predicted dance action features and the temporal association relationship between each of the predicted dance action features, to obtain a target action feature sequence corresponding to the target character; and a control module, configured to control the target character to perform a target dance action corresponding to the target action feature sequence.
[0205] The acquisition module 801, the first determination module 802, the second determination module 803 and the combination module 804 may be implemented based on a processor of an electronic device.
[0206] In addition, each functional module in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software functional modules.
[0207] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0208] Specifically, the computer program instructions corresponding to an action generation method in this embodiment can be stored on a storage medium such as a CD, a hard disk, or a USB flash drive. When the computer program instructions corresponding to an action generation method in the storage medium are read or executed by an electronic device, any action generation method in the aforementioned embodiments is implemented.
[0209] Based on the same technical concept as the above embodiments, see Fig. 9 , which shows an electronic device 90 provided by an embodiment of the present invention, which may include: a memory 91, a processor 92, and a computer program stored in the memory 91 and executable on the processor 92; wherein,
[0210] The memory 91 is used to store computer programs and data; the processor 92 is used to execute the computer program stored in the memory to implement any one of the action generation methods in the aforementioned embodiments.
[0211] In practical applications, the memory 91 may be a volatile memory, such as RAM; or a non-volatile memory, such as ROM, flash memory, hard disk drive (HDD) or solid-state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the processor 92.
[0212] The processor 92 may be at least one of an ASIC, a DSP, a DSPD, a PLD, a FPGA, a CPU, a controller, a microcontroller, and a microprocessor.
[0213] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0214] The above description of the various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other. For the sake of brevity, this article will not repeat them.
[0215] The methods disclosed in the various method embodiments provided in the present disclosure may be arbitrarily combined without conflict to obtain new method embodiments.
[0216] The features disclosed in the various product embodiments provided in the present disclosure can be arbitrarily combined without conflict to obtain new product embodiments.
[0217] The features disclosed in the various method or device embodiments provided in the present disclosure may be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0218] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0219] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. An action generation method, characterized in that: The method comprises: Acquire a sequence of predicted action features associated in time sequence; wherein the predicted action feature sequence is generated at least according to audio features; Determining, from a preset action feature library, a quantized action feature that matches each predicted action feature in the predicted action feature sequence; Determining the spatial correlation relationship between each of the predicted action features in the predicted action feature sequence; According to the spatial correlation relationship of each predicted action feature and the temporal correlation relationship of each predicted action feature, the quantized action features matching each predicted action feature are combined to obtain a target action feature sequence; The step of determining, from a preset action feature library, a quantized action feature that matches each predicted action feature in the predicted action feature sequence comprises: Performing dimensionality reduction processing on each of the predicted action features to obtain a coding feature; wherein the dimension of the coding feature is the same as the dimension of each quantized action feature in the preset action feature library; According to the distance between the encoding feature and each quantized motion feature in the preset motion feature library, a quantized motion feature matching each of the predicted motion features is determined from the preset motion feature library.
2. The method according to claim 1, characterized in that: The step of determining, from the preset action feature library, a quantized action feature that matches each of the predicted action features according to the distance between the encoding feature and each quantized action feature in the preset action feature library comprises: Determine the distance between the coding feature to be processed and each quantized action feature in the preset action feature library; Sorting the distances corresponding to the coding features to be processed to obtain a sorting result; Determine, according to the sorting result, a quantized action feature corresponding to the coding feature to be processed; According to the quantized action features corresponding to the respective coding features to be processed, quantized action features matching the respective predicted action features are determined.
3. The method according to claim 1 or 2, characterized in that: The determining of the spatial correlation between the predicted action features in the predicted action feature sequence includes: According to each of the quantified action features, relative position information between each key point of the target character and a preset standard point and displacement information of the target character are determined; wherein the predicted action feature sequence is generated according to the audio feature and the initial action feature of the target character; The spatial correlation relationship between the predicted motion features is determined according to the relative position information and the displacement information.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Obtaining a sample action feature sequence; According to each of the sample action features in the sample action feature sequence and the preset spatial association relationship between each of the sample action features, the model parameters of the initial feature processing model and the quantized action features in the initial action feature library of the initial feature processing model are updated to obtain an update result; Obtaining a target feature processing model having the preset action feature library based on the update result; The step of determining, from a preset action feature library, a quantized action feature that matches each predicted action feature in the predicted action feature sequence comprises: From the preset action feature library of the target feature processing model, a quantized action feature matching each predicted action feature in the predicted action feature sequence is determined.
5. The method according to claim 4, characterized in that The updating of the model parameters of the initial feature processing model and the quantized action features in the initial action feature library of the initial feature processing model according to each of the sample action features in the sample action feature sequence and the preset spatial association relationship between each of the sample action features to obtain an update result includes: Using the initial feature processing model, obtaining a predicted correlation relationship between each of the sample action features in space; Determining a first loss value according to the predicted association relationship in space and the preset association relationship in space; Performing dimensionality reduction processing on each of the sample action features to obtain sample coding features; Determining a second loss value according to the sample encoding feature; Obtaining a first target loss value according to the first loss value and the second loss value; The model parameters of the initial feature processing model and the quantized action features in the initial action feature library of the initial feature processing model are updated using the first target loss value to obtain the updated result.
6. The method according to claim 5, characterized in that The determining of the second loss value according to the sample encoding feature includes: Determining, from the initial action feature library, a quantized action feature that matches the sample action feature according to the sample coding feature; The second loss value is determined according to the sample coding feature and the quantized action feature matching the sample action feature.
7. The method according to claim 6, characterized in that The determining the second loss value according to the sample coding feature and the quantized action feature matching the sample action feature includes: Determining a first sub-loss value according to a difference between the sample encoding feature and the sample quantization action feature; Determine a second sub-loss value according to the inverse of a difference between the sample encoding feature and the sample quantized motion feature; The second loss value is determined according to the first sub-loss value, the second sub-loss value and a preset weight coefficient.
8. The method according to any one of claims 1 to 7, characterized in that: The step of obtaining a temporally associated predicted action feature sequence includes: According to each sub-audio feature in the audio feature and the initial action feature of the target character, determining a predicted action feature aligned with each sub-audio feature in time sequence; wherein each sub-audio feature is associated in time sequence; The predicted action feature sequence is obtained according to each of the predicted action features.
9. The method according to claim 8, characterized in that The step of determining, based on each sub-audio feature in the audio feature and the initial action feature of the target character, a predicted action feature aligned with each sub-audio feature in time sequence comprises: According to the part information of the target character, the initial action feature is split to obtain at least two sub-initial action features; Determining the degree of association between each of the sub-audio features and each of the sub-initial action features; wherein the degree of association at least represents the degree of association between the sub-audio features and each of the sub-initial action features in terms of content and timing; The predicted action feature is determined according to the correlation degree between each of the sub-audio features and each of the sub-initial action features.
10. The method according to any one of claims 1 to 9, characterized in that: The method further comprises: Obtaining sample audio features and sample initial action features of a sample character; Splitting the sample initial action feature according to the part information of the sample character to obtain at least two sub-sample initial action features; Determine a predicted sample action feature sequence according to each sub-sample audio feature in the sample audio feature and each sub-sample initial action feature; The initial motion prediction model is trained based on each prediction sample motion feature and each preset sample motion feature in the prediction sample motion feature sequence to obtain a target motion prediction model; The step of obtaining a temporally associated predicted action feature sequence includes: The target action prediction model is used to obtain a temporally associated predicted action feature sequence.
11. The method according to claim 10, characterized in that The initial motion prediction model is trained based on each prediction sample motion feature and each preset sample motion feature in the prediction sample motion feature sequence to obtain a target motion prediction model, including: According to the audio features of each sub-sample and the initial action features of each sub-sample, a candidate action feature and a probability value corresponding to each of the candidate action features are obtained; wherein the probability value is used to determine the predicted sample action feature from the candidate action features; determining a third loss value according to the number of the sub-sample audio features, the preset sample action features and the probability value; determining a fourth loss value according to the number of the sub-sample audio features, the predicted sample action features and the probability value; Obtaining a second target loss value according to the third loss value and the fourth loss value; The model parameters of the initial action prediction model are updated using the second target loss value to obtain the target action prediction model.
12. The method according to claim 11, characterized in that The determining of the third loss value according to the number of the sub-sample audio features, the preset sample action features and the probability value comprises: Determine the difference between the vector feature of the probability value and the preset sample action feature; Determining the third loss value according to the difference between the vector feature of the probability value and the preset sample action feature and the number of the sub-sample audio features; and / or, The determining of the fourth loss value according to the number of the sub-sample audio features, the predicted sample action features and the probability value comprises: Determine a difference between the predicted sample action feature and the vector feature of the probability value; Determining the orientation features of the sample characters according to the initial action features of each sub-sample; The fourth loss value is determined according to the number of the sub-sample audio features, the difference between the predicted sample action features and the vector features of the probability values, and the orientation features.
13. The method according to any one of claims 1 to 12, characterized in that: The method further comprises: Acquire the audio features of the target music and the initial action features of the target character; Generate a temporally associated predicted action feature sequence according to the audio features of the target music and the initial action features of the target character; wherein the predicted action feature sequence includes predicted dance action features; Determining, from a preset action feature library, a quantized action feature that matches each of the predicted dance action features; Determining the spatial correlation between the predicted dance movement features in the predicted movement feature sequence; According to the spatial correlation relationship of each predicted dance movement feature and the temporal correlation relationship of each predicted dance movement feature, the quantized movement features matching each predicted dance movement feature are combined to obtain a target movement feature sequence corresponding to the target character; The target character is controlled to perform a target dance action corresponding to the target action feature sequence.
14. An action generating device, characterized in that: The device comprises: An acquisition module configured to acquire a predicted action feature sequence associated in time sequence; wherein the predicted action feature sequence is generated at least according to an audio feature; A first determination module is configured to determine, from a preset action feature library, a quantized action feature that matches each predicted action feature in the predicted action feature sequence; A second determination module is configured to determine the spatial correlation relationship between each of the predicted action features in the predicted action feature sequence; A combination module, configured to combine the quantized action features that match the respective predicted action features according to the spatial correlation relationship of the respective predicted action features and the temporal correlation relationship of the respective predicted action features, to obtain a target action feature sequence; The first determination module is configured to perform dimensionality reduction processing on each of the predicted action features respectively to obtain a coding feature; wherein the dimension of the coding feature is the same as the dimension of each quantized action feature in the preset action feature library; based on the distance between the coding feature and each quantized action feature in the preset action feature library, determine the quantized action feature that matches each of the predicted action features from the preset action feature library.
15. An electronic device, characterized in that: comprising a processor and a memory for storing a computer program capable of running on the processor; wherein, The processor is configured to run the computer program to execute the action generation method according to any one of claims 1 to 13.
16. A computer storage medium having a computer program stored thereon, characterized in that: The computer program implements claims 1 to 13 when executed by a processor.
Citation Information
Patent Citations
Game role action generation method and device, computer equipment and storage medium
CN110781820A
Dance movement data generation method and device
CN110955786A
Dance motion synthesis method, device and equipment and storage medium
CN110992449A
Audio-based action sequence generation method and device, and electronic equipment
CN111080752A
Method, device for generating video, equipment and medium
CN111432233A
