CN-122029563-A - Method, device, computer equipment and medium for beautifying face
Abstract
The disclosure provides a method, a device, computer equipment and a medium for beautifying, wherein the method comprises the steps of obtaining a target image, identifying an upper body detection frame and a face detection frame of a target person in the target image, dividing the image area of the upper body detection frame to perform beautifying treatment, and identifying a plurality of face key points in the image area of the face detection frame to perform beautifying treatment. According to the method, the upper body detection frame and the face detection frame of the target person in the target image are identified, the image area of the upper body detection frame comprises the face skin area and other skin areas of the upper body, so that the face skin area and the other skin areas of the upper body are natural in transition after the face beautifying treatment, the viewing experience is improved, the image area of the face detection frame only comprises the face area, noise when key points of the face are identified in the image area of the face detection frame is greatly reduced, and the detection accuracy and precision are improved.
Inventors
- LIU DEZHI
- CHEN QIXUN
Assignees
- 深圳市昊一源科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20231123
Claims (10)
- A method of maintaining beauty and shape comprising: Acquiring a target image; Identifying an upper body detection frame and a face detection frame of a target person in a target image; performing skin segmentation on the image area of the upper body detection frame so as to perform beauty treatment; And identifying a plurality of face key points in the image area of the face detection frame so as to perform beauty treatment.
- The method of claim 1, wherein the number of facial keypoints is 106, wherein 98 keypoints are standard keypoints and 8 keypoints are custom keypoints located in the nose.
- The method of claim 2, wherein the custom keypoints are symmetrically distributed on the left and right sides of the nose and intersect the nose edge through a horizontal line on the nose.
- The method of claim 1, wherein the skin segmentation of the image region of the upper body detection frame is performed by a first neural network, wherein the identifying of the face keypoints of the image region of the face detection frame is performed by a second neural network, and wherein the first and second neural networks are lightweight neural networks.
- The method of claim 4, wherein the device performing the method is deployed with DSP, GPU, NPU and a CPU, the method further comprising: Performing skin segmentation on an image area of the upper body detection frame through the DSP; carrying out beauty treatment through a GPU and carrying out beauty treatment; The step of identifying the upper body detection frame and the face detection frame of the target person in the target image comprises the following steps: Preprocessing the target image through a DSP; The NPU is used for identifying a plurality of candidate upper body detection frames and a plurality of candidate face detection frames of the target person in the preprocessed target image based on the target detection model; Determining the upper body detection frames and the face detection frames from the candidate upper body detection frames and the candidate face detection frames through a CPU; The step of identifying a plurality of face key points of an image area of a face detection frame comprises the following steps: Preprocessing an image area of the face detection frame through a GPU; Identifying a plurality of candidate face key points of the preprocessed target image through the NPU by the second neural network; And determining a plurality of face key points from the plurality of candidate face key points through the CPU.
- The method of claim 5, wherein the object detection model is a modified YOLOv model, and the header network of the modified YOLOv model includes a feature fusion module for expanding receptive fields, upsampling, and transforming channel number processing of the low-resolution feature map, and fusing the processed low-resolution feature map with the high-resolution feature map.
- A device for beautifying the face and the face, characterized by comprising the following steps: The image acquisition module is used for acquiring a target image; the image recognition module is used for recognizing an upper body detection frame and a face detection frame of a target person in the target image; the skin segmentation module is used for carrying out skin segmentation on the image area of the upper body detection frame so as to carry out beauty treatment; And the key point detection module is used for identifying a plurality of face key points in the image area of the face detection frame so as to perform the shape beautifying processing.
- The apparatus of claim 7, wherein the number of facial keypoints is 106, wherein 98 keypoints are standard keypoints, 8 keypoints are custom keypoints located in the nose, and the custom keypoints are symmetrically distributed on the left and right sides of the nose and intersect the nose edge through a horizontal line on the nose.
- A computer device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor to cause the processor to perform the method of any one of claims 1-6.
- A computer readable storage medium, characterized in that the medium has stored thereon a computer program which, when executed by a processor, implements the method of any of claims 1-6.
Description
Method, device, computer equipment and medium for beautifying face Technical Field The present disclosure relates to the field of image processing, and in particular, to a method, an apparatus, a computer device, and a medium for beautifying. Background In live broadcasting, short video and social software, the functions of beautifying the face and the skin are required to be provided to meet the demands of users, the face is mainly treated by whitening, grinding and the like of the skin, and the face is mainly treated by thinning the face, big eyes and the like. In the related art, a face detection frame of each person in an image is generally identified, and an operation of extracting a skin area and detecting key points is performed on an image area of the face detection frame, so as to perform a face-beautifying process. However, the image area of the face detection frame can only extract the skin area of the face, and other skin areas in the image can not be extracted, so that the difference between the facial skin area and other skin areas after the face beautifying treatment is obvious, and the visual experience is poor. If the image area of the face detection frame includes other areas (such as a neck area) except the face, excessive noise is generated when the key points of the face are identified, and the detection accuracy is low. Disclosure of Invention In view of the above, embodiments of the present disclosure provide a method, an apparatus, a computer device and a medium for beautifying and shaping, so as to solve the technical problems in the related art. According to a first aspect of an embodiment of the present disclosure, a method for beautifying and shaping is provided, including: Acquiring a target image; Identifying an upper body detection frame and a face detection frame of a target person in a target image; performing skin segmentation on the image area of the upper body detection frame so as to perform beauty treatment; And identifying a plurality of face key points in the image area of the face detection frame so as to perform beauty treatment. Optionally, the number of the face key points is 106, wherein 98 key points are standard key points, and 8 key points are custom key points located in the nose range. Optionally, the custom key points are symmetrically distributed on the left and right sides of the nose, and intersect with the nose edge through a horizontal line on the nose. Optionally, the skin segmentation of the image area of the upper body detection frame is performed through a first neural network, the identification of the plurality of face key points of the image area of the face detection frame is performed through a second neural network, and the first neural network and the second neural network are lightweight neural networks. Optionally, a device for performing the method is configured with DSP, GPU, NPU and a CPU, and the method further includes: Performing skin segmentation on an image area of the upper body detection frame through the DSP; carrying out beauty treatment through a GPU and carrying out beauty treatment; The step of identifying the upper body detection frame and the face detection frame of the target person in the target image comprises the following steps: Preprocessing the target image through a DSP; The NPU is used for identifying a plurality of candidate upper body detection frames and a plurality of candidate face detection frames of the target person in the preprocessed target image based on the target detection model; Determining the upper body detection frames and the face detection frames from the candidate upper body detection frames and the candidate face detection frames through a CPU; The step of identifying a plurality of face key points of an image area of a face detection frame comprises the following steps: Preprocessing an image area of the face detection frame through a GPU; Identifying a plurality of candidate face key points of the preprocessed target image through the NPU by the second neural network; And determining a plurality of face key points from the plurality of candidate face key points through the CPU. Optionally, the target detection model is a modified YOLOv model, and the header network of the modified YOLOv model includes a feature fusion module, where the feature fusion module is configured to perform processing of expanding receptive fields, upsampling, and transforming channel numbers on the low-resolution feature map, and fuse the processed low-resolution feature map with the high-resolution feature map. According to a second aspect of the embodiments of the present disclosure, there is provided a beauty device, including: The image acquisition module is used for acquiring a target image; the image recognition module is used for recognizing an upper body detection frame and a face detection frame of a target person in the target image; the skin segmentation module is used for carrying out skin segmentation o