Method, device, computer equipment and storage medium for generating perception model
Through the method of feature extraction and network correction of image sequences, the problem of low efficiency in human 3D posture and morphology perception in multi-subject scenes is solved, and efficient and accurate multi-subject perception effects are achieved.
Patent Information
- Application Number
- CN202310707536.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-14
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2043-06-14
AI Technical Summary
It is difficult for the existing technology to efficiently and accurately perceive the 3D posture and form of the human body in multi-subject scenarios. Especially in interactive scenarios such as short videos, live broadcasts, and online education, a more accurate 3D posture and form of the human body model is needed. method of perception.
By obtaining the training data set, extracting the features of the image sequence, inputting the spatiotemporal feature extraction network and perception network in the initial perception model, and performing network correction based on the difference between the perception results and the annotated data until the trained perception model is obtained, thereby achieving multi-dimensional 3D pose and form perception of individual subjects.
The efficiency and perception speed of the generated perception model in multi-subject scenarios are improved, and the 3D posture and form of multiple subjects can be perceived at one time, which expands the scope of application and robustness of the perception model.
Smart Images

Figure CN116664730B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, especially to technical fields such as computer vision, augmented reality, virtual reality, and deep learning, and can be applied to scenarios such as the metaverse. Specifically, it relates to a method, device, computer equipment, and storage medium for generating a perception model. Background Art
[0002] With the continuous rise of industries such as short videos, live broadcasts, and online education, there are more and more functional demands for interaction based on human body model reconstruction information in various interactive scenarios. Therefore, a method is needed to more accurately perceive the 3D posture and morphology of the human body model. Summary of the invention
[0003] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
[0004] The first embodiment of the present disclosure provides a method for generating a perception model, including:
[0005] Acquire a training data set, wherein the training data set includes a plurality of image sequences and 3D posture and morphology annotation data corresponding to each of the image sequences;
[0006] Performing feature extraction and segmentation on each image frame in the image sequence to obtain an image feature sequence corresponding to each image frame, wherein the image feature sequence includes features of multiple image blocks;
[0007] Input each of the image feature sequences into the spatiotemporal feature extraction network in the initial perception model to obtain the spatiotemporal feature sequence corresponding to the image sequence;
[0008] Inputting the spatiotemporal feature sequence into the perception network in the initial perception model to obtain the perception result corresponding to the image sequence;
[0009] Based on the difference between the perception result and the labeled data, the spatiotemporal feature extraction network and the perception network are modified until a trained perception model is obtained.
[0010] In a second aspect of the present disclosure, a device for generating a perception model is provided, comprising:
[0011] A first acquisition module is used to acquire a training data set, wherein the training data set includes a plurality of image sequences and 3D posture and morphology annotation data corresponding to each of the image sequences;
[0012] A second acquisition module is used to extract and segment each image frame in the image sequence to obtain an image feature sequence corresponding to each image frame, wherein the image feature sequence includes features of multiple image blocks;
[0013] A third acquisition module is used to input each of the image feature sequences into the spatiotemporal feature extraction network in the initial perception model to obtain the spatiotemporal feature sequence corresponding to the image sequence;
[0014] A fourth acquisition module, used for inputting the spatiotemporal feature sequence into the perception network in the initial perception model to obtain the perception result corresponding to the image sequence;
[0015] The fifth acquisition module is used to modify the spatiotemporal feature extraction network and the perception network based on the difference between the perception result and the labeled data until a trained perception model is obtained.
[0016] The third aspect embodiment of the present disclosure proposes a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method for generating a perception model proposed in the first aspect embodiment of the present disclosure is implemented.
[0017] The fourth aspect embodiment of the present disclosure proposes a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the method for generating a perception model proposed in the first aspect embodiment of the present disclosure is implemented.
[0018] The fifth aspect embodiment of the present disclosure proposes a computer program product, including a computer program, which, when executed by a processor, implements the method for generating a perception model as proposed in the first aspect embodiment of the present disclosure.
[0019] The method, device, computer equipment and storage medium for generating a perception model provided by the present disclosure have the following beneficial effects:
[0020] In the disclosed embodiment, a training data set is first obtained, and feature extraction and segmentation are performed on each image frame in the image sequence to obtain an image feature sequence corresponding to each image frame. Each image feature sequence is then input into the spatiotemporal feature extraction network in the initial perception model to obtain the spatiotemporal feature sequence corresponding to the image sequence. The spatiotemporal feature sequence is then input into the perception network in the initial perception model to obtain the perception result corresponding to the image sequence. Then, based on the difference between the perception result and the annotated data in the training data set, the spatiotemporal feature extraction network and the perception network are corrected until a trained perception model is obtained. As a result, the perception model can perceive multiple subjects at one time, thereby improving the efficiency and perception speed of the generated perception model in multi-subject scenarios.
[0021] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0023] Figure 1 A schematic diagram of a flow chart of a method for generating a perception model provided by an embodiment of the present disclosure;
[0024] Figure 2 A flowchart of a method for generating a perception model provided by another embodiment of the present disclosure
[0025] Figure 3 A schematic diagram of a flow chart of a 3D posture and shape perception method provided by an embodiment of the present disclosure;
[0026] Figure 4 A schematic diagram of the structure of a device for generating a perception model provided by an embodiment of the present disclosure;
[0027] Figure 5 A schematic diagram of the structure of a 3D posture and shape perception device provided by an embodiment of the present disclosure;
[0028] Figure 6 A block diagram of an exemplary computer device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0029] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0030] The embodiments of the present disclosure relate to the fields of artificial intelligence technology such as computer vision, deep learning, and image processing.
[0031] Artificial Intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence.
[0032] Deep learning is the process of learning the inherent laws and representation levels of sample data. The information obtained in the learning process is of great help in interpreting data such as text, images, and sounds. The ultimate goal of deep learning is to enable machines to have analytical learning capabilities like humans and to be able to recognize data such as text, images, and sounds.
[0033] Computer vision refers to the use of cameras and computers to replace the human eye to identify, track and measure targets, and further perform graphic processing so that the computer processing becomes an image that is more suitable for human eye observation or transmission to instrument detection.
[0034] Image processing usually refers to the technology of using computers to analyze images to achieve the desired results. It is also called image processing. Image processing generally refers to digital image processing. A digital image refers to a large two-dimensional array obtained by shooting with industrial cameras, video cameras, scanners and other equipment. The elements of the array are called pixels, and their values are called grayscale values. Image processing technology generally includes three parts: image compression, enhancement and restoration, matching, description and recognition.
[0035] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0036] The method for generating a perceptual model in the embodiment of the present disclosure can be executed by the device for generating a perceptual model in the embodiment of the present disclosure, and the device can be configured in a computer device, which is not limited in the present disclosure. The computer device can be any device with computing capabilities, such as a mobile phone, a tablet computer, a personal computer, a personal digital assistant, and other hardware devices with various operating systems, touch screens, and / or display screens. The embodiment of the present disclosure takes the configuration of the device for generating a perceptual model in the generation system of the perceptual model as an example.
[0037] The following describes the method, apparatus, computer device and storage medium for generating a perception model according to an embodiment of the present disclosure with reference to the accompanying drawings.
[0038] Figure 1 A flowchart of a method for generating a perception model provided in one embodiment of the present disclosure.
[0039] like Figure 1 As shown, the method for generating the perception model may include:
[0040] Step 101: Acquire a training data set, wherein the training data set includes a plurality of image sequences and 3D posture and morphology annotation data corresponding to each image sequence.
[0041] Here, an image sequence refers to a plurality of images in an orderly manner in a video.
[0042] Among them, 3D posture and morphology annotation data refers to the information used to describe human posture and movement in image sequences.
[0043] In some possible implementation forms, after acquiring the training data set, the perception model generation system may also pre-process the training data set, for example, by scaling the images in the image sequence at different scales, rotating them at different angles, and performing disturbance enhancement in the color space to generate a new image sequence, and then adding the newly generated image sequence and the corresponding 3D posture and morphological annotation data to the training data set to expand the training data set. The present disclosure does not limit this.
[0044] Step 102 , extracting and segmenting features of each image frame in the image sequence to obtain an image feature sequence corresponding to each image frame, wherein the image feature sequence includes features of multiple image blocks.
[0045] In some possible implementation forms, the generation system of the perception model can first use the Backbone Network to perform feature extraction for each image frame in the image sequence to obtain the depth feature Ft corresponding to the image frame, and its dimension is H*W*C, where H and W are the image resolutions, and C is the feature latitude (such as 256, 512, etc.). The depth feature Ft is then divided into L=B*B image blocks in the latitude of H*W, and each image block is encoded as a feature with a latitude of D to obtain an image feature sequence corresponding to each image frame. Among them, the value of L can be a value determined according to the resolution of the image frame, or it can be a fixed value preset in the generation system of the perception model, etc. The latitude D can be obtained by compressing or amplifying the feature dimension C, and the present disclosure is not limited to this.
[0046] It should be noted that in the present disclosure, by dividing each image frame into image feature sequences corresponding to multiple image blocks, the features of each image block can be extracted and perceived in time and space, so that when the image sequence is an image of a multi-person scene, the features of each person can be identified.
[0047] Step 103, input each image feature sequence into the spatiotemporal feature extraction network in the initial perception model to obtain the spatiotemporal feature sequence corresponding to the image sequence.
[0048] The initial perception model may be an existing perception model, or a model obtained by fine-tuning or transfer learning of an existing perception model, etc., and the present disclosure does not limit this.
[0049] Among them, the spatiotemporal feature extraction network can include two parts: a temporal feature extraction network and a spatial feature extraction network.
[0050] In some possible implementation forms, multiple area blocks corresponding to the image frames at each moment in the image sequence can first be taken as a patch and input into the spatial feature extraction network in the initial perception model, so that the depth features can be encoded into L*D spatial fusion features through spatial perception (SE). Then, the spatial fusion features corresponding to each image frame in the image sequence are taken as a patch and input into the temporal feature extraction network in the initial perception model, so that the spatial fusion features corresponding to all image frames can be obtained through temporal perception (TE) to obtain the spatiotemporal fusion features between multiple image frames. After that, the parameters of the SE and TE networks can be kept unchanged, and the SE and TE processes can be cycled 2-6 times to obtain the spatiotemporal feature sequence corresponding to the image sequence, with the latitude of T*L*D, where L=B*B.
[0051] Step 104: input the spatiotemporal feature sequence into the perception network in the initial perception model to obtain the perception result corresponding to the image sequence.
[0052] Among them, the perception network may include a key point prediction module and a morphology prediction module, so the acquired perception results may include three-dimensional (3D) key points representing each subject in the image sequence and second posture and morphology parameters describing each subject, etc.
[0053] In some possible implementation forms, the generation system of the perception model is based on the spatiotemporal feature sequence of the image sequence. The perception network in the initial perception model can perform key point prediction and morphology prediction for each area block on each image frame respectively, and use the key point prediction (Pose Detection, PD) module to directly regress the coordinates of the 3D key points of each human body in the image sequence, and use the morphology prediction (Shape Detection, SD) module to predict SMPL (Skinned Multi-Person Linear).
[0054] Step 105, based on the difference between the perception result and the labeled data, the spatiotemporal feature extraction network and the perception network are modified until a trained perception model is obtained.
[0055] In the disclosed embodiment, the perception model generation system can determine a correction gradient based on the difference between the perception results and the labeled data, and then perform multiple corrections on the corresponding parameters of the spatiotemporal feature extraction network and the perception network based on the correction gradient to obtain a trained perception model.
[0056] In some possible implementations, the annotated data may include 2D key points. In this case, the generation system of the perception model needs to project the predicted SMPL parameters into a two-dimensional plane to obtain 2D key point information, and then correct the network based on the difference between the two.
[0057] In this embodiment, a training data set is first obtained, and feature extraction and segmentation are performed on each image frame in the image sequence in the training data set to obtain an image feature sequence corresponding to each image frame, and then each image feature sequence is respectively input into the spatiotemporal feature extraction network in the initial perception model to obtain the spatiotemporal feature sequence corresponding to the image sequence, and then the spatiotemporal feature sequence is input into the perception network in the initial perception model to obtain the perception result corresponding to the image sequence, and then based on the difference between the perception result and the annotated data in the training data set, the spatiotemporal feature extraction network and the perception network are corrected until the trained perception model is obtained. Thus, by dividing each image frame in the image sequence into multiple image blocks and then performing model training, the generated perception model can perceive the 3D postures and forms corresponding to multiple subjects at one time, thereby improving the efficiency and perception speed of the generated perception model in multi-subject scenes.
[0058] Figure 2 A flowchart of a method for generating a perception model provided in another embodiment of the present disclosure.
[0059] like Figure 2 As shown, the method for generating the perception model may include:
[0060] Step 201 : obtaining a training data set, wherein the training data set includes a plurality of image sequences and 3D posture and morphology annotation data corresponding to each image sequence.
[0061] The specific implementation form of the above step 201 can refer to the above embodiments of the present disclosure, which will not be repeated here.
[0062] Step 202, when the number of images contained in any image sequence is greater than a first number, and a first difference between the number of images contained in any image sequence and the first number is greater than a first threshold, divide any image sequence into a first number of sub-sequences, wherein a second difference between the number of images contained in every two sub-sequences is less than a second threshold.
[0063] Step 203: extract an image from each subsequence to generate a new image sequence.
[0064] The first number refers to the number of images that a preset perception model can process simultaneously each time, such as 5, 10, etc., and this disclosure does not limit this.
[0065] Among them, the first threshold can be a fixed value preset in the generation system of the perception model, or it can be a value that changes according to the first quantity. For example, when the first quantity is 5, the first threshold can be 3, 4 or 5, or when the first quantity is 10, the first threshold can be 7, 8, 9 or 10, etc. The present disclosure does not limit this.
[0066] The second threshold refers to a value preset in the generation system of the perception model and used to control the number of images in all subsequences to be as equal as possible. For example, the second threshold is 0, 1 or 2, etc., and the present disclosure does not limit this.
[0067] For example, when the first number is 5, the first threshold is 4, and the second threshold is 2, and any image sequence contains 12 images, since the first difference is 12-5=7, 7>4, then the image sequence can be divided into 5 subsequences, and the second difference between the number of images contained in every two subsequences is less than 2, then the number of images contained in the 5 subsequences may be 3, 3, 2, 2, and 2. Then, one image can be randomly selected from each subsequence to generate a new image sequence.
[0068] In the disclosed embodiment, when the number of images contained in any image sequence is much larger than the number of images that the perception model can process simultaneously at a time, the image sequence is divided as evenly as possible into multiple image subsequences, and then an image is extracted from each image subsequence to generate a new image sequence for processing. This ensures that the extracted image frames can reflect the subject contained in the entire image sequence to the greatest extent, covering the deviation caused by the changes in the speed of the subject during movement.
[0069] Optionally, when the number of images included in any image sequence is greater than a first number, and a first difference between the number of images included in any image sequence and the first number is less than or equal to a first threshold, a first number of images may be randomly extracted from any image sequence to generate a new image sequence. Thus, when the number of images included in any image sequence is a finite number more than the number of images that can be processed simultaneously by the perception model each time, images may be directly extracted from any image sequence to generate a new image sequence, thereby ensuring that the new image sequence is an image sequence that can be processed by the perception model and improving the efficiency of image extraction.
[0070] It should be noted that, since the feature changes between every two consecutive images in the image sequence are not significant, in order to make the extracted images representative, a first number of images that are not completely consecutive may be extracted as a new image sequence.
[0071] Taking the above example, when the number of images in the image sequence is 7, since the first difference is 7-5=2, 2<4, 5 incompletely continuous images can be randomly selected from the above image sequence to generate a new image sequence. Alternatively, when the number of images in the image sequence is 8, since the first difference is 8-5=3, 3<5, 5 incompletely continuous images can also be randomly selected from the image sequence to generate a new image sequence.
[0072] Optionally, when the number of images included in any image sequence is greater than the first number, any image sequence may be divided into multiple image subsequences, wherein the number of images included in each divided image subsequence is equal to the first number.
[0073] That is, when the number of images contained in any image sequence is greater than the number of images that can be processed simultaneously by the perception model each time, the image sequence can be segmented into multiple image sequences containing the first number of images. This not only enables the segmented image sequences to be processed by the perception model, but also further enriches the amount of training data, providing conditions for further improving the robustness of the perception model.
[0074] It should be noted that if the number of images contained in any image sequence is less than the first number, then the images in any image sequence can be upsampled to obtain an image sequence that can be processed by the perception model.
[0075] Step 204 , extracting and segmenting features of each image frame in the image sequence to obtain an image feature sequence corresponding to each image frame, wherein the image feature sequence includes features of multiple image blocks.
[0076] Step 205 , input each image feature sequence into the spatiotemporal feature extraction network in the initial perception model to obtain the spatiotemporal feature sequence corresponding to the image sequence.
[0077] Step 206: input the spatiotemporal feature sequence into the perception network in the initial perception model to obtain the perception result corresponding to the image sequence.
[0078] The specific implementation of the above steps 204-206 can refer to the above embodiments of the present disclosure and will not be repeated here.
[0079] Step 207, determining a first difference between the target block in the labeled data and the predicted block in the perception result, and a second difference between the first posture and morphological parameters in the labeled data and the second posture and morphological parameters in the perception result.
[0080] The target block refers to the area block in the image of the subject associated with the 3D posture and morphology data in the 3D posture and morphology annotation data. The target block may be one area block in the image or multiple area blocks in the image. Optionally, since the image sequence may include multiple subjects, and there may be overlapping areas between multiple subjects, in the present disclosure, each subject may correspond to a target block, such as determining the block where the center of the subject is located as its target block, etc., and the present disclosure does not limit this.
[0081] The prediction block refers to a block of a subject in an image associated with posture and morphological parameters predicted by the perception network, which may be one image block or multiple image blocks. Optionally, the prediction block may be a block where the center of the subject predicted by the perception network is located.
[0082] Among them, the posture and morphological parameters can be any form of parameters or vectors that can describe the size and shape of a human body, such as height, chest circumference, waist circumference, hip circumference, and the rotation status of all body joints, and the present disclosure does not limit this.
[0083] In the disclosed embodiment, the first difference may be determined based on the distance between the target block and the prediction block, and the average value of the difference between each corresponding parameter in the first posture and morphology parameter and the second posture and morphology parameter may be determined as the second difference.
[0084] Step 208: determining a correction gradient based on the first difference and the second difference.
[0085] In the embodiment of the present disclosure, the first difference and the second difference may be averaged (weighted) to obtain a correction gradient.
[0086] Optionally, the correction gradients corresponding to the spatiotemporal feature extraction network and the perception network may be determined based on different weight pairs. For example, the first correction gradient corresponding to the perception network may be determined based on the first difference, the second difference, and the first weight pair, and then the second correction gradient corresponding to the spatiotemporal feature extraction network may be determined based on the first difference, the second difference, and the second weight pair.
[0087] The first weight pair includes two weight values representing the influence of the first difference and the second difference on the perception network, which can be preset in the generation system of the perception model. Similarly, the second weight pair also includes two weight values representing the influence of the first difference and the second difference on the feature extraction network.
[0088] In the embodiments of the present disclosure, by calculating the correction gradients corresponding to the perception network and the spatiotemporal feature extraction network based on different weight pairs, different gradient corrections can be performed on the perception network and the spatiotemporal feature extraction network, respectively, providing conditions for further improving the training efficiency of the perception model.
[0089] Step 209, based on the correction gradient, the spatiotemporal feature extraction network and the perception network are respectively corrected until a trained perception model is obtained.
[0090] In the disclosed embodiment, if the spatiotemporal feature extraction network and the perception network correspond to different correction gradients respectively, then after obtaining the first correction gradient and the second correction gradient, the key point prediction module and the morphology prediction module of the perception network can be corrected based on the first correction gradient, and the parameters corresponding to the temporal feature extraction network and the spatial feature extraction network in the spatiotemporal extraction network can be corrected based on the second correction gradient until the trained perception model is obtained.
[0091] In the disclosed embodiment, the perception model is corrected and trained based on a first difference between a target block in the annotated data and a predicted block in the perception result, and a second difference between a first posture and morphological parameter in the annotated data and a second posture and morphological parameter in the perception result. This allows the perception model generated by the training to not only perceive the 3D posture and morphology of a single subject, but also, when an image sequence contains multiple subjects, to perceive the 3D posture and morphology of each subject. This not only improves the robustness of the perception model, but also expands the scope of application of the perception model.
[0092] In this embodiment, the system for generating the perception model first obtains a training data set, and then, when the number of images included in any image sequence is greater than a first number, and the first difference between the number of images included in any image sequence and the first number is greater than a first threshold, the image sequence is divided into a first number of subsequences, wherein the second difference between the number of images included in each two subsequences is less than a second threshold. Then, an image is extracted from each subsequence to generate a new image sequence, and then feature extraction and segmentation are performed on each image frame in the image sequence to obtain an image feature sequence corresponding to each image frame, and then each image feature sequence is respectively input into the spatiotemporal feature extraction network in the initial perception model to obtain the spatiotemporal feature sequence corresponding to the image sequence, and then the spatiotemporal feature sequence is input into the perception network in the initial perception model to obtain the perception result corresponding to the image sequence, and then the first difference between the target block in the annotation data and the predicted block in the perception result, and the second difference between the first posture and morphological parameters in the annotation data and the second posture and morphological parameters in the perception result are determined, and based on the first difference and the second difference, a correction gradient is determined, and the spatiotemporal feature extraction network and the perception network are respectively corrected until the trained perception model is obtained. Therefore, by correcting and training the perception model based on multi-dimensional differences, the trained perception model can not only perceive the 3D posture and form of a single subject, but also perceive the 3D posture and form of each subject when the image sequence contains multiple subjects. This not only improves the robustness of the perception model, but also expands the scope of application of the perception model.
[0093] Figure 3 A flowchart of a 3D posture and shape perception method provided by an embodiment of the present disclosure.
[0094] like Figure 3 As shown, the 3D posture and shape perception method may include:
[0095] Step 301: Obtain an image sequence to be processed.
[0096] Step 302, extracting and segmenting each image frame in the image sequence to obtain an image feature sequence corresponding to each image frame, wherein the image feature sequence includes features of multiple image blocks. The specific implementation process of the above steps 301 and 302 can refer to the detailed description of other embodiments of the present disclosure, and will not be repeated here.
[0097] Step 303: input each image feature sequence into a preset perception model to obtain the 3D posture and morphological parameters of the subject contained in the image sequence.
[0098] Among them, the preset perception model is generated using the perception model generation method of the above embodiment of the present disclosure.
[0099] Since the size of the image sequence that can be processed by the perception model is limited, that is, the number of images that can be processed simultaneously by the perception model is limited, after obtaining the image sequence to be processed, it is necessary to first determine whether the size of the image sequence meets the requirements of the perception model. If it does not meet the requirements of the perception model, the image sequence to be processed needs to be processed first, such as upsampling, downsampling, etc., which is not limited in this disclosure.
[0100] Optionally, when the number of images included in the image sequence is greater than the first number, and the first difference between the number of images included in the image sequence and the first number is greater than the first threshold, the image sequence can be divided into a first number of subsequences, wherein the second difference between the number of images included in every two subsequences is less than the second threshold. Then, an image is extracted from each subsequence to generate a new image sequence to be processed, and then feature extraction and segmentation are performed on each image frame in the new image sequence to be processed. This ensures that the extracted image frame can reflect the subject included in the entire image sequence to the greatest extent, covering the deviation effect caused by the change in the speed of the subject during movement.
[0101] Optionally, when the number of images contained in any image sequence is greater than the first number, any image sequence can also be divided into multiple image subsequences, wherein the number of images contained in each image subsequence after division is equal to the first number, and then feature extraction and segmentation are performed on each image frame in each image subsequence, and then the image feature sequence corresponding to each image subsequence is processed using the perception model to determine the 3D posture and morphological parameters of the subject contained in each image subsequence. In this way, not only the segmented image sequence can be processed by the perception model, but also the amount of training data is further enriched, providing conditions for further improving the robustness of the perception model.
[0102] It is understandable that, since different image subsequences may include the same image frames, the recognition results corresponding to different image subsequences may overlap. At this time, the 3D posture and morphological parameters of the subject respectively included in each image subsequence are fused to obtain the 3D posture and morphological parameters of the subject included in the image sequence to be processed.
[0103] In this embodiment, firstly, an image sequence to be processed is obtained. When the number of images contained in the image sequence is greater than a first number, and the first difference between the number of images contained in the image sequence and the first number is greater than a first threshold value, the image sequence is divided into a first number of subsequences, and then an image is extracted from each subsequence to generate a new image sequence to be processed. After that, feature extraction and segmentation are performed on each image frame in the new image sequence to obtain an image feature sequence corresponding to each image frame, and then each image feature sequence is input into a preset perception model to obtain the 3D posture and morphological parameters of the subject contained in the image sequence. Thus, before perceiving the image sequence, each image frame in the image sequence is first divided into a plurality of image blocks, so that the perception model can perceive the 3D posture and morphological parameters of the plurality of subjects contained in the image sequence through one-time processing, thereby improving the perception efficiency in multi-subject scenes.
[0104] In order to implement the above embodiments, the present disclosure also proposes a device for generating a perception model.
[0105] Figure 4 A schematic diagram of the structure of a device for generating a perception model provided in an embodiment of the present disclosure.
[0106] like Figure 4 As shown, the perceptual model generation device 400 includes:
[0107] The first acquisition module 401 is used to acquire a training data set, wherein the training data set includes a plurality of image sequences and 3D posture and morphology annotation data corresponding to each image sequence.
[0108] The second acquisition module 402 is used to extract and segment each image frame in the image sequence to obtain an image feature sequence corresponding to each image frame, wherein the image feature sequence includes features of multiple image blocks.
[0109] The third acquisition module 403 is used to input each image feature sequence into the spatiotemporal feature extraction network in the initial perception model to obtain the spatiotemporal feature sequence corresponding to the image sequence.
[0110] The fourth acquisition module 404 is used to input the spatiotemporal feature sequence into the perception network in the initial perception model to obtain the perception result corresponding to the image sequence.
[0111] The fifth acquisition module 405 is used to modify the spatiotemporal feature extraction network and the perception network based on the difference between the perception result and the labeled data until a trained perception model is obtained.
[0112] Optionally, the second acquisition module 402 further includes:
[0113] The first segmentation unit is used to divide any image sequence into a first number of subsequences when the number of images contained in any image sequence is greater than a first number and a first difference between the number of images contained in any image sequence and the first number is greater than a first threshold, wherein a second difference between the number of images contained in every two subsequences is less than a second threshold.
[0114] The first generating unit is used to extract an image from each subsequence to generate a new image sequence.
[0115] Optionally, the second acquisition module 402 further includes:
[0116] The second generating unit is configured to randomly extract a first number of images from any image sequence to generate a new image sequence when the number of images included in any image sequence is greater than the first number and a first difference between the number of images included in any image sequence and the first number is less than or equal to a first threshold. Or,
[0117] The second segmentation unit is used to segment any image sequence into multiple image subsequences when the number of images included in any image sequence is greater than the first number, wherein the number of images included in each image subsequence after segmentation is equal to the first number.
[0118] Optionally, the fifth acquisition module 405 is specifically configured to:
[0119] determining a first difference between a target block in the annotated data and a predicted block in the perceived result, and a second difference between a first pose and morphological parameter in the annotated data and a second pose and morphological parameter in the perceived result,
[0120] Based on the first difference and the second difference, a correction gradient is determined.
[0121] The spatiotemporal feature extraction network and the perception network are corrected respectively based on the corrected gradient.
[0122] Optionally, the fifth acquisition module 405 may also be used to:
[0123] Based on the first difference, the second difference and the first weight pair, a first correction gradient corresponding to the perception network is determined.
[0124] Based on the first difference, the second difference and the second weight pair, a second revised gradient corresponding to the spatiotemporal feature extraction network is determined.
[0125] It should be noted that the aforementioned explanation of the method for generating a perceptual model is also applicable to the device for generating a perceptual model of this embodiment and will not be repeated here.
[0126] In this embodiment, a training data set is first obtained, and feature extraction and segmentation are performed on each image frame in the image sequence in the training data set to obtain an image feature sequence corresponding to each image frame, and then each image feature sequence is respectively input into the spatiotemporal feature extraction network in the initial perception model to obtain the spatiotemporal feature sequence corresponding to the image sequence, and then the spatiotemporal feature sequence is input into the perception network in the initial perception model to obtain the perception result corresponding to the image sequence, and then based on the difference between the perception result and the annotated data in the training data set, the spatiotemporal feature extraction network and the perception network are corrected until the trained perception model is obtained. As a result, the generated perception model can perceive the 3D postures and forms corresponding to multiple subjects at one time, thereby improving the efficiency and perception speed of the generated perception model in multi-subject scenes.
[0127] Figure 5 A schematic diagram of the structure of a 3D posture and shape perception device provided in an embodiment of the present disclosure.
[0128] like Figure 5 As shown, the 3D posture and shape perception device 500 includes:
[0129] The sixth acquisition module 501 is used to acquire an image sequence to be processed.
[0130] The seventh acquisition module 502 is used to perform feature extraction and segmentation on each image frame in the image sequence to obtain an image feature sequence corresponding to each image frame, wherein the image feature sequence includes features of multiple image blocks.
[0131] The eighth acquisition module 503 is used to input each image feature sequence into a preset perception model to obtain the 3D posture and morphological parameters of the subject contained in the image sequence, wherein the preset perception model is the perception model generated in the above embodiment of the present disclosure.
[0132] Optionally, the seventh acquisition module further includes:
[0133] When the number of images contained in the image sequence is greater than a first number, and a first difference between the number of images contained in the image sequence and the first number is greater than a first threshold, the image sequence is divided into a first number of sub-sequences, wherein a second difference between the number of images contained in every two sub-sequences is less than a second threshold.
[0134] An image is extracted from each subsequence to generate a new image sequence to be processed.
[0135] Perform feature extraction and segmentation on each image frame in the new image sequence to be processed.
[0136] Optionally, the seventh acquisition module further includes:
[0137] When the number of images included in any image sequence is greater than a first number, dividing any image sequence into a plurality of image subsequences, wherein the number of images included in each divided image subsequence is equal to the first number;
[0138] Feature extraction and segmentation are performed on each image frame in each image subsequence.
[0139] It should be noted that the above explanation of the 3D posture and shape perception method is also applicable to the 3D posture and shape perception device of this embodiment, and will not be repeated here.
[0140] In this embodiment, firstly, an image sequence to be processed is obtained. When the number of images contained in the image sequence is greater than a first number, and the first difference between the number of images contained in the image sequence and the first number is greater than a first threshold value, the image sequence is divided into a first number of subsequences, and then an image is extracted from each subsequence to generate a new image sequence to be processed. After that, feature extraction and segmentation are performed on each image frame in the new image sequence to obtain an image feature sequence corresponding to each image frame, and then each image feature sequence is input into a preset perception model to obtain the 3D posture and morphological parameters of the subject contained in the image sequence. Thus, before perceiving the image sequence, each image frame in the image sequence is first divided into a plurality of image blocks, so that the perception model can perceive the 3D posture and morphological parameters of the plurality of subjects contained in the image sequence through one-time processing, thereby improving the perception efficiency in multi-subject scenes.
[0141] In order to implement the above embodiments, the present disclosure also proposes a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the perception model generation method or 3D posture and morphology perception method proposed in the aforementioned embodiments of the present disclosure.
[0142] In order to implement the above embodiments, the present disclosure also proposes a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the perception model generation method or 3D posture and morphology perception method proposed in the aforementioned embodiments of the present disclosure.
[0143] In order to implement the above embodiments, the present disclosure also proposes a computer program product, including a computer program. When the computer program is executed by a processor, it implements the perception model generation method or 3D posture and morphology perception method proposed in the above embodiments of the present disclosure.
[0144] Figure 6 A block diagram of an exemplary computer device suitable for implementing embodiments of the present disclosure is shown. Figure 6The computer device 601 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0145] like Figure 6 As shown, the computer device 601 is in the form of a general-purpose computing device. The components of the computer device 601 may include, but are not limited to: one or more processors or processing units 602, a system memory 603, and a bus 604 connecting different system components (including the system memory 603 and the processing unit 602).
[0146] Bus 604 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnection (PCI) bus.
[0147] The computer device 601 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 601, including volatile and non-volatile media, removable and non-removable media.
[0148] The memory 603 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 605 and / or cache memory 606. The computer device 601 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 607 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 not shown, usually called a "hard drive"). Although Figure 6Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a compact disc read-only memory (CD-ROM), a digital versatile disc read-only memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to the bus 604 via one or more data medium interfaces. The memory 603 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the various embodiments of the present disclosure.
[0149] A program / utility 609 having a set (at least one) of program modules 608 may be stored, for example, in the memory 603, such program modules 608 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 608 generally perform the functions and / or methods of the embodiments described in the present disclosure.
[0150] The computer device 601 may also communicate with one or more external devices 610 (e.g., keyboard, pointing device, display 611, etc.), one or more devices that enable a user to interact with the computer device 601, and / or any device that enables the computer device 601 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via an input / output (I / O) interface 612. Furthermore, the computer device 601 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 613. As shown, the network adapter 613 communicates with other modules of the computer device 601 via a bus 604. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer device 601, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0151] The processing unit 602 executes various functional applications and data processing by running the programs stored in the system memory 603, such as implementing the methods mentioned in the above embodiments.
[0152] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0153] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0154] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present disclosure includes additional implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present disclosure belong.
[0155] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.
[0156] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0157] A person skilled in the art may understand that all or part of the steps in the above-mentioned embodiment method may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0158] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0159] The storage medium mentioned above may be a read-only memory, a disk or an optical disk, etc. Although the embodiments of the present disclosure have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations of the present disclosure. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present disclosure.
Claims
1. A method for generating a perception model, comprising: Acquire a training data set, wherein the training data set includes a plurality of image sequences and 3D posture and morphology annotation data corresponding to each of the image sequences; Performing feature extraction and segmentation on each image frame in the image sequence to obtain an image feature sequence corresponding to each image frame, wherein the image feature sequence includes features of multiple image blocks; Input each of the image feature sequences into the spatiotemporal feature extraction network in the initial perception model to obtain the spatiotemporal feature sequence corresponding to the image sequence; Inputting the spatiotemporal feature sequence into the perception network in the initial perception model to obtain the perception result corresponding to the image sequence; Determine a first difference between a target block in the morphological annotation data and a predicted block in the perception result, and a second difference between a first posture and morphological parameters in the morphological annotation data and a second posture and morphological parameters in the perception result; the target block refers to a region block of a subject in an image associated with the 3D posture and morphological data; the predicted block refers to a block of a subject in an image associated with the posture and morphological parameters predicted by the perception network; determining a correction gradient based on the first difference and the second difference; The spatiotemporal feature extraction network and the perception network are respectively corrected based on the correction gradient.
2. The method of claim 1, wherein: Also includes: When the number of images included in any image sequence is greater than a first number, and a first difference between the number of images included in any image sequence and the first number is greater than a first threshold, dividing the any image sequence into the first number of subsequences, wherein a second difference between the number of images included in every two subsequences is less than a second threshold; An image is extracted from each of the subsequences to generate a new image sequence.
3. The method of claim 1, wherein: Also includes: When the number of images included in any image sequence is greater than a first number, and a first difference between the number of images included in any image sequence and the first number is less than or greater than a first threshold, randomly extracting the first number of images from any image sequence to generate a new image sequence; or, When the number of images included in any image sequence is greater than a first number, the image sequence is divided into a plurality of image subsequences, wherein the number of images included in each divided image subsequence is equal to the first number.
4. The method of claim 3, wherein: The step of determining a correction gradient based on the first difference and the second difference comprises: Determining a first correction gradient corresponding to the perception network based on the first difference, the second difference, and a first weight pair; Based on the first difference, the second difference and a second weight pair, a second revised gradient corresponding to the spatiotemporal feature extraction network is determined.
5. A 3D posture and morphology perception method, comprising: Obtain the image sequence to be processed; Performing feature extraction and segmentation on each image frame in the image sequence to obtain an image feature sequence corresponding to each image frame, wherein the image feature sequence includes features of multiple image blocks; Each of the image feature sequences is input into a preset perception model to obtain 3D posture and morphological parameters of the subject contained in the image sequence, wherein the preset perception model is generated using the method described in any one of claims 1-4.
6. The method of claim 5, wherein: The extracting and segmenting each image frame in the image sequence includes: When the number of images included in the image sequence is greater than a first number, and a first difference between the number of images included in the image sequence and the first number is greater than a first threshold, dividing the image sequence into the first number of subsequences, wherein a second difference between the number of images included in every two subsequences is less than a second threshold; Extracting an image from each of the subsequences to generate a new image sequence to be processed; Perform feature extraction and segmentation on each image frame in the new image sequence to be processed.
7. The method of claim 5, wherein: The extracting and segmenting each image frame in the image sequence includes: When the number of images included in any image sequence is greater than a first number, dividing the image sequence into a plurality of image subsequences, wherein the number of images included in each divided image subsequence is equal to the first number; Feature extraction and segmentation are performed on each image frame in each of the image subsequences.
8. A device for generating a perception model, comprising: A first acquisition module is used to acquire a training data set, wherein the training data set includes a plurality of image sequences and 3D posture and morphology annotation data corresponding to each of the image sequences; A second acquisition module is used to extract and segment each image frame in the image sequence to obtain an image feature sequence corresponding to each image frame, wherein the image feature sequence includes features of multiple image blocks; A third acquisition module is used to input each of the image feature sequences into the spatiotemporal feature extraction network in the initial perception model to obtain the spatiotemporal feature sequence corresponding to the image sequence; A fourth acquisition module, used for inputting the spatiotemporal feature sequence into the perception network in the initial perception model to obtain the perception result corresponding to the image sequence; The fifth acquisition module is used to determine the first difference between the target block in the morphological annotation data and the predicted block in the perception result, and the second difference between the first posture and morphological parameters in the morphological annotation data and the second posture and morphological parameters in the perception result; based on the first difference and the second difference, determine the correction gradient; based on the correction gradient, respectively correct the spatiotemporal feature extraction network and the perception network; the target block refers to the area block of the subject in the image associated with the 3D posture and morphological data; the prediction block refers to the block of the subject in the image associated with the posture and morphological parameters predicted by the perception network.
9. The device of claim 8, wherein: The second acquisition module further includes: a first segmentation unit, configured to, when the number of images included in any image sequence is greater than a first number and a first difference between the number of images included in any image sequence and the first number is greater than a first threshold, divide the any image sequence into the first number of subsequences, wherein a second difference between the number of images included in every two subsequences is less than a second threshold; The first generating unit is used to extract an image from each of the subsequences to generate a new image sequence.
10. The device of claim 8, wherein: The second acquisition module further includes: A second generating unit is configured to randomly extract the first number of images from any image sequence to generate a new image sequence when the number of images included in any image sequence is greater than a first number and a first difference between the number of images included in any image sequence and the first number is less than or greater than a first threshold; or The second segmentation unit is used to segment any image sequence into multiple image subsequences when the number of images included in any image sequence is greater than a threshold, wherein the number of images included in each image subsequence after segmentation is equal to the threshold.
11. The device of claim 8, wherein: The fifth acquisition module is further used for: Determining a first correction gradient corresponding to the perception network based on the first difference, the second difference, and a first weight pair; Based on the first difference, the second difference and a second weight pair, a second revised gradient corresponding to the spatiotemporal feature extraction network is determined.
12. A 3D posture and shape perception device, comprising: A sixth acquisition module, used for acquiring an image sequence to be processed; a seventh acquisition module, configured to perform feature extraction and segmentation on each image frame in the image sequence to obtain an image feature sequence corresponding to each image frame, wherein the image feature sequence includes features of multiple image blocks; An eighth acquisition module is used to input each of the image feature sequences into a preset perception model to obtain the 3D posture and morphological parameters of the subject contained in the image sequence, wherein the preset perception model is generated using the method described in any one of claims 1-4.
13. The device of claim 12, wherein: The seventh acquisition module is further used for: When the number of images included in the image sequence is greater than a first number, and a first difference between the number of images included in the image sequence and the first number is greater than a first threshold, dividing the image sequence into the first number of subsequences, wherein a second difference between the number of images included in every two subsequences is less than a second threshold; Extracting an image from each of the subsequences to generate a new image sequence to be processed; Perform feature extraction and segmentation on each image frame in the new image sequence to be processed.
14. The device of claim 12, wherein: The seventh acquisition module is further used for: When the number of images included in any image sequence is greater than a first number, dividing the image sequence into a plurality of image subsequences, wherein the number of images included in each divided image subsequence is equal to the first number; Feature extraction and segmentation are performed on each image frame in each of the image subsequences.
15. A computer device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method for generating a perception model as described in any one of claims 1 to 4.
16. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the 3D posture and form perception method as described in any one of claims 5 to 7 is implemented.
17. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the method for generating a perception model as described in any one of claims 1-4.
18. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the 3D posture and shape perception method as described in any one of claims 5 to 7 is implemented.
19. A computer program product, comprising a computer program, which, when executed by a processor, implements the method for generating a perception model as described in any one of claims 1 to 4.
20. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the 3D posture and shape perception method as claimed in any one of claims 5 to 7.
Citation Information
Patent Citations
Training method and device, equipment of human body posture estimation model, medium and product
CN112528858A
3D form and attitude estimation method and device based on space-time correlation image
CN113298047A
Target detection method and system based on global feature perception
CN113673420A
Object attitude estimation method and device, electronic equipment and storage medium
CN114332214A
Video pedestrian re-identification network based on attitude perception
CN115410222A
