Method and device for training models, method and device for detecting body postures, and storage medium
AssigneeBigo Technology Pte. Ltd.
InventorSen Jia
Life of this patent
Estimating the term…
Abstract
A method for training models is provided. The method includes: inputting an image training sample corresponding to a current iteration into a current posture detection network model, and acquiring a first loss function corresponding to the current iteration; re-projecting the current output result of the current posture detection network model, and acquiring a second loss function corresponding to the current iteration; and acquiring a posture detection network model for a next iteration by performing backpropagation on the current posture detection network model, and achieving training of the posture detection network model by performing the next iteration before an iteration end condition is met.
Claims17
A method for training models, comprising:
- inputting an image training sample corresponding to a current iteration into a current posture detection network model, and acquiring, based on a data form of the image training sample and a current output result of the current posture detection network model, a first loss function corresponding to the current iteration;
- re-projecting, based on an acquired camera parameter, the current output result of the current posture detection network model, and acquiring, based on a result of the re-projection, a second loss function corresponding to the current iteration;
- and
- acquiring a posture detection network model for a next iteration by performing, based on a fitting loss function defined by the first loss function and the second loss function, backpropagation on the current posture detection network model, and achieving training of the posture detection network model by performing the next iteration before an iteration end condition is met;
- wherein the posture detection network model is a heatmap regression network model constructed using a fully convolutional network structure;
- and
- the data form of the image training sample comprises:
- a labeling form of natural scene sample image-two-dimensional coordinates of a key point, or a labeling form of constrained scene sample image-two-dimensional coordinates of the key point and three-dimensional coordinates of the key point;
- wherein acquiring, based on the data form of the image training sample and the current output result of the current posture detection network model, the first loss function corresponding to the current iteration comprises:
- in response to the data form of the image training sample being the labeling form of the constrained scene sample image-two-dimensional coordinates of the key point and three-dimensional coordinates of the key point, acquiring a current heatmap set output by the posture detection network model, wherein the current heatmap set comprises a second current probability heatmap and a current three-dimensional coordinate heatmap group;
- and
- acquiring a predetermined standard heatmap set, and acquiring, based on the standard heatmap set and the current heatmap set, the first loss function corresponding to the current iteration;
- wherein the standard heatmap set is determined by transforming the three-dimensional coordinates of the key point in the image training sample, and the standard heatmap set comprises a second standard probability heatmap and a standard three-dimensional coordinate heatmap group.
A method for detecting body postures, comprising:
- acquiring a human real-scene image to be detected;
- inputting the human real-scene image into a predetermined posture detection network model;
- and
- acquiring three-dimensional spatial position coordinates of a plurality of key points of a human in the human real-scene image by detecting, based on an output result of the predetermined posture detection network model, a body posture of the human;
- wherein the predetermined posture detection network model is acquired by:
- inputting an image training sample corresponding to a current iteration into a current posture detection network model, and acquiring, based on a data form of the image training sample and a current output result of the current posture detection network model, a first loss function corresponding to the current iteration;
- re-projecting, based on an acquired camera parameter, the current output result of the current posture detection network model, and acquiring, based on a result of the re- projection, a second loss function corresponding to the current iteration;
- and
- acquiring a posture detection network model for a next iteration by performing, based on a fitting loss function defined by the first loss function and the second loss function, backpropagation on the current posture detection network model, and achieving training of the posture detection network model by performing the next iteration before an iteration end condition is met;
- wherein the posture detection network model is a heatmap regression network model constructed using a fully convolutional network structure;
- and
- the data form of the image training sample comprises:
- a labeling form of natural scene sample image-two-dimensional coordinates of one of the plurality of key points, or a labeling form of constrained scene sample image-two-dimensional coordinates of the one of the plurality of key points and three-dimensional coordinates of the one of the plurality of key points;
- wherein acquiring, based on the data form of the image training sample and the current output result of the current posture detection network model, the first loss function corresponding to the current iteration comprises:
- in response to the data form of the image training sample being the labeling form of the constrained scene sample image-two-dimensional coordinates of the one of the plurality of key points and three-dimensional coordinates of the one of the plurality of key points, acquiring a current heatmap set output by the posture detection network model, wherein the current heatmap set comprises a second current probability heatmap and a current three-dimensional coordinate heatmap group;
- and
- acquiring a predetermined standard heatmap set, and acquiring, based on the standard heatmap set and the current heatmap set, the first loss function corresponding to the current iteration;
- wherein the standard heatmap set is determined by transforming the three-dimensional coordinates of the one of the plurality of key points in the image training sample, and the standard heatmap set comprises a second standard probability heatmap and a standard three-dimensional coordinate heatmap group.
A computer device for training models, comprising a memory, a processor, and a computer program stored on the memory and runnable on the processor, wherein the processor, when loading and running the computer program, is caused to perform:
- inputting an image training sample corresponding to a current iteration into a current posture detection network model, and acquiring, based on a data form of the image training sample and a current output result of the current posture detection network model, a first loss function corresponding to the current iteration;
- re-projecting, based on an acquired camera parameter, the current output result of the current posture detection network model, and acquiring, based on a result of the re-projection, a second loss function corresponding to the current iteration;
- and
- acquiring a posture detection network model for a next iteration by performing, based on a fitting loss function defined by the first loss function and the second loss function, backpropagation on the current posture detection network model, and achieving training of the posture detection network model by performing the next iteration before an iteration end condition is met;
- wherein the posture detection network model is a heatmap regression network model constructed using a fully convolutional network structure;
- and
- the data form of the image training sample comprises:
- a labeling form of natural scene sample image-two-dimensional coordinates of a key point, or a labeling form of constrained scene sample image-two-dimensional coordinates of the key point and three-dimensional coordinates of the key point;
- wherein acquiring, based on the data form of the image training sample and the current output result of the current posture detection network model, the first loss function corresponding to the current iteration comprises:
- in response to the data form of the image training sample being the labeling form of the constrained scene sample image-two-dimensional coordinates of the key point and three-dimensional coordinates of the key point, acquiring a current heatmap set output by the posture detection network model, wherein the current heatmap set comprises a second current probability heatmap and a current three-dimensional coordinate heatmap group;
- and
- acquiring a predetermined standard heatmap set, and acquiring, based on the standard heatmap set and the current heatmap set, the first loss function corresponding to the current iteration;
- wherein the standard heatmap set is determined by transforming the three-dimensional coordinates of the key point in the image training sample, and the standard heatmap set comprises a second standard probability heatmap and a standard three-dimensional coordinate heatmap group.
Dependencies are inferred from the claim text.