Face anonymization in digital images
Face anonymization techniques are described that overcome conventional challenges to generate an anonymized face. In one example, a digital object editing system is configured to generate an anonymized face based on a target face and a reference face. As part of this, the digital object editing system employs an encoder as part of machine learning to extract a target encoding of the target face image and a reference encoding of the reference face. The digital object editing system then generates a mixed encoding from the target and reference encodings. The mixed encoding is employed by a machine-learning model of the digital object editing system to generate a mixed face. An object replacement module is used by the digital object editing system to replace the target face in the target digital image with the mixed face.
1 . A method comprising:
receiving, by a processing device, a target digital image depicting a target face;
automatically editing, by the processing device, the target digital image to remove a portion of the target digital image around the target face;
encoding, by the processing device using a machine learning model, data related to the target digital image to generate a target encoding including feature vectors representing three-dimensional aspects of a pose of the target face;
generating, by the processing device using the machine learning model, data including a descriptor of the pose of the target face based on the target encoding;
generating, by the processing device, a search query for a reference face in a reference digital image based on the descriptor of the pose of the target face;
automatically selecting, by the processing device, the reference digital image from candidate digital image results resulting from the search query by comparing the feature vectors representing the three-dimensional aspects of the pose of the target face and feature vectors representing three-dimensional aspects of poses of candidate faces of the candidate digital image results; and
generating, by the processing device, a mixed face by editing the target digital image to incorporate a portion of the reference face.
2 . The method of claim 1 , wherein the descriptor of the pose of the target face indicates a facial pose or a facial feature.
3 . The method of claim 1 , further comprising cropping the reference face from the reference digital image.
4 . The method of claim 1 , further comprising extracting the target encoding from the target face and a reference encoding from the reference face.
5 . The method of claim 4 , wherein the mixed face is generated by mixing the target encoding with the reference encoding.
6 . The method of claim 5 , wherein the target encoding is mixed with the reference encoding using linear interpolation.
7 . The method of claim 1 , further comprising replacing the target face in the target digital image with the mixed face.
8 . The method of claim 1 , wherein automatically selecting the reference digital image further comprises comparing a three-dimensional target face shape model with a three-dimensional reference face shape model.
9 . The method of claim 1 , further comprising encoding, using the machine learning model, the candidate digital image results to generate the feature vectors representing the three-dimensional aspects of the poses of the candidate faces of the candidate digital image results.
10 . The method of claim 1 , wherein a similarity score defines a level of visual similarity between the pose of the target face and the poses of the candidate faces of the candidate digital image results for automatically selecting the reference digital image.
11 . A system comprising:
a memory component; and
a processing device coupled to the memory component, the processing device to perform operations comprising:
receiving a target digital image depicting a target object;
automatically editing the target digital image to remove a portion of the target digital image around the target object;
encoding, using a machine learning model, data related to the target digital image to generate a target encoding including feature vectors representing three-dimensional aspects of a pose of the target object;
generating, using the machine learning model, data including a descriptor of the pose of the target object based on the target encoding;
generating a search query for a reference object in a reference digital image based on the descriptor of the pose of the target object;
executing a search of digital images using the search query;
automatically selecting the reference digital image from candidate digital image results resulting from the search query by comparing the feature vectors representing the three-dimensional aspects of the pose of the target object and feature vectors representing three-dimensional aspects of poses of candidate objects of the candidate digital image results; and
generating a mixed object by editing the target digital image to incorporate a portion of the reference object.
12 . The system of claim 11 , wherein the descriptor of the pose of the target object indicates a feature of the target object.
13 . The system of claim 11 , further comprising extracting the target encoding from the target object and a reference encoding from the reference object.
14 . The system of claim 13 , wherein the mixed object is generated by mixing the target encoding with the reference encoding.
15 . The system of claim 14 , wherein the target encoding is mixed with the reference encoding using linear interpolation.
16 . The system of claim 11 , further configured to perform operations comprising encoding, using the machine learning model, the candidate digital image results to generate the feature vectors representing the three-dimensional aspects of the poses of the candidate objects of the candidate digital image results.
17 . A non-transitory computer-readable storage medium storing executable instructions, which when executed by a processing device, cause the processing device to perform operations comprising:
receiving a target digital image depicting a target face;
automatically editing the target digital image to remove a portion of the target digital image around the target face;
encoding, using a machine learning model, data related to the target digital image to generate a target encoding including feature vectors representing three-dimensional aspects of a pose of the target face;
generating, using the machine learning model, data including a descriptor of the pose of the target face based on the target encoding;
generating a search query for a reference face in a reference digital image based on the descriptor of the pose of the target face;
automatically selecting the reference digital image from candidate digital image results resulting from the search query by comparing the feature vectors representing the three-dimensional aspects of the pose of the target face and feature vectors representing three-dimensional aspects of poses of candidate faces of the candidate digital image results; and
generating a mixed face by editing the target digital image to incorporate a portion of the reference face.
18 . The non-transitory computer-readable storage medium of claim 17 , wherein the descriptor of the pose of the target face indicates a facial pose or a facial feature.
19 . The non-transitory computer-readable storage medium of claim 17 , further comprising cropping the reference face from the reference digital image.
20 . The non-transitory computer-readable storage medium of claim 17 , further configured to perform operations comprising encoding, using the machine learning model, the candidate digital image results to generate the feature vectors representing the three-dimensional aspects of the poses of the candidate faces of the candidate digital image results.