Human body posture recognition method, device, computer equipment and readable storage medium
By obtaining specific image frames of the video frame sequence in dynamic videos, using the fusion correction technology of the initial pose prediction module and the pose fusion residual module, combined with the complementary information of the differential fusion residual module, the accuracy of human pose recognition in dynamic videos is solved. and stability issues, achieving a more efficient recognition effect.
Patent Information
- Application Number
- CN202411155779.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-08-22
AI Technical Summary
The existing technology has low accuracy and stability in human posture recognition in dynamic videos. Especially when the human body is blocked or moves quickly, the corresponding relationship between joint points is easily established or interrupted incorrectly, resulting in a decrease in recognition accuracy.
By obtaining specific image frames in the video frame sequence, the initial pose prediction module and the pose fusion residual module are used to determine the fusion weight based on the frame distance, fuse the corrected heat map to generate the human pose recognition result, and complement the information through the differential fusion residual module , improve recognition accuracy.
It improves the accuracy and stability of human posture recognition in dynamic scenes, reduces the interference of redundant image frames, and enhances the recognition ability under blur and occlusion conditions.
Smart Images

Figure CN118692153B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, and in particular to a method, device, computer equipment and readable storage medium for human posture recognition. Background Art
[0002] Human pose estimation can estimate the position and pose of various parts of the human body through image or video data, identify the posture and movement of the human body in the image or video, and estimate and locate the coordinates of various parts and joints of the human body, so as to understand human behavior intentions. Human pose estimation has not only attracted much attention in academic research, but also has a wide range of applications in industry, such as human-computer interaction, augmented reality, motion analysis, etc. Through human pose estimation, machines can better understand and respond to human behavior.
[0003] In the related art, a human posture recognition model is used to identify multiple key points of the human body in the corresponding picture, and a greedy algorithm is used to quickly correspond the joint points to different individuals through the detected joint points and joint connection areas. However, this method is only applicable to static images. In dynamic videos, the human body may be blocked by other objects, or the human body may move too fast, resulting in blurred human body information. At this time, the correspondence between the joint points may be incorrectly established or interrupted. If the human posture recognition model in the related art is used to recognize the human posture, the accuracy and stability of recognition may be reduced. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a human body posture recognition method, device, computer equipment and readable storage medium, which can improve the accuracy and stability of human body posture recognition.
[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a human body posture recognition method, the method comprising:
[0006] Acquire an image frame sequence corresponding to a target video, and acquire a first image frame of a current time sequence, a second image frame preceding the first image frame, and a third image frame following the first image frame from the image frame sequence; the second image frame and the third image frame are determined based on a mean square error between the first image frame and each image frame in the image frame sequence;
[0007] Inputting the first image frame, the second image frame, and the third image frame into an initial posture prediction module in a target model for key point recognition, to obtain a first heat map corresponding to the first image frame, a second heat map corresponding to the second image frame, and a third heat map corresponding to the third image frame;
[0008] Determining a fusion weight ratio among the first heat map, the second heat map, and the third heat map according to a frame distance between the second image frame and the third image frame relative to the first image frame;
[0009] By using the posture fusion residual module of the target model, fusing and correcting the first heat map, the second heat map and the third heat map based on the fusion weight ratio, so as to obtain a first feature tensor;
[0010] Determine, by means of the differential fusion residual module of the target model, a first difference heat map of the second heat map relative to the first heat map and a second difference heat map of the third heat map relative to the first heat map, and fuse and correct the first heat map, the first difference heat map and the second difference heat map based on the fusion weight ratio to obtain a second feature tensor;
[0011] The first heat map is corrected according to the first feature tensor and the second feature tensor, and a human posture recognition result is generated based on the corrected first heat map.
[0012] Accordingly, a second aspect of an embodiment of the present application provides a human body posture recognition device, the device comprising:
[0013] an acquisition module, used to acquire an image frame sequence corresponding to a target video, and acquire a first image frame of a current time sequence, a second image frame located before the first image frame, and a third image frame located after the first image frame from the image frame sequence; the second image frame and the third image frame are determined based on a mean square error between the first image frame and each image frame in the image frame sequence;
[0014] a recognition module, configured to input the first image frame, the second image frame, and the third image frame into an initial posture prediction module in a target model for key point recognition, and obtain a first heat map corresponding to the first image frame, a second heat map corresponding to the second image frame, and a third heat map corresponding to the third image frame;
[0015] a determination module, configured to determine a fusion weight ratio among the first heat map, the second heat map, and the third heat map according to a frame distance between the second image frame and the third image frame relative to the first image frame;
[0016] A first correction module, configured to perform fusion correction on the first heat map, the second heat map and the third heat map based on the fusion weight ratio through the posture fusion residual module of the target model to obtain a first feature tensor;
[0017] A second correction module is used to determine a first difference heat map of the second heat map relative to the first heat map and a second difference heat map of the third heat map relative to the first heat map through the differential fusion residual module of the target model, and fuse and correct the first heat map, the first difference heat map and the second difference heat map based on the fusion weight ratio to obtain a second feature tensor;
[0018] The first generating module is used to correct the first heat map according to the first feature tensor and the second feature tensor, and generate a human posture recognition result based on the corrected first heat map.
[0019] In some implementations, the acquisition module is further used to:
[0020] Determine at least one target joint point from the target video;
[0021] For each of the target joint points, determining an inter-frame displacement between any two adjacent image frames in the target video;
[0022] Determining the inter-frame speed of the target joint point according to the inter-frame displacement;
[0023] Based on the inter-frame rate, an image frame sequence corresponding to the target video is determined.
[0024] In some implementations, the acquisition module is further used to:
[0025] Acquire a first image frame of a current time sequence from an image frame sequence, and calculate a mean square error between each image frame in the image frame sequence and the first image frame;
[0026] Determine, from the image frame sequence, a preamble sequence located at the preamble of the first image frame and a postamble sequence located at the postamble of the first image frame;
[0027] Based on a mean square error between each image frame and the first image frame, a second image frame is determined from the preceding sequence, and a third image frame is determined from the succeeding sequence.
[0028] In some implementations, the acquisition module is further used to:
[0029] Arrange the mean square error corresponding to each image frame in the preceding sequence according to the time sequence of each image frame in the preceding sequence to obtain a first mean square error sequence;
[0030] Arrange the mean square errors corresponding to each image frame in the preceding sequence in ascending order to obtain a second mean square error sequence;
[0031] For the second mean square error sequence, determine a first target mean square error located at the median, and determine a position of the first target mean square error in the first mean square error sequence, so as to determine an image frame corresponding to the first target mean square error according to the position of the first target mean square error in the first mean square error sequence, and use the image frame as the second image frame;
[0032] Arranging the mean square error corresponding to each image frame in the subsequent sequence according to the time sequence of each image frame in the subsequent sequence to obtain a third mean square error sequence;
[0033] Arrange the mean square errors corresponding to each image frame in the post-sequence in ascending order to obtain a fourth mean square error sequence;
[0034] For the fourth mean square error sequence, determine a second target mean square error located at the median, and determine the position of the second target mean square error in the third mean square error sequence, so as to determine an image frame corresponding to the second target mean square error according to the position of the second target mean square error in the third mean square error sequence, and use the image frame as the third image frame.
[0035] In some embodiments, the first correction module is further configured to:
[0036] Based on the fusion weight ratio, determining a first adjustment weight corresponding to the first heat map, a second adjustment weight corresponding to the second heat map, and a third adjustment weight corresponding to the third heat map;
[0037] By means of the pose fusion residual module of the target model, the second heat map is adjusted based on the second adjustment weight to obtain an adjusted second heat map, and the third heat map is adjusted based on the third adjustment weight to obtain an adjusted third heat map;
[0038] The first heat map, the second heat map and the third heat map are stacked and corrected to obtain a first initial feature tensor;
[0039] The first initial feature tensor is input into the grouped convolution layer of the target model for grouped convolution, and then input into the residual block for feature fusion to obtain a first feature tensor.
[0040] In some embodiments, the second correction module is further used to:
[0041] Determine a second difference heat map corresponding to the second heat map, and a third difference heat map corresponding to the third heat map according to difference values between the second heat map and the third heat map and the first heat map respectively;
[0042] By means of the differential fusion residual module of the target model, the second difference heat map is adjusted based on the second adjustment weight to obtain an adjusted second difference heat map, and the third difference heat map is adjusted based on the third adjustment weight to obtain an adjusted third difference heat map;
[0043] The first heat map, the second difference heat map and the third difference heat map are stacked and corrected to obtain a second initial feature tensor;
[0044] The second initial feature tensor is input into the grouped convolution layer of the target model for grouped convolution, and then input into the residual block for feature fusion to obtain a second feature tensor.
[0045] In some implementations, the first generating module is further configured to:
[0046] Concatenate the first feature tensor and the second feature tensor according to the channel dimension to obtain a modified feature tensor;
[0047] The corrected feature tensor is input into the posture correction module of the target model to correct each key point in the first heat map.
[0048] In some embodiments, the initial posture prediction module includes a first posture prediction submodule and a second posture prediction submodule; the recognition module is further used to:
[0049] Inputting the first image frame, the second image frame, and the third image frame into the first posture prediction submodule for equal weight distribution, and performing position prediction of key points and probability mapping of each position according to the first image frame to which the equal weight distribution has been performed, to obtain a first heat map corresponding to the first image frame;
[0050] The second image frame and the third image frame are sequentially input into the second posture prediction submodule to locate and identify key points, and a second heat map corresponding to the second image frame and a third heat map corresponding to the third image frame are sequentially obtained.
[0051] In some embodiments, the identification module is further used to:
[0052] Inputting the second image frame and the third image frame into the first posture prediction submodule for feature fusion to obtain an intermediate image frame between the second image frame and the third image frame;
[0053] In the first posture prediction submodule, equal weights are assigned to the intermediate image frame and the first image frame, and weights of the intermediate image frame and the first image frame are adjusted according to the equally assigned weights to obtain new intermediate image frames and first image frames;
[0054] The intermediate image frame and the first image frame are fused to obtain a new first image frame, and the positions of key points and probability mapping of each position are performed on the first image frame to generate a first heat map corresponding to the first image frame.
[0055] In some implementations, the human body posture recognition device further includes a second generation module, which is used to:
[0056] Generate a first target image frame, a second target image frame, and a third target image frame according to content information corresponding to the target human body region in the first image frame, the second image frame, and the third image frame, respectively;
[0057] Then the step of inputting the first image frame, the second image frame and the third image frame into an initial posture prediction module in a target model for key point recognition to obtain a first heat map corresponding to the first image frame, a second heat map corresponding to the second image frame and a third heat map corresponding to the third image frame includes:
[0058] The first target image frame, the second target image frame and the third target image frame are input into the initial posture prediction module in the target model for key point recognition to obtain a first heat map corresponding to the first target image frame, a second heat map corresponding to the second target image frame and a third heat map corresponding to the third target image frame.
[0059] Correspondingly, the third aspect of the embodiments of the present application proposes a computer device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the human body posture recognition method described in any one of the embodiments of the first aspect of the present application when executing the computer program.
[0060] Correspondingly, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the human body posture recognition method described in any one of the embodiments of the first aspect of the present application.
[0061] The embodiment of the present application obtains an image frame sequence corresponding to a target video, and obtains a first image frame of the current time sequence, a second image frame located in front of the first image frame, and a third image frame located in the back sequence from the image frame sequence; the second image frame and the third image frame are determined based on the mean square error between the first image frame and each image frame in the image frame sequence; the first image frame, the second image frame, and the third image frame are input into an initial posture prediction module in a target model for key point recognition, to obtain a first heat map corresponding to the first image frame, a second heat map corresponding to the second image frame, and a third heat map corresponding to the third image frame; according to the frame distances of the second image frame and the third image frame relative to the first image frame, the first heat map corresponding to the first image frame, the second heat map corresponding to the second image frame, and the third heat map corresponding to the third image frame are determined; The fusion weight ratio between the heat map, the second heat map and the third heat map; through the posture fusion residual module of the target model, the first heat map, the second heat map and the third heat map are fused and corrected based on the fusion weight ratio to obtain the first feature tensor; through the differential fusion residual module of the target model, the first difference heat map of the second heat map relative to the first heat map and the second difference heat map of the third heat map relative to the first heat map are determined, and the first heat map, the first difference heat map and the second difference heat map are fused and corrected based on the fusion weight ratio to obtain the second feature tensor; the first heat map is corrected according to the first feature tensor and the second feature tensor, and the human posture recognition result is generated based on the corrected first heat map. In this way, in a dynamic scene, the time sequence information of the target video can be used to select the second image frame and the third image frame with representative and high quality through the mean square error between each image frame and the first image frame, thereby greatly reducing the number of image frames input to the target model, avoiding the interference of repeated and redundant image frames, and thus improving the efficiency and accuracy of human posture recognition. Moreover, the present application can determine the fusion weight ratio between the heat maps according to the frame distance of the second image frame and the third image frame relative to the first image frame, so as to integrate the information in the first heat map, the second heat map and the third heat map, and correct the key points that are incorrectly identified; at the same time, it can realize the fusion of complementary information according to the differential fusion residual module. Finally, the first feature tensor obtained by the posture fusion residual module and the second feature tensor obtained by the differential fusion residual module are used to correct the first heat map, and the first heat map can be corrected by integrating various information, which can further solve the problems of posture ambiguity and posture occlusion, and ensure the accuracy and stability of the human posture recognition results outputted in the end. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 is a schematic diagram of the architecture of a human posture recognition system provided in an embodiment of the present application;
[0063] Figure 2 It is an architecture diagram of the target model provided in the embodiment of the present application;
[0064] Figure 3 is a flow chart of a human body posture recognition method provided by an embodiment of the present application;
[0065] Figure 4 is a schematic diagram of the functional modules of the human body posture recognition device provided in an embodiment of the present application;
[0066] Figure 5 It is a schematic diagram of the hardware structure of the computer device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0068] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0069] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0070] Human pose estimation can estimate the position and pose of various parts of the human body through image or video data, identify the posture and movement of the human body in the image or video, and estimate and locate the coordinates of various parts and joints of the human body, so as to understand human behavior intentions. Human pose estimation has not only attracted much attention in academic research, but also has a wide range of applications in industry, such as human-computer interaction, augmented reality, motion analysis, etc. Through human pose estimation, machines can better understand and respond to human behavior.
[0071] In the related art, a human posture recognition model is used to identify multiple key points of the human body in the corresponding picture, and a greedy algorithm is used to quickly correspond the joint points to different individuals through the detected joint points and joint connection areas. However, this method is only applicable to static images. In dynamic videos, the human body may be blocked by other objects, or the human body may move too fast, resulting in blurred human body information. At this time, the correspondence between the joint points may be incorrectly established or interrupted. If the human posture recognition model in the related art is used to recognize the human posture, the accuracy and stability of recognition may be reduced.
[0072] In another related technology, a recursive neural network is used to estimate human posture. However, when estimating human posture, especially when estimating human posture in a dynamic environment, since the change of posture involves a long time span, in the process of recognizing a sequence with a long time span, the recursive neural network is very likely to have the problem of gradient vanishing or gradient exploding, which reduces the accuracy and stability of human posture recognition.
[0073] Based on this, the embodiments of the present application provide a human body posture recognition method, apparatus, computer equipment and readable storage medium, which can improve the accuracy and stability of human body posture recognition.
[0074] First, in order to make the following description clearer, the present application embodiment introduces the main application network:
[0075] IFRNet (Instance-Free Representation Learning for Semantic Segmentation): IFRNet is a neural network architecture for semantic segmentation that can improve the performance of semantic segmentation by learning instance-free representations. IFRNet does not rely on individual instance information to extract features, but instead generates high-quality segmentation masks through global context information and pixel-level features, which can be used to process and block complex backgrounds.
[0076] HRNet-W48 (High-Resolution Network with 48 layers): HRNet-W48 is a high-resolution network with 48 layers that can improve the performance of segmentation and detection tasks by maintaining the high resolution of image features. HRNet-W48 can maintain the original resolution of the input image throughout the network, allowing the network to capture fine detail information. HRNet-W48 can be used in tasks such as image segmentation, object detection, and pose estimation.
[0077] HRNet-W64 (High-Resolution Network with 64 layers): HRNet-W64 is similar to HRNet-W48, except that it has 64 layers and can learn more complex feature representations, and can maintain high resolution of image features, giving it better performance when processing images with rich details.
[0078] The human body posture recognition method, apparatus, computer device and readable storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the human body posture recognition system in the embodiments of the present application is described.
[0079] This application embodiment provides a human posture recognition system. Figure 1 In some implementations, the human body posture recognition system includes a server 11 and a terminal 12 .
[0080] Specifically, the server side 11 can be a high-performance computing device such as a server or a cloud computing platform. The server side can be configured with high-performance hardware including a central processing unit (CPU), a graphics processing unit (GPU), memory and storage to support the training and reasoning of the target model.
[0081] Please refer to Figure 2 In some embodiments, the target model may be located at the server end 11, and the server end 11 trains the target model, and after the target model training is completed, runs the target model to detect human posture. Specifically, the target model may include a sequence selection module, an initial posture recognition module, a posture fusion residual module, a differential fusion residual module, and a posture correction module. The sequence selection module is used to determine the first image frame, the second image frame, and the third image frame from the image sequence corresponding to the video image, and input the first image frame to the human body detector of the initial posture prediction module, so that the human body detector can extract the key area of human posture recognition, thereby improving the efficiency and accuracy of posture recognition.
[0082] Exemplarily, the initial posture recognition module may include a first posture prediction submodule and a second posture prediction submodule, and the first posture prediction submodule and the second posture prediction submodule may run in parallel. Specifically, the first posture prediction submodule may be obtained by connecting IFRNet and HRNet-W48 in series, and after the second image frame and the third image frame are input into IFRNet, an intermediate image frame of the second image frame and the third image frame may be obtained, and then, the intermediate image frame and the first image frame are fused with equal weights to obtain a first heat map corresponding to the first image; the second posture prediction submodule may include HRNet-W64, and by inputting the second image frame and the third image frame into HRNet-W64, a second heat map corresponding to the second image frame and a third heat map corresponding to the third image frame may be obtained.
[0083] Furthermore, the first heat map, the second heat map and the third heat map can be fused and corrected according to the fusion weight ratio through the posture fusion residual module in the target model, and the fused tensors are grouped and convolved and then input into the residual block to obtain the first feature tensor.
[0084] Furthermore, the difference fusion residual module and the posture fusion residual module run in parallel. The second difference heat map corresponding to the second heat map and the third difference heat map corresponding to the third heat map can be obtained through the difference fusion residual module in the target model. After that, the first heat map, the second difference heat map and the third difference heat map are fused and corrected according to the fusion weight ratio, and the fused tensors are grouped and convolved, and then input into the residual block to obtain the second feature tensor.
[0085] Furthermore, the posture correction module may include HRNet-W48. After the first feature tensor and the second feature tensor are spliced according to the channel dimension, they can be input into HRNet-W48 to correct the first heat map, thereby achieving accurate and stable recognition of human posture.
[0086] In some embodiments, the terminal 12 may be a device with limited computing power, such as a smart camera, a smart phone, a tablet computer, or a lightweight edge computing device. The terminal 12 may be responsible for capturing video data and sending it to the server 11. The terminal 12 device may perform basic video processing tasks, such as the terminal 12 may capture an image frame sequence as input, and receive the final key point heat map processed by the server 11 as output.
[0087] The human body posture recognition method in the embodiment of the present application can be illustrated by the following embodiment.
[0088] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first. Moreover, the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or separate consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or separate consent, the necessary user-related data for enabling the normal operation of the embodiment of the present application will be obtained.
[0089] In the embodiments of the present application, the human body posture recognition device will be described from the perspective of the human body posture recognition device, which can be specifically integrated into a computer device. Figure 3 , Figure 3 This is a flowchart of the steps of the human posture recognition method provided in the embodiment of the present application. In the embodiment of the present application, the human posture recognition device is specifically integrated in a terminal or a server as an example. When the processor on the terminal or the server executes the program instructions corresponding to the human posture recognition method, the specific process is as follows:
[0090] Step 101, obtain an image frame sequence corresponding to the target video, and obtain the first image frame of the current time sequence and the second image frame located before the first image frame and the third image frame located after the first image frame from the image frame sequence; the second image frame and the third image frame are determined based on the mean square error between the first image frame and each image frame in the image frame sequence.
[0091] In some embodiments, in order to improve the accuracy of human posture recognition, especially the accuracy of dynamic human posture recognition, several representative frames of images can be selected from the image frame sequence through the mean square error of each image frame and the image frame of the current time sequence, so that there is no need to analyze the entire image frame sequence. This can avoid the problems of gradient vanishing and gradient exploding to a certain extent, and can greatly save computing resources while ensuring the accuracy of human posture recognition.
[0092] The target video is an input video data, including continuous image frames. The target video may be composed of a series of continuous image frames, which are arranged in time order and can capture the changes of scenes over time. For example, the changes of human posture over time can be captured by analyzing a series of image frames of the target video. Furthermore, the target video may be video data generated in real time or video data acquired in advance.
[0093] The image frame sequence may be a sequence of continuous image frames extracted from the target video, and each image frame is a two-dimensional image that can capture a moment in the target video.
[0094] The first image frame may be an image frame containing a target area when recognizing a human posture. For example, the target area may be an area in each image frame used to recognize a human posture, or may be a posture area to be recognized. For example, if it is necessary to recognize a hand movement, the first image frame may include an area where the hand is located. In other words, if it is necessary to recognize a human posture, the first image frame contains the human posture.
[0095] Exemplarily, when it is necessary to identify the target video generated in real time, the first image frame may be the image frame corresponding to the current time sequence, and then the first image frame is marked, and the image frame sequence before and after the first image frame is obtained according to the preset interception ratio. Further, the first image frame can also be manually selected in the target video generated in real time or the pre-set target video. Alternatively, the image frame sequence can be identified by a pre-trained convolutional neural network, the target area in each image frame in the image frame sequence is framed, and the area of the framed area of each image frame is determined, and the image frame with a large framed area is used as the first image frame, so as to increase the probability of the target model recognizing human posture. Furthermore, each image frame can also be input into the convolutional neural network through a pre-trained convolutional neural network to obtain the clarity score of each output image frame, and the graphic frame with the highest clarity score is used as the first image frame, so that the target model can recognize human posture more quickly and accurately.
[0096] The second image frame may be at least one image frame located before the first image frame, that is, an image frame located in the front sequence of the first image frame, and the second image frame may assist the first image frame in recognizing the human body posture. The second image frame may be selected based on the median of the mean square error between the first image frame and the front sequence image frame, or may be selected based on the average of the mean square error, and the embodiment of the present application does not impose any specific limitation on this.
[0097] The third image frame may be at least one image frame after the first image frame, that is, an image frame subsequent to the first image frame, and the third image frame may assist the first image frame in recognizing a human body posture. The third image frame may be selected based on the median of the mean square error between the first image frame and the subsequent image frame, or may be selected based on the average of the mean square error, and the embodiment of the present application does not impose any specific limitation on this.
[0098] Through the above method, the first image frame of the current time sequence and the second image frame located in front of the first image frame and the third image frame located in the back sequence can be obtained from the image frame sequence, so as to obtain representative image frames, so as to assist in key point recognition of the first image frame through the second image frame and the third image frame, and to perform a more accurate analysis of human body posture.
[0099] In some implementations, in order to prevent the human body from moving too much and affecting the accuracy of gesture recognition, the video frame rate can be adjusted. When the human body moves faster, the video frame rate is adjusted to a high frame rate to avoid missing key actions and affecting the accuracy of human gesture recognition; when the human body moves slower, the video frame rate is adjusted to a low frame rate to avoid obtaining many identical or highly similar image frames, which affects the efficiency of human gesture recognition. The "obtaining an image frame sequence corresponding to the target video" in step 101 may include:
[0100] (101.a1) determining at least one target joint point from the target video;
[0101] (101.a2) for each target joint point, determine the inter-frame displacement between any two adjacent image frames in the target video;
[0102] (101.a3) Determine the inter-frame velocity of the target joint point based on the inter-frame displacement;
[0103] (101.a4) Determine an image frame sequence corresponding to the target video based on the inter-frame rate.
[0104] The target joints may be key parts of the human body that need to be tracked and detected during the human body posture recognition process. The target joints may include the head, neck, shoulders, wrists, hips, knees, and ankles. After detecting the target joints, the posture of the human body can be determined.
[0105] Among them, the inter-frame displacement can be the displacement of the position of each target joint point between two consecutive frames. By calculating the inter-frame displacement of the target joint point, the moving distance and direction of the target joint point in space can be obtained. Image frames with large inter-frame displacement indicate that the inter-frame speed is fast and the video frame rate needs to be appropriately increased; image frames with constant inter-frame displacement indicate that the inter-frame speed is slow and the video frame rate needs to be appropriately increased; image frames with moderate inter-frame displacement changes indicate that the inter-frame speed is moderate and there is no need to adjust the video frame rate.
[0106] The inter-frame speed may be the speed at which the position of each target joint point changes between two consecutive image frames, and the inter-frame speed may be calculated by dividing the inter-frame displacement by the time interval between the image frames.
[0107] Specifically, a speed threshold can be set. When the inter-frame speed is greater than the speed threshold, the video frame rate is adjusted to a low frame rate, for example, it can be adjusted to 30 frames per second, and then the image frame sequence of the target video is obtained; when the inter-frame speed is less than the speed threshold, the video frame rate is adjusted to a high frame rate, for example, it can be adjusted to 60 frames per second, and then the image frame sequence of the target video is obtained; when the inter-frame speed is equal to the speed threshold, or is within the fluctuation range relative to the speed threshold, there is no need to adjust the video frame rate, and the image frame sequence corresponding to the target video is directly determined. It can be understood that the specific video frame rate can be determined according to the inter-frame speed, or it can be determined manually, and the embodiments of the present application do not impose specific restrictions on this.
[0108] Through the above method, the video frame rate of the target video can be dynamically adjusted, which can optimize resource utilization and processing efficiency while ensuring the accuracy of video analysis.
[0109] In some embodiments, in order to select a representative key frame in the image frame sequence for subsequent gesture recognition, the mean square error between each image frame and the first image frame can be calculated, and a moderate image frame can be selected from the mean square error as the second image frame and the third image frame. It can be understood that the second image frame and the third image frame can refer to one image frame or multiple image frames respectively. For example, in step 101, "obtaining the first image frame of the current time sequence and the second image frame located before the first image frame and the third image frame located after the first image frame" can include:
[0110] (101.b1) Obtaining the first image frame of the current time sequence from the image frame sequence, and calculating the mean square error between each image frame in the image frame sequence and the first image frame;
[0111] (101.b2) determining, from the image frame sequence, a pre-sequence located before the first image frame and a post-sequence located after the first image frame;
[0112] (101.b3) Determine a second image frame from the preceding sequence and a third image frame from the succeeding sequence based on a mean square error between each image frame and the first image frame.
[0113] Exemplarily, the pixel value of the first image frame may be first obtained, and for each image frame in the preceding sequence, the pixel value of the image frame may be subtracted from the pixel value of the first image frame, and the resultant value is divided by the total number of image frames in the preceding sequence, thereby obtaining the mean square error of the corresponding image frame. Furthermore, for the subsequent sequence of the first image frame, the pixel value of the image frame may be subtracted from the pixel value of the first image frame, and the resultant value is divided by the total number of image frames in the subsequent sequence, thereby obtaining the mean square error of the corresponding image frame.
[0114] For example, there is a post-sequence containing 5 image frames , the pixel value matrix of the first image frame is , then we can calculate The mean square error between each image frame in and the first image frame, such as, for , mean square error The calculation is as follows:
[0115] (1)
[0116] Similarly, the mean square errors between the other image frames in the subsequent sequence and the previous sequence and the first image frame can also be calculated using the mean square error formula. The specific calculation method can be referred to formula (1), which will not be described in detail here.
[0117] Furthermore, the second image frame can be determined from the preceding sequence and the third image frame can be determined from the following sequence according to the mean square error between each image frame in the preceding sequence and the following sequence and the first image frame. Specifically, the preceding sequence can be sorted in order or in reverse order according to the mean square error, and the image frame corresponding to the mean square error at the median is selected as the second image frame; similarly, the third image frame can be selected from the following sequence in the same way.
[0118] In some implementations, the preamble sequence and the postamble sequence may be further divided into a plurality of sub-image sequences, and for each sub-image sequence, a corresponding mean square error sequence is determined, and corresponding plurality of second image frames or plurality of third image frames are selected according to the mean square error sequence. For example, the pixel value matrix of the first image frame is , for the post-sequence , which can be divided into multiple sub-image sequences , and , the mean square error of each sub-image sequence relative to the first image frame can be calculated, and each sub-image sequence can be sorted according to the mean square error, and the median is selected from the sorting results as the key frame of the corresponding sub-image sequence. Multiple key frames of the subsequent sequence are accumulated to obtain multiple third image frames.
[0119] Similarly, by referring to the above method, multiple second image frames can be obtained.
[0120] It can be understood that when the number of image frames in the image frame sequence does not exceed the frame threshold, for example, when the frame threshold is set to 30, only one second image frame and a third image frame can be selected, but when the number of image frames exceeds the frame threshold, multiple second image frames and multiple third image frames can be determined to ensure that the selected multiple key image frames can accurately recognize human body posture while ensuring recognition efficiency.
[0121] In the above manner, representative second and third image frames can be selected from the image frame sequence, and the similarity between the selected second and third image frames and the first image frame can be ensured to be in a moderate state, so as to facilitate more accurate recognition of human body posture.
[0122] In some embodiments, in order to select a representative second image frame and a third image frame, the mean square error between each image frame in the preceding sequence and the succeeding sequence and the first image frame may be calculated, and at least one second image frame may be determined from the preceding sequence based on the mean square error, and at least one third image frame may be determined from the succeeding sequence, and the position of the first target mean square error in the first mean square error sequence and the position of the second target mean square error in the third mean square error sequence may be determined, so as to facilitate the subsequent calculation of the fusion weight ratio of the second image frame and the third image frame. For example, (101.b3) may include:
[0123] (101.b3.1) Arrange the mean square error corresponding to each image frame in the preceding sequence according to the time sequence of each image frame in the preceding sequence to obtain a first mean square error sequence;
[0124] (101.b3.2) Arrange the mean square errors corresponding to each image frame in the previous sequence in ascending order to obtain a second mean square error sequence;
[0125] (101.b3.3) For the second mean square error sequence, determine a first target mean square error located at the median, and determine a position of the first target mean square error in the first mean square error sequence, determine an image frame corresponding to the first target mean square error according to the position of the first target mean square error in the first mean square error sequence, and use the image frame as the second image frame;
[0126] (101.b3.4) Arrange the mean square error corresponding to each image frame in the subsequent sequence according to the time sequence of each image frame in the subsequent sequence to obtain a third mean square error sequence;
[0127] (101.b3.5) Arrange the mean square error corresponding to each image frame in the subsequent sequence in ascending order to obtain a fourth mean square error sequence;
[0128] (101.b3.6) For the fourth mean square error sequence, determine the second target mean square error located at the median, and determine the position of the second target mean square error in the third mean square error sequence, so as to determine the image frame corresponding to the second target mean square error according to the position of the second target mean square error in the third mean square error sequence, and use the image frame as the third image frame.
[0129] The first mean square error sequence is a sequence obtained by arranging the image frames in the preceding sequence in the time order after calculating the mean square error of each image frame in the preceding sequence relative to the first image frame. For example, the preceding sequence includes image frames 1, 2, 3, 4, and 5 arranged in time order, then the mean square error corresponding to image frame 1 is , the mean square error corresponding to image frame 2 is , the mean square error corresponding to image frame 3 is , the mean square error corresponding to image frame 4 is , the mean square error corresponding to image frame 5 is , then the first mean square error sequence is , , , , .
[0130] The second mean square error sequence is a sequence obtained by arranging the mean square error values of each image frame in the preceding sequence in ascending or descending order relative to the first image frame. The mean square error is 3. The mean square error is 7. The mean square error is 4. The mean square error is 8. The mean square error is 2, then the second mean square error sequence is 2, 3, 4, 7, 8.
[0131] The first target mean square error may be the median of the second mean square error sequence. For example, if the second mean square error sequence is 2, 3, 4, 7, 8, then the first target mean square error is 4.
[0132] The third mean square error sequence is a sequence obtained by arranging the image frames in the subsequent sequence in the time order after calculating the mean square error of each image frame in the subsequent sequence relative to the first image frame. For example, in the subsequent sequence, there are image frames 1, image frame 2, image frame 3, image frame 4, and image frame 5 arranged in time order, then the mean square error corresponding to image frame 1 is , the mean square error corresponding to image frame 2 is , the mean square error corresponding to image frame 3 is , the mean square error corresponding to image frame 4 is , the mean square error corresponding to image frame 5 is , then the first mean square error sequence is , , , , .
[0133] The fourth mean square error sequence is a sequence obtained by arranging the mean square error values of each image frame in the subsequent sequence in ascending or descending order relative to the first image frame. The mean square error is 6, The mean square error is 5. The mean square error is 1. The mean square error is 9. The mean square error of is 3, so the fourth mean square error sequence is 1, 3, 5, 6, 9.
[0134] The second target mean square error may be the median of the fourth mean square error sequence. For example, if the fourth mean square error sequence is 1, 3, 5, 6, 9, then the second target mean square error is 5.
[0135] Further, the position of the first target mean square error in the first mean square error sequence can be determined, and the image frame corresponding to the first target mean square error can be determined according to the position of the first target mean square error in the first mean square error sequence, and the image frame can be used as the second image frame. For example, if the first target mean square error is 4, the mean square error corresponding to 4 is , since the first mean square error sequence is arranged in time order, then The position of the first mean square error sequence is the position of the image frame 3 in the preceding sequence. Specifically, The position of the first mean square error sequence corresponds to the position of image frame 3, so it can be determined that image frame 3 is the second image frame. Specifically, to represent image frame 3, the frame distance of image frame 3 relative to the last image frame of the previous sequence can be determined first. In this example, image frame 5 is the last image frame in the previous sequence, and the frame distance of image frame 3 relative to the last image frame of the previous sequence is 2. Therefore, the second image frame can be represented by express.
[0136] Further, the position of the second target mean square error in the third mean square error sequence can be determined, so as to determine the image frame corresponding to the second target mean square error according to the position of the second target mean square error in the third mean square error sequence, and use the image frame as the third image frame. For example, if the second target mean square error is 5, the mean square error corresponding to 5 is , since the third mean square error sequence is arranged in chronological order, then The position of the third mean square error sequence is the position of image frame 2 in the subsequent sequence. Specifically, The position of the third mean square error sequence corresponds to the position of image frame 2, so image frame 2 can be determined to be the third image frame. Specifically, to represent image frame 2, the frame distance of image frame 2 relative to the first image frame of the subsequent sequence can be first determined. In this example, image frame 1 is the first image frame in the subsequent sequence, and the frame distance of image frame 2 relative to the last image frame of the subsequent sequence is 1. Therefore, the third image frame can be represented by express.
[0137] In some implementations, if the preceding sequence and the succeeding sequence are respectively divided into a plurality of sub-image sequences, then the second image frame and the third image frame are selected in the same manner as described above, and reference is made to the above, which will not be described in detail here.
[0138] It can be understood that, in order to facilitate determination of the medians of the second mean square error sequence and the fourth mean square error sequence, generally a leading sequence and a trailing sequence whose total number of image frames is an odd number can be selected.
[0139] By calculating and sorting the mean square errors between each image frame in the preceding sequence and the succeeding sequence and the first image frame, and selecting the first image frame and the second image frame, representative image frames with high quality can be selected. At the same time, by determining the position of the first target mean square error in the first mean square error sequence and the position of the second target mean square error in the third mean square error sequence, the frame distances of the second image frame and the third image frame relative to the first image frame can be accurately obtained, so as to facilitate the subsequent calculation of the fusion weight ratio of the second image frame and the third image frame, and further more accurately identify the human body posture.
[0140] Step 102: input the first image frame, the second image frame and the third image frame into the initial posture prediction module in the target model for key point recognition to obtain a first heat map corresponding to the first image frame, a second heat map corresponding to the second image frame and a third heat map corresponding to the third image frame.
[0141] It can be understood that in order to determine the spatial information of each key point used to identify human posture, the first image frame, the second image frame and the third image frame can be input into the initial posture prediction module in the target model, so as to represent the confidence information of each key joint point of the human body through the first heat map, the second heat map and the third heat map, thereby improving the accuracy of human posture recognition.
[0142] Among them, the initial posture prediction module can be used to predict the positions of key joints of the human body in the first image frame, the second image frame and the third image frame, and output the first heat map, the second heat map and the third heat map accordingly. In some embodiments, the initial posture prediction module may include a first posture prediction submodule and a second posture prediction submodule. Specifically, the first posture prediction submodule may include IFRNet and HRNet-W48, which can be used to generate an intermediate image frame according to the second image frame and the third image frame, and perform equal weight fusion distribution on the intermediate image frame and the first image frame, and generate a first heat map corresponding to the first image frame; the second posture prediction submodule may include HRNet-W64, which can be used to generate a second heat map and a third heat map according to the second image frame and the third image frame, respectively.
[0143] Among them, the first heat map is generated after the first image frame is input into the initial posture prediction module. The first heat map can give the intensity or probability of a specific feature corresponding to each pixel in the first image frame. For example, the first heat map can be used to represent the position probability distribution of each key joint point of the human body (such as head, shoulder, elbow, wrist, hip, knee, ankle, etc.) in the first image frame. Further, the first heat map can map the position information of the key point to each pixel of the first image frame. The pixel with the highest intensity (usually white or close to white) indicates that the corresponding position has the highest probability of being the position of the key point. Through the first heat map, the area corresponding to the key point, such as the joint position of the human body, can be directly determined.
[0144] Among them, the second heat map is generated after the second image frame is input into the initial posture prediction module. The second heat map can give the intensity or probability of a specific feature corresponding to each pixel in the second image frame. For example, the second heat map can be used to represent the position probability distribution of each key joint point of the human body in the second image frame. Alternatively, the second heat map can map the position information of the key point to each pixel of the second image frame, and the pixel with the highest intensity indicates that the corresponding position has the highest probability of being the position of the key point. Through the second heat map, the area corresponding to the key point, such as the joint position of the human body, can be directly determined.
[0145] Among them, the third heat map is generated after the third image frame is input into the initial posture prediction module. The third heat map can be given in the third image frame, the intensity or probability of a specific feature corresponding to each pixel point. For example, the third heat map can be used to represent the position probability distribution of each key joint point of the human body in the third image frame. Alternatively, the third heat map can map the position information of the key point to each pixel of the third image frame, and the pixel with the highest intensity indicates that the corresponding position has the highest probability of being the position of the key point. Through the third heat map, the area corresponding to the key point, such as the joint position of the human body, can be directly determined.
[0146] Through the above method, the first image frame, the second image frame and the third image frame can be converted into corresponding first heat maps, second heat maps and third heat maps, so as to more efficiently and accurately identify and predict key points in the human posture recognition task, and facilitate the subsequent weight fusion of each heat map according to the fusion weight ratio, so as to accurately identify the human posture.
[0147] In some embodiments, the initial posture prediction module includes a first posture prediction submodule and a second posture prediction submodule; in order to generate more accurate first heat maps, second heat maps, and third heat maps, so as to facilitate subsequent accurate detection of human body posture, the first heat map corresponding to the first image frame can be generated by the first posture prediction submodule, and the second heat map corresponding to the second image frame and the third heat map corresponding to the third image frame can be generated by the second posture prediction submodule. For example, step 102 may include:
[0148] (102.1) Inputting the first image frame, the second image frame, and the third image frame into the first posture prediction submodule for equal weight distribution, and performing position prediction of key points and probability mapping of each position based on the first image frame to which the equal weight distribution has been performed, to obtain a first heat map corresponding to the first image frame;
[0149] (102.2) The second image frame and the third image frame are sequentially input into the second posture prediction submodule to locate and identify key points, and a second heat map corresponding to the second image frame and a third heat map corresponding to the third image frame are sequentially obtained.
[0150] In some embodiments, the first posture prediction submodule and the second posture prediction submodule can run in parallel to improve the efficiency of heat map generation, thereby accelerating the efficiency of human posture recognition. Exemplarily, the second image and the third image can be first input into the IFRNet in the first posture prediction submodule to obtain the intermediate image frames of the second image and the third image. Then, the first image frame and the intermediate image frame are fused with equal weights, that is, the first image frame and the intermediate image frame are respectively given a weight of 50% and then fused and input into HRNet-W48 to obtain the first heat map.
[0151] It can be understood that since the second image frame is located in front of the first image frame and the third image frame is located after the first image frame, the intermediate image frame obtained by inputting the second image frame and the third image frame into IFRNet is a predicted image of the first image frame, representing the transition information between the second image frame and the third image frame. Therefore, the intermediate image frame and the first image frame have the same importance, so it is necessary to fuse the intermediate image frame and the first image with equal weights to improve the accuracy of human posture recognition. Furthermore, by inputting the second image frame and the third image frame into HRNet-W64 respectively to generate the second heat map and the third heat map, a more accurate second heat map and third heat map can be generated.
[0152] In the above manner, by generating the first heat map, the second heat map and the third heat map corresponding to the first image frame, the second image frame and the third image frame, it can help to determine each key point, so as to determine the human body's movement intention, so as to obtain a more accurate human posture recognition result.
[0153] In some embodiments, in order to generate a more accurate first heat map, an intermediate image frame may be generated based on the second image frame and the third image frame. The intermediate image frame may fuse the intermediate information of the second image frame and the third image frame, and the first image frame also represents the intermediate information of the second image frame and the third image frame to a certain extent. Therefore, the intermediate image frame and the first image frame may be fused with equal weights to generate a more accurate first heat map. For example, (102.1) may include:
[0154] (102.1.1) Inputting the second image frame and the third image frame into the first posture prediction submodule for feature fusion to obtain an intermediate image frame between the second image frame and the third image frame;
[0155] (102.1.2) in the first posture prediction submodule, assigning equal weights to the intermediate image frame and the first image frame, and adjusting the weights of the intermediate image frame and the first image frame according to the equally assigned weights to obtain new intermediate image frames and first image frames;
[0156] (102.1.3) Fuse the intermediate image frame and the first image frame to obtain a new first image frame, perform position prediction of key points and probability mapping of each position on the first image frame, and generate a first heat map corresponding to the first image frame.
[0157] Among them, the intermediate image frame can be obtained based on the fusion of the second image frame and the third image frame. The intermediate image frame is a virtual representation between the second image frame and the third image frame in time, and can represent an image frame at the intermediate time point between the second image frame and the third image frame.
[0158] In some embodiments, the second image frame and the third image frame may be input to the IFRNet in the first posture prediction submodule for fusion. Specifically, the encoder of the IFRNet may extract feature representations of the second image frame and the third image frame, and fuse the extracted feature representations, which may be combined by matrix multiplication or the like, and then the decoder may be used to generate an intermediate frame image based on the fused features, so as to better utilize the intermediate information of the second image frame and the third image frame and improve the accuracy of human posture recognition.
[0159] Furthermore, equal weights can be assigned to the intermediate image frame and the first image frame. For example, a 50% weight can be assigned to the intermediate image frame and a 50% weight can be assigned to the first image frame. The two can then be fused to obtain a more comprehensive, continuous and accurate representation of the human body posture, thereby improving the quality of posture estimation.
[0160] Furthermore, after the intermediate image frame and the first image frame are fused to obtain a new first image frame, the first image frame can be input into HRNet-W48 in the first posture prediction submodule. HRNet-W48 can extract different feature representations from the first image frame for feature extraction.
[0161] In some implementations, when the preceding sequence and the succeeding sequence are divided into a plurality of sub-image sequences, a second image frame and a third image frame corresponding to each sub-sequence are obtained. Then, the following processing may be performed on the plurality of second image frames and the plurality of third image frames in the first posture prediction submodule and the second posture prediction submodule:
[0162] Exemplarily, in the first posture prediction submodule, each second image frame and the corresponding third image frame are combined into an image frame pair, and the image frames in each pair of image frames are at the same position from the first image frame. For example, if the second image frame is selected based on a sub-image sequence consisting of the first 6 to first 10 image frames of the first image frame, then the third image frame should be selected based on a sub-image sequence consisting of the last 6 to last 10 image frames of the first image frame. Afterwards, each image frame pair is sequentially input into the IFRNet in the first posture prediction submodule to obtain intermediate frame images of multiple sub-image pairs. Afterwards, weight ratios are assigned to the first image frame and multiple intermediate frame images. Specifically, since the first image frame is more critical to human posture recognition, 50% of the ratio is still assigned to the first image frame, and the remaining 50% is equally distributed to multiple intermediate frame images generated by multiple sub-image pairs. For example, when there are 5 intermediate frame images, 10% of the ratio can be assigned to each intermediate frame image, and then each intermediate frame image is fused with the first image frame to obtain a new first image frame, and then the new first image frame is input into HRNet-W48 to obtain a first heat map.
[0163] Exemplarily, in the second posture prediction submodule, IFRNet or other fused neural networks can be set before HRNet-W64, and IFRNet can fuse all second image frames to obtain the final second image frame; and fuse all third image frames to obtain the final third image frame. Furthermore, the fused second image frame and third image frame can be input into HRNet-W64 respectively to obtain the second heat map corresponding to the second image frame, and the third heat map corresponding to the third image frame. It can be understood that by processing the multiple second image frames and multiple third image frames obtained by screening, the accuracy of human posture recognition can be improved without inputting all image frames into the target model for processing.
[0164] It is understandable that, in order to facilitate the subsequent posture recognition task, the target human body region in each image frame can be identified and the non-target human body region can be removed. Specifically, the target human body region can be identified and the cropped target human body region can be processed to obtain the first target image frame, the second target image frame and the third target image frame. For example, before step 102, it can include:
[0165] (A1) generating a first target image frame, a second target image frame and a third target image frame according to content information corresponding to the target human body region in the first image frame, the second image frame and the third image frame respectively;
[0166] The first image frame, the second image frame, and the third image frame are input into the initial posture prediction module in the target model for key point recognition, and a first heat map corresponding to the first image frame, a second heat map corresponding to the second image frame, and a third heat map corresponding to the third image frame are obtained, including:
[0167] The first target image frame, the second target image frame and the third target image frame are input into the initial posture prediction module in the target model for key point recognition to obtain a first heat map corresponding to the first target image frame, a second heat map corresponding to the second target image frame and a third heat map corresponding to the third target image frame.
[0168] The target human body region may be a human body part included in the first image frame, the second image frame and the third image frame, that is, a region of interest during human body detection and recognition.
[0169] The content information may be information corresponding to the cropped target human body region, for example, size information of the target human body region.
[0170] The first target image frame is generated based on the content information obtained after cropping the target human body region in the first image frame. Similarly, the second target image frame is generated based on the content information obtained after cropping the target human body region in the second image, and the third target image frame is generated based on the content information obtained after cropping the target human body region in the third image frame.
[0171] Specifically, the human body detector in the target model can identify the target human body area in the first image frame, the second image frame, and the third image frame, and mark the target human body area with a rectangular bounding box, and in the first image frame, the second image frame, and the third image frame, each marked rectangular bounding box is extended outward from the center of each image frame by a certain proportion. The extension ratio can be determined according to the size of each image frame, for example, it can be 20%, etc., to ensure that important human body parts and related environmental information are included in the cropped area. Furthermore, after the rectangular bounding box is extended, the rectangular bounding box can be cropped so that the target model can focus more on the recognition of the target human body area and improve the accuracy of human posture recognition.
[0172] In some implementations, if the cropped image frame does not meet the input size requirement of the target model, the size may be reduced or enlarged to adapt to the input size of the target model.
[0173] Step 103, determining a fusion weight ratio among the first heat map, the second heat map, and the third heat map according to the frame distances of the second image frame and the third image frame relative to the first image frame.
[0174] It can be understood that in some embodiments, in order to fuse the first heat map, the second heat map and the third heat map to obtain the first feature tensor and the second feature tensor to correct the first heat map, the fusion weight ratio between the first heat map, the second heat map and the third heat map can be calculated to facilitate accurate correction of the first heat map and obtain more accurate human posture recognition results.
[0175] In some embodiments, the fusion weight ratio includes a first adjustment weight, a second adjustment weight, and a third adjustment weight, and the fusion weight ratio is used to adjust the weights of the first heat map, the second heat map, and the third heat map; from the image frame sequence, determine the second frame distance of the second image frame relative to the first image frame, and the third frame distance of the third image frame relative to the first image frame; based on the second frame distance as the numerator, the sum of the second frame distance and the third frame distance is used as the denominator to obtain the second adjustment weight corresponding to the second heat map; based on the third frame distance as the numerator, the sum of the second frame distance and the third frame distance is used as the denominator to obtain the third adjustment weight corresponding to the third heat map; wherein the sum of the second adjustment weight and the third adjustment weight is equal to the first adjustment weight corresponding to the first heat map.
[0176] Exemplarily, when the second frame distance of the second image frame relative to the first image frame is 4, and the third frame distance of the third image frame relative to the first image frame is 5, then the sum of the second frame distance and the third frame distance is 9, the second adjustment weight corresponding to the second heat map is 4 / 9, and the third adjustment weight corresponding to the third heat map is 5 / 9.
[0177] It can be understood that, since the first image frame of the current time sequence is mainly identified, the first thermal image frame corresponding to the first image frame is Figure 1 The first adjustment weight generally obtained by allocation is 1, and the sum of the second adjustment weight and the third adjustment weight is also 1, so that the first heat map, the second heat map and the third heat map can be fused and corrected based on the fusion weight ratio later.
[0178] Step 104, through the posture fusion residual module of the target model, the first heat map, the second heat map and the third heat map are fused and corrected based on the fusion weight ratio to obtain a first feature tensor.
[0179] It is understandable that in order to eliminate the mutual influence between the key points of different joint areas, the first heat map, the second heat map and the third heat map can be multiplied by the corresponding fusion weight ratio, and then the first heat map, the second heat map and the third heat map with adjusted weights can be stacked to correct the key points. Furthermore, the first initial feature tensor obtained by stacking can be grouped and convolved and input into the residual block to avoid the problem of gradient disappearance or gradient explosion, thereby improving the accuracy of human posture recognition.
[0180] Among them, the posture fusion residual module may include a grouped convolution layer and a 3*3 residual block, so that after the first initial feature tensor is grouped and convolved, it is input into the residual block to integrate and adjust the posture information, thereby more efficiently processing spatiotemporal data.
[0181] Among them, the first feature tensor is obtained by fusing the data of the first heat map, the second heat map and the third heat map through the posture fusion residual module, and is an important feature for the target model to recognize the posture.
[0182] Exemplarily, the first heat map can be multiplied by the first adjustment weight, the second heat map can be multiplied by the second adjustment weight, and the third heat map can be multiplied by the third adjustment weight to obtain the first heat map, the second heat map, and the third heat map with adjusted weights. After that, the first heat map, the second heat map, and the third heat map are stacked to obtain the first initial feature tensor, and then the first initial feature tensor is convolved and input into the 3*3 residual block to obtain the first feature tensor, and the feature representation is further optimized to facilitate the subsequent correction of the first heat map according to the first feature tensor and the second feature tensor to obtain a more accurate human posture recognition result.
[0183] In some embodiments, in order to eliminate the mutual influence between the key points in the joint area, the first heat map, the second heat map and the third heat map may be stacked and corrected to obtain a first initial feature tensor, and the first initial feature tensor may be subjected to group convolution and feature fusion of the residual block to obtain a first feature tensor, so as to facilitate the subsequent correction of the first heat map in combination with the second feature tensor to improve the accuracy of human posture recognition. For example, step 104 may include:
[0184] (104.1) determining a first adjustment weight corresponding to the first heat map, a second adjustment weight corresponding to the second heat map, and a third adjustment weight corresponding to the third heat map based on the fusion weight ratio;
[0185] (104.2) adjusting the second heat map based on the second adjustment weight to obtain an adjusted second heat map through the pose fusion residual module of the target model, and adjusting the third heat map based on the third adjustment weight to obtain an adjusted third heat map;
[0186] (104.3) stacking and correcting the first heat map, the second heat map, and the third heat map to obtain a first initial feature tensor;
[0187] (104.4) The first initial feature tensor is input into the grouped convolution layer of the target model for grouped convolution, and then input into the residual block for feature fusion to obtain the first feature tensor.
[0188] The first adjustment weight may be used to characterize the contribution of the first heat map in the first initial feature tensor. Since the first heat map is the key to human body posture recognition, the contribution of the first heat map is generally 1.
[0189] The second adjustment weight may be used to characterize the contribution of the second heat map in the first initial feature tensor.
[0190] The third adjustment weight can be used to characterize the contribution of the third heat map in the first initial feature tensor. The sum of the second adjustment weight and the third adjustment weight is 1, and the sum of the second adjustment weight and the third adjustment weight is equal to the first adjustment weight, so as to characterize the importance of the first heat map, which is the same as the importance of the sum of the second heat map and the third heat map.
[0191] The first initial feature tensor may be a feature tensor obtained by stacking and correcting the first heat map, the second heat map, and the third heat map. Specifically, the pixel values of the first heat map, the second heat map, and the third heat map may be merged in the channel dimension to obtain the first initial feature tensor, which has three channels, each channel corresponding to a heat map.
[0192] Among them, the grouped convolution layer can divide each channel of the first initial feature tensor into several groups, and then perform convolution on each group, each group has a corresponding convolution kernel, and all convolution kernels are shared in the spatial dimension to extract useful and accurate features from the first initial feature tensor.
[0193] The residual block can be a residual block in a residual step network (RSN) or a residual block in a residual network (ResNet). By performing group convolution on the first initial feature tensor and inputting it into the residual block, more complex feature representations can be learned in deeper layers of the network, thereby maintaining stable propagation of the gradient.
[0194] The first feature tensor may be a feature tensor that fuses the first heat map, the second heat map, and the third heat map.
[0195] Exemplarily, the first heat map is used Indicates that the second heat map is used Indicates, n indicates the second frame distance of the second image frame corresponding to the second heat map relative to the first image frame, and the third heat map is represented by Indicates that m is the third frame distance of the third image frame relative to the first image frame. Then, the first adjustment weight is 1, the second adjustment weight is n / (n+m), and the third adjustment weight is m / (n+m). Then the first initial feature tensor obtained after stacking and fusion is for:
[0196]
[0197] It can be understood that stacking the first heat map, the second heat map, and the third heat map can increase the amount of information available to the model when dealing with posture recognition problems. For example, the first heat map may more prominently display certain joints, while the second heat map and the third heat map may contain more information about other joints. By stacking these heat maps, the target model can obtain a more comprehensive perspective, thereby improving the accuracy of posture estimation.
[0198] Furthermore, the first initial feature tensor obtained by stacking can be divided into groups and then convolved. For example, the convolution kernel of each group is responsible for the feature extraction of one channel, so as to effectively extract the key features for human posture recognition, and integrate the various features output by the grouped convolution layer through a 3*3 residual block. The identity mapping characteristics of the residual block can also be used to enhance the gradient flow, so that the network can better accurately recognize the posture information.
[0199] Step 105, through the differential fusion residual module of the target model, determine the first difference heat map of the second heat map relative to the first heat map and the second difference heat map of the third heat map relative to the first heat map, and fuse and correct the first heat map, the first difference heat map and the second difference heat map based on the fusion weight ratio to obtain a second feature tensor.
[0200] In some embodiments, in order to further improve the accuracy of human posture recognition, a first difference heat map and a second difference heat map can be obtained, and the first heat map, the first difference heat map and the second difference heat map can be fused and corrected through a differential fusion residual module to compare the pixel-level differences between different heat maps to obtain a second feature tensor, and the first feature tensor and the second feature tensor can be spliced in the channel dimension to further correct the first heat map to improve the accuracy of human posture recognition.
[0201] Among them, the differential fusion residual module may include a differential module, a grouped convolutional layer and a residual block, and the differential fusion residual module may be used to process and fuse difference information from different first heat maps, second heat maps and third heat maps.
[0202] The first difference heat map may be a heat map generated by comparing the difference between the first heat map and the second heat map. The first difference heat map reflects the difference information between the first heat map and the second heat map at the pixel level, and the first difference heat map may be obtained based on the pixel difference between the first heat map and the second heat map.
[0203] The second difference heat map may be a heat map generated by comparing the difference between the first heat map and the third heat map. The first difference heat map reflects the difference information between the first heat map and the third heat map at the pixel level, and the second difference heat map may be obtained based on the pixel difference between the third heat map and the first heat map.
[0204] The second feature tensor may be a feature tensor that fuses feature information of the first heat map, the first difference heat map, and the second difference heat map.
[0205] Exemplarily, the pixel difference between the first heat map and the second heat map can be first obtained to obtain a first difference heat map, and then the pixel difference between the third heat map and the first heat map can be obtained to obtain a second difference heat map, and the weight of the first difference heat map can be adjusted by the second adjustment weight corresponding to the second heat map obtained in advance, and the weight of the second difference heat map can be adjusted by the third adjustment weight corresponding to the third heat map obtained in advance, so as to correctly determine the contribution of each heat map to the final posture recognition result.
[0206] Furthermore, after weight adjustment of the first heat map, the first difference heat map and the second difference heat map, a second initial feature tensor can be obtained, and the second initial feature tensor is grouped and convolved and weighted fused to obtain a second feature tensor, thereby efficiently extracting the most beneficial features for human posture recognition, and effectively solving the problems of gradient disappearance and gradient explosion, thereby improving the accuracy of human posture recognition.
[0207] (105.1) Determine a second difference heat map corresponding to the second heat map and a third difference heat map corresponding to the third heat map according to difference values between the second heat map and the third heat map and the first heat map respectively;
[0208] (105.2) adjusting the second difference heat map based on the second adjustment weight to obtain an adjusted second difference heat map through the differential fusion residual module of the target model, and adjusting the third difference heat map based on the third adjustment weight to obtain an adjusted third difference heat map;
[0209] (105.3) stacking and correcting the first heat map, the second difference heat map, and the third difference heat map to obtain a second initial feature tensor;
[0210] (105.4) The second initial feature tensor is input into the grouped convolution layer of the target model for grouped convolution, and then input into the residual block for feature fusion to obtain the second feature tensor.
[0211] In some embodiments, in order to enhance the sensitivity and distinguishability of the model to posture changes, the difference values between the second heat map and the third heat map and the first heat map can be calculated to better capture and utilize useful information in different perspectives and feature maps, and improve the accuracy and robustness of posture estimation. For example, step 105 may include:
[0212] The difference value may be a difference in pixels between the second heat map and the third heat map and the first heat map, respectively.
[0213] The second initial feature tensor may be a multi-channel feature map, and the second initial feature tensor includes information from the first heat map, the second difference heat map, and the third difference heat map. Specifically, the pixel values of the first heat map, the second difference heat map, and the third difference heat map may be merged in the channel dimension to obtain the second initial feature tensor, and the second initial feature tensor has three channels, and each channel corresponds to a heat map.
[0214] Exemplarily, the first heat map is used Indicates that the second heat map is used Indicates, n indicates the second frame distance of the second image frame corresponding to the second heat map relative to the first image frame, and the third heat map is represented by Indicates that m is the third frame distance of the third image frame relative to the first image frame, then the first adjustment weight is 1, the second adjustment weight is n / (n+m), and the third adjustment weight is m / (n+m).
[0215] Furthermore, the difference between the second heat map and the first heat map for: , the difference between the third heat map and the first heat map for: ;
[0216] Then the second initial feature tensor for:
[0217]
[0218] It can be understood that through the differential fusion residual module, the first heat map, the second difference heat map and the third difference heat map can be appropriately adjusted and fused, so that the target model can recognize very subtle posture changes even at different viewing angles. After the stacked corrected feature tensor is input into the grouped convolution layer and the residual block, the features can be further extracted and fused, and finally a second feature tensor containing rich posture information is obtained. The second feature tensor can be spliced with the first feature tensor to correct the first heat map, thereby improving the accuracy and robustness of human posture recognition.
[0219] Furthermore, the second initial feature tensor obtained by stacking can be divided into groups and then convolved. For example, the convolution kernel of each group is responsible for the feature extraction of one channel, so as to effectively extract the key features for human posture recognition, and integrate the various features output by the grouped convolution layer through a 3*3 residual block. The identity mapping characteristics of the residual block can also be used to enhance the gradient flow, so that the network can better accurately recognize the posture information.
[0220] Step 106: Correct the first heat map according to the first feature tensor and the second feature tensor, and generate a human posture recognition result based on the corrected first heat map.
[0221] In some embodiments, the first feature tensor and the second feature tensor can be spliced in the channel dimension to obtain a corrected feature tensor, which is input into HRNet-W48 to correct the first heat map, and the corrected first heat map is converted into coordinate points to output the human posture recognition result. It can be understood that the first feature tensor contains information about static features in the image frame sequence, which can help the target model understand the human posture more accurately; the second feature tensor is used to characterize the changes between the first heat map, the second heat map and the third heat map, that is, the dynamic features, which helps the target model to understand the movement trend of human body parts over time. Therefore, the content of the first heat map, the second heat map and the third heat map contains the spatial distribution of weights and features. By splicing the first feature tensor and the second feature tensor according to the channel dimension, it can help the target model understand the human posture in a more complex environment.
[0222] In some embodiments, in order to generate a more accurate posture recognition result, the first feature tensor and the second feature tensor may be spliced according to the channel dimension, and the corrected feature tensor may be input into the posture correction module of the target model to correct the first heat map that needs to be posture recognized, so as to obtain a more accurate human posture recognition result. For example, "correcting the first heat map according to the first feature tensor and the second feature tensor" in step 106 may include:
[0223] (106.1) concatenating the first feature tensor and the second feature tensor according to the channel dimension to obtain a modified feature tensor;
[0224] (106.2) The corrected feature tensor is input into a posture correction module of the target model to correct each key point in the first heat map.
[0225] Among them, the modified feature tensor can be the first feature tensor and the second feature tensor spliced according to the channel dimension, so as to form a more comprehensive feature tensor.
[0226] Among them, the posture correction module may include HRNet-W48, and the posture correction module can correct each key point in the first heat map, and use the information in the corrected feature tensor to calibrate and optimize the key point positions in the original heat map, so as to obtain more precise and accurate human posture recognition results.
[0227] It can be understood that by splicing the first feature tensor and the second feature tensor according to the channel dimension, the modified feature tensor formed contains both the static information of the human body in the time series and the dynamic displacement information, which helps to further improve the accuracy of human posture recognition in a dynamic environment.
[0228] Furthermore, the corrected feature tensor can be input into HRNet-W48, and HRNet-W48 can use the corrected feature tensor to calibrate the position of each key point on the first heat map, thereby correcting inaccurate key point predictions caused by motion blur or other factors.
[0229] For example, when identifying the posture of a person performing weightlifting, the first feature tensor can enhance HRNet-W48's understanding of the arm position, while the second feature tensor can find position changes in the first heat map, the first difference heat map, and the second difference heat map to identify the arm raising action. After the first feature tensor and the second feature tensor are spliced according to the channel dimension and input into the posture correction module, HRNet-W48 can use these static and dynamic information to correct each arm key point in the first heat map to obtain a more accurate posture when the arm is finally raised.
[0230] In some implementations, the target model may be a multi-frame prediction fusion neural network framework (Muit-FramePose, MFPose). The target model may be trained in the following manner:
[0231] First, prepare a dataset for training the target model. For example, you can use the PoseTrack2017 multi-frame task pose estimation challenge dataset. PoseTrack2017 is a large-scale public dataset for human pose estimation in videos, including challenging situations such as complex human motion in crowded environments. The PoseTrack2017 dataset contains 514 video clips and 16,219 pose annotations, of which 250 clips are used for training, 50 clips are used for verification, and 214 clips are used for testing. Furthermore, in order to achieve the diversity of the dataset and improve the performance of the target model, data enhancement can be performed on the basis of the original data of the dataset, that is, image rotation, scaling, truncation, horizontal flipping and other operations can be performed on the original dataset.
[0232] Furthermore, the loss function can use the standard pose estimation loss function to minimize the distance between the prediction of the key points of all joints and the true heat map. The standard pose estimation loss function is easy to calculate, measures the error more accurately, and the gradient can change with the error. It has a good convergence effect and is conducive to improving the training efficiency of the target model. The loss function used to train the target model is as follows:
[0233]
[0234] in, is the true value, is the predicted value, is the number of joint points, For the The visibility of each joint.
[0235] Furthermore, the parameters of the target model can be set. For example, the input image can be set to 384*288, the Adam optimizer can be used, the basic learning rate can be 0.0001, and the batch size can be 32.
[0236] Furthermore, the hardware configuration of the target model can be set. For example, two NVIDIA GeForce RTX 3090ti graphics cards can be used as computing units for model training.
[0237] Furthermore, the accuracy of the target model can be evaluated by using average precision. Specifically, the accuracy of each key point can be calculated, and then the average of all the accuracy rates can be taken. Specifically, the accuracy rate can be calculated by comparing the predicted key point with the real key point, and calculating the Euclidean distance between the predicted key point and the real key point. If the Euclidean distance is less than a preset threshold, the prediction is considered to be accurate. The preset threshold can be adjusted according to the actual situation.
[0238] It is understandable that, during the process of training the target model, the parameters of the target model can be continuously adjusted according to the loss function until the target model converges, or until the target model reaches a preset number of training times to obtain a trained target model.
[0239] The embodiment of the present application obtains an image frame sequence corresponding to a target video, and obtains a first image frame of the current time sequence, a second image frame located in front of the first image frame, and a third image frame located in the back sequence from the image frame sequence; the second image frame and the third image frame are determined based on the mean square error between the first image frame and each image frame in the image frame sequence; the first image frame, the second image frame, and the third image frame are input into an initial posture prediction module in a target model for key point recognition, to obtain a first heat map corresponding to the first image frame, a second heat map corresponding to the second image frame, and a third heat map corresponding to the third image frame; according to the frame distances of the second image frame and the third image frame relative to the first image frame, the first heat map corresponding to the first image frame, the second heat map corresponding to the second image frame, and the third heat map corresponding to the third image frame are determined; The fusion weight ratio between the heat map, the second heat map and the third heat map; through the posture fusion residual module of the target model, the first heat map, the second heat map and the third heat map are fused and corrected based on the fusion weight ratio to obtain the first feature tensor; through the differential fusion residual module of the target model, the first difference heat map of the second heat map relative to the first heat map and the second difference heat map of the third heat map relative to the first heat map are determined, and the first heat map, the first difference heat map and the second difference heat map are fused and corrected based on the fusion weight ratio to obtain the second feature tensor; the first heat map is corrected according to the first feature tensor and the second feature tensor, and the human posture recognition result is generated based on the corrected first heat map. In this way, in a dynamic scene, the time sequence information of the target video can be used to select the second image frame and the third image frame with representative and high quality through the mean square error between each image frame and the first image frame, thereby greatly reducing the number of image frames input to the target model, avoiding the interference of repeated and redundant image frames, and thus improving the efficiency and accuracy of human posture recognition. Moreover, the present application can determine the fusion weight ratio between the heat maps according to the frame distance of the second image frame and the third image frame relative to the first image frame, so as to integrate the information in the first heat map, the second heat map and the third heat map, and correct the key points that are incorrectly identified; at the same time, it can realize the fusion of complementary information according to the differential fusion residual module. Finally, the first feature tensor obtained by the posture fusion residual module and the second feature tensor obtained by the differential fusion residual module are used to correct the first heat map, and the first heat map can be corrected by integrating various information, which can further solve the problems of posture ambiguity and posture occlusion, and ensure the accuracy and stability of the human posture recognition results outputted in the end.
[0240] See also Figure 4 The embodiment of the present application further provides a human posture recognition device, which can implement the above human posture recognition method. The human posture recognition device includes:
[0241] The acquisition module 41 is used to acquire an image frame sequence corresponding to the target video, and acquire a first image frame of the current time sequence, a second image frame located before the first image frame, and a third image frame located after the first image frame from the image frame sequence; the second image frame and the third image frame are determined based on the mean square error between the first image frame and each image frame in the image frame sequence;
[0242] The recognition module 42 is used to input the first image frame, the second image frame and the third image frame into the initial posture prediction module in the target model to perform key point recognition, and obtain a first heat map corresponding to the first image frame, a second heat map corresponding to the second image frame and a third heat map corresponding to the third image frame;
[0243] A determination module 43, configured to determine a fusion weight ratio among the first heat map, the second heat map, and the third heat map according to a frame distance between the second image frame and the third image frame relative to the first image frame;
[0244] A first correction module 44 is used to perform fusion correction on the first heat map, the second heat map and the third heat map based on a fusion weight ratio through a posture fusion residual module of the target model to obtain a first feature tensor;
[0245] A second correction module 45 is used to determine a first difference heat map of the second heat map relative to the first heat map and a second difference heat map of the third heat map relative to the first heat map through a differential fusion residual module of the target model, and fuse and correct the first heat map, the first difference heat map and the second difference heat map based on a fusion weight ratio to obtain a second feature tensor;
[0246] The first generating module 46 is used to correct the first heat map according to the first feature tensor and the second feature tensor, and generate a human posture recognition result based on the corrected first heat map.
[0247] The specific implementation of the human posture recognition device is basically the same as the specific implementation of the human posture recognition method described above, and will not be repeated here. On the premise of meeting the requirements of the embodiment of the present application, the human posture recognition device can also be provided with other functional modules to implement the human posture recognition method in the above embodiment.
[0248] The embodiment of the present application also provides a computer device, the computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned human posture recognition method when executing the computer program. The computer device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0249] See also Figure 5 , Figure 5 The hardware structure of a computer device according to another embodiment is shown, and the computer device includes:
[0250] The processor 51 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0251] The memory 52 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 52 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 52, and the processor 51 calls and executes the human body posture recognition method of the embodiment of this application;
[0252] Input / output interface 53, used to implement information input and output;
[0253] Communication interface 54, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0254] A bus 55 that transmits information between the various components of the device (e.g., the processor 51, the memory 52, the input / output interface 53, and the communication interface 54);
[0255] The processor 51 , the memory 52 , the input / output interface 53 and the communication interface 54 are connected to each other in communication within the device via a bus 55 .
[0256] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned human body posture recognition method is implemented.
[0257] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0258] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0259] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0260] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0261] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0262] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0263] It should be understood that in the present application, "at least one (item)" and "several" refer to one or more, and "plurality" refers to two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0264] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0265] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0266] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0267] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0268] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A human body posture recognition method, characterized in that: The method comprises: Acquire an image frame sequence corresponding to a target video, and acquire a first image frame of a current time sequence, a second image frame preceding the first image frame, and a third image frame following the first image frame from the image frame sequence; the second image frame and the third image frame are determined based on a mean square error between the first image frame and each image frame in the image frame sequence; Inputting the first image frame, the second image frame, and the third image frame into an initial posture prediction module in a target model for key point recognition, to obtain a first heat map corresponding to the first image frame, a second heat map corresponding to the second image frame, and a third heat map corresponding to the third image frame; Determining a fusion weight ratio among the first heat map, the second heat map, and the third heat map according to a frame distance between the second image frame and the third image frame relative to the first image frame; By using the posture fusion residual module of the target model, fusing and correcting the first heat map, the second heat map and the third heat map based on the fusion weight ratio, so as to obtain a first feature tensor; Determine, by means of the differential fusion residual module of the target model, a first difference heat map of the second heat map relative to the first heat map and a second difference heat map of the third heat map relative to the first heat map, and fuse and correct the first heat map, the first difference heat map and the second difference heat map based on the fusion weight ratio to obtain a second feature tensor; The first heat map is corrected according to the first feature tensor and the second feature tensor, and a human posture recognition result is generated based on the corrected first heat map.
2. The human body posture recognition method according to claim 1, characterized in that: The step of obtaining an image frame sequence corresponding to the target video includes: Determine at least one target joint point from the target video; For each of the target joint points, determining an inter-frame displacement between any two adjacent image frames in the target video; Determining the inter-frame speed of the target joint point according to the inter-frame displacement; Based on the inter-frame rate, an image frame sequence corresponding to the target video is determined.
3. The human body posture recognition method according to claim 2, characterized in that: The method of acquiring a first image frame of the current time sequence and a second image frame located before the first image frame and a third image frame located after the first image frame from the image frame sequence includes: Acquire a first image frame of a current time sequence from an image frame sequence, and calculate a mean square error between each image frame in the image frame sequence and the first image frame; Determine, from the image frame sequence, a preamble sequence located at the preamble of the first image frame and a postamble sequence located at the postamble of the first image frame; Based on a mean square error between each image frame and the first image frame, a second image frame is determined from the preceding sequence, and a third image frame is determined from the succeeding sequence.
4. The human body posture recognition method according to claim 3, characterized in that: The determining of the second image frame from the preceding sequence based on the mean square error between each image frame and the first image frame, and the determining of the third image frame from the succeeding sequence, comprises: Arrange the mean square error corresponding to each image frame in the preceding sequence according to the time sequence of each image frame in the preceding sequence to obtain a first mean square error sequence; Arrange the mean square errors corresponding to each image frame in the preceding sequence in ascending order to obtain a second mean square error sequence; For the second mean square error sequence, determine a first target mean square error located at the median, and determine a position of the first target mean square error in the first mean square error sequence, so as to determine an image frame corresponding to the first target mean square error according to the position of the first target mean square error in the first mean square error sequence, and use the image frame as the second image frame; Arranging the mean square error corresponding to each image frame in the subsequent sequence according to the time sequence of each image frame in the subsequent sequence to obtain a third mean square error sequence; Arrange the mean square errors corresponding to each image frame in the post-sequence in ascending order to obtain a fourth mean square error sequence; For the fourth mean square error sequence, determine a second target mean square error located at the median, and determine the position of the second target mean square error in the third mean square error sequence, so as to determine an image frame corresponding to the second target mean square error according to the position of the second target mean square error in the third mean square error sequence, and use the image frame as the third image frame.
5. The human body posture recognition method according to claim 1, characterized in that: The method of fusing and correcting the first heat map, the second heat map, and the third heat map based on the fusion weight ratio through the posture fusion residual module of the target model to obtain a first feature tensor includes: Based on the fusion weight ratio, determining a first adjustment weight corresponding to the first heat map, a second adjustment weight corresponding to the second heat map, and a third adjustment weight corresponding to the third heat map; By means of the pose fusion residual module of the target model, the second heat map is adjusted based on the second adjustment weight to obtain an adjusted second heat map, and the third heat map is adjusted based on the third adjustment weight to obtain an adjusted third heat map; The first heat map, the second heat map and the third heat map are stacked and corrected to obtain a first initial feature tensor; The first initial feature tensor is input into the grouped convolution layer of the target model for grouped convolution, and then input into the residual block for feature fusion to obtain a first feature tensor.
6. The human body posture recognition method according to claim 5, characterized in that: The method further comprises: determining a first difference heat map of the second heat map relative to the first heat map and a second difference heat map of the third heat map relative to the first heat map through the differential fusion residual module of the target model, and fusing and correcting the first heat map, the first difference heat map and the second difference heat map based on the fusion weight ratio to obtain a second feature tensor, including: Determine a second difference heat map corresponding to the second heat map, and a third difference heat map corresponding to the third heat map according to difference values between the second heat map and the third heat map and the first heat map respectively; By means of the differential fusion residual module of the target model, the second difference heat map is adjusted based on the second adjustment weight to obtain an adjusted second difference heat map, and the third difference heat map is adjusted based on the third adjustment weight to obtain an adjusted third difference heat map; The first heat map, the second difference heat map and the third difference heat map are stacked and corrected to obtain a second initial feature tensor; The second initial feature tensor is input into the grouped convolution layer of the target model for grouped convolution, and then input into the residual block for feature fusion to obtain a second feature tensor.
7. The human body posture recognition method according to claim 1, characterized in that: The modifying the first heat map according to the first feature tensor and the second feature tensor includes: Concatenate the first feature tensor and the second feature tensor according to the channel dimension to obtain a modified feature tensor; The corrected feature tensor is input into the posture correction module of the target model to correct each key point in the first heat map.
8. The human body posture recognition method according to claim 1, characterized in that: The initial posture prediction module includes a first posture prediction submodule and a second posture prediction submodule; the initial posture prediction module inputs the first image frame, the second image frame and the third image frame into the target model for key point recognition to obtain a first heat map corresponding to the first image frame, a second heat map corresponding to the second image frame and a third heat map corresponding to the third image frame, including: Inputting the first image frame, the second image frame, and the third image frame into the first posture prediction submodule for equal weight distribution, and performing position prediction of key points and probability mapping of each position according to the first image frame to which the equal weight distribution has been performed, to obtain a first heat map corresponding to the first image frame; The second image frame and the third image frame are sequentially input into the second posture prediction submodule to locate and identify key points, and a second heat map corresponding to the second image frame and a third heat map corresponding to the third image frame are sequentially obtained.
9. The human body posture recognition method according to claim 8, characterized in that: The first image frame, the second image frame, and the third image frame are input into the first posture prediction submodule for equal weight distribution, and the position prediction of key points and probability mapping of each position are performed according to the first image frame to which the equal weight distribution has been performed, so as to obtain a first heat map corresponding to the first image frame, including: Inputting the second image frame and the third image frame into the first posture prediction submodule for feature fusion to obtain an intermediate image frame between the second image frame and the third image frame; In the first posture prediction submodule, equal weights are assigned to the intermediate image frame and the first image frame, and weights of the intermediate image frame and the first image frame are adjusted according to the equally assigned weights to obtain new intermediate image frames and first image frames; The intermediate image frame and the first image frame are fused to obtain a new first image frame, and the positions of key points and probability mapping of each position are performed on the first image frame to generate a first heat map corresponding to the first image frame.
10. The human body posture recognition method according to claim 1, characterized in that: Before inputting the first image frame, the second image frame and the third image frame into the initial posture prediction module in the target model for key point recognition and obtaining a first heat map corresponding to the first image frame, a second heat map corresponding to the second image frame and a third heat map corresponding to the third image frame, the method further includes: Generate a first target image frame, a second target image frame, and a third target image frame according to content information corresponding to the target human body region in the first image frame, the second image frame, and the third image frame, respectively; Then the step of inputting the first image frame, the second image frame and the third image frame into an initial posture prediction module in a target model for key point recognition to obtain a first heat map corresponding to the first image frame, a second heat map corresponding to the second image frame and a third heat map corresponding to the third image frame includes: The first target image frame, the second target image frame and the third target image frame are input into the initial posture prediction module in the target model for key point recognition to obtain a first heat map corresponding to the first target image frame, a second heat map corresponding to the second target image frame and a third heat map corresponding to the third target image frame.
11. A human body posture recognition device, characterized in that: The device comprises: an acquisition module, used to acquire an image frame sequence corresponding to a target video, and acquire a first image frame of a current time sequence, a second image frame located before the first image frame, and a third image frame located after the first image frame from the image frame sequence; the second image frame and the third image frame are determined based on a mean square error between the first image frame and each image frame in the image frame sequence; a recognition module, configured to input the first image frame, the second image frame, and the third image frame into an initial posture prediction module in a target model for key point recognition, and obtain a first heat map corresponding to the first image frame, a second heat map corresponding to the second image frame, and a third heat map corresponding to the third image frame; a determination module, configured to determine a fusion weight ratio among the first heat map, the second heat map, and the third heat map according to a frame distance between the second image frame and the third image frame relative to the first image frame; A first correction module, configured to perform fusion correction on the first heat map, the second heat map and the third heat map based on the fusion weight ratio through the posture fusion residual module of the target model to obtain a first feature tensor; A second correction module is used to determine a first difference heat map of the second heat map relative to the first heat map and a second difference heat map of the third heat map relative to the first heat map through the differential fusion residual module of the target model, and fuse and correct the first heat map, the first difference heat map and the second difference heat map based on the fusion weight ratio to obtain a second feature tensor; The first generating module is used to correct the first heat map according to the first feature tensor and the second feature tensor, and generate a human posture recognition result based on the corrected first heat map.
12. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the human body posture recognition method according to any one of claims 1 to 10 when executing the computer program.
13. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the human body posture recognition method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Figure posture recognition method and device, computer equipment and storage medium
CN111753643A
Sitting posture recognition method based on monocular video image sequence
WO2021237913A1
