A human body key point recognition method, device, equipment and storage medium

By inputting the human body image to be identified into the pre-trained key point recognition network model, the coordinates of the human body key points are directly calculated, and the problem of insufficient real-time identification of human body key points in the prior art is solved, achieving more efficient processing speed and real-time performance.

CN112560780BActive Publication Date: 2025-02-28BEIJING IQIYI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011567601.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-25
Publication Date
2025-02-28
Estimated Expiration
2040-12-25

AI Technical Summary

Technical Problem

In the prior art, the real-time nature of human key point recognition cannot be guaranteed because the GPU needs to generate a heat map with a larger resolution to ensure the accuracy of key point coordinates, resulting in slow processing speed and large system transfer overhead.

Method used

By inputting the human body image to be recognized into the pre-trained key point recognition network model, the coordinates of the human body key points are directly calculated without generating a feature map and sending it to the CPU.

Benefits of technology

It saves transfer overhead in the system, improves processing speed, and realizes real-time recognition of key points in human body.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112560780B_ABST
    Figure CN112560780B_ABST
Patent Text Reader

Abstract

The human body key point recognition method, device, equipment and storage medium provided by the present application, after obtaining the human body image to be recognized, input the human body image to be recognized into a pre-trained key point recognition network model, recognize the human body key points in the human body image to be recognized, and calculate according to the recognition result to obtain the coordinates of the human body key points in the human body image to be recognized, wherein the key point recognition network model is obtained by training a preset network model based on a sample human body image and the true value human body key point coordinates in the sample human body image, that is, the coordinates of the human body key points can be directly calculated according to the human body image to be recognized, without generating the corresponding feature map, thereby improving the processing speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent analysis technology, and in particular to a method, device, equipment and storage medium for recognizing key points of a human body. Background Art

[0002] In the field of intelligent analysis, it is often necessary to identify human behavior. Among them, the most basic is human motion recognition. In the process of motion recognition, first of all, the key points of the human body can be identified, and then, based on the key points of the human body, the human body's movements and behaviors can be analyzed.

[0003] At present, the method for identifying key points of the human body is usually as follows: first, a GPU (Graphics Processing Unit) uses a heat map recognition network to extract features of the human body image to be identified, and obtains a heat map corresponding to each human body key point of the human body image to be identified, wherein the value of a pixel point in the heat map is the probability that the pixel point at the corresponding position in the human body image to be identified is the human body key point corresponding to the heat map; then, the GPU sends the obtained heat map to the CPU (Central Processing Unit), and the CPU analyzes the heat map to obtain the coordinates of the human body key points.

[0004] However, in the above method, the GPU needs to generate a heat map of the human image to be identified and send the heat map to the CPU, and the accuracy of the human key points finally obtained by the CPU is positively correlated with the resolution of the heat map generated by the GPU. For example, if the resolution of the human image to be identified is 100*100, and the resolution of its corresponding heat map is 10*10, then the coordinates of the human key points in the heat map will be offset by one pixel and 10 pixels in the human image to be identified, and if the resolution of the heat map is 50*50, then the coordinates of the human key points in the heat map will be offset by one pixel and 2 pixels in the human image to be identified.

[0005] In other words, the GPU needs to generate a heat map with a larger resolution so that the final coordinates of the key points of the human body meet the accuracy requirements. The larger the heat map generated, the longer it takes the GPU to extract features from the human body image to be identified, and the slower the processing speed. At the same time, the GPU sends the heat map of the human body image to be identified to the CPU. The greater the system transfer overhead, the slower the CPU obtains the coordinates of the key points of the human body image to be identified, making it impossible to ensure the real-time recognition of the key points of the human body. Summary of the invention

[0006] The purpose of this application is to provide a human key point recognition method, device, equipment and storage medium to automatically calculate the similarity between the redirected action and the original action. The specific technical solution is as follows:

[0007] In a first aspect of the present invention, a method for identifying key points of a human body is provided, the method comprising:

[0008] Acquire a human body image to be identified;

[0009] Inputting the human body image to be identified into a pre-trained key point recognition network model, identifying the human body key points in the human body image to be identified, and calculating according to the recognition result to obtain the coordinates of the human body key points in the human body image to be identified;

[0010] The key point recognition network model is obtained by training a preset network model based on a sample human body image and true value human key point coordinates in the sample human body image.

[0011] Optionally, the step of inputting the human body image to be identified into a pre-trained key point recognition network model, identifying the human body key points in the human body image to be identified, and calculating according to the recognition result to obtain the coordinates of the human body key points in the human body image to be identified includes:

[0012] Input the human body image to be identified into a preset feature extraction network, identify the human body key points in the human body image to be identified, and obtain a feature matrix of the human body image to be identified, wherein the value of each element in the feature matrix is ​​the probability that the pixel point at the corresponding position in the human body image to be identified is a human body key point;

[0013] The coordinates of the maximum value in the feature matrix are calculated as the coordinates of the key points of the human body in the human body image to be identified.

[0014] Optionally, calculating the coordinates of the maximum value in the feature matrix as the coordinates of the human body key points in the human body image to be identified includes:

[0015] Generate a third row index matrix according to the number of columns and pages of the feature matrix, and generate a third column index matrix according to the number of rows and pages of the feature matrix;

[0016] Generate a fourth row index matrix according to the preset base matrix, the preset coefficients, the characteristic matrix and the third row index matrix, and generate a fourth column index matrix according to the preset base matrix, the preset coefficients, the characteristic matrix and the third column index matrix;

[0017] The sum of the fourth row index matrix in the vertical direction axis and the horizontal direction axis is calculated as the first sequence, and the sum of the fourth column index matrix in the vertical direction axis and the horizontal direction axis is calculated as the second sequence, wherein the first sequence is the horizontal coordinate of the human body key point in the human body image to be identified, and the second sequence is the vertical coordinate of the human body key point corresponding to the first sequence.

[0018] Optionally, generating a third row index matrix according to the number of columns and pages of the feature matrix, and generating a third column index matrix according to the number of rows and pages of the feature matrix, includes:

[0019] Generate a row index vector according to the number of columns of the feature matrix, where the elements in the row index vector are natural numbers from 0 to a number less than the number of columns;

