Animation processing method

By executing the animation processing method on the computing device and using the deep reinforcement learning training strategy model, the problem that cartoon segments do not conform to physical laws in the prior art are solved, and cartoon segments that conform to physical characteristics are generated, which solves the problem that cartoon segments are unnatural. , realizes the refinement and nature of cartoon clips.

CN119169159APending Publication Date: 2024-12-20INVENTEC PUDONG TECH CORPOARTION +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310731949.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-19
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

In the prior art, when generating high-quality cartoon clips, it is difficult to ensure that the character's actions comply with the laws of physics, resulting in unrealistic jitter or unnatural actions.

Method used

By performing multiple steps on the computing device, including obtaining character files, setting keyframes, generating action files, and using deep reinforcement learning training strategy models in the simulator, simulating the interaction of characters in the physical environment. To collect and process action data, generate cartoon clips that follow physical characteristics.

Benefits of technology

Achieving the generation of physically accurate animation clips from inaccurate or rough animation clips ensures that the animation respects the physical properties of the characters and environment, such as gravity, mass, and ground friction, while following the original behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169159A_ABST
    Figure CN119169159A_ABST
Patent Text Reader

Abstract

An animation processing method comprises the following steps: acquiring a character file used for setting characters in an animation, setting a plurality of frames of the animation as key frames, generating an action file according to the character file and the key frames, and generating action information of the characters in each frame according to the action file and the key frames, loading a role file in the simulator to establish a role, and executing a training program based on deep reinforcement learning, the training program comprising: executing a plurality of actions in an environment set by the role in the simulator, collecting a plurality of data when the role executes the actions so as to generate a training data set, and training a strategy model according to the training data set, wherein the strategy model outputs one of the actions according to the state of the role and the action information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to character animation, and in particular to an animation processing method for making the actions of characters in the animation conform to physical laws. Background Art

[0002] Character animation is crucial in many industries, such as movies, games, and robotic control. In the movie industry, it brings the vivid movements of the actors in the scene, which requires the character animation to be clear and high-quality. In games, the responsiveness of the character's movement plays a key role in immersive gameplay. In addition, animation can also be used as a reference for control strategies to imitate user-defined and data-driven behaviors.

[0003] To obtain high-quality animation clips, practitioners usually use motion capture technology; however, this requires a considerable investment in equipment and is time-consuming. Another option is to create animation clips by hand; however, this requires extensive artistic experience and time investment. In both of the above methods, if the physical limitations of the character are not respected, unrealistic movements will be produced, such as jitters or movements that do not conform to the laws of physics. Summary of the invention

[0004] In view of this, the present invention proposes a animation clip processing workflow that can embed the physical limitations and characteristics of a character into a given animation clip. These physical characteristics include mass, gravity, ground friction, and contact interaction with other objects.

[0005] An animation processing method according to one embodiment of the present invention includes multiple steps performed by a computing device: obtaining a character file, wherein the character file is used to specify a character in an animation, setting multiple key frames in multiple frames of the animation, generating an action file based on the character file and these key frames, wherein the action file is used to specify the action information of the character in each frame, loading the character file into a simulator to create the character, and executing a training program based on deep reinforcement learning, including: having the character perform multiple actions in an environment set by the simulator, and collecting multiple data when the character performs these actions, thereby establishing a training data set, and training a strategy model based on the training data set, wherein the strategy model outputs one of the actions based on the state and action information of the character.

[0006] Before the character performs the multiple actions in the environment set in the simulator, it further includes: determining whether the amount of data in the training data set exceeds a threshold; when the amount of data does not exceed the threshold, checking whether the character is in a reset state; when the character is in the reset state, resetting the character to an initial state; when the character is not in the reset state, outputting one of the multiple actions based on the state and the action information of the character using the strategy model; and performing the multiple actions in the environment set in the simulator with the character; wherein collecting the multiple data when the character performs the multiple actions includes: calculating a reward when the character performs each of the multiple actions; and storing the state, the reward, each of the multiple actions, and the end state after the character performs each of the multiple actions as a training data in the training data set.

[0007] The role profile is in a unified robot description format.

[0008] The step of generating a motion file according to the character file and the plurality of key frames includes: performing an interpolation method according to the character file and the plurality of key frames to generate the motion file.

[0009] The action information includes: the rotation angle of each joint of the character, the three-dimensional coordinates of the center of mass of the character, and the three-axis angles of the center of mass.

[0010] The environment set by the simulator includes: gravity, ground friction and external interference.

[0011] The simulator is an Isaac Gym simulator.

[0012] It also includes: determining whether the execution times of the training program exceeds a threshold value, and ending the training program when the execution times exceeds the threshold value.

