Virtual digital human generation method and apparatus, and electronic device
Generating a virtual digital human through human body key recognition and proportional relationships solves the problem of inconsistent movements when users perform fitness videos, and improves the fitness experience and effect.
Patent Information
- Application Number
- PCT/CN2023/112848
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-12-30
- Filing Date
- 2023-08-14
- Publication Date
- 2024-09-12
AI Technical Summary
In the field of human-computer interaction technology, when users perform fitness videos, due to large differences in movements, the fitness effect is poor. How to ensure the consistency of movements is an urgent problem to be solved.
Through the first frame of the image collected by the image acquisition device when acquiring the video, the key points of the human body are identified, the key points of the human body and the length of the body parts are determined, and a virtual digital human is generated based on the target proportion relationship and the actual length to ensure that the movements of the virtual digital human are consistent with the user's. .
It improves the user's fitness experience by intuitively displaying the consistency of movements through a virtual digital human, helping users adjust their movements, thereby improving fitness effects.
Smart Images

Figure CN2023112848_12092024_PF_FP_ABST
Abstract
Description
Method, device and electronic device for generating virtual digital human
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on December 12, 2022, with application number 202211597595.4, and the Chinese patent application filed with the China Patent Office on December 30, 2022, with application number 202211735800.9, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of human-computer interaction technology, and in particular to a method, device and electronic device for generating a virtual digital human. Background Art
[0004] Currently, in the field of human-computer interaction technology, users can complete their fitness routines by performing corresponding fitness exercises through fitness videos played by electronic devices (such as smart TVs and mobile phones). However, different users may perform different fitness exercises when learning the same fitness video, resulting in poor fitness results. Therefore, how to ensure that users perform the fitness exercises corresponding to the fitness videos played by electronic devices consistently has become an urgent problem to be solved.
[0005] Summary of the Invention
[0006] In a first aspect, the present application provides a method for generating a virtual digital human, comprising: obtaining a first frame of image captured by an image acquisition device when playing a target video; wherein the target video includes at least one fitness movement; performing human body key recognition on the first frame of image, determining position information between human body key points, a first actual length of a target body part, and a second actual length of body parts other than the target body part; determining a second predicted length of body parts other than the target body part based on a target proportional relationship and the first actual length; wherein the target proportional relationship includes a corresponding ratio of the first actual length to the predicted length of body parts other than the target body part; determining a drawing height of the other body parts based on the second actual length and the predicted length; and drawing based on the first actual length, the drawing height, and the positional relationship to generate a virtual digital human.
[0007] In a second aspect, the present application provides a device for generating a virtual digital human, comprising: an acquisition unit, configured to acquire a first frame of image acquired by an image acquisition device when a target video is played; wherein the target video includes at least one fitness movement; a processing unit, configured to perform human body key recognition on the first frame of image acquired by the acquisition unit, and determine position information between key points of the human body, a first actual length of a target body part, and a second actual length of body parts other than the target body part; the processing unit is further configured to determine a predicted length of body parts other than the target body part based on a target proportional relationship and the first actual length; wherein the target proportional relationship includes a corresponding ratio of the first actual length to the predicted length of body parts other than the target body part; the processing unit is further configured to determine a drawing height of other body parts based on the second actual length and the predicted length; the processing unit is further configured to draw based on the first actual length, the drawing height, and the positional relationship to generate a virtual digital human.
[0008] In a third aspect, the present application provides an electronic device comprising: a memory and a processor, the memory being used to store a computer program; the processor being used to enable the electronic device to implement any one of the methods for generating a virtual digital human provided in the first aspect above when executing the computer program.
[0009] In a fourth aspect, the present application provides a computer non-volatile readable storage medium, comprising: a computer program stored on the computer non-volatile readable storage medium, which, when executed by a computing device, enables the computing device to implement any one of the methods for generating a virtual digital human provided in the first aspect above.
[0010] In a fifth aspect, the present invention provides a computer program product, which, when executed on a computer, enables the computer to execute any one of the methods for generating a virtual digital human as provided in the first aspect.
[0011] It should be noted that the aforementioned computer instructions may be stored in whole or in part on a first computer-readable non-volatile storage medium. The first computer-readable non-volatile storage medium may be packaged together with the processor of the virtual digital human generation device, or may be packaged separately from the processor of the virtual digital human generation device, and this application does not limit this.
[0012] The descriptions of the second, third, fourth and fifth aspects of this application can refer to the detailed description of the first aspect; and the beneficial effects of the descriptions of the second, third, fourth and fifth aspects can refer to the analysis of the beneficial effects of the first aspect, which will not be repeated here.
[0013] In this application, the name of the aforementioned virtual digital human generation device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear with other names. As long as the functions of each device or functional module are similar to those of this application, they fall within the scope of the claims of this application and their equivalents. 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 application and, together with the description, serve to explain the principles of the present application.
[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0016] FIG1 is a schematic diagram of a scenario of a method for generating a virtual digital human according to an embodiment of the present application;
[0017] FIG2 is a schematic diagram showing a structure of a display device in a method for generating a virtual digital human according to an embodiment of the present application;
[0018] FIG3 is a second structural diagram of a display device in the method for generating a virtual digital human according to an embodiment of the present application;
[0019] FIG4 is a flow chart of a method for generating a virtual digital human according to an embodiment of the present application;
[0020] FIG5 is a schematic diagram of a human body key in a method for generating a virtual digital human according to an embodiment of the present application;
[0021] FIG6 is a schematic diagram of body parts in a method for generating a virtual digital human according to an embodiment of the present application;
[0022] FIG7 is a second flow chart of a method for generating a virtual digital human according to an embodiment of the present application;
[0023] FIG8 is a third flow chart of a method for generating a virtual digital human according to an embodiment of the present application;
[0024] FIG9 is a fourth flow chart of a method for generating a virtual digital human according to an embodiment of the present application;
[0025] FIG10 is a fifth flow chart of a method for generating a virtual digital human according to an embodiment of the present application;
[0026] FIG11 is a sixth flow chart of a method for generating a virtual digital human according to an embodiment of the present application;
[0027] FIG12 is a seventh flow chart of a method for generating a virtual digital human according to an embodiment of the present application;
[0028] FIG13 is a schematic diagram of a target interface in a method for generating a virtual digital human according to an embodiment of the present application;
[0029] FIG14 is a schematic diagram of a preset interface in a method for generating a virtual digital human according to an embodiment of the present application;
[0030] FIG15 is a schematic structural diagram of a display device according to an embodiment of the present application;
[0031] FIG16 is a schematic diagram of a chip system according to an embodiment of the present application;
[0032] FIG17 is a block diagram of the hardware configuration of an animation generating device according to an embodiment of the present application;
[0033] FIG18 is a schematic diagram of a network architecture of an animation generating device according to an embodiment of the present application;
[0034] FIG19 is a flowchart of the steps of the animation generation method according to an embodiment of the present application;
[0035] FIG20 is a schematic diagram of an animation generation method according to an embodiment of the present application;
[0036] FIG21 is a schematic diagram of another animation generation method according to an embodiment of the present application;
[0037] FIG22 is a flowchart of another animation generation method according to an embodiment of the present application;
[0038] FIG23 is a schematic diagram of an animation generation method according to an embodiment of the present application;
[0039] FIG24 is a flowchart of another animation generation method according to an embodiment of the present application;
[0040] FIG25 is a diagram illustrating an architecture of an animation generation method according to an embodiment of the present application;
[0041] FIG26 is a schematic diagram of another animation generation method according to an embodiment of the present application;
[0042] Figure 27 is an overall framework diagram of another animation generation method according to an embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to more clearly understand the above-mentioned objectives, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that, in the absence of conflict, the embodiments of the present application and the features therein can be combined with each other.
[0044] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application can also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present application, not all of the embodiments.
[0045] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0046] The CPM in the embodiments of this application refers to Convolutional Pose Machine, which is used to apply deep learning to human posture analysis and is the predecessor of the CMU open source project OpenPose.
[0047] OpenPose in the embodiments of this application is an open source library developed based on convolutional neural networks and supervised learning and using Caffe as the framework.
[0048] FIG1 is a schematic diagram of an operation scenario between a display device and a control device according to one or more embodiments of the present application. As shown in FIG1 , a user can operate a display device 200 through a mobile terminal 300 and a control device 100. The control device 100 can be a remote control, and communication between the remote control and the display device includes infrared protocol communication, Bluetooth protocol communication, wireless or other wired methods to control the display device 200. The user can control the display device 200 by inputting user commands through buttons on the remote control, voice input, control panel input, etc. In some embodiments, a mobile terminal, tablet computer, computer, laptop computer, and other smart devices can also be used to control the display device 200.
[0049] In some embodiments, the mobile terminal 300 can install software applications with the display device 200, and achieve connection and communication through a network communication protocol to achieve the purpose of one-to-one control operation and data communication. The audio and video content displayed on the mobile terminal 300 can also be transmitted to the display device 200 to achieve a synchronous display function. The display device 200 also communicates data with the display device 200 through various communication methods. The display device 200 can be allowed to communicate and connect through a local area network (LAN), a wireless local area network (WLAN) and other networks. The display device 200 can provide various content and interactions to the display device 200. The display device 200 can be a liquid crystal display, an OLED display, or a projection display device. In addition to providing a broadcast receiving television function, the display device 200 can also provide an intelligent network TV function that provides computer support functions.
[0050] In some embodiments, the electronic device provided by the embodiments of the present application may be the display device 200 described above. When a user needs to exercise, they can power on the display device 200, which then runs a first application capable of playing a target video (e.g., a fitness video). In response to the startup operation, the first application displays a startup interface. The user can then select the target video to play in the startup interface. After the user selects the target video, the first application, upon receiving the user's selection, prompts the user to face the image capture device and perform a target action, such as standing, before starting to play the target video. In this case, if the user faces the image capture device and performs the standing action as prompted, the image capture device may capture a second frame of the user facing the image capture device and performing the standing action. The first application then performs human key recognition on the second frame of the image to determine at least one human key point and the configuration information for each human key point. Upon determining that both the position information and the confidence level meet the standing condition, the first application obtains the height of the preview control. The first application then determines the human height based on the first and second information. The first application determines a target proportional relationship based on the human height and the control height. While the first application is playing a target video, if a user needs to know whether their current fitness movements match those in the target video, they can select a target function. In response to the target function selection, the first application acquires the first frame of image captured by the image acquisition device during the target video playback and performs human key recognition on the first frame to determine the positional information between key points, a first actual length of the target body part, and a second actual length of other body parts other than the target body part. The first application then determines the predicted lengths of other body parts other than the target body part based on a predetermined target ratio and the first actual length. The first application then determines the rendering heights of the other body parts based on the second actual length and the predicted length. Finally, the first application renders the virtual human based on the first actual length, rendering height, and positional relationship to generate the virtual human. The first application then displays the target interface. This allows the user to view the virtual human while watching the target video. Since the virtual human's corresponding fitness movements match the user's current fitness movements, the user can intuitively determine whether their current fitness movements match those in the target video, enhancing the user experience.
[0051] FIG2 illustrates a hardware configuration block diagram of a display device 200 according to an exemplary embodiment. As shown in FIG2 , display device 200 includes at least one of a tuner 210, a communicator 220, a detector 230, an external device interface 240, a processor 250, a display 260, an audio output interface 270, a memory, a power supply, and a user interface 280. The processor includes a central processing unit (CPU), a video processor, an audio processor, a graphics processor, RAM, ROM, and first through nth interfaces for input / output. Display 260 may be a touch-enabled display, such as a touch display. Tuner 210 receives broadcast television signals via wired or wireless reception and demodulates audio and video signals, such as EPG data signals, from multiple wireless or wired broadcast television signals. Detector 230 is used to collect signals from the external environment or external interactions. Processor 250 and tuner 210 may be located in separate devices; that is, tuner 210 may also be located in a device external to the main device where processor 250 resides, such as an external set-top box.
[0052] In some embodiments, the image acquisition device may be a camera. The display device 200 may be provided with at least one camera. The camera may be built into the display device 200, or the camera may be connected to the display device 200 by wire or wireless means. For example, the camera may be provided at the lower edge of the display 260 of the display device 200. Of course, the embodiment of the present application does not limit the position of the camera on the display device 200. Alternatively, the display device 200 may not include a camera, that is, the above-mentioned camera is not provided in the display device 200. The display device 200 may be connected to an external camera through an interface (such as a USB interface 130). The external camera may be fixed to the display device 200 by an external fixing member (such as a camera bracket with a clip). For example, the external camera may be fixed to the edge of the display 260 of the display device 200, such as the upper edge, by an external fixing member.
[0053] In some embodiments, the image acquisition device may be a camera. The display device 200 may be provided with at least one camera. The camera may be built into the display device 200, or the camera may be connected to the display device 200 by wire or wireless means. For example, the camera may be provided at the lower edge of the display 260 of the display device 200. Of course, the embodiment of the present application does not limit the position of the camera on the display device 200. Alternatively, the display device 200 may not include a camera, that is, the above-mentioned camera is not provided in the display device 200. The display device 200 may be connected to an external camera through an interface (such as a USB interface 130). The external camera may be fixed to the display device 200 by an external fixing member (such as a camera bracket with a clip). For example, the external camera may be fixed to the edge of the display 260 of the display device 200, such as the upper edge, by an external fixing member.
[0054] In some embodiments, the processor 250 controls the operation of the display device and responds to user operations through various software control programs stored in the memory. The processor 250 controls the overall operation of the display device 200.
[0055] In some examples, taking the display device 200 for applying one or more embodiments as a television 1, and the operating system of the television 1 as an Android system, as shown in Figure 3, the television 1 can be logically divided into an application layer (referred to as "application layer") 21, an application framework layer (referred to as "framework layer") 22, an Android runtime (Android runtime) and system library layer (referred to as "system runtime library layer") 23, and a kernel layer 24.
[0056] Among them, the application layer 21 includes one or more applications. The application can be a system application or a third-party application. For example, the application layer 21 includes a first application, which can provide a fitness video playback function. The framework layer 22 provides an application programming interface (API) and a programming framework for the application of the application layer 21. The system runtime layer 23 provides support for the upper layer, namely the framework layer 22. When the framework layer 22 is used, the Android operating system will run the C / C++ library contained in the system runtime layer 23 to implement the functions to be implemented by the framework layer 22. The kernel layer 24 serves as a software middleware between the hardware layer and the application layer 21, and is used to manage and control hardware and software resources.
[0057] In some examples, the kernel layer 24 includes a first driver configured to transmit user operations captured by the detector 230 to the first application. After receiving the user operation transmitted by the first driver, the first application's acquisition unit 210 analyzes the user operation captured by the acquisition unit 210. If the user operation is a startup operation, the processing unit 211 controls the display unit 212 to display a startup interface in response to the startup operation. The user can then select a target video to play in the startup interface. If the user selects the target video, the processing unit 211 of the first application, after determining that the receiving unit 213 has received the user's selection of the target video, prompts the user to face the image capture device and perform a target action, such as standing, before starting the target video. If the user faces the image capture device and performs the standing action in accordance with the prompt, the image capture device can capture a second frame of imagery showing the user facing the image capture device and performing the standing action. The processing unit 211 of the first application then performs human body key recognition on the second frame of imagery captured by the acquisition unit 210 to determine at least one human key point and configuration information for each human key point. When the processing unit 211 of the first application determines that both the position information and the confidence level meet the standing condition, it controls the acquisition unit 210 to acquire the height of the preview control. Subsequently, the processing unit 211 of the first application determines the height of the human body based on the first information and the second information. The processing unit 211 of the first application determines a target proportional relationship based on the human body height and the control height acquired by the acquisition unit 211. During playback of a target video, if the user needs to determine whether the current fitness movement matches the fitness movement in the target video played by the first application, the processing unit 211 of the first application controls the display unit 212 to select the target function. At this time, the target function selection operation captured by the detector 230 is sent to the first application. The acquisition unit 210 of the first application receives the target function selection operation transmitted by the detector 230. In response to the target function selection operation received by the acquisition unit 210, the processing unit 211 of the first application controls the acquisition unit 210 to acquire the first frame of image captured by the image acquisition device during playback of the target video. The processing unit 211 of the first application performs human key recognition on the first frame image acquired by the acquisition unit 210, determining the positional information between human key points, the first actual length of the target body part, and the second actual length of the body parts other than the target body part. The processing unit 211 of the first application then determines the predicted lengths of the body parts other than the target body part based on the predetermined target proportional relationship and the first actual length. The processing unit 211 of the first application then determines the rendering heights of the body parts based on the second actual length and the predicted length. Finally, the processing unit 211 of the first application renders the body parts based on the first actual length, rendering height, and positional relationship to generate a virtual digital human.Afterwards, the processing unit 211 of the first application controls the display unit 212 to display the target interface.
[0058] Specifically, the electronic device provided in the embodiment of the present application may be the above-mentioned display 200 or the server 400, which is not limited here.
[0059] Specifically, the storage unit 214 is used to store the application program of the first application and the target ratio relationship, etc.
[0060] The first frame image and the second frame image involved in this application can both be data authorized by the user or fully authorized by all parties.
[0061] In the following embodiments, the method of the embodiment of the present application is described by taking the above-mentioned display device 200 as an example of an execution subject of the method for generating a virtual digital human provided in the embodiment of the present application.
[0062] An embodiment of the present application provides a method for generating a virtual digital human. As shown in FIG4 , the method for generating a virtual digital human may include S11 - S15.
[0063] S11, acquiring a first frame of image captured by an image capture device when playing a target video, wherein the target video includes at least one fitness movement.
[0064] In some examples, when the display device 200 plays a target video, the user can perform corresponding exercises based on the fitness movements being played to achieve a fitness effect. To ensure that the fitness movements performed by the user are consistent with the fitness movements corresponding to the target video played by the display device 200, the method for generating a virtual digital human provided in embodiments of the present application obtains a first frame of image captured by an image acquisition device when the target video is played, then identifies key points of the human body in the first frame of image to obtain positional information between key points, a first actual length of the target body part, and a second actual length of other body parts other than the target body part. Subsequently, the predicted lengths of the other body parts other than the target body part are determined based on the target proportional relationship and the first actual length. The rendering heights of the other body parts are determined based on the second actual length and the predicted length. Finally, the rendering is performed based on the first actual length, the rendering height, and the positional relationship to generate a virtual digital human. When the user selects a target function, the display device 200 displays the target interface, allowing the user to view the virtual digital human while watching the target video. Since the virtual digital human is drawn according to the position information of the user's actual human body key points, the first actual length, and the second actual length, the fitness movements corresponding to the virtual digital human are the same as the user's current fitness movements. Therefore, the user can intuitively understand whether the current fitness movements are consistent with the fitness movements in the target video played by the first application, thereby improving the user experience.
[0065] S12. Perform human body key recognition on the first frame image to determine position information between human body key points, a first actual length of the target body part, and a second actual length of other body parts except the target body part.
[0066] In some examples, the human body key points include: a human body key point for characterizing the skeletal joint as the nose, a human body key point for characterizing the skeletal joint as the left eye, a human body key point for characterizing the skeletal joint as the right eye, a human body key point for characterizing the skeletal joint as the left ear, a human body key point for characterizing the skeletal joint as the right ear, a human body key point for characterizing the skeletal joint as the left shoulder, a human body key point for characterizing the skeletal joint as the right shoulder, a human body key point for characterizing the skeletal joint as the left elbow, a human body key point for characterizing the skeletal joint as the right elbow, a human body key point for characterizing the skeletal joint as the left wrist, a human body key point for characterizing the skeletal joint as the right wrist, a human body key point for characterizing the skeletal joint as the left hip, a human body key point for characterizing the skeletal joint as the right hip, a human body key point for characterizing the skeletal joint as the left knee, a human body key point for characterizing the skeletal joint as the right knee, a human body key point for characterizing the skeletal joint as the left ankle, a human body key point for characterizing the skeletal joint as the right ankle, a human body key point for characterizing the skeletal joint as the left palm, and one or more of the human body key points for characterizing the skeletal joint as the right palm.
[0067] For example, the distribution of key points on the human body is shown in FIG5 . Among them, 0 represents the human key point used to characterize the skeletal joint as the nose, 1 represents the human key point used to characterize the skeletal joint as the left eye, 2 represents the human key point used to characterize the skeletal joint as the right eye, 3 represents the human key point used to characterize the skeletal joint as the left ear, 4 represents the human key point used to characterize the skeletal joint as the right ear, 5 represents the human key point used to characterize the skeletal joint as the left shoulder, 6 represents the human key point used to characterize the skeletal joint as the right shoulder, 7 represents the human key point used to characterize the skeletal joint as the left elbow, 8 represents the human key point used to characterize the skeletal joint as the right elbow, 9 represents the human key point used to characterize the skeletal joint as the left wrist, 10 represents the human key point used to characterize the skeletal joint as the right wrist, 11 represents the human key point used to characterize the skeletal joint as the left hip, 12 represents the human key point used to characterize the skeletal joint as the right hip, 13 represents the human key point used to characterize the skeletal joint as the left knee, 14 represents the human key point used to characterize the skeletal joint as the right knee, 15 represents the human key point used to characterize the skeletal joint as the left ankle, and 16 represents the human key point used to characterize the skeletal joint as the right ankle.
[0068] The target body parts include any one of: neck length, shoulder width, torso length, hip width, upper arm length, forearm length, thigh length and calf length. Among them, the neck length is equal to the length from the nose to the center point of the line connecting the two shoulders (the key point of the human body used to characterize the left shoulder bone joint and the key point of the human body used to characterize the right shoulder bone joint), the shoulder width is equal to the length of the line connecting the two shoulders, the torso length is equal to the length of the line connecting the midpoint of the two shoulders to the midpoint of the line connecting the two hips (the key point of the human body used to characterize the left hip bone joint and the key point of the human body used to characterize the right hip bone joint), the hip width is equal to the length of the midpoint of the line connecting the two hips, the upper arm length is equal to the length from the key point of the human body used to characterize the left shoulder bone joint to the key point of the human body used to characterize the left elbow bone joint, or the upper arm length is equal to the length from the key point of the human body used to characterize the right shoulder bone joint to the key point of the human body used to characterize the right elbow bone joint, and the forearm length is equal to the length from the key point of the human body used to characterize the left elbow bone joint. The length from the key point to the human body key point for representing the left wrist bone joint, or the forearm length is equal to the length from the human body key point for representing the right elbow bone joint to the human body key point for representing the right wrist bone joint, the thigh length is equal to the length from the human body key point for representing the left hip bone joint to the human body key point for representing the left knee bone joint, or the thigh length is equal to the length from the human body key point for representing the right hip bone joint to the human body key point for representing the right knee bone joint, the calf length is equal to the length from the human body key point for representing the left knee bone joint to the human body key point for representing the left ankle bone joint, or the calf length is equal to the length from the human body key point for representing the right knee bone joint to the human body key point for representing the right ankle bone joint.
[0069] For example, the distribution of neck length, shoulder width, torso length, hip width, upper arm length, forearm length, thigh length and calf length in the human body is shown in FIG6 .
[0070] In some examples, to determine the position information of key points on the human body in the first frame of image, a coordinate system needs to be established. For example, a coordinate system is established with the upper left corner of the first frame of image as the coordinate origin, a line connecting the coordinate origin and the upper right corner of the first frame of image as the x-axis, and a line connecting the coordinate origin and the lower left corner of the first frame of image as the y-axis. This allows the position information of the key points on the human body to be determined in the first frame of image. Subsequently, a first actual length of the target body part and a second actual length of other body parts other than the target body part can be determined based on the position information of the key points on the human body.
[0071] It should be noted that the above example is based on the example of establishing a rectangular coordinate system in the first frame image. In other examples, the operation and maintenance personnel can set the coordinate system according to actual needs, and this application does not limit it.
[0072] S13. Determine predicted lengths of other body parts except the target body part based on the target proportional relationship and the first actual length, wherein the target proportional relationship includes a corresponding ratio between the first actual length and the predicted lengths of other body parts except the target body part.
[0073] In some examples, to more vividly draw a virtual digital human, the virtual digital human generation method provided in embodiments of the present application selects a target body part as a reference, and then uses the first actual length corresponding to the target body part to predict the predicted lengths of other body parts. For example, the predicted lengths of the other body parts other than the target body part are determined by multiplying the first actual length by the corresponding ratio of the first actual length to the predicted lengths of the other body parts other than the target body part.
[0074] Alternatively, the first actual length is input into the prediction model to determine the predicted lengths of other body parts except the target body part. The training process of the prediction model is as follows:
[0075] Acquire training sample data and labeling results of the training sample data, wherein the training sample data includes the historical actual length of the target body part, and the labeling results include the historical predicted lengths of other body parts except the target body part.
[0076] The training sample data is input into the neural network model for training, and the prediction result of the neural network model for the training sample data is obtained.
[0077] Based on the prediction results and labeling results, the network parameters of the neural network model are adjusted until the neural network model converges to obtain a prediction model.
[0078] For example, taking the target body part as shoulder width as an example, the target proportion relationship is shown in Table 1.
[0079] Table 1
[0080] When the first actual length corresponding to the shoulder width is 40 pixels, it can be determined that the predicted length corresponding to the neck length is equal to 40×0.84=33.6, the predicted length corresponding to the hip width is equal to 40×0.62=24.8, the predicted length corresponding to the torso length is equal to 40×1.82=72.8, the predicted length corresponding to the upper arm length is equal to 40×1.04=41.6, the predicted length corresponding to the forearm length is equal to 40×0.84=33.6, the predicted length corresponding to the thigh length is equal to 40×1.31=52.4, and the predicted length corresponding to the calf length is equal to 40×1.47=58.8.
[0081] In other examples, because different body parts have different length ratios in the human body, when the target body part changes, the corresponding target proportion relationship will also change.
[0082] For example, taking the target body part as neck length as an example, the target proportion relationship is shown in Table 2.
[0083] Table 2
[0084] When the predicted length corresponding to the neck length is 40 pixels, it can be determined that the predicted length corresponding to the shoulder width is equal to 40×1.19=47.6, the predicted length corresponding to the hip width is equal to 40×0.74=29.6, the predicted length corresponding to the torso length is equal to 40×2.17=86.8, the predicted length corresponding to the upper arm length is equal to 40×1.24=49.6, the predicted length corresponding to the forearm length is equal to 40×1=40, the predicted length corresponding to the thigh length is equal to 40×1.56=62.4, and the predicted length corresponding to the calf length is equal to 40×1.75=70.
[0085] S14. Determine the rendering heights of other body parts based on the second actual length and the predicted length.
[0086] In some examples, to prevent deformation of the drawn virtual digital human, the virtual digital human generation method provided in embodiments of the present application uses a second actual length to correct the predicted length, thereby ensuring that the drawn virtual digital human better meets the user's aesthetic taste and enhances the user experience. For example, if the second actual length of another body part is greater than the predicted length of the other body part, the drawing height of the other body part is determined to be equal to the second actual length of the other body part; if the second actual length of the other body part is less than or equal to the predicted length of the other body part, the drawing height of the other body part is determined to be equal to the predicted length of the other body part. Alternatively, the drawing height of the other body part is equal to the average of the second actual length and the predicted length of the other body part.
[0087] In some examples, when the second actual length is less than the predicted length, in the process of drawing the virtual digital human based on the position information, it is necessary to translate the key points corresponding to the body parts (e.g., one or more of upward translation, downward translation, leftward translation, and rightward translation) to ensure the integrity of the drawn virtual digital human. For example, if the predicted length of only the shoulder width is greater than the second actual length of the shoulder width, in this case, along the line connecting the key points representing the left shoulder and the right shoulder, with the midpoint of the line connecting the shoulder width as the center, the key points representing the left shoulder and the right shoulder are translated to the left and right, respectively, so that the length of the line connecting the translated key points representing the left shoulder and the translated key points representing the right shoulder equals the predicted length. Alternatively, when the predicted length corresponding to the thigh length among body parts is greater than the second actual length corresponding to the thigh length, and the predicted length corresponding to the calf length among body parts is greater than the second actual length corresponding to the calf length, it is necessary to translate the key point of the human body used to characterize the skeletal joint as the left knee downward on the line connecting the key point of the human body used to characterize the skeletal joint as the left hip to the key point of the human body used to characterize the skeletal joint as the left knee; at the same time, translate the key point of the human body used to characterize the skeletal joint as the left ankle downward on the line connecting the key point of the human body used to characterize the skeletal joint as the left knee to the key point of the human body used to characterize the skeletal joint as the left ankle. At the same time, translate the key point of the human body used to characterize the skeletal joint as the right knee downward on the line connecting the key point of the human body used to characterize the skeletal joint as the right hip to the key point of the human body used to characterize the skeletal joint as the right knee; at the same time, translate the key point of the human body used to characterize the skeletal joint as the right ankle downward on the line connecting the key point of the human body used to characterize the skeletal joint as the right knee to the key point of the human body used to characterize the skeletal joint as the right ankle.
[0088] S15: Drawing is performed based on the first actual length, the drawing height, and the position relationship to generate a virtual digital human.
[0089] In some examples, when a user performs different fitness movements, the position information of key points on the human body in the first frame image will also change. Therefore, the method for generating a virtual digital human provided in an embodiment of the present application draws the virtual digital human based on the position information of key points on the human body in the first frame image, the first actual length, and the second actual length. This ensures that the fitness movement corresponding to the virtual digital human is the same as the user's current fitness movement. Therefore, the user can intuitively understand whether the fitness movement currently being performed is consistent with the fitness movement in the target video played by the first application, thereby improving the user experience.
[0090] As can be seen from the above, when a user wishes to display a virtual human, they can select a target function. This will display a target interface that includes playback controls for playing the target video and preview controls for displaying the virtual human. This allows the user to view the virtual human while watching the target video. Because the virtual human is drawn based on the user's actual body key point location information, first actual length, and second actual length, the fitness movements corresponding to the virtual human are identical to the user's current fitness movements. Therefore, the user can intuitively understand whether the fitness movements they are currently performing are consistent with those in the target video played by the first application.
[0091] In some feasible examples, in combination with FIG4 , as shown in FIG7 , the method for generating a virtual digital human provided in the embodiment of the present application further includes: S16-S20.
[0092] S16: Acquire a second frame of image captured by the image capture device when the target video is started, wherein the second frame of image includes a human body facing the image capture device and performing the target action.
[0093] In some examples, users of different age groups may have different target proportion relationships. To ensure the accuracy of the drawn virtual digital human, the virtual digital human generation method provided in embodiments of the present application assigns different target proportion relationships to users of different age groups. Therefore, when the target video is started, the second frame of image captured by the image acquisition device can be analyzed to determine the human height. The target proportion relationship currently in use is then determined based on the human height and the control height. For example, a first template is assigned to adults (users over 18 years old), and a second template is assigned to children (users under 18 years old). The ratio of the human height to the control height is compared with a preset threshold to determine whether the current user is an adult or a child. For example, if the ratio of the human height to the control height is greater than the preset threshold, the current user is an adult, and the target proportion relationship currently in use is determined to be the first template. Conversely, if the ratio of the human height to the control height is less than or equal to the preset threshold, the current user is a child, and the target proportion relationship currently in use is determined to be the second template. In this way, when drawing a virtual digital human, different target proportion relationships can be used for users of different age groups, thereby ensuring the accuracy of the generated virtual digital human and improving the user experience.
[0094] In some examples, the display device 200 has a distance detection function, such as a distance measurement sensor provided on the display device 200. When the human body is far away from the display device 200, the user can be prompted to move closer to the display device 200. When the human body is close to the display device 200, the user can be prompted to move away from the display device 200. When the human body deviates from the display device 200, the user can be prompted to stand back within the capture area of the image capture device. In this way, the integrity of the human body in the first frame or the second frame of the image captured by the image capture device can be guaranteed, thereby ensuring the user experience.
[0095] S17: Perform human body key recognition on the second frame image to determine at least one human body key point and configuration information of each human body key point, wherein the configuration information includes position information and confidence level.
[0096] In some examples, when performing human key recognition on the second image frame, the second image frame needs to be preprocessed to determine the preprocessed first image. Thereafter, the first image is recognized to determine the actual detection frame corresponding to the human body. The first image is then cropped based on the actual detection frame to obtain a human image of the human body. Thereafter, the human image is recognized to determine at least one target key point corresponding to the human body. Alternatively, a human detection algorithm is used to detect the second image frame to determine at least one human key point.
[0097] In some exemplary embodiments, the preprocessing includes at least one of denoising, scaling, distortion correction, and stereo correction.
[0098] In some examples, recognizing a first image and determining an actual detection frame corresponding to a human body includes: separating the foreground and background of the first image to obtain a corresponding foreground. Then, performing image recognition within the foreground to determine the human body contained within the foreground. Finally, by recognizing the human body, determining a minimum rectangle inscribed within the human body, and using the minimum rectangle as the actual detection frame corresponding to the human body.
[0099] Alternatively, the foreground and background of the first image are separated to determine the foreground in the first image. Image recognition is then performed on the foreground to determine the human body contained in the foreground. Finally, the human body is identified to determine the minimum rectangle inscribed within the human body, which is then used as the actual detection frame corresponding to the human body. Alternatively, the first image is input into a human detection network to determine the actual detection frame corresponding to the human body.
[0100] Specifically, the training process of the human body detection network is as follows:
[0101] Get the training images and the labeled results of the training images.
[0102] Inputting the training image into a first object detection network to obtain a prediction result of the first object detection network for the training image, wherein the first object detection network includes at least one of the object detection algorithms YOLO, Single Shot Multi-Frame Detector (SSD), and Faster RCNN.
[0103] When the labeling result is different from the prediction result, the network parameters of the first object detection network are repeatedly adjusted until the entire object detection network converges to obtain a human detection network.
[0104] In some examples, when cropping a frame image based on an actual detection frame, the actual detection frame and the frame image are first projected to determine the image of the frame image within the actual detection frame. The image within the actual detection frame is then separated into foreground and background to obtain the corresponding foreground. Image recognition is then performed within the foreground to determine the human body contained within the foreground. The human body contained within the foreground is then cropped to obtain a human image of the human body.
[0105] In some examples, the second frame image can be input into a human key point detection network to determine at least one human key point and configuration information of each human key point.
[0106] Specifically, the training process of the human key point detection network is as follows:
[0107] A training sample image and a training supervision image are obtained; wherein the training sample image and the training supervision image both include a human body, key points corresponding to the human body, and historical configuration information of each key point.
[0108] A second object detection network is trained based on the training sample images to obtain a pre-trained second object detection network.
[0109] Among them, the second target detection network includes at least any one of the heat map-based human skeleton point detection network HRNet, Simple Baseline, or a non-heat map network with an output end of argmax.
[0110] Based on the training supervision image, the network parameters of the pre-trained second object detection network are adjusted until the pre-trained second object detection network converges to obtain a human key point detection network.
[0111] Alternatively, a human key point detection algorithm is used to perform human key recognition on the second frame image to determine at least one human key point and configuration information of each human key point.
[0112] In some examples, the human body detection algorithm includes: a CPM algorithm, or any one of the OpenPose algorithms.
[0113] S18: When both the position information and the confidence level satisfy the standing condition, obtain the height of the preview control, wherein the preview control is used to display the virtual digital human.
[0114] In some examples, in order to determine whether a human body meets the standing condition, it is necessary to select key points of the human body that can represent that the human body is in a standing state, such as: a key point of the human body used to represent that the skeletal joint is the nose, a key point of the human body used to represent that the skeletal joint is the left shoulder, a key point of the human body used to represent that the skeletal joint is the right shoulder, a key point of the human body used to represent that the skeletal joint is the left hip, a key point of the human body used to represent that the skeletal joint is the right hip, a key point of the human body used to represent that the skeletal joint is the left knee, a key point of the human body used to represent that the skeletal joint is the right knee, a key point of the human body used to represent that the skeletal joint is the left ankle, and a key point of the human body used to represent that the skeletal joint is the right ankle. Subsequently, based on the position information and confidence of the key points of the human body that can represent that the human body is in a standing state, it is determined whether the human body meets the standing condition. For example: the confidence of the key point of the human body with the nose as the skeleton joint, the confidence of the key point of the human body with the left shoulder as the skeleton joint, the confidence of the key point of the human body with the right shoulder as the skeleton joint, the confidence of the key point of the human body with the left hip as the skeleton joint, the confidence of the key point of the human body with the right hip as the skeleton joint, the confidence of the key point of the human body with the left knee as the skeleton joint, the confidence of the key point of the human body with the right knee as the skeleton joint, the confidence of the key point of the human body with the left ankle as the skeleton joint, and the confidence of the key point of the human body with the right ankle as the skeleton joint are all greater than the confidence threshold, and the confidence of the key point of the human body with the right ankle as the skeleton joint is greater than the confidence threshold, and the confidence of the key point of the human body with the left hip as the skeleton joint is greater than the confidence threshold, and the confidence of the key point of the human body with the right knee as the skeleton joint is greater than the confidence threshold, and the confidence of the key point of the human body with the left ankle as the skeleton joint is greater than the confidence threshold, and the confidence of the key point of the human body with the right ... left hip as the skeleton joint is greater than the confidence threshold, The position information of the human body key point whose skeletal joint is the nose, the position information of the human body key point whose skeletal joint is the left hip, the position information of the human body key point whose skeletal joint is the right hip, the position information of the human body key point whose skeletal joint is the left knee, and the position information of the human body key point whose skeletal joint is the right knee meet the first condition, and when the angle formed by the human body key point whose skeletal joint is the right hip, the human body key point whose skeletal joint is the right knee, and the human body key point whose skeletal joint is the right knee is greater than or equal to the angle threshold, it is considered that both the position information and the confidence level meet the standing condition.
[0115] In some examples, when a user needs to know whether their current exercise matches the exercise in a target video played by a first application, they can select a target function provided by the first application. In response to this selection, the first application displays a target interface containing playback controls for the target video and preview controls for displaying a virtual digital human. This allows the user to view the virtual digital human while watching the target video. Because the exercise corresponding to the virtual digital human matches the user's current exercise, the user can intuitively determine whether their current exercise matches the exercise in the target video played by the first application, enhancing the user experience.
[0116] In some examples, the size of the actual generated virtual human is larger than the size of the preview control. In this case, the virtual human needs to be scaled according to a preset ratio before being displayed in the preview control. The preset ratio can be pre-set or determined based on the first actual length and the preview control's height or width. For example, if the target body part corresponding to the first actual length is shoulder width, the preset ratio can be determined based on the ratio of the control width to the first actual length. Alternatively, if the target body part corresponding to the first actual length is torso length, the preset ratio can be determined based on the ratio of the control height to the first actual length.
[0117] S19: Determine the height of the human body based on the first information and the second information, wherein the first information includes position information of a key point of the human body representing a nose as a skeletal joint, and the second information includes position information of a key point of the human body representing an ankle as a skeletal joint.
[0118] S20: Determine a target proportional relationship based on the height of the human body and the height of the control.
[0119] In some feasible examples, as shown in FIG8 in combination with FIG7 , the above S17 can be specifically implemented through the following S170 .
[0120] S170: Perform human key recognition on the second frame image using a human key point detection algorithm to determine at least one human key point and configuration information of each human key point.
[0121] In some feasible examples, as shown in FIG9 in combination with FIG7 , the above S18 can be specifically implemented through the following S180 .
[0122] S180: If the confidence levels are all greater than or equal to the confidence threshold, the position information satisfies the first condition, and the angle formed by the three target key points is greater than or equal to the angle threshold, obtain the height of the preview control, where the target key point is any key point on the human body.
[0123] In some examples, the three target key points may be a human body key point representing a right hip joint, a human body key point representing a right knee joint, and a human body key point representing a right knee joint. The angle formed by the three target key points is the angle formed by the line connecting the human body key point representing the right knee joint and the human body key point representing the right hip joint, and the angle formed by the line connecting the human body key point representing the right knee joint and the human body key point representing the right ankle joint.
[0124] Exemplarily, the angle threshold may be 150°.
[0125] In some feasible examples, the position information includes at least a ordinate, and the target body part includes a torso; the first condition includes: the sum of the ordinate of the human body key point for representing the skeletal joint of the nose and the obtained value is less than the ordinate of the human body key point for representing the skeletal joint of the left hip, and the ordinate of the human body key point for representing the skeletal joint of the left knee is greater than or equal to the ordinate of the human body key point for representing the skeletal joint of the left hip, and the ordinate of the human body key point for representing the skeletal joint of the right knee is greater than or equal to the ordinate of the human body key point for representing the skeletal joint of the right hip; or, the sum of the ordinate of the human body key point for representing the skeletal joint of the nose and the obtained value is less than the ordinate of the human body key point for representing the skeletal joint of the right hip, and the ordinate of the human body key point for representing the skeletal joint of the left knee is greater than or equal to the ordinate of the human body key point for representing the skeletal joint of the left hip, and the ordinate of the human body key point for representing the skeletal joint of the right knee is greater than or equal to the ordinate of the human body key point for representing the skeletal joint of the right hip. Wherein, the obtained value is determined according to the length of the torso.
[0126] In some examples, the obtained value is equal to the product of a preset coefficient and the torso length, where the preset coefficient is a constant.
[0127] In some feasible examples, as shown in FIG10 in combination with FIG7 , the above S19 can be specifically implemented through the following S190.
[0128] S190. Determine the height of the human body according to the absolute value of the difference between the longitudinal coordinate of the key point of the human body for representing the skeletal joint of the nose and the longitudinal coordinate of the key point of the human body for representing the skeletal joint of the ankle.
[0129] In some examples, the human body height is equal to the absolute value of the difference between the vertical coordinate of the human body key point used to represent the skeletal joint of the nose and the vertical coordinate of the human body key point used to represent the skeletal joint of the ankle.
[0130] In some feasible examples, as shown in FIG11 in combination with FIG7 , the above S20 can be specifically implemented through the following S200 and S201 .
[0131] S200: When the ratio of the control height to the human body height is greater than a preset threshold, determine the target proportional relationship as a first template.
[0132] S201: When the ratio of the control height to the human body height is less than or equal to a preset threshold, determining the target proportion relationship as a second template, wherein both the first template and the second template include corresponding proportions of the first actual length to the actual lengths of other body parts other than the target body part, and the corresponding proportions in the first template are different from the corresponding proportions in the second template.
[0133] In some feasible examples, in combination with FIG7 , as shown in FIG12 , the method for generating a virtual digital human provided in the embodiment of the present application further includes: S21.
[0134] S21: In response to the selection operation of the target function, a target interface is displayed, wherein the target interface includes a play control for playing the target video and a preview control for displaying the virtual digital human.
[0135] For example, when a user needs to know whether their current fitness routine matches the one in the target video played by the first application, they can select the target function provided by the first application. In response to this selection, the first application displays a target interface, as shown in Figure 13, which includes a playback control 1 for playing the target video and a preview control 2 for displaying a virtual digital human. As can be seen, the user can simultaneously view the virtual digital human while watching the target video. Since the fitness routine corresponding to the virtual digital human is the same as the user's current fitness routine, the user can intuitively determine whether their current fitness routine matches the one in the target video played by the first application, enhancing the user experience.
[0136] Alternatively, when a user needs to know whether their current fitness movements match those in the target video played by the first application, they can select another function provided by the first application. In response to this selection, the first application displays a preset interface, as shown in Figure 14, including a playback control 1 for playing the target video and a preview control 3 for displaying the current environment image. As can be seen, while the user is watching the target video, they can also see themselves, allowing them to intuitively understand whether their current fitness movements match those in the target video played by the first application, improving the user experience.
[0137] The above mainly introduces the solution according to the embodiment of the present application from the perspective of method. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily appreciate that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0138] In the embodiments of the present application, the functional modules of the device for generating a virtual digital human can be divided according to the above-mentioned method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into a single processing unit. The above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. It should be noted that the division of modules in the embodiments of the present application is schematic and is only a logical functional division. In actual implementation, other division methods may be used.
[0139] As shown in FIG15 , an embodiment of the present application provides a schematic structural diagram of a display device 200 , which includes a communicator 2001 and a processor 2002 .
[0140] Communicator 2001 is configured to obtain a first frame of image captured by an image acquisition device when playing a target video. The target video includes at least one fitness exercise. Processor 2002 is configured to perform human body key recognition on the first frame of image acquired by communicator 2001, and determine the positional information between key points of the human body, the first actual length of the target body part, and the second actual length of other body parts other than the target body part. Processor 2002 is further configured to determine the predicted lengths of other body parts other than the target body part based on a target proportional relationship and the first actual length. The target proportional relationship includes the corresponding ratio between the first actual length and the predicted lengths of other body parts other than the target body part. Processor 2002 is further configured to determine the drawing height of other body parts based on the second actual length and the predicted length. Processor 2002 is further configured to draw based on the first actual length, the drawing height, and the positional relationship to generate a virtual digital human.
[0141] In some feasible examples, the communicator 2001 is further configured to obtain a second frame of image captured by the image acquisition device when the target video is started. The second frame of image includes a human body facing the image acquisition device and performing the target action. The processor 2002 is further configured to perform human key recognition on the second frame of image acquired by the communicator 2001, determining at least one human key point and configuration information for each human key point. The configuration information includes position information and a confidence level. The processor 2002 is further configured to control the communicator 2001 to obtain the height of the preview control when both the position information and the confidence level meet the standing condition. The preview control is used to display a virtual digital human. The processor 2002 is further configured to determine the human body height based on the first information and the second information. The first information includes the position information of the human body key point representing the skeletal joint of the nose, and the second information includes the position information of the human body key point representing the skeletal joint of the ankle. The processor 2002 is further configured to determine the target proportional relationship based on the human body height and the control height.
[0142] In some feasible examples, the processor 2002 is specifically configured to perform human key recognition on the second frame image acquired by the communicator 2001 using a human key point detection algorithm, and determine at least one human key point and configuration information of each human key point.
[0143] In some feasible examples, the processor 2002 is specifically configured to control the communicator 2001 to obtain the height of the preview control when the confidence levels are all greater than or equal to the confidence threshold, the position information satisfies the first condition, and the angle formed by the three target key points is greater than or equal to the angle threshold. The target key point is any key point on the human body.
[0144] In some feasible examples, the position information includes at least a ordinate, and the target body part includes the torso; the first condition includes: the sum of the ordinate of the human body key point for representing the skeletal joint of the nose and the obtained value is less than the ordinate of the human body key point for representing the skeletal joint of the left hip, and the ordinate of the human body key point for representing the skeletal joint of the left knee is greater than or equal to the ordinate of the human body key point for representing the skeletal joint of the left hip, and the ordinate of the human body key point for representing the skeletal joint of the right knee is greater than or equal to the ordinate of the human body key point for representing the skeletal joint of the right hip. Alternatively, the sum of the ordinate of the human body key point for representing the skeletal joint of the nose and the obtained value is less than the ordinate of the human body key point for representing the skeletal joint of the right hip, and the ordinate of the human body key point for representing the skeletal joint of the left knee is greater than or equal to the ordinate of the human body key point for representing the skeletal joint of the left hip, and the ordinate of the human body key point for representing the skeletal joint of the right knee is greater than or equal to the ordinate of the human body key point for representing the skeletal joint of the right hip; wherein the obtained value is determined according to the length of the torso.
[0145] In some feasible examples, the position information includes at least a vertical coordinate, and the processor 2002 is specifically used to determine the height of the human body based on the absolute value of the difference between the vertical coordinate of the human body key point used to represent the skeletal joint of the nose and the vertical coordinate of the human body key point used to represent the skeletal joint of the ankle.
[0146] In some practicable examples, the processor 2002 is specifically configured to determine the target proportional relationship as a first template when the ratio of the control height to the human body height is greater than a preset threshold; and the processor 2002 is specifically configured to determine the target proportional relationship as a second template when the ratio of the control height to the human body height is less than or equal to the preset threshold. The first template and the second template both include corresponding ratios of the first actual length to the actual lengths of other body parts other than the target body part, and the corresponding ratios in the first template are different from the corresponding ratios in the second template.
[0147] In some feasible examples, the display device 200 further includes a display 2003. The processor 2002 is further configured to control the display 2003 to display a target interface in response to a selection operation of a target function; wherein the target interface includes a play control for playing a target video and a preview control for displaying a virtual digital human.
[0148] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and its role will not be repeated here.
[0149] Of course, the display device 200 according to the embodiment of the present application includes but is not limited to the above modules. For example, the display device 200 may further include a memory 2004. The memory 2004 may be used to store program code of the display device 200, and may also be used to store data generated during operation of the display device 200, such as data in a write request.
[0150] As an example, in combination with Figure 3, the functions implemented by the acquisition unit 210 and the receiving unit 213 in the server 400 are the same as the functions of the communicator 2001, the functions implemented by the processing unit 211 are the same as the functions of the processor 2002, the functions implemented by the display unit 212 are the same as the functions of the display 2003, and the functions implemented by the storage unit 214 are the same as the functions of the memory 2004.
[0151] As shown in Figure 16, an embodiment of the present application also provides a chip system, which can be applied to the display device 200 in the aforementioned embodiment. The chip system includes at least one processor 1501 and at least one interface circuit 1502. The processor 1501 can be the processor in the above-mentioned display device 200. The processor 1501 and the interface circuit 1502 can be interconnected via a line. The processor 1501 can receive and execute computer instructions from the memory of the above-mentioned display device 200 through the interface circuit 1502. When the computer instructions are executed by the processor 1501, the display device 200 can execute the various steps performed by the display device 200 in the above-mentioned embodiment. Of course, the chip system can also include other discrete components, which are not specifically limited in this embodiment of the present application.
[0152] The embodiment of the present application further provides a computer non-volatile readable storage medium for storing computer instructions executed by the above-mentioned display device 200.
[0153] The embodiment of the present application also provides a computer program product, including computer instructions executed by the above-mentioned display device 200.
[0154] In addition to the above embodiments, this application also provides some other embodiments for animation generation, which are described in detail as follows:
[0155] In some embodiments, the processor includes at least one of a central processing unit (CPU), a video processor, an audio processor, RAM (Random Access Memory, RAM), ROM (Read-Only Memory, ROM), a first interface to an nth interface for input / output, a communication bus, etc.
[0156] In some embodiments, taking the operating system of the smart device as an example, as shown in FIG17 , the animation generating device 200 can be logically divided into an application layer (“application layer” for short) 31 , a kernel layer 32 and a hardware layer 33 .
[0157] As shown in Figure 17 , the hardware layer may include the processor 250, communicator 220, and detector 230 shown in Figure 2 . The application layer 31 includes one or more applications. These applications can be system applications or third-party applications. For example, the application layer 31 may include a speech recognition application that provides an animation generation interface and services for connecting the animation generation device 200 to the server 400.
[0158] The kernel layer 32 serves as a software middleware between the hardware layer and the application layer 31 and is used to manage and control hardware and software resources.
[0159] In some embodiments, the kernel layer 32 includes a detector driver, which is used to send the voice data collected by the detector 230 to the voice recognition application. Exemplarily, when the voice recognition application in the animation generation device 200 is started and the animation generation device 200 establishes a communication connection with the server 400, the detector driver is used to send the voice data of the user input collected by the detector 230 to the voice recognition application. Thereafter, the voice recognition application sends the query information containing the voice data to the intent recognition module 102 in the server. The intent recognition module 102 is used to input the voice data sent by the animation generation device 200 into the intent recognition model.
[0160] To clearly illustrate the embodiments of the present application, a speech recognition network architecture according to an embodiment of the present application is described below in conjunction with Figure 18.
[0161] Refer to Figure 18, which is a schematic diagram of an animation generation network architecture according to an embodiment of the present application. In Figure 18, the animation generation device is used to receive input information and output the processing results of the information. The speech recognition module is deployed with a speech recognition service for recognizing audio as text; the semantic understanding module is deployed with a semantic understanding service for semantically parsing text; the business management module is deployed with a business instruction management service for providing business instructions; the language generation module is deployed with a language generation service (NLG) for converting instructions for the animation generation device to execute into text language; the speech synthesis module is deployed with a speech synthesis (TTS) service for processing the text language corresponding to the instruction and sending it to the speaker for broadcast. In one embodiment, the architecture shown in Figure 18 may have multiple entity service devices deployed with different business services, or one or more functional services may be collected in one or more entity service devices.
[0162] In some embodiments, the following describes an example of a process of processing information input to an animation generating device based on the architecture shown in FIG18 , taking the case where the information input to the animation generating device is a voice command inputted via voice as an example:
[0163] [Speech Recognition]
[0164] After receiving the voice command inputted via voice, the animation generating device may perform noise reduction processing and feature extraction on the audio of the voice command. The noise reduction processing here may include steps such as removing echo and ambient noise.
[0165] [Semantic Understanding]
[0166] Using acoustic models and language models, the natural language understanding of the identified candidate text and the associated context information is performed, and the text is parsed into structured, machine-readable information, business domain, intent, word slots and other information to express semantics, etc. The executable intent is obtained and the intent confidence score is determined. The semantic understanding module selects one or more candidate executable intents based on the determined intent confidence score.
[0167] [Business Management]
[0168] The semantic understanding module sends an execution instruction to the corresponding business management module based on the semantic analysis results of the voice command text to perform the operation corresponding to the voice command, complete the user's request for this operation, and provide feedback on the execution result of the operation corresponding to the voice command.
[0169] In some embodiments, the animation generating device 200 performs style transfer on the target facial image through the processor 250 to obtain a transfer image corresponding to the target facial image; performs key point detection on the transfer image to obtain facial key points of the transfer image; determines the driving key points and driving anchor points of the transfer image based on the facial key points and the corner points of the transfer image; obtains the texture coordinates of the transfer image based on the coordinates of the driving key points and the coordinates of the driving anchor points; triangulates the driving key points and the driving anchor points to obtain multiple texture triangles of the transfer image; drives the transfer image according to the vertex coordinate sequence corresponding to the driving voice obtained in real time, the texture coordinates and the multiple texture triangles to generate a style transfer animation corresponding to the target facial image.
[0170] In some embodiments, the animation generation device 200 performs style transfer on the target face image through the processor 250, and the method for obtaining the transfer image corresponding to the target face image can be: generating the transfer image corresponding to the target face image according to the target face image and the style transfer model; wherein the style transfer model is a generator in a generative adversarial network GAN, and the generator includes: an encoder, an auxiliary classifier, an attention module and a decoder; the encoder is used to downsample the input image of the GAN to obtain a first downsampled image, process the first downsampled image through a convolution residual block to obtain residual features, and perform instance normalization IN on the residual features to obtain encoding features; the auxiliary classifier is used to obtain weight coefficients of each channel of the encoding features, and the attention module is used to obtain attention features from the weight coefficients of each channel of the encoding features and the encoding features; the decoder is used to perform IN or layer normalization LN on the attention features to obtain normalized features and upsample the normalized features to obtain the output image of the generator.
[0171] In some embodiments, the animation generating device 200 is further configured through the processor 250 to obtain an original image set before generating a migration image corresponding to the target facial image based on the target facial image and the style migration model, the original image set including multiple sample facial images and multiple sample migration images; obtain facial key points of each image in the original image set; perform rotation correction on each image in the original image set according to the facial key points of each image to obtain a corrected image set; scale the facial bounding box corresponding to each image in the corrected image set to a preset size, and extract the image content within the scaled facial bounding box to obtain a cropped image set; the facial bounding box corresponding to any image is the circumscribed positive direction of the facial key points of the image; set the background of each image in the cropped image set to a preset color to obtain a sample image set; train the GAN based on the sample image set to obtain the style migration model.
[0172] In some embodiments, the animation generation device 200 performs key point detection on the migration image through the processor 250, and the method for obtaining the facial key points of the migration image can be: performing key point detection on the migration image based on a facial key point detection model to obtain the facial key points of the migration image; wherein, the facial key point detection model is a model obtained by training a preset machine learning model based on sample data, and the sample data includes: multiple sample facial images and facial key point information corresponding to each sample facial image.
[0173] In some embodiments, the facial key points of the migration image of the animation generating device 200 include 68 key points, and the processor is specifically configured to: select 20 driving key points from the mouth key points, left eye key points and right eye key points among the facial key points; set 8 driving anchor points according to the mouth key points, chin key points, nose key points, left eye key points and right eye key points among the facial key points, and set 4 driving anchor points according to the corner points of the migration image.
[0174] In some embodiments, the processor 250 of the animation generation device 200 is specifically configured to: normalize the coordinates of the driving key points and the coordinates of the driving anchor points to obtain the texture coordinates of the migration image; the processor is also configured to: process each coordinate value in the vertex coordinate sequence as a value within [-1,1].
[0175] In some embodiments, the processor 250 of the animation generating device 200 is specifically configured to obtain a first offset sequence corresponding to the driving voice in real time; convert the first offset sequence into a second offset sequence corresponding to the migration image according to a preset scaling parameter and a preset offset; update the coordinates of the driving key point and the coordinates of the driving anchor point according to the second offset sequence, and obtain a vertex coordinate sequence corresponding to the driving voice.
[0176] In some embodiments, the processor 250 of the animation generating device 200 is specifically configured to convert the first vertex offset into the second vertex offset according to the preset scaling parameter, the preset offset, and the following formula:
[0177] in, is the i-th offset in the second offset sequence, is the i-th offset in the first offset sequence, scale is the preset scaling parameter, and shift is the preset offset.
[0178] In some embodiments, the processor 250 of the animation generating device 200 is further configured to: determine a target frequency according to the frame rate of the style transfer animation; and acquire the vertex coordinate sequence according to the target frequency.
[0179] FIG19 exemplarily shows a flowchart of an animation generation method according to an embodiment of the present application. As shown in FIG19 , the animation generation method according to an embodiment of the present application includes the following steps:
[0180] S501: Perform style migration on a target face image to obtain a migration image corresponding to the target face image.
[0181] In some embodiments, the style transfer of the target facial image is the conversion of images in two different domains. Specifically, a style image is provided, and any image is converted into this style while retaining the content of the original image as much as possible.
[0182] S502: Perform key point detection on the transition image to obtain facial key points of the transition image.
[0183] In some embodiments, the key point detection is actually processing the relationship description of the image. The facial key points can express both point information and position information and associated information. The facial key points can be obtained through detection, and the facial posture can be calculated based on them. Each key point in the face can express the type characteristics of the face. For example, the key point of the eye can express the shape of the eye and the position information of the eye on the face.
[0184] S503: Determine driving key points and driving anchor points of the transition image according to the facial key points and the corner points of the transition image.
[0185] In some embodiments, the corner points of the migration image are located at the four vertices of the migration image, which are used to fix the overall stretching effect of the migration image. As shown in Figure 20, there are four corner points A, B, C, and D at the four vertices of the migration image 600. The positions indicated by the four points A, B, C, and D are the corner point positions of the migration image.
[0186] S504 : Acquire texture coordinates of the migration image according to the coordinates of the driving key points and the coordinates of the driving anchor points.
[0187] In some embodiments, the coordinates of the driving key points and the coordinates of the driving anchor points can be expressed as Ref[a1, b1, c1], Ref[a2, b2, c2], etc., where a, b, and c represent position parameters of a coordinate.
[0188] S505 : Perform triangulation on the driving key points and the driving anchor points to obtain a plurality of texture triangles of the migration image.
[0189] In some embodiments, the triangulation of the driving key points and the driving anchor points is to use the Delaunay triangulation algorithm on the driving key points and the driving anchor points, wherein Delaunay triangulation (Triangulation) is the process of generating a set of triangles for a given plane point set. For example, in finite element simulation, ray tracing rendering and other calculations, it is necessary to convert the geometric model into triangular mesh data, that is, "triangulated mesh generation".
[0190] Exemplarily, referring to FIG21 , which is a schematic diagram of the formation process of multiple texture triangles of the migration image, the coordinate parameters of the driving key points and the driving anchor points are input using the subdiv.gettrianglelist method, and the points are connected into triangles using the Delauney decomposition empty circle characteristic and the rule of maximizing the minimum angle, and the triangle index is output. No matter where the Delauney triangulation network is started from, it is unique and closest to a regularized triangulation network, which can optimize the subsequent end-side stretching effect and improve the stretching efficiency.
[0191] S506 : Drive the transfer image according to the vertex coordinate sequence corresponding to the driving voice acquired in real time, the texture coordinates, and the plurality of texture triangles to generate a style transfer animation corresponding to the target face image.
[0192] In some embodiments, the driving voice can be obtained by identifying the user voice through intelligent technologies such as speech semantic recognition, or directly obtained from a cloud voice library based on the current scene content.
[0193] In some embodiments, the method for obtaining a vertex coordinate sequence corresponding to a driving voice in real time includes the following steps A to D:
[0194] Step A: acquiring a first offset sequence corresponding to the driving voice in real time.
[0195] In some embodiments, the first offset sequence corresponding to the driving voice can be a voice-driven key point offset input from the cloud. For example, when there are 32 key points, the first offset sequence can be expressed as: Delta[A1, B1, C1] N , Delta[A2, B2, C2] N 、……Delta[A 32 、B 32 、C 32 ] N .
[0196] Step B: converting the first offset sequence into a second offset sequence corresponding to the migration image according to a preset scaling parameter and a preset offset.
[0197] In some embodiments, the preset scaling parameter is a floating point number, and the preset offset can be expressed as [x_, y_, z_].
[0198] Step C: converting the first vertex offset into the second vertex offset according to the preset scaling parameter, the preset offset, and the following formula:
[0199] in, is the i-th offset in the second offset sequence, is the i-th offset in the first offset sequence, scale is the preset scaling parameter, and shift is the preset offset.
[0200] In some embodiments, the preset scaling parameter and the preset offset can be obtained by manually debugging multiple times according to different migration cartoon images.
[0201] Step D: updating the coordinates of the driving key points and the driving anchor points according to the second offset sequence, and obtaining a vertex coordinate sequence corresponding to the driving voice.
[0202] As can be seen from the above technical solutions, the animation generation device and method according to the embodiment of the present application performs style transfer on a target facial image through a processor to obtain a transfer image corresponding to the target facial image; performs key point detection on the transfer image to obtain facial key points of the transfer image; determines the driving key points and driving anchor points of the transfer image based on the facial key points and the corner points of the transfer image; obtains the texture coordinates of the transfer image based on the coordinates of the driving key points and the coordinates of the driving anchor points; triangulates the driving key points and the driving anchor points to obtain multiple texture triangles of the transfer image; and drives the transfer image based on the vertex coordinate sequence corresponding to the driving voice obtained in real time, the texture coordinates, and the multiple texture triangles to generate a style transfer animation corresponding to the target facial image. Compared with the existing technology, the generated style transfer animation has poor effect and is not very visually appealing. The present application triangulates the style transfer image to give the obtained transfer image a better stretching effect, thereby making the generated animation better and improving the user experience.
[0203] As an extension and refinement of the above embodiment, FIG22 exemplarily shows a flow chart of an animation generation method according to an embodiment of the present application. As shown in FIG22 , the animation generation method according to an embodiment of the present application includes the following steps:
[0204] S801: Perform style migration on a target face image to obtain a migration image corresponding to the target face image.
[0205] S802: Perform key point detection on the migration image based on a facial key point detection model to obtain facial key points of the migration image.
[0206] Among them, the facial key point detection model is a model obtained by training a preset machine learning model based on sample data, and the sample data includes: multiple sample face images and facial key point information corresponding to each sample face image.
[0207] In the above S802, the facial key points of the migration image include 68 key points. FIG. 23 is a schematic diagram of the 68 facial key points in the migration image. The method for obtaining the facial key points of the migration image includes the following steps 1 and 2:
[0208] Step 1: Select 20 driving key points from the mouth key points, left eye key points and right eye key points in the facial key points.
[0209] In some embodiments, referring to Figure 23, which is a schematic diagram of the positions of 68 facial key points in the migration image, 8 key points are selected from the mouth key points of the 68 facial key points, 6 key points are selected from the left eye key points and 6 key points are selected from the right eye key points, and these 20 key points are used as driving key points.
[0210] Step 2: Set 8 driving anchor points based on the mouth key point, chin key point, nose key point, left eye key point and right eye key point among the facial key points, and set 4 driving anchor points based on the corner points of the migration image.
[0211] In some embodiments, eight key points, including the mouth, chin, nose, left eye, and right eye, are selected from the facial key points as the driving anchor points to control the stretching of the surrounding areas caused by eliminating the driving key points. For example, referring to FIG. 21 , the positions of the 32 key points, including the driving key points and the driving anchor points, are shown in FIG. 21 (1).
[0212] It should be noted that the selection of key points and the setting of anchor points to ensure the stretching effect must follow the following two principles:
[0213] Principle 1: Fine-tune the key points of the eyes and mouth to ensure the symmetry of the overall coordinates of the key points and the surrounding of the parts.
[0214] Principle 2: Different images require different anchor point positions. In principle, the result of the triangulation algorithm shall prevail.
[0215] S803: Determine driving key points and driving anchor points of the transition image according to the facial key points and the corner points of the transition image.
[0216] S804: Acquire texture coordinates of the migration image according to the coordinates of the driving key points and the coordinates of the driving anchor points.
[0217] In the above S804, the method of obtaining the texture coordinates of the migrated image according to the coordinates of the driving key points and the coordinates of the driving anchor points further includes:
[0218] Normalizing the coordinates of the driving key points and the coordinates of the driving anchor points to obtain texture coordinates of the migration image.
[0219] In some embodiments, the texture coordinate value range is 0 to 1, so the coordinates of the driving key point and the coordinates of the driving anchor point need to be normalized to the space of [0, 1]. Exemplarily, the scaling method can be to divide the coordinates of the driving key point and the coordinates of the driving anchor point by the pixel width of the stretched image (square).
[0220] S805 , performing triangulation meshing on the driving key points and the driving anchor points, as shown in ( 2 ) of FIG. 21 , to obtain a plurality of texture triangles of the migration image.
[0221] S806 : Drive the transfer image according to the vertex coordinate sequence corresponding to the driving voice acquired in real time, the texture coordinates, and the plurality of texture triangles to generate a style transfer animation corresponding to the target face image.
[0222] In the above S806, the method further includes: processing each coordinate value in the vertex coordinate sequence into a value within [-1, 1].
[0223] As an extension and refinement of the above embodiment, FIG24 exemplarily shows a flowchart of an animation generation method according to an embodiment of the present application. As shown in FIG24 , the animation generation method according to an embodiment of the present application includes the following steps:
[0224] S1001. Generate a migration image corresponding to the target facial image based on the target facial image and a style migration model.
[0225] The style transfer model is a generator in a generative adversarial network (GAN), which includes an encoder, an auxiliary classifier, an attention module, and a decoder. In some embodiments, as shown in FIG25 , the generator 1100 in the generative adversarial network (GAN) includes:
[0226] Encoder 1101, configured to downsample the input image of the GAN to obtain a first downsampled image, process the first downsampled image using a convolution residual block to obtain residual features, and perform instance normalization (IN) on the residual features to obtain encoding features;
[0227] The auxiliary classifier 1102 is used to obtain the weight coefficients of each channel of the coding feature.
[0228] The attention module 1103 obtains an attention feature using the weight coefficients of each channel of the coding feature and the coding feature.
[0229] The decoder 1104 is used to perform IN or layer normalization LN on the attention feature to obtain normalized features and upsample the normalized features to obtain the output image of the generator.
[0230] The style transfer model also includes a discriminator in a generative adversarial network (GAN). As shown in FIG26 , the discriminator 1200 in the generative adversarial network (GAN) includes an encoder 1201, an auxiliary classifier 1202, an attention module 1203, and a classifier 1204. The discriminator has a basically identical structure to the generator, except that the generator and the discriminator use different loss functions when training the classifier.
[0231] Before generating a transfer image corresponding to the target face image based on the target face image and the style transfer model, it is necessary to obtain the style transfer model. The method for obtaining the style transfer model includes the following steps 1 to 6:
[0232] Step 1: Acquire an original image set, where the original image set includes multiple sample face images and multiple sample migration images.
[0233] Step 2: Obtain facial key points of each image in the original image set.
[0234] Step 3: Perform rotation correction on each image in the original image set according to the facial key points of each image to obtain a corrected image set.
[0235] Step 4: Scale the face bounding box corresponding to each image in the corrected image set to a preset size, extract the image content within the scaled face bounding box, and obtain a cropped image set; the face bounding box corresponding to any image is the circumscribed positive direction of the face key point of the image.
[0236] Step 5: Set the background of each image in the cropped image set to a preset color to obtain a sample image set.
[0237] Step 6: Train the GAN based on the sample image set to obtain the style transfer model.
[0238] In some embodiments, when obtaining the style transfer model, a loss function needs to be set to calculate the gap between the forward calculation result of each iteration of the neural network and the true value, so as to guide the next step of training in the right direction. In this embodiment of the present application, there are four loss functions, namely Adversarial loss, Cycle loss, Identity loss and CAM loss (class activation loss).
[0239] Specifically, we train a function Gs->t that maps the source domain Xs to the target domain Xt. Training uses mismatched samples from the two domains. Our framework consists of generators Gs->t and Gt->s, and two discriminators Ds and Dt. The attention module in the discriminator helps the generator focus on the most important areas for generating realistic images. The generator's attention focuses on the key parts that distinguish the source domain from other domains.
[0240] Let x∈{Xt,Gs->t(Xs)} represent samples from the target domain or generated, D t It is a model that includes encoder—EDt, classifier CDt, and auxiliary classifier ηDt. ηDt(x) and Dt(x) are used to identify whether x comes from Xt or Gs->t(Xs).
[0241] Adversarial loss: The mean squared error (MSE) is used to match the distribution of the translated image with the target image. The loss function is expressed as follows:
[0242] Cycle loss: Cycle loss is to alleviate the mode collapse problem and apply the cycle consistency constraint to the generator. Given an image x∈Xs, after the sequential transformation of x from Xs to Xt and from Xt to Xs, the image should be successfully transformed back to the original domain. The loss function expression is as follows:
[0243] Identity loss: The regression loss function L1 loss is used. The identity loss is to ensure that the color distribution of the input image and the output image is similar, and the identity consistency constraint is applied to the generator. Given an image x∈Xt, after using Gs→t to transform X, the image should not change. The loss function expression is as follows:
[0244] CAM loss: Binary Cross Entropy Loss (BCE loss) is used in the generator, and MSE loss is used in the discriminator. The information of the auxiliary classifier is used to calculate the maximum difference between the target domain and the source domain.
[0245] The loss function expression in Gnerator is as follows:
[0246] The loss function expression in Discriminator is as follows:
[0247] Among them, ηs(x) represents the probability that x comes from Xs, ηD t (x) means x comes from D t probability.
[0248] S1002: Perform key point detection on the migration image based on a facial key point detection model to obtain facial key points of the migration image.
[0249] Among them, the facial key point detection model is a model obtained by training a preset machine learning model based on sample data, and the sample data includes: multiple sample face images and facial key point information corresponding to each sample face image.
[0250] S1003: Determine driving key points and driving anchor points of the transition image based on the facial key points and the corner points of the transition image.
[0251] S1004 : Acquire texture coordinates of the migration image according to the coordinates of the driving key points and the coordinates of the driving anchor points.
[0252] S1005 : Perform triangulation on the driving key points and the driving anchor points to obtain a plurality of texture triangles of the migration image.
[0253] S1006 , driving the transfer image according to the vertex coordinate sequence corresponding to the driving voice acquired in real time, the texture coordinates, and the plurality of texture triangles, to generate a style transfer animation corresponding to the target face image.
[0254] As an extension and refinement of the above embodiment, FIG. 27 is a schematic diagram of the overall framework of the animation generation method, which includes:
[0255] The superimposed key point module 1301 is used to obtain a vertex coordinate sequence.
[0256] The processing module 1302 is configured to obtain a vertex coordinate sequence corresponding to the driving voice, the texture coordinates, and the plurality of texture triangles, drive the migration animation, and control the alignment of the audio and the picture.
[0257] The processing module includes an OpenGL ES renderer, a Vertex Array Object (VAO) area, a Vertex Buffer Object (VBO) area, a Verter processor, and a Shader. In some embodiments, the speed of inputting vertex coordinates (rendering speed) is used to control the alignment of audio and video. The generated vertex coordinate sequence has a frame rate of 80 FPS (frames per second), so the rendering speed based on the Open Graphics Library (OpenGL) is 12.5 ms / frame. Generally, the vertex coordinate sequence can be selected every other frame, for example, one frame is selected every four frames, which becomes 20 FPS and the rendering speed is 50 ms / frame.
[0258] The driving module 1303 is used to obtain driving audio and control the superimposed key point module 1301 to generate a vertex coordinate sequence in real time.
[0259] The playback speed control module 1304 is used to control the playback speed of the animation.
[0260] The audio and video synchronous playback module 1305 is used to synchronously play audio and video.
[0261] The audio track module 1306 is used to obtain the audio and video of the animation to be played.
[0262] In some embodiments, an embodiment of the present application provides a computer non-volatile readable storage medium, on which a computer program is stored. When the computer program is executed by a computing device, the computing device implements the animation generation method described in any of the above embodiments.
[0263] In some embodiments, the embodiments of the present application provide a computer program product, which, when running on a computer, enables the computer to implement the animation generation method described in the second aspect or any embodiment of the second aspect.
[0264] The foregoing description is intended only to provide specific embodiments of the present application, which will enable those skilled in the art to understand and implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments described herein, but is intended to be construed in the broadest manner consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating a virtual digital human, comprising: Acquire a first frame of image captured by an image acquisition device when playing a target video; wherein the target video includes at least one fitness action; Performing human body key recognition on the first frame image to determine position information between human body key points, a first actual length of a target body part, and a second actual length of other body parts except the target body part; Determining predicted lengths of other body parts except the target body part according to the target proportional relationship and the first actual length; wherein the target proportional relationship includes a corresponding ratio of the first actual length to the predicted lengths of other body parts except the target body part; Determining a drawing height of the other body parts based on the second actual length and the predicted length; Drawing is performed based on the first actual length, the drawing height, and the positional relationship to generate a virtual digital human.
2. According to the method for generating a virtual digital human according to claim 1, before acquiring the frame image captured by the image acquisition device when playing the target video, the method further comprises: Acquire a second frame of image captured by the image acquisition device when the target video is started; wherein the second frame of image includes a human body facing the image acquisition device and performing a target action; Performing human key recognition on the second frame image to determine at least one human key point and configuration information of each human key point; wherein the configuration information includes position information and confidence level; When both the position information and the confidence level satisfy the standing condition, obtaining a control height of a preview control; wherein the preview control is used to display the virtual digital human; Determine the height of the human body according to the first information and the second information; wherein the first information includes the position information of the key point of the human body for characterizing the nose as the skeletal joint, and the second information includes the position information of the key point of the human body for characterizing the ankle as the skeletal joint; The target proportional relationship is determined according to the height of the human body and the height of the control.
3. The method for generating a virtual digital human according to claim 2, wherein the step of performing human key recognition on the second frame image to determine at least one human key point and configuration information of each human key point comprises: A human key point detection algorithm is used to perform human key recognition on the second frame image to determine at least one human key point and configuration information of each of the human key points.
4. The method for generating a virtual digital human according to claim 2, wherein when both the position information and the confidence level satisfy the standing condition, obtaining the height of the preview control comprises: When the confidences are all greater than or equal to the confidence threshold, the position information satisfies the first condition, and the angle formed by the three target key points is greater than or equal to the angle threshold, the control height of the preview control is obtained; wherein the target key point is any one of the human body key points.
5. The method for generating a virtual digital human according to claim 4, wherein the position information at least includes a vertical coordinate, and the target body part includes a torso; The first condition includes: The sum of the ordinate of the key point of the human body for representing the nose as a skeletal joint and the obtained value is less than the ordinate of the key point of the human body for representing the left hip as a skeletal joint, and the ordinate of the key point of the human body for representing the left knee as a skeletal joint is greater than or equal to the ordinate of the key point of the human body for representing the left hip as a skeletal joint, and the ordinate of the key point of the human body for representing the right knee as a skeletal joint is greater than or equal to the ordinate of the key point of the human body for representing the right hip as a skeletal joint; or, The sum of the ordinate of the key point of the human body characterizing the nose as a skeletal joint and the acquired value is smaller than the ordinate of the key point of the human body characterizing the right hip as a skeletal joint, and the ordinate of the key point of the human body characterizing the left knee as a skeletal joint is greater than or equal to the ordinate of the key point of the human body characterizing the left hip as a skeletal joint, and the ordinate of the key point of the human body characterizing the right knee as a skeletal joint is greater than or equal to the ordinate of the key point of the human body characterizing the right hip as a skeletal joint; wherein the acquired value is determined according to the torso length.
6. The method for generating a virtual digital human according to claim 2, wherein the position information at least includes a vertical coordinate, and the step of determining the height of the human body according to the first information and the second information comprises: The height of the human body is determined based on the absolute value of the difference between the longitudinal coordinate of the key point of the human body that is used to characterize the skeletal joint of the nose and the longitudinal coordinate of the key point of the human body that is used to characterize the skeletal joint of the ankle.
7. The method for generating a virtual digital human according to claim 2, wherein the step of determining the target proportional relationship according to the human body height and the control height comprises: When the ratio of the height of the control to the height of the human body is greater than a preset threshold, determining the target proportional relationship as a first template; When the ratio of the control height to the human body height is less than or equal to the preset threshold, the target proportional relationship is determined to be a second template; wherein both the first template and the second template include a corresponding ratio of the first actual length to the actual length of other body parts except the target body part, and the corresponding ratio in the first template is different from the corresponding ratio in the second template.
8. A device for generating a virtual digital human, comprising: An acquisition unit, used to acquire a first frame of image acquired by an image acquisition device when playing a target video; wherein the target video includes at least one fitness action; a processing unit, configured to perform human key recognition on the first frame of image acquired by the acquisition unit, and determine position information between human key points, a first actual length of a target body part, and a second actual length of other body parts except the target body part; The processing unit is further configured to determine predicted lengths of other body parts except the target body part according to the target proportional relationship and the first actual length; wherein the target proportional relationship includes a corresponding ratio of the first actual length to the predicted lengths of other body parts except the target body part; The processing unit is further used to determine the drawing height of the other body parts based on the second actual length and the predicted length; The processing unit is further used to generate a virtual digital human by drawing based on the first actual length, the drawing height and the positional relationship.
9. An electronic device, comprising: A memory and a processor, wherein the memory is used to store a computer program; The processor is used to enable the electronic device to implement the method for generating a virtual digital human as described in any one of claims 1 to 7 when executing a computer program.
10. A computer non-volatile readable storage medium, comprising: The computer non-volatile readable storage medium stores a computer program, and when the computer program is executed by a computing device, the computing device implements the method for generating a virtual digital human as described in any one of claims 1 to 7.