[0020] Repeat the row index vector in the vertical direction axis for the number of times to obtain a first row index matrix;

[0021] Establishing a third axial direction of the first row index matrix, repeating the first row index matrix on the third axial direction for the number of pages to obtain a second row index matrix;

[0022] Swapping the third direction axis and the horizontal direction axis of the second row index matrix to obtain a third row index matrix;

[0023] Generate a column index vector according to the number of rows of the feature matrix, where the elements in the column index vector are natural numbers from 0 to a number less than the number of rows;

[0024] Repeat the column index vector in the horizontal direction axis for the number of times of the column to obtain a first column index matrix;

[0025] Establishing a third axial direction of the first column index matrix, repeating the first column index matrix on the third axial direction for the number of pages to obtain a second column index matrix;

[0026] The third direction axis and the horizontal direction axis of the second column of the index matrix are exchanged to obtain a third column of the index matrix.

[0027] Optionally, generating a fourth row index matrix according to a preset base matrix, a preset coefficient, the characteristic matrix and the third row index matrix, and generating a fourth column index matrix according to the preset base matrix, the preset coefficient, the characteristic matrix and the third column index matrix includes:

[0028] Multiplying the characteristic matrix by a preset coefficient to obtain a first process matrix;

[0029] Using the value of each element in the first process matrix as the exponent of the element at the corresponding position in the preset base matrix to obtain an exponential matrix;

[0030] Calculate the quotient of the exponential matrix and the sum of the elements in the exponential matrix to obtain a second process matrix;

[0031] The product of the second process matrix and the third row index matrix is ​​calculated to obtain a fourth row index matrix, and the product of the second process matrix and the third column index matrix is ​​calculated to obtain a fourth column index matrix.

[0032] Optionally, the key point recognition network model is trained by adopting the following steps:

[0033] Acquire the sample human body image and true value human body key point coordinates in the sample human body image;

[0034] Inputting the sample human body image into a preset network model, identifying key points of the human body in the sample human body image, and obtaining a feature matrix of the sample human body image;

[0035] Calculating the coordinates of the maximum value in the feature matrix of the sample human body image as the predicted coordinates of the human body key points;

[0036] Calculate the loss value between the true value human body key point coordinates and the predicted human body key point coordinates;

[0037] Determine whether the loss value meets the preset conditions. If not, iterate the parameters in the preset network model. If it meets the conditions, use the preset network model with the current parameters as the key point recognition network model.

[0038] In a second aspect of the present invention, a human body key point recognition device is provided, the device comprising:

[0039] An acquisition module, used for acquiring a human body image to be identified;

[0040] A processing module is used to input the human body image to be identified into a pre-trained key point recognition network model, identify the human body key points in the human body image to be identified, and calculate according to the recognition results to obtain the coordinates of the human body key points in the human body image to be identified, wherein the key point recognition network model is obtained by training a preset network model based on a sample human body image and the true value human body key point coordinates in the sample human body image.

[0041] Optionally, the processing module includes:

[0042] A feature extraction submodule is used to input the human body image to be identified into a preset feature extraction network, identify the key points of the human body in the human body image to be identified, and obtain a feature matrix of the human body image to be identified, wherein the value of each element in the feature matrix is ​​the probability that the pixel point at the corresponding position in the human body image to be identified is a key point of the human body;

[0043] The coordinate calculation submodule is used to calculate the coordinates of the maximum value in the feature matrix as the coordinates of the human body key points in the human body image to be identified.

[0044] Optionally, the coordinate calculation submodule includes:

[0045] A first index generating unit, configured to generate a third row index matrix according to the number of columns and pages of the feature matrix, and to generate a third column index matrix according to the number of rows and pages of the feature matrix;

[0046] a second index generating unit, configured to generate a fourth row index matrix according to a preset base matrix, a preset coefficient, the characteristic matrix, and the third row index matrix, and to generate a fourth column index matrix according to the preset base matrix, the preset coefficient, the characteristic matrix, and the third column index matrix;

[0047] A coordinate sequence calculation unit is used to calculate the sum of the fourth row index matrix in the vertical direction axis and the horizontal direction axis as a first sequence, and calculate the sum of the fourth column index matrix in the vertical direction axis and the horizontal direction axis as a second sequence, wherein the first sequence is the horizontal coordinate of the human body key point in the human body image to be identified, and the second sequence is the vertical coordinate of the human body key point corresponding to the first sequence.

[0048] Optionally, the first index generating unit is specifically configured to:

[0049] Generate a row index vector according to the number of columns of the feature matrix, where the elements in the row index vector are natural numbers from 0 to a number less than the number of columns;

[0050] Repeat the row index vector in the vertical direction axis for the number of times to obtain a first row index matrix;

[0051] Establishing a third axial direction of the first row index matrix, repeating the first row index matrix on the third axial direction for the number of pages to obtain a second row index matrix;

[0052] Swapping the third direction axis and the horizontal direction axis of the second row index matrix to obtain a third row index matrix;

[0053] Generate a column index vector according to the number of rows of the feature matrix, where the elements in the column index vector are natural numbers from 0 to a number less than the number of rows;

[0054] Repeat the column index vector in the horizontal direction axis for the number of times of the column to obtain a first column index matrix;

[0055] Establishing a third axial direction of the first column index matrix, repeating the first column index matrix on the third axial direction for the number of pages to obtain a second column index matrix;

[0056] The third direction axis and the horizontal direction axis of the second column of the index matrix are exchanged to obtain a third column of the index matrix.

[0057] Optionally, the second index generating unit is specifically configured to:

[0058] Multiplying the characteristic matrix by a preset coefficient to obtain a first process matrix;

[0059] Using the value of each element in the first process matrix as the exponent of the element at the corresponding position in the preset base matrix to obtain an exponential matrix;

[0060] Calculate the quotient of the exponential matrix and the sum of the elements in the exponential matrix to obtain a second process matrix;

[0061] The product of the second process matrix and the third row index matrix is ​​calculated to obtain a fourth row index matrix, and the product of the second process matrix and the third column index matrix is ​​calculated to obtain a fourth column index matrix.

[0062] Optionally, the device further comprises:

