Face image processing methods and apparatuses, and electronic devices
Abstract
A face image processing method includes: performing face detection on an image to be processed, and obtaining at least one face region image included in the image to be processed and face attribute information in the at least one face region image; and for the at least one face region image, processing an image corresponding to a first region and/or an image corresponding to a second region in the face region image at least according to the face attribute information in the face region image, wherein the first region is a skin region, and the second region includes at least a non-skin region.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A face image processing method, comprising:
performing face detection on an image to be processed, and obtaining at least one face region image comprised in the image to be processed and face attribute information in the at least one face region image; for the at least one face region image,
responsive to the face attribute information comprising face attachment information, determining a facial processing parameter according to the face attachment information, wherein the determined facial processing parameter fails to comprise a processing parameter of a facial specific part occluded by a facial attachment in a facial region image; or
responsive to the face attribute information comprising facial angle information, determining a facial processing parameter corresponding to a face angle of the face region image indicated by the facial angle information, wherein different face angles correspond to different facial processing parameters; and
processing, at least according to the facial processing parameter, at least one of an image corresponding to a first region in the face region image or an image corresponding to a second region in the face region image, wherein the first region is a skin region, and the second region comprises at least a non-skin region.
2 . The method according to claim 1 , wherein
the method further comprises: obtaining face key-point information in the at least one face region image; the for the at least one face region image, processing, at least according to the face attribute information in the face region image, at least one of an image corresponding to a first region in the face region image or an image corresponding to a second region in the face region image comprises: for the at least one face region image, processing, according to the face attribute information and the face key-point information in the face region image, at least one of the image corresponding to the first region in the face region image or the image corresponding to the second region in the face region image.
3 . The method according to claim 1 , wherein before the processing, according to the face attribute information in the face region image, at least one of an image corresponding to a first region in the face region image or an image corresponding to a second region in the face region image at least, the method further comprises:
determining, according to user input information, at least one of the image corresponding to the first region in the face region image or the image corresponding to the second region in the face region image.
4 . The method according to claim 1 ,
wherein the processing at least one of an image corresponding to a first region in the face region image or an image corresponding to a second region in the face region image comprises at least one of facial whitening, facial ruddy, face-lifting, eye enlargement, eye enhancement, eye size correction, facial skin grinding, tooth whitening, or facial enhancement; wherein the face attribute information comprises at least one of the following: gender information, race information, age information, facial movement information, facial attachment information, or facial angle information; wherein the method further comprises at least one of the following: the facial movement information comprises at least one of the following: eye close information or mouth open information; the facial attachment information comprises at least one of the following: information on whether a beard is present, information on whether a mask is worn, or information on whether glasses are worn; or, the facial angle information comprises at least one of the following: facial horizontal angle information, facial rotation angle information, or facial pitch angle information.
5 . The method according to claim 1 , wherein responsive to the facial attachment information indicating presence of worn glasses in the face region image, the processing parameter of the facial specific part occluded by the facial attachment comprises at least one of the following: an eye enlargement processing parameter, an eye enhancement processing parameter, or an eye size correction parameter.
6 . The method according to claim 2 , wherein the processing, according to the face attribute information and the face key-point information in the face region image, at least one of an image corresponding to a first region in the face region image or an image corresponding to a second region in the face region image comprises:
obtaining a preset standard face template, wherein the standard face template comprises standard face key-point information; performing, according to the face key-point information in the face region image and the standard face key-point information, matching deformation on the standard face template; and processing, at least according to the face attribute information in the face region image and the deformed standard face template, at least one of the image corresponding to the first region or the image corresponding to the second region; wherein the obtaining a preset standard face template comprises: determining a standard face template required for current image processing from one standard face template or at least two different standard face templates comprised in a preset standard face template set.
7 . The method according to claim 6 , wherein the standard face template further comprises at least one of a first preset region for indicating a skin region in a standard face or a second preset region for indicating a non-skin region in the standard face;
the processing, at least according to the face attribute information in the face region image and the deformed standard face template, at least one of the image corresponding to the first region or the image corresponding to the second region comprises: determining, at least according to at least one of the first preset region in the deformed standard face template or the second preset region in the deformed standard face template, at least one of the first region in the face region image or the second region in the face region image; and processing, according to the face attribute information in the face region image and at least one of the determined first region in the face region image or the determined second region in the face region image, at least one of the image corresponding to the first region or the image corresponding to the second region.
8 . The method according to claim 7 , wherein the determining, at least according to at least one of the first preset region in the deformed standard face template or the second preset region in the deformed standard face template, at least one of the first region in the face region image or the second region in the face region image comprises:
determining a region in the face region image corresponding to the first preset region in the deformed standard face template as a first initial region; screening pixels for indicating non-skin in an image corresponding to the first initial region; determining a region with the pixels for indicating non-skin screened in the first initial region as the first region; and determining a region in the face region image corresponding to the second preset region in the deformed standard face template and a portion screened from the first initial region as the second region.
9 . The method according to claim 2 , wherein the processing, according to the face attribute information and the face key-point information in the face region image, at least one of an image corresponding to a first region or an image corresponding to a second region in the face region image comprises:
obtaining a preset standard face template, wherein the standard face template comprises standard face key-point information; performing, according to the face key-point information in the face region image and the standard face template, deformation on the face region image; and processing, according to the face attribute information, the original face region image, and the deformed face region image, at least one of the image corresponding to the first region or the image corresponding to the second region; wherein the obtaining a preset standard face template comprises: determining a standard face template required for current image processing from one standard face template or at least two different standard face templates comprised in a preset standard face template set.
10 . The method according to claim 1 , wherein the processing at least one of an image corresponding to a first region in the face region image or an image corresponding to a second region in the face region image comprises:
performing at least one of facial whitening, facial ruddy, or facial skin grinding on at least one of the image corresponding to the first region in the face region image or the image corresponding to the second region in the face region image; and performing smooth processing on the processed face region image.
11 . The method according to claim 1 , wherein the performing face detection on an image to be processed comprises: performing face detection on the image to be processed by means of a pre-trained neural network;
wherein training the neural network comprises: obtaining, by performing at least information preserving scrambling processing on an original sample image comprising face key-point annotation information, a scrambled sample image and image information processed by the information preserving scrambling processing; detecting the original sample image and the scrambled sample image based on the neural network; obtaining first prediction information for a face key-point in the original sample image and second prediction information for a face key-point in the scrambled sample image; determining a first difference between the first prediction information and the annotation information, a second difference between the first prediction information and the second prediction information, and a third difference between the second difference and the image information processed by the information preserving scrambling processing; and adjusting, according to the first difference and the third difference, network parameters of the neural network.
12 . The method according to claim 11 , wherein the performing at least information preserving scrambling processing on an original sample image comprising face key-point annotation information comprises:
performing information preserving scrambling processing and information non-preserving scrambling processing on the original sample image comprising the face key-point annotation information, wherein the information preserving scrambling processing comprises at least one of the following: affine transformation processing, translation processing, scaling processing, or rotation processing.
13 . The method according to either claim 11 , wherein the determining a first difference between the first prediction information and the annotation information comprises:
determining, by using a first loss function, the first difference between the first prediction information and the face key-point annotation information in the original sample image, wherein the first loss function is used for measuring the accuracy of a face key-point prediction result in the original sample image.
14 . The method according to claim 13 , wherein the determining a second difference between the first prediction information and the second prediction information comprises: determining, by using a second loss function, the second difference between the first prediction information and the second prediction information, wherein the second loss function is used for measuring a difference between the face key-point prediction result in the original sample image and the face key-point prediction result in the scrambled sample image.
15 . An electronic device, comprising:
a processor; and a memory for storing instructions executable by the processor; wherein execution of the instructions by the processor causes the processor to perform: performing face detection on an image to be processed, and obtaining at least one face region image comprised in the image to be processed and face attribute information in the at least one face region image; for the at least one face region image,
responsive to the face attribute information comprising face attachment information, determining a facial processing parameter according to the face attachment information, wherein the determined facial processing parameter fails to comprise a processing parameter of a facial specific part occluded by a facial attachment in a facial region image; or
responsive to the face attribute information comprising facial angle information, determining a facial processing parameter corresponding to a face angle of the face region image indicated by the facial angle information, wherein different face angles correspond to different facial processing parameters; and
processing, at least according to the facial processing parameter, at least one of an image corresponding to a first region in the face region image or an image corresponding to a second region in the face region image, wherein the first region is a skin region, and the second region comprises at least a non-skin region.
16 . The device according to claim 15 , wherein the processor further performs: obtaining face key-point information in the at least one face region image;
the for the at least one face region image, processing , at least according to the face attribute information in the face region image, at least one of an image corresponding to a first region in the face region image or an image corresponding to a second region in the face region image comprises: for the at least one face region image, processing, according to the face attribute information and the face key-point information in the face region image, at least one of the image corresponding to the first region in the face region image or the image corresponding to the second region in the face region image.
17 . The device according to claim 15 , wherein before the processing, according to the face attribute information in the face region image, at least one of an image corresponding to a first region in the face region image or an image corresponding to a second region in the face region image at least, the processor further performs:
determining, according to user input information, at least one of the image corresponding to the first region in the face region image or the image corresponding to the second region in the face region image.
18 . The device according to claim 15 ,
wherein the processing at least one of an image corresponding to a first region in the face region image or an image corresponding to a second region in the face region image comprises at least one of facial whitening, facial ruddy, face-lifting, eye enlargement, eye enhancement, eye size correction, facial skin grinding, tooth whitening, or facial enhancement; wherein the face attribute information comprises at least one of the following: gender information, race information, age information, facial movement information, facial attachment information, or facial angle information; wherein the instructions further comprises at least one of the following: the facial movement information comprises at least one of the following: eye close information or mouth open information; the facial attachment information comprises at least one of the following: information on whether a beard is present, information on whether a mask is worn, or information on whether glasses are worn; or, the facial angle information comprises at least one of the following: facial horizontal angle information, facial rotation angle information, or facial pitch angle information.
19 . The device according to claim 15 , wherein responsive to the facial attachment information indicating presence of worn glasses in the face region image, the processing parameter of the facial specific part occluded by the facial attachment comprises at least one of the following: an eye enlargement processing parameter, an eye enhancement processing parameter, or an eye size correction parameter.
20 . A non-transitory computer readable storage medium, configured to store computer-readable instructions, wherein execution of the instructions by the processor causes the processor to perform:
performing face detection on an image to be processed, and obtaining at least one face region image comprised in the image to be processed and face attribute information in the at least one face region image; for the at least one face region image,
responsive to the face attribute information comprising face attachment information, determining a facial processing parameter according to the face attachment information, wherein the determined facial processing parameter fails to comprise a processing parameter of a facial specific part occluded by a facial attachment in a facial region image; or
responsive to the face attribute information comprising facial angle information, determining a facial processing parameter corresponding to a face angle of the face region image indicated by the facial angle information, wherein different face angles correspond to different facial processing parameters; and
processing, at least according to the facial processing parameter, at least one of an image corresponding to a first region in the face region image or an image corresponding to a second region in the face region image, wherein the first region is a skin region, and the second region comprises at least a non-skin region.Join the waitlist — get patent alerts
Track US2022083763A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.