[0013] The reward includes a plurality of error quantities between the initial state and a target state, and the plurality of error quantities include joint positions, joint velocities, end effector positions, center of mass position and linear velocity, and center of mass direction and angular velocity.

[0014] The checking whether the character is in a reset state includes: checking whether the character falls in the environment; and checking whether the number of the plurality of actions exceeds a set value.

[0015] In summary, the present invention implements a process for processing animation clips to generate physically accurate animation clips from inaccurate or rough animation clip input. After processing, the animation clips follow the general behavior described in the original clips while respecting the physical properties of the characters and the environment, such as gravity, mass, and ground friction.

[0016] The above description of the content of the present invention and the following description of the embodiments are intended to demonstrate and explain the spirit and principle of the present invention, and to provide further explanation of the claims of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a flow chart of an animation processing method according to an embodiment of the present invention;

[0018] Figure 2 It is an example of the content of the action file;

[0019] Figure 3 is an example diagram of linear interpolation;

[0020] Figure 4 is a detailed flowchart of the training procedure; and

[0021] Figure 5 yes Figure 4 Detailed flowchart of the steps in the diagram.

[0022] Explanation of symbols:

[0023] S1~S5,S51~S53,S521~S527: Steps

[0024] x0,x1: time point

[0025] y0,y1: rotation angle DETAILED DESCRIPTION

[0026] The detailed features and characteristics of the present invention are described in detail in the following embodiments, and the content is sufficient to enable any person skilled in the relevant art to understand the technical content of the present invention and implement it accordingly, and according to the content, claims and drawings disclosed in this specification, any person skilled in the relevant art can easily understand the relevant concepts and characteristics of the present invention. The following examples further illustrate the viewpoints of the present invention in detail, but do not limit the scope of the present invention in any viewpoint.

[0027] The present invention provides an animation processing method, including a plurality of steps executed by a computing device. In one embodiment, the animation processing method of the present invention is implemented by software or a program executed on a computing device, and the computing device can be one of the following devices: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Field Programmable Gate Array (FPGA), System-on-a-chip (SOC), Deep Learning Accelerator, but the present invention is not limited to the above examples.

[0028] Figure 1 FIG. 1 is a flow chart of an animation processing method according to an embodiment of the present invention. Figure 1 As shown, step S1, obtain the character file. The character file is used to set the character in the animation, such as a human or a quadruped. A character includes multiple joints (revolution joints) and the connections between these joints, but the present invention does not limit the number of joints of the character. In one embodiment, the character file can be in the Unified Robot Description Format (URDF) format. The character file describes the anatomical structure of the character, indicates the hierarchical relationship between each connection and joint, including its physical specifications and limitations. Examples of physical specifications include: joint mass, joint morphology, motor position; examples of limitations include: minimum / maximum rotation angle of the joint.

[0029] Step S2, setting the key frame in the animation is equivalent to specifying the key pose of the character at a specific time point. The animation includes multiple frames, at least two of which are set as key frames. The present invention does not limit the upper limit of the number of key frames. In one embodiment, the character profile and key frame are set by the user through the interface provided by the software or program.

[0030] Step S3, generating an action file based on the character file and the keyframes. One implementation of step S3 is an animation editor software that can receive the character file as input. For example, the rotation angle range of the joint is imported into the software as a control item, where the number of control items corresponds to the number of joints. Step S3 is used to create a rough animation clip, allowing the character to perform a target action specified by the user, such as jumping on the spot. The action file is used to specify the action information of the character in each frame of the animation.

[0031] In one embodiment, the motion information includes: the rotation angle of each joint of the character, the three-dimensional coordinates of the center of mass (COM) of the character, and the three-axis angles of the center of mass. Figure 2 is an example of the content of an action file. Figure 2 As shown, each row (from Attributes 0 to 13) represents a frame in the animation. Each row contains multiple action information, where Position X / Y / Z represents the spatial coordinates of the character's center of mass; Roll / Pitch / Yaw refers to the three-axis angle of the center of mass, and Joint 0 to 11 represents the rotation angle of the joint.

[0032] In one embodiment, a linear interpolation method may be performed based on the character file and at least two key frames to generate a motion file. Figure 3 is an example diagram of linear interpolation. Figure 3 As shown in the figure, the horizontal axis represents time, the vertical axis represents the rotation angle of the joint, and the two points (x0, y0) and (x1, y1) represent the start keyframe and the end keyframe of an action respectively. In other words, x0 represents the start time, x1 represents the end time, y0 represents the start rotation angle, and y1 represents the end rotation angle. Given the current time x, we can use the linear equation Calculate the rotation angle y corresponding to the time point.