[0063] A model training module is used to obtain the sample human body image and the true value human body key point coordinates in the sample human body image; input the sample human body image into a preset network model, identify the human body key points in the sample human body image, and obtain the feature matrix of the sample human body image; calculate the coordinates of the maximum value in the feature matrix of the sample human body image as the predicted human body key point coordinates; calculate the loss value between the true value human body key point coordinates and the predicted human body key point coordinates; determine whether the loss value meets the preset conditions, if not, iterate the parameters in the preset network model, if satisfied, the preset network model with the current parameters is used as the key point recognition network model.

[0064] In another aspect of the present invention, there is provided an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0065] Memory, used to store computer programs;

[0066] The processor is used to implement any of the above-mentioned human body key point recognition methods when executing the program stored in the memory.

[0067] In another aspect of the present invention, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes any of the above-mentioned methods for recognizing key points of a human body.

[0068] In another aspect of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned methods for recognizing key points of a human body.

[0069] The human key point recognition method, device, equipment and storage medium provided by the present application, after obtaining the human image to be recognized, inputs the human image to be recognized into the key point recognition network model obtained by pre-training, recognizes the human key points in the human image to be recognized, and calculates according to the recognition result to obtain the coordinates of the human key points in the human image to be recognized, wherein the key point recognition network model is obtained by training a preset network model based on the sample human image and the coordinates of the human key points in the sample human image. In this way, after the GPU obtains the human image to be recognized, it can use the key point recognition network model obtained by pre-training to directly calculate the coordinates of the human key points, without generating the feature map corresponding to the human image to be recognized, and further without executing the step of sending the feature map to the CPU, and only needs to send the coordinates of the human key points to the CPU, therefore, while saving the transfer overhead within the system, it can also improve the processing speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0071] Figure 1 Schematic diagram for identifying key points of a human body in an image;

[0072] Figure 2 A flowchart of a method for identifying key points of a human body provided in this application;

[0073] Figure 3 A flowchart of the steps for calculating the coordinates of the maximum value in a feature matrix provided by the present application;

[0074] Figure 4 A schematic diagram of a process for training a key point recognition network model provided in this application;

[0075] Figure 5 A structural block diagram of a human body key point recognition device provided in this application;

[0076] Figure 6 A schematic diagram of an electronic device provided in this application. DETAILED DESCRIPTION

[0077] The technical solution in this application will be described below in conjunction with the drawings in this application.

[0078] In the related technology, the GPU needs to generate a heat map of the human image to be identified and send the heat map to the CPU, and the accuracy of the human key points finally obtained by the CPU is positively correlated with the resolution of the heat map generated by the GPU. In other words, the GPU needs to generate a heat map with a larger resolution so that the coordinates of the human key points finally obtained meet the accuracy requirements. The larger the generated heat map, the longer it takes for the GPU to extract features from the human image to be identified, and the slower the processing speed. At the same time, the GPU sends the heat map of the human image to be identified to the CPU. The system transfer overhead is also greater. In this way, the CPU obtains the coordinates of the key points of the human image to be identified more slowly, making it impossible to ensure the real-time recognition of the human key points.

[0079] In order to solve the above problems, the present application proposes a method for identifying key points of a human body. The method for identifying key points of a human body provided by the present application is generally described below. The method comprises the following steps:

[0080] Acquire a human body image to be identified;

[0081] Inputting the human body image to be identified into the pre-trained key point recognition network model, identifying the key points of the human body in the human body image to be identified, and calculating according to the recognition result to obtain the coordinates of the key points of the human body in the human body image to be identified;

[0082] Among them, the key point recognition network model is obtained by training a preset network model based on sample human images and the true value human key point coordinates in the sample human images.

[0083] It can be seen from the above that the human body key point recognition method provided by the present application is an end-to-end human body key point recognition method. In this way, after the GPU obtains the human body image to be identified, it can use the pre-trained key point recognition network model to directly calculate the coordinates of the human body key points. There is no need to generate a feature map corresponding to the human body image to be identified, and there is no need to execute the step of sending the feature map to the CPU. It is only necessary to send the coordinates of the human body key points to the CPU. Therefore, while saving the transfer overhead within the system, it can also improve the processing speed.

[0084] The human body key point recognition method provided by the present application will be described in detail below through specific embodiments.

[0085] Reference Figure 2 , shows a flowchart of a method for identifying key points of a human body in the present application, which may specifically include the following steps:

[0086] S210: Acquire a human body image to be identified.

[0087] In this step, the human body image to be identified may be a human body image directly obtained from surveillance or video, or may be a human body image with relatively uniform specifications obtained by performing some preprocessing on the original human body image.

[0088] In one implementation method, first, an original human body image can be obtained, and then the original human body image can be preprocessed. For example, the preprocessing of the original human body image can include adjusting the size of the original human body image, normalizing the pixel values ​​of the original human body image, and randomly enhancing the brightness, saturation, etc. of the original human body image. The purpose is to make the human body image to be identified have a format that is closer to the sample image used to train the key point recognition network model, so that the output result of the model is more accurate. The specific steps are not limited.

[0089] S220: Input the human body image to be identified into the pre-trained key point recognition network model, identify the human body key points in the human body image to be identified, and calculate according to the recognition result to obtain the coordinates of the human body key points in the human body image to be identified, wherein the key point recognition network model is obtained by training a preset network model based on the sample human body image and the true value human body key point coordinates in the sample human body image.

[0090] In one implementation, the human body image to be identified is input into a pre-trained key point recognition network model for processing, and the specific steps of obtaining the coordinates of the human body key points in the human body image to be identified may include:

[0091] First, the human image to be identified is input into a preset feature extraction network, and the key points of the human body in the human image to be identified are identified to obtain a feature matrix of the human image to be identified, wherein the value of each element in the feature matrix is ​​the probability that the pixel point at the corresponding position in the human image to be identified is a key point of the human body. For example, the preset feature extraction network can be any feasible feature extraction network, such as a mobilenet network or a resnet network, etc., wherein different feature extraction networks may analyze different image information of the human image to be identified, and this application does not limit this.

[0092] Then, the coordinates of the maximum value in the feature matrix are calculated as the coordinates of the key points of the human body in the human body image to be identified. Specifically, Figure 3 As shown, the process of calculating the coordinates of the maximum value in the feature matrix may include the following steps:

[0093] S221, generating a third row index matrix according to the number of columns and pages of the feature matrix, and generating a third column index matrix according to the number of rows and pages of the feature matrix.

[0094] For example, the feature matrix can be expressed as h f × f ×K matrix, where h f Indicates the number of rows of the feature matrix, w f represents the number of columns of the feature matrix, and K represents the number of pages of the feature matrix.

[0095] In S221, the specific steps of generating the third row index matrix may include:

[0096] First, a row index vector is generated according to the number of columns of the feature matrix, and the elements in the row index vector are natural numbers from 0 to less than the number of columns; then, the row index vector is repeated in the vertical direction axis for the number of rows to obtain the first row index matrix; then, the third direction axis of the first row index matrix is ​​established, and the first row index matrix is ​​repeated in the third direction axis for the number of pages to obtain the second row index matrix; then, the third direction axis and the horizontal direction axis of the second row index matrix are exchanged to obtain the third row index matrix.

[0097] That is, the row index vector V x The number of elements in is 1×w f , which can be expressed as V x =[0,1,2,…,w f -1]. Then, V x Repeat h on the vertical axis f times, and the dimension is h f × f The first row index matrix M x1 Next, create the third axis on the first row of the index matrix and convert M x1 Repeat K times in the third axis to get a dimension of K×h f × f The second row index matrix M x2 . Then, M x2 The third axis and the horizontal axis are exchanged to obtain a dimension of h f × f ×K third row index matrix M x3 .

[0098] Correspondingly, the specific steps of generating the third column index matrix may include:

[0099] First, a column index vector is generated according to the number of rows of the feature matrix, and the elements in the column index vector are natural numbers from 0 to less than the number of rows; then, the column index vector is repeated in the horizontal direction axis for the number of columns to obtain the first column index matrix; then, the third direction axis of the first column index matrix is ​​established, and the first column index matrix is ​​repeated in the third direction axis for the number of pages to obtain the second column index matrix; then, the third direction axis and the horizontal direction axis of the second column index matrix are exchanged to obtain the third column index matrix.

[0100] That is, the column index vector V y The number of elements in is h f ×1, which can be expressed as V y =[[0],[1],[2],…,[h f -1]]. Then, V y Repeat w on the horizontal axis f times, and the dimension is h f × f The first column index matrix M y1 Next, create a third axis on the first column index matrix and convert M y1 Repeat K times in the third axis to get a dimension of K×h f × f The second column index matrix M y2 . Then, M y2 The third axis and the horizontal axis are exchanged to obtain a dimension of h f × f The third column index matrix M of ×K y3 .

[0101] S222, generating a fourth row index matrix according to the preset base matrix, preset coefficients, characteristic matrix and the third row index matrix, and generating a fourth column index matrix according to the preset base matrix, preset coefficients, characteristic matrix and the third column index matrix.

[0102] Among them, the preset base matrix M d The size of is the same as that of the feature matrix, and the value of each element therein is a preset value D, the value of D is a positive integer from 1 to 10, and the value of the preset coefficient S is an empirical value, for example, it can be 50.

[0103] In S222, the specific steps of generating the fourth row index matrix and the fourth column index matrix may include:

[0104] First, the characteristic matrix is ​​multiplied by the preset coefficient to obtain the first process matrix; then, the value of each element in the first process matrix is ​​used as the exponent of the element at the corresponding position in the preset base matrix to obtain the exponential matrix; then, the quotient of the exponential matrix and the sum of the elements in the exponential matrix is ​​calculated to obtain the second process matrix; further, the product of the second process matrix and the third row index matrix is ​​calculated to obtain the fourth row index matrix, and the product of the second process matrix and the third column index matrix is ​​calculated to obtain the fourth column index matrix.

[0105] Continuing with the example in S120, the first process matrix M f1 =M f *S, the exponential matrix can be expressed as f(M d ,M f1 ), where M = f(a, b) represents an operation, and a and b are matrices of the same dimension. Then M = f(a, b) means that the value of each element in M ​​is the exponential operation of the values ​​of a and b at the corresponding position, that is, For example, if a=[1,2], b=[3,4], then M=[1 3 , 2 4 ]. The second process matrix M f2 =f(M d ,M f1 ) / SUM(f(M d ,M f1 )), where SUM represents the exponential matrix f(M d ,M f1 ), the fourth row indexes the matrix M x4 =M f2 ·M x3 , the fourth column index matrix M y4 =M f2 ·M y3 .

[0106] S223, calculate the sum of the fourth row index matrix in the vertical axis and the horizontal axis as the first sequence, and calculate the sum of the fourth column index matrix in the vertical axis and the horizontal axis as the second sequence, wherein the first sequence is the horizontal coordinate of the human body key point in the human body image to be identified, and the second sequence is the vertical coordinate of the human body key point corresponding to the first sequence.

[0107] Continuing with the above example, the first sequence X = SUM(M x4 ,axis=(0,1)), where axis=(0,1) represents the 0th axis and the 1st axis, that is, the vertical axis and the horizontal axis. The X sequence is the horizontal coordinate of the K key points. The second sequence Y=SUM(M x4,axis=(0,1)), the Y sequence is the ordinate of the K key points, where the dimensions of X and Y are both 1×K.

[0108] In this way, the coordinates of the maximum value in the feature matrix are obtained, that is, the coordinates of the key points of the human body in the human body image to be identified.

[0109] In one implementation, the following steps can be used to train a key point recognition network model:

[0110] First, obtain a sample human body image and the true value human body key point coordinates in the sample human body image; then, input the sample human body image into a preset network model, identify the human body key points in the sample human body image, and obtain the feature matrix of the sample human body image; calculate the coordinates of the maximum value in the feature matrix of the sample human body image as the predicted human body key point coordinates; and calculate the loss value between the true value human body key point coordinates and the predicted human body key point coordinates; then, judge whether the loss value meets the preset conditions. If not, it iterate the parameters in the preset network model. If it meets, the preset network model with the current parameters is used as the key point recognition network model.

[0111] like Figure 4 As shown, it is a flow chart of the above-mentioned training key point recognition network model. The training samples of the training process are sample human body images and true value human body key point coordinates in the sample human body images. First, the sample human body images can be preprocessed, and then the processed sample human body images are input into the preset network model for processing to obtain the predicted human body key point coordinates of the sample human body image, and the preset network model is trained according to the loss value between the true value human body key point coordinates and the predicted human body key point coordinates until the loss value meets the preset conditions. In this way, the obtained key point recognition network model can be put into business applications to directly process the input human body image to be identified to obtain the coordinates of the human body key points.