[0033] Before editing the motion, in addition to using a linear interpolation method to generate a motion file, in other embodiments, the user can set the motion between these key frames, or use a pose estimation model to capture the motion from the video.

[0034] The rough animation clips generated according to the process of step S1 to step S3 can follow the joint constraints defined in the character file. However, the character is not restricted by any physical interaction, so the character's movements may look unnatural or may violate physical properties. The animation processing method proposed in the present invention uses a post-processing process called imitation learning to correct the character's movements, as described below.

[0035] Please refer to Figure 1. Step S4, create a character and set the environment in the simulator. In one embodiment, the IsaacGym simulator is used to load the character file to create the character. In addition, it is also necessary to set the environment in which the character is located in the simulator so that the character can interact with this environment later. In one embodiment, the environmental parameters set by the simulator include: gravity, ground friction, and external interference (such as external force, uneven terrain, and noise). During the interaction process, the character's movements will be affected by the environmental parameters and will also be affected by the mass of each joint of the character (defined in the character file).

[0036] Step S5, a training procedure is performed based on deep reinforcement learning (DRL) to generate a policy model. In this procedure, the character is placed in an environment that conforms to the laws of physics and is affected by gravity, ground friction, the mass of the character's joints, and other external disturbances. Through deep reinforcement learning, a policy model is trained. Figure 4 It is a detailed flow chart of the training procedure, including steps S51 to S53.

[0037] Step S51, determining whether the training program is completed. In one embodiment, if the number of iterations of the training program exceeds a threshold set by the user, it means that the training program is completed and the training program can be terminated. On the contrary, if the number of iterations does not exceed the threshold, it means that the training program is not completed and step S52 needs to be continued.

[0038] Step S52, a training data set is established based on multiple data of the character performing multiple actions in the environment. In step S52, the character performs actions to interact in the environment that conforms to the laws of physics, and then the simulator collects multiple states of the character in the above process, the target state that the character wants to achieve, the rewards obtained by the character performing actions, etc. as training data. See below for details.

[0039] Figure 5 It is a detailed flowchart of step S52, including steps S521 to S527.

[0040] Step S521, determining whether the number of data in the training data set exceeds a threshold. The training data set includes a plurality of training data. If the number of training data reaches the threshold, step S53 is executed. Otherwise, the process after step S522 is executed to generate more training data. In one embodiment, the setting of the threshold value depends on other hyper-parameters, such as batch size, batch number, and maximum number of episodes.

[0041] The maximum number of rounds is a parameter used in deep reinforcement learning to quantify character performance. Each time a character makes an action is a round. The setting value of the maximum number of rounds depends on the training goal. Since the goal of the present invention is to allow a character that conforms to the laws of physics to imitate the actions specified by the action file through imitation learning, the setting value of the maximum number of rounds is at least equal to the animation length specified by the action file. In another embodiment, the setting value of the maximum number of rounds is 2 to 3 times the animation length. By increasing the difficulty of character training (the more rounds, the longer the character must survive), the learning results of the character are made more stable.