[0112] As can be seen from the above, the human key point recognition method provided by the present application is an end-to-end human key point recognition method. In this way, after the GPU obtains the human image to be recognized, it can use the key point recognition network model obtained by pre-training to directly calculate the coordinates of the human key points. There is no need to generate the feature map corresponding to the human image to be recognized, and then there is no need to execute the step of sending the feature map to the CPU. It only needs to send the coordinates of the human key points to the CPU. Therefore, while saving the transfer overhead in the system, the processing speed can also be improved. Moreover, the process of calculating the coordinates of the maximum value in the feature matrix can be differentiated, the gradient can be transferred, and the processing efficiency is relatively high. The coordinates of the maximum value in any specified plane in the matrix can be calculated. Since the calculation process is a tensor calculation, all calculations are composed of matrix operations. Therefore, it is more suitable for running in a GPU device, which is convenient for parallel computing.

[0113] For ease of understanding, the process of calculating the coordinates of the maximum value in the feature matrix in S221 to S223 is described below through a specific embodiment:

[0114] For example, if w f =3,h f =4, K=5;

[0115] Feature matrix M f =

[0116] [[[0.17735992,0.17735992,0.17735992,0.17735992,0.17735992,0.17735992],

[0117] [0.7207364,0.7207364,0.7207364,0.7207364,0.7207364],

[0118] [0.33386825,0.33386825,0.33386825,0.33386825,0.33386825]],

[0119] [[0.84014634,0.84014634,0.84014634,0.84014634,0.84014634],

[0120] [0.51696645,0.51696645,0.51696645,0.51696645,0.51696645],

[0121] [0.65116289,0.65116289,0.65116289,0.65116289,0.65116289]],

[0122] [[0.00093748,0.00093748,0.00093748,0.00093748,0.00093748],

[0123] [0.35016161,0.35016161,0.35016161,0.35016161,0.35016161],

[0124] [0.04574418,0.04574418,0.04574418,0.04574418,0.04574418,0.04574418]],

[0125] [[0.49256489,0.49256489,0.49256489,0.49256489,0.49256489],

[0126] [0.27715809,0.27715809,0.27715809,0.27715809,0.27715809],

[0127] [0.61000036,0.61000036,0.61000036,0.61000036,0.61000036]]]

[0128] Then, according to the number of columns w of the feature matrix f , generate the row index vector V x =[0,1,2], according to the number of rows of the feature matrix h f , generate the column index vector V y =[[0],[1],[2],[3]].

[0129] Then, V x Repeat h on the vertical axis f times, and the dimension is h f × f M x1 .

[0130] M x1 =[[0,1,2],[0,1,2],[0,1,2],[0,1,2]]

[0131] V y Repeat w on the horizontal axis f times, and the dimension is h f × f M y1 .

[0132] M y1 =[[0,0,0],[1,1,1],[2,2,2],[3,3,3]]

[0133] Establish the third axis on the first row of the index matrix and set M x1 Repeat K times in the third axis to get a dimension of K×h f × f The second row index matrix M x2 .

[0134] M x2 =[[[0,1,2],[0,1,2],[0,1,2],[0,1,2]],

[0135] [[0,1,2],[0,1,2],[0,1,2],[0,1,2]],

[0136] [[0,1,2],[0,1,2],[0,1,2],[0,1,2]],

[0137] [[0,1,2],[0,1,2],[0,1,2],[0,1,2]],

[0138] [[0,1,2],[0,1,2],[0,1,2],[0,1,2]]]

[0139] Establish the third axis on the first column index matrix and set M y1 Repeat K times in the third axis to get a dimension of K×h f × f The second column index matrix M y2 .

[0140] M y2 =[[[0,0,0],[1,1,1],[2,2,2],[3,3,3]],

[0141] [[0,0,0],[1,1,1],[2,2,2],[3,3,3]],

[0142] [[0,0,0],[1,1,1],[2,2,2],[3,3,3]],

[0143] [[0,0,0],[1,1,1],[2,2,2],[3,3,3]],

[0144] [[0,0,0],[1,1,1],[2,2,2],[3,3,3]]]

[0145] Furthermore, M x2 The third axis and the horizontal axis are exchanged to obtain a dimension of h f × f ×K third row index matrix M x3 .

[0146] M x3 =[[[0,0,0,0,0],[1,1,1,1,1],[2,2,2,2,2]],

[0147] [[0,0,0,0,0],[1,1,1,1,1],[2,2,2,2,2]],

[0148] [[0,0,0,0,0],[1,1,1,1,1],[2,2,2,2,2]],

[0149] [[0,0,0,0,0],[1,1,1,1,1],[2,2,2,2,2]]]

[0150] M y2 The third axis and the horizontal axis are exchanged to obtain a dimension of h f × f The third column index matrix M of ×K y3 .

[0151] M y3 =[[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]],

[0152] [[1,1,1,1,1],[1,1,1,1,1],[1,1,1,1,1]],

[0153] [[2,2,2,2,2],[2,2,2,2,2],[2,2,2,2,2]],

[0154] [[3,3,3,3,3],[3,3,3,3,3],[3,3,3,3,3]]]

[0155] If the preset coefficient is 50, then the first process matrix M f1 =M f *S.

[0156] M f1 =[[[8.867996,8.867996,8.867996,8.867996,8.867996],

[0157] [36.03682,36.03682,36.03682,36.03682,36.03682],

[0158] [16.6934125,16.6934125,16.6934125,16.6934125,16.6934125]],

[0159] [[42.007317,42.007317,42.007317,42.007317,42.007317],

[0160] [25.8483225,25.8483225,25.8483225,25.8483225,25.8483225],

[0161] [32.5581445,32.5581445,32.5581445,32.5581445,32.5581445]],

[0162] [[0.046874,0.046874,0.046874,0.046874,0.046874],

[0163] [17.5080805,17.5080805,17.5080805,17.5080805,17.5080805],

[0164] [2.287209,2.287209,2.287209,2.287209,2.287209]],

[0165] [[24.6282445,24.6282445,24.6282445,24.6282445,24.6282445],

[0166] [13.8579045,13.8579045,13.8579045,13.8579045,13.8579045],

[0167] [30.500018,30.500018,30.500018,30.500018,30.500018]]]

[0168] The preset base matrix M d The preset value D of each element in is set to 4, and the preset base matrix M is obtained. d .

[0169] M d =[[[4,4,4,4,4],[4,4,4,4,4],[4,4,4,4,4]],

[0170] [[4,4,4,4,4],[4,4,4,4,4],[4,4,4,4,4]],

[0171] [[4,4,4,4,4],[4,4,4,4,4],[4,4,4,4,4]],

[0172] [[4,4,4,4,4],[4,4,4,4,4],[4,4,4,4,4]]]

[0173] The second process matrix M f2 =f(M d ,M f1 ) / SUM(f(M d ,M<h2 style=";text-align:left;direction:ltr"> f1 <h2 style=";text-align:left;direction:ltr"> ))。<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">

[0174] <h2 style=";text-align:left;direction:ltr"> M<h2 style=";text-align:left;direction:ltr"> f2 <h2 style=";text-align:left;direction:ltr"> =[[[2.23387723e-21,2.23387723e-21,2.23387723e-21,<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">

[0175] <h2 style=";text-align:left;direction:ltr"> 2.23387723e-21,2.23387723e-21],<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">

[0176] <h2 style=";text-align:left;direction:ltr"> [5.08535461e-05,5.08535461e-05,5.08535461e-05,<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">

[0177] <h2 style=";text-align:left;direction:ltr"> 5.08535461e-05,5.08535461e-05],<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">

[0178] <h2 style=";text-align:left;direction:ltr"> [1.14928964e-16,1.14928964e-16,1.14928964e-16,<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">

[0179] <h2 style=";text-align:left;direction:ltr"> 1.14928964e-16,1.14928964e-16]],<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">

[0180] <h2 style=";text-align:left;direction:ltr"> [[1.99948714e-01,1.99948714e-01,1.99948714e-01,<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">

[0181] <h2 style=";text-align:left;direction:ltr"> 1.99948714e-01,1.99948714e-01],<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">

[0182] <h2 style=";text-align:left;direction:ltr"> [3.73451773e-11,3.73451773e-11,3.73451773e-11,<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">

[0183] <h2 style=";text-align:left;direction:ltr"> 3.73451773e-11,3.73451773e-11],<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">

[0184] <h2 style=";text-align:left;direction:ltr"> [4.09213451e-07,4.09213451e-07,4.09213451e-07,4.09213451e-07,4.09213451e-07]],<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">

[0185] <h2 style=";text-align:left;direction:ltr"> [[1.09197995e-26,1.09197995e-26,1.09197995e-26,1.09197995e-26,1.09197995e-26],<h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">

[0186] <h2 style=";text-align:left;direction:ltr"> [3.55556399e-16,3.55556399e-16,3.55556399e-16,3.55556399e-16,3.55556399e-16],<h2 style=";text-align:left;direction:ltr">

[0187] [2.43798336e-25,2.43798336e-25,2.43798336e-25,2.43798336e-25,2.43798336e-25]],

[0188] [[6.88136154e-12,6.88136154e-12,6.88136154e-12,6.88136154e-12,6.88136154e-12],

[0189] [2.25571158e-18,2.25571158e-18,2.25571158e-18,2.25571158e-18,2.25571158e-18],

[0190] [2.35957767e-08,2.35957767e-08,2.35957767e-08,2.35957767e-08,2.35957767e-08]]]

[0191] The fourth row index matrix M x4 =M f2 ·M x3 .

[0192] M x4 =

[0193] [[[0.00000000e+00,0.00000000e+00,0.00000000e+00,

[0194] 0.00000000e+00,0.00000000e+00],

[0195] [5.08535461e-05,5.08535461e-05,5.08535461e-05,

[0196] 5.08535461e-05,5.08535461e-05],

[0197] [2.29857927e-16,2.29857927e-16,2.29857927e-16,

[0198] 2.29857927e-16,2.29857927e-16]],

[0199] [[0.00000000e+00,0.00000000e+00,0.00000000e+00,

[0200] 0.00000000e+00,0.00000000e+00],

[0201] [3.73451773e-11,3.73451773e-11,3.73451773e-11,

[0202] 3.73451773e-11,3.73451773e-11],

[0203] [8.18426903e-07,8.18426903e-07,8.18426903e-07,

[0204] 8.18426903e-07,8.18426903e-07]],

[0205] [[0.00000000e+00,0.00000000e+00,0.00000000e+00,

[0206] 0.00000000e+00,0.00000000e+00],

[0207] [3.55556399e-16,3.55556399e-16,3.55556399e-16,

[0208] 3.55556399e-16,3.55556399e-16],

[0209] [4.87596671e-25,4.87596671e-25,4.87596671e-25,

[0210] 4.87596671e-25,4.87596671e-25]],

[0211] [[0.00000000e+00,0.00000000e+00,0.00000000e+00,

[0212] 0.00000000e+00,0.00000000e+00],

[0213] [2.25571158e-18,2.25571158e-18,2.25571158e-18,

[0214] 2.25571158e-18,2.25571158e-18],

[0215] [4.71915535e-08,4.71915535e-08,4.71915535e-08,

[0216] 4.71915535e-08,4.71915535e-08]]]

[0217] The fourth column index matrix M y4 =M f2 ·M y3 .

[0218] M y4 =