[0042] Step S522, when the amount of data does not exceed the threshold, check whether the character is in a reset state. In one embodiment, the reset state includes the character falling in the environment (for example, the character's back touches the ground), and whether the maximum number of rounds exceeds a set value. When the character is in a reset state, step S523 is executed to reset the character to an initial state. Otherwise, step S524 is executed to output the action based on the state and action information of the character using the strategy model. In one embodiment, the reset items of step S523 are as follows: the position, rotation angle, linear speed and angular speed of the center of mass; the position, rotation angle, linear speed and angular speed of the joint; the round counter (used to calculate the current number of rounds); the reference action index (recording the frame number of the current action), and the history buffer (a register for storing multiple actions in the past).

[0043] In one embodiment, the policy model can use a feed-forward neural network to input the current state of the character s t and action information t , the policy model π outputs the role’s action a t (the rotation angle of each joint of the character), expressed as π(a t |s t , g t ), where t represents the time point.

[0044] Current Status t It is the status of the character simulated by the simulator. Action information g t is from the action file. In one embodiment, the current state s t It includes: joint angle, direction, angular velocity, binary indicator of whether the character is touching the ground, and actions performed at the past M time points. The action information is selected from N consecutive frames in the automatic action file. The present invention does not limit the numerical settings of M and N.

[0045] Step S525, the character performs an action in the environment set by the simulator. Step S526, calculate a reward for the character to perform the action. In one embodiment, the reward includes multiple error quantities between the initial state and the target state, and these error quantities include joint position, joint velocity, end-effector position, center of mass position and linear velocity, and center of mass direction and angular velocity. Step S527, store the state, action information, reward, and the end state after the character performs the action as training data in the training data set. A training data can be represented as (s t , r t , a t , done), where s t Represents the current state of the character, r t Rewards, a t represents the action, done represents the end state (done=1 represents the end, done=0 represents not the end, if the maximum number of rounds exceeds the set value, done is set to 1), and t represents the time point.

[0046] Please refer to Figure 4 . Step S53, training the policy model based on the training data set. In one embodiment, the Proximal Policy Optimization (PPO) algorithm is used to design the loss function and perform gradient decent calculations. As described in step S526, the learning signal used to train the policy model consists of five different components, which measure the differences between the character's actions that conform to the laws of physics and the user-defined character actions. The goal of step S53 training is to minimize the posture difference, joint velocity difference, end effector position difference, center of mass position difference, and center of mass velocity difference between the character and the action file.

[0047] Overall, the result of the imitation learning process is a policy model. During training, the policy model imitates the specified actions in the action archive as closely as possible while still obeying the physical constraints defined by the environment. By sampling actions from the policy, the refined actions can be played. Deployed in an environment with physical simulation, such as in 3D animations and games, characters performing the refined actions can realistically interact with the environment and react to environmental changes.

[0048] In summary, the present invention implements a process for processing animation clips to generate physically accurate animation clips from inaccurate or rough animation clip input. After processing, the animation clips follow the general behavior described in the original clips while respecting the physical properties of the characters and the environment, such as gravity, mass, and ground friction.

[0049] Although the present invention is disclosed in the above embodiments, it is not intended to limit the present invention. Any changes and modifications made without departing from the spirit and scope of the present invention are within the scope of patent protection of the present invention. Please refer to the attached claims for the scope of protection defined by the present invention.

Claims

1. An animation processing method, characterized in that: The method comprises executing, by a computing device: Obtaining a character file, wherein the character file is used to set a character in an animation; Setting a plurality of key frames in a plurality of frames of the animation; generating a motion file according to the character file and the plurality of key frames, wherein the motion file is used to specify motion information of the character in each of the plurality of frames; Loading the character file with a simulator to create the character; as well as A training procedure is performed based on deep reinforcement learning, including: The character performs a plurality of actions in an environment set by the simulator, and collects a plurality of data when the character performs the plurality of actions, thereby establishing a training data set; and A strategy model is trained according to the training data set, wherein the strategy model outputs one of the plurality of actions according to a state of the character and the action information.

2. The animation processing method according to claim 1, characterized in that: Before the character performs the plurality of actions in the environment set by the simulator, the method further comprises: Determining whether the amount of data in the training data set exceeds a threshold; When the data quantity does not exceed the threshold, checking whether the character is in a reset state; When the character is in the reset state, resetting the character to an initial state; When the character is not in the reset state, outputting one of the plurality of actions using the strategy model according to the state of the character and the action information; and Performing the plurality of actions with the character in the environment set in the simulator; The collecting of the plurality of data when the character performs the plurality of actions comprises: calculating a reward when the character performs each of the plurality of actions; and The state, the reward, each of the multiple actions, and the end state of the character after performing each of the multiple actions are used as training data and stored in the training data set.

3. The animation processing method according to claim 1, characterized in that: The role profile is in a unified robot description format.

4. The animation processing method according to claim 1, characterized in that: The step of generating a motion file according to the character file and the plurality of key frames includes: performing an interpolation method according to the character file and the plurality of key frames to generate the motion file.

5. The animation processing method according to claim 1, characterized in that: The action information includes: the rotation angle of each joint of the character, the three-dimensional coordinates of the center of mass of the character, and the three-axis angles of the center of mass.

6. The animation processing method according to claim 1, characterized in that: The environment set by the simulator includes: gravity, ground friction and external interference.

7. The animation processing method according to claim 1, characterized in that: The simulator is an Isaac Gym simulator.

8. The animation processing method according to claim 1, characterized in that: Also includes: Determine whether the execution times of the training program exceeds a threshold, and terminate the training program when the execution times exceeds the threshold.

9. The animation processing method according to claim 2, characterized in that: The reward includes a plurality of error quantities between the initial state and a target state, and the plurality of error quantities include joint positions, joint velocities, end effector positions, center of mass position and linear velocity, and center of mass direction and angular velocity.

10. The animation processing method according to claim 2, characterized in that: Wherein checking whether the character is in a reset state comprises: checking whether the character has fallen in the environment; and Check whether the number of the plurality of actions exceeds a set value.