[0219] [[[0.00000000e+00,0.00000000e+00,0.00000000e+00,

[0220] 0.00000000e+00,0.00000000e+00],

[0221] [0.00000000e+00,0.00000000e+00,0.00000000e+00,

[0222] 0.00000000e+00,0.00000000e+00],

[0223] [0.00000000e+00,0.00000000e+00,0.00000000e+00,

[0224] 0.00000000e+00,0.00000000e+00]],

[0225] [[1.99948714e-01,1.99948714e-01,1.99948714e-01,

[0226] 1.99948714e-01,1.99948714e-01],

[0227] [3.73451773e-11,3.73451773e-11,3.73451773e-11,

[0228] 3.73451773e-11,3.73451773e-11],

[0229] [4.09213451e-07,4.09213451e-07,4.09213451e-07,4.09213451e-07,4.09213451e-07]],

[0230] [[2.18395991e-26,2.18395991e-26,2.18395991e-26,

[0231] 2.18395991e-26,2.18395991e-26],

[0232] [7.11112799e-16,7.11112799e-16,7.11112799e-16,

[0233] 7.11112799e-16,7.11112799e-16],

[0234] [4.87596671e-25,4.87596671e-25,4.87596671e-25,4.87596671e-25,4.87596671e-25]],

[0235] [[2.06440846e-11,2.06440846e-11,2.06440846e-11,

[0236] 2.06440846e-11,2.06440846e-11],

[0237] [6.76713474e-18,6.76713474e-18,6.76713474e-18,6.76713474e-18,6.76713474e-18],

[0238] [7.07873302e-08,7.07873302e-08,7.07873302e-08,

[0239] 7.07873302e-08,7.07873302e-08]]]

[0240] The first sequence X = SUM(M x4 ,axis=(0,1)).

[0241] X=[5.17192019e-05,5.17192019e-05,5.17192019e-05,

[0242] 5.17192019e-05,5.17192019e-05]

[0243] The second sequence Y = SUM(M x4 ,axis=(0,1)).

[0244] Y=[0.19994919,0.19994919,0.19994919,0.19994919,0.19994919]

[0245] Reference Figure 5 , shows a structural block diagram of a human key point recognition device of the present application, and the device may specifically include the following modules:

[0246] An acquisition module 301 is used to acquire a human body image to be identified;

[0247] The processing module 302 is used to input the human body image to be identified into the key point recognition network model obtained by pre-training, identify the human body key points in the human body image to be identified, and calculate according to the recognition result to obtain the coordinates of the human body key points in the human body image to be identified, wherein the key point recognition network model is obtained by training a preset network model based on the sample human body image and the true value human body key point coordinates in the sample human body image.

[0248] In one implementation, the processing module 302 includes:

[0249] The feature extraction submodule is used to input the human body image to be identified into a preset feature extraction network, identify the key points of the human body in the human body image to be identified, and obtain a feature matrix of the human body image to be identified, wherein the value of each element in the feature matrix is ​​the probability that the pixel point at the corresponding position in the human body image to be identified is a key point of the human body;

[0250] The coordinate calculation submodule is used to calculate the coordinates of the maximum value in the feature matrix as the coordinates of the key points of the human body in the human body image to be identified.

[0251] In one implementation, the coordinate calculation submodule includes:

[0252] A first index generating unit, used to generate a third row index matrix according to the number of columns and pages of the feature matrix, and to generate a third column index matrix according to the number of rows and pages of the feature matrix;

[0253] A second index generating unit, configured to generate a fourth row index matrix according to the preset base matrix, the preset coefficients, the characteristic matrix and the third row index matrix, and to generate a fourth column index matrix according to the preset base matrix, the preset coefficients, the characteristic matrix and the third column index matrix;

[0254] A coordinate sequence calculation unit is used to calculate the sum of the fourth row index matrix in the vertical direction axis and the horizontal direction axis as the first sequence, and calculate the sum of the fourth column index matrix in the vertical direction axis and the horizontal direction axis as the second sequence, wherein the first sequence is the horizontal coordinate of the human body key point in the human body image to be identified, and the second sequence is the vertical coordinate of the human body key point corresponding to the first sequence.

[0255] In one implementation, the first index generating unit is specifically configured to:

[0256] Generate a row index vector according to the number of columns of the feature matrix. The elements in the row index vector are natural numbers from 0 to less than the number of columns.

[0257] Repeat the row index vector several times in the vertical direction to get the first row index matrix;

[0258] Establish a third direction axis of the first row index matrix, repeat the first row index matrix several times along the third direction axis to obtain a second row index matrix;

[0259] The third direction axis and the horizontal direction axis of the second row index matrix are exchanged to obtain the third row index matrix;

[0260] Generate a column index vector according to the number of rows of the feature matrix. The elements in the column index vector are natural numbers from 0 to less than the number of rows.

[0261] Repeat the column index vector in the horizontal direction for a number of times to get the first column index matrix;

[0262] Establish a third axis of the first column index matrix, repeat the first column index matrix several times on the third axis to obtain a second column index matrix;

[0263] The third direction axis and the horizontal direction axis of the second column index matrix are exchanged to obtain the third column index matrix.

[0264] In one implementation, the second index generating unit is specifically configured to:

[0265] Multiplying the characteristic matrix with the preset coefficient to obtain a first process matrix;

[0266] Using the value of each element in the first process matrix as the exponent of the element at the corresponding position in the preset base matrix to obtain an exponential matrix;

[0267] Calculate the quotient of the exponential matrix and the sum of the elements in the exponential matrix to obtain a second process matrix;

[0268] The product of the second process matrix and the third row index matrix is ​​calculated to obtain a fourth row index matrix, and the product of the second process matrix and the third column index matrix is ​​calculated to obtain a fourth column index matrix.

[0269] In one implementation, the device further includes:

[0270] The model training module is used to obtain sample human images and true value human key point coordinates in the sample human images; input the sample human images into the preset network model, identify the human key points in the sample human images, and obtain the feature matrix of the sample human images; calculate the coordinates of the maximum value in the feature matrix of the sample human images as the predicted human key point coordinates; calculate the loss value between the true value human key point coordinates and the predicted human key point coordinates; judge whether the loss value meets the preset conditions. If not, iterate the parameters in the preset network model. If it meets, the preset network model with current parameters is used as the key point recognition network model.

[0271] It can be seen from the above that the human body key point recognition device provided by the present application is an end-to-end human body key point recognition method. In this way, after the GPU obtains the human body image to be identified, it can use the pre-trained key point recognition network model to directly calculate the coordinates of the human body key points. There is no need to generate a feature map corresponding to the human body image to be identified, and there is no need to execute the step of sending the feature map to the CPU. It is only necessary to send the coordinates of the human body key points to the CPU. Therefore, while saving the transfer overhead within the system, it can also improve the processing speed.

[0272] The present application also provides an electronic device, such as Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.

[0273] Memory 603, used for storing computer programs;

[0274] The processor 601 is used to execute the program stored in the memory 603 to implement the following steps:

[0275] Acquire a human body image to be identified;

[0276] Inputting the human body image to be identified into the pre-trained key point recognition network model, identifying the key points of the human body in the human body image to be identified, and calculating according to the recognition result to obtain the coordinates of the key points of the human body in the human body image to be identified;

[0277] Among them, the key point recognition network model is obtained by training a preset network model based on sample human images and the true value human key point coordinates in the sample human images.

[0278] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0279] The communication interface is used for communication between the above terminal and other devices.

[0280] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0281] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0282] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the human body key point recognition method described in any of the above embodiments.

[0283] In another embodiment of the present invention, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to execute the human body key point recognition method described in any one of the above embodiments.

[0284] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in this application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk SolidState Disk (SSD)), etc.

[0285] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0286] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0287] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A method for identifying key points of a human body, characterized in that: The method comprises: Acquire a human body image to be identified; Input the human image to be identified into a preset feature extraction network, identify the human key points in the human image to be identified, and obtain a feature matrix of the human image to be identified, wherein the value of each element in the feature matrix is ​​the probability that the pixel point at the corresponding position in the human image to be identified is a human key point; generate a third row index matrix according to the number of columns and pages of the feature matrix, and generate a third column index matrix according to the number of rows and pages of the feature matrix; generate a fourth row index matrix according to a preset base matrix, a preset coefficient, the feature matrix and the third row index matrix, and generate a fourth column index matrix according to the preset base matrix, the preset coefficient, the feature matrix and the third column index matrix; calculate the sum of the fourth row index matrix in the vertical direction axis and the horizontal direction axis as the first sequence, and calculate the sum of the fourth column index matrix in the vertical direction axis and the horizontal direction axis as the second sequence, wherein the first sequence is the horizontal coordinates of the human key points in the human image to be identified, and the second sequence is the vertical coordinates of the human key points in the human image to be identified corresponding to the first sequence; The key point recognition network model is obtained by training a preset network model based on a sample human body image and true value human key point coordinates in the sample human body image.

2. The method according to claim 1, characterized in that The step of generating a third row index matrix according to the number of columns and pages of the feature matrix, and generating a third column index matrix according to the number of rows and pages of the feature matrix, comprises: Generate a row index vector according to the number of columns of the feature matrix, where the elements in the row index vector are natural numbers from 0 to a number less than the number of columns; Repeat the row index vector in the vertical direction axis for the number of times to obtain a first row index matrix; Establishing a third axial direction of the first row index matrix, repeating the first row index matrix on the third axial direction for the number of pages to obtain a second row index matrix; Swapping the third direction axis and the horizontal direction axis of the second row index matrix to obtain a third row index matrix; Generate a column index vector according to the number of rows of the feature matrix, where the elements in the column index vector are natural numbers from 0 to a number less than the number of rows; Repeat the column index vector in the horizontal direction axis for the number of times of the column to obtain a first column index matrix; Establishing a third axial direction of the first column index matrix, repeating the first column index matrix on the third axial direction for the number of pages to obtain a second column index matrix; The third direction axis and the horizontal direction axis of the second column of the index matrix are exchanged to obtain a third column of the index matrix.

3. The method according to claim 1, characterized in that The step of generating a fourth row index matrix according to the preset base matrix, the preset coefficients, the characteristic matrix, and the third row index matrix, and generating a fourth column index matrix according to the preset base matrix, the preset coefficients, the characteristic matrix, and the third column index matrix includes: Multiplying the characteristic matrix by a preset coefficient to obtain a first process matrix; Using the value of each element in the first process matrix as the exponent of the element at the corresponding position in the preset base matrix to obtain an exponential matrix; Calculate the quotient of the exponential matrix and the sum of the elements in the exponential matrix to obtain a second process matrix; The product of the second process matrix and the third row index matrix is ​​calculated to obtain a fourth row index matrix, and the product of the second process matrix and the third column index matrix is ​​calculated to obtain a fourth column index matrix.

4. The method according to claim 1, characterized in that: The key point recognition network model is trained by the following steps: Acquire the sample human body image and true value human body key point coordinates in the sample human body image; Inputting the sample human body image into a preset network model, identifying key points of the human body in the sample human body image, and obtaining a feature matrix of the sample human body image; Calculating the coordinates of the maximum value in the feature matrix of the sample human body image as the predicted coordinates of the human body key points; Calculate the loss value between the true value human body key point coordinates and the predicted human body key point coordinates; Determine whether the loss value meets the preset conditions. If not, iterate the parameters in the preset network model. If it meets the conditions, use the preset network model with the current parameters as the key point recognition network model.

5. A human body key point recognition device, characterized in that: The device comprises: An acquisition module, used for acquiring a human body image to be identified; A processing module is used to input the human body image to be identified into a preset feature extraction network, identify the human body key points in the human body image to be identified, and obtain a feature matrix of the human body image to be identified, wherein the value of each element in the feature matrix is ​​the probability that the pixel point at the corresponding position in the human body image to be identified is a human body key point; generate a third row index matrix according to the number of columns and pages of the feature matrix, and generate a third column index matrix according to the number of rows and pages of the feature matrix; generate a fourth row index matrix according to a preset base matrix, a preset coefficient, the feature matrix and the third row index matrix, and generate a fourth row index matrix according to the preset base matrix, the preset coefficient, the feature matrix and the third row index matrix, and generate a fourth row index matrix according to the preset base matrix, the preset coefficient, the feature matrix and the third row index matrix. number, the feature matrix and the third column index matrix to generate a fourth column index matrix; calculate the sum of the fourth row index matrix in the vertical direction axis and the horizontal direction axis as the first sequence, and calculate the sum of the fourth column index matrix in the vertical direction axis and the horizontal direction axis as the second sequence, wherein the first sequence is the horizontal coordinates of the human body key points in the human body image to be identified, and the second sequence is the vertical coordinates of the human body key points in the human body image to be identified corresponding to the first sequence, wherein the key point recognition network model is obtained by training a preset network model based on the sample human body image and the true value human body key point coordinates in the sample human body image.

6. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 4 when executing a program stored in a memory.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Human body key point recognition method and device, and electronic equipment

    CN111027412A