Image processing method, device and computer readable storage medium

By performing mirroring and vector processing on side profile images and combining them with an image generation model to generate target face images, the problem of identity characteristics and applicability in side profile image processing in existing technologies is solved, and frontal face image generation with higher similarity and wider applicability is achieved.

CN116188277BActive Publication Date: 2026-07-03GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU SHIYUAN ELECTRONICS CO LTD
Filing Date
2021-11-24
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing technologies struggle to ensure consistency between facial identity characteristics and skin texture reconstruction when processing profile images, and their applicability is limited, impacting the user's image processing experience.

Method used

By obtaining the vector of the side profile image, performing a mirroring operation, and combining it with the mirror-symmetrical side profile image, an image generation model is used to generate the target face image, ensuring identity consistency and similarity.

Benefits of technology

The generated frontal and side profile images have higher similarity, wider applicability, and improve the image processing effect and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116188277B_ABST
    Figure CN116188277B_ABST
Patent Text Reader

Abstract

This application discloses an image processing method, apparatus, and computer-readable storage medium. The method includes: acquiring a first face image and acquiring a first vector corresponding to the first face image; the first face image is a profile image with a pose angle satisfying preset conditions; performing a mirror operation on the first face image to obtain a second face image and acquiring a second vector corresponding to the second face image; determining a target vector based on the first vector and the second vector, and inputting the target vector into an image generation model to obtain a target face image. By performing a mirror operation on the acquired profile image, a frontal face image can be obtained by combining two mirror-symmetrical profile images while ensuring the consistency of the face image identity. This results in a higher similarity between the generated frontal face image and the profile image, and wider applicability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of artificial intelligence technology, and specifically relates to an image processing method, apparatus and computer-readable storage medium. Background Technology

[0002] Image processing is the act of using computers to process image information to meet human visual, psychological, or application needs. It is widely used in professional fields such as surveying, atmospheric science, astronomy, and graphic design.

[0003] When processing images containing human faces, if the face image is a side profile, it increases the difficulty of image processing. Therefore, when processing such images, it is necessary to first convert the side profile image to a frontal view. Summary of the Invention

[0004] This application provides an image processing method, apparatus, and computer-readable storage medium, the technical solutions of which are as follows:

[0005] In a first aspect, embodiments of this application provide an image processing method, the method comprising:

[0006] Obtain a first face image and obtain a first vector corresponding to the first face image; the first face image is a profile image whose pose angle meets preset conditions;

[0007] The first face image is mirrored to obtain the second face image, and the second vector corresponding to the second face image is obtained.

[0008] The target vector is determined based on the first vector and the second vector, and the target vector is input into the image generation model to obtain the target face image. The image generation model is trained by multiple random vectors and sample images corresponding to each of the multiple random vectors. The target face image is a frontal face image.

[0009] In one alternative approach of the first aspect, obtaining the first face image includes:

[0010] Obtain the initial face image;

[0011] Adjust the pose angle of the initial face image until the pose angle of the initial face image meets the preset conditions, and use the initial face image whose pose angle meets the preset conditions as the first face image.

[0012] In another alternative to the first aspect, the preset condition is that the angle between the vertical axis of the plane where the first face image is located and the face represented by the first face image is 0.

[0013] In another alternative to the first aspect, obtaining the first vector corresponding to the first face image includes:

[0014] The first random vector is input into the image generation model to obtain the third face image;

[0015] A first loss function is constructed based on the first random vector, the first face image, and the third face image;

[0016] The first loss function is optimized to obtain the first vector corresponding to the first face image.

[0017] In another alternative to the first aspect, obtaining the second vector corresponding to the second face image includes:

[0018] The second random vector is input into the image generation model to obtain the fourth face image;

[0019] A second loss function is constructed based on the second random vector, the second face image, and the fourth face image;

[0020] The second loss function is optimized to obtain the second vector corresponding to the second face image.

[0021] In another alternative to the first aspect, determining the target vector based on the first vector and the second vector includes:

[0022] Calculate the average vector of the first vector and the second vector, and use the average vector as the target vector.

[0023] In another alternative to the first aspect, the image generation model includes a first generation network and a second generation network;

[0024] The first generative network is used to generate random face images based on the input random vector;

[0025] The second generator network is trained on sample images based on known prediction values. The sample images include random face images and real face images. The random face images are input into the second generator network to obtain the first prediction value, and the real face images are input into the second generator network to obtain the second prediction value.

[0026] The image generation model is used to train the first generation network based on the predicted values ​​corresponding to random face images obtained by the second generation network, so that the trained first generation network is input into the second generation network based on random face images obtained by random vectors to obtain target predicted values ​​belonging to a preset threshold range.

[0027] Secondly, embodiments of this application also provide an image processing apparatus, the apparatus comprising:

[0028] The first acquisition module is used to acquire a first face image and acquire a first vector corresponding to the first face image; the first face image is a side face image whose pose angle meets preset conditions;

[0029] The second acquisition module is used to perform a mirroring operation on the first face image to obtain a second face image, and to acquire a second vector corresponding to the second face image;

[0030] The processing module is used to determine the target vector based on the first vector and the second vector, and input the target vector into the image generation model to obtain the target face image; the image generation model is trained by multiple random vectors and sample images corresponding to each of the multiple random vectors, and the target face image is a frontal face image.

[0031] In one alternative embodiment of the second aspect, the first acquisition module includes:

[0032] The acquisition unit is used to acquire the initial face image;

[0033] The first processing unit is used to adjust the pose angle of the initial face image until the pose angle of the initial face image meets the preset conditions, and to use the initial face image whose pose angle meets the preset conditions as the first face image.

[0034] In another alternative of the second aspect, the preset condition is that the angle between the vertical axis of the plane where the first face image is located and the face represented by the first face image is 0.

[0035] In another alternative solution to the second aspect, the first acquisition module further includes:

[0036] The second processing unit is used to input the first random vector into the image generation model to obtain the third face image;

[0037] The first construction unit is used to construct a first loss function based on a first random vector, a first face image, and a third face image;

[0038] The first optimization unit is used to optimize the first loss function to obtain the first vector corresponding to the first face image.

[0039] In another alternative embodiment of the second aspect, the second acquisition module includes:

[0040] The third processing unit is used to input the second random vector into the image generation model to obtain the fourth face image;

[0041] The second construction unit is used to construct a second loss function based on the second random vector, the second face image, and the fourth face image;

[0042] The second optimization unit is used to optimize the second loss function to obtain the second vector corresponding to the second face image.

[0043] In another alternative solution to the second aspect, the processing module is specifically used for:

[0044] Calculate the average vector of the first vector and the second vector, and use the average vector as the target vector.

[0045] In another alternative of the second aspect, the image generation model includes a first generation network and a second generation network;

[0046] The first generative network is used to generate random face images based on the input random vector;

[0047] The second generator network is trained on sample images based on known prediction values. The sample images include random face images and real face images. The random face images are input into the second generator network to obtain the first prediction value, and the real face images are input into the second generator network to obtain the second prediction value.

[0048] The image generation model is used to train the first generation network based on the predicted values ​​corresponding to random face images obtained by the second generation network, so that the trained first generation network is input into the second generation network based on random face images obtained by random vectors to obtain target predicted values ​​belonging to a preset threshold range.

[0049] Thirdly, embodiments of this application also provide an image processing apparatus, including a processor and a memory;

[0050] The processor is connected to the memory;

[0051] Memory, used to store executable program code;

[0052] The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the image processing method provided by the first aspect of the embodiments of this application or any implementation thereof.

[0053] Fourthly, embodiments of this application provide a computer storage medium storing a computer program, which includes program instructions. When executed by a processor, the program instructions can implement the image processing method provided by the first aspect or any implementation thereof of the embodiments of this application.

[0054] In this embodiment, a first face image is first acquired, and a first vector corresponding to the first face image is obtained. Then, the first face image is mirrored to obtain a second face image, and a second vector corresponding to the second face image is obtained. A target vector is determined based on the first and second vectors, and this target vector is then input into an image generation model to obtain a target face image. By mirroring the acquired side-view image, a frontal face image is obtained by combining two mirror-symmetrical side-view images while ensuring the consistency of the face image identity. This results in a higher similarity between the generated frontal face image and the side-view image, and wider applicability. Attached Figure Description

[0055] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0056] Figure 1 This is a schematic diagram illustrating a common processing effect of frontal face transformation in an embodiment of this application;

[0057] Figure 2 This is a schematic diagram of the architecture of an image processing system provided in an embodiment of this application;

[0058] Figure 3 A schematic flowchart of an image processing method provided in an embodiment of this application;

[0059] Figure 4 This application provides a schematic diagram illustrating the effects of different pose angles on a human face image in an embodiment of the present application.

[0060] Figure 5 This is a schematic diagram illustrating the mirroring effect of a face image provided in an embodiment of this application;

[0061] Figure 6 A schematic diagram illustrating different pose angles of a face image, as provided in an embodiment of this application.

[0062] Figure 7 A schematic diagram illustrating the processing flow of an image generation model provided in an embodiment of this application;

[0063] Figure 8 A schematic flowchart illustrating another image processing method provided in an embodiment of this application;

[0064] Figure 9 A schematic flowchart illustrating another image processing method provided in an embodiment of this application;

[0065] Figure 10This is a schematic diagram illustrating the effect of image processing provided in an embodiment of this application;

[0066] Figure 11 This is a schematic flowchart of an image processing apparatus provided in an embodiment of this application;

[0067] Figure 12 This is a schematic flowchart of another image processing apparatus provided in an embodiment of this application. Detailed Implementation

[0068] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0069] The terms "first," "second," "third," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0070] When processing images with profile views, a common approach is to first convert the profile view to a frontal view, and then process the frontal view image. Specifically, when converting a profile view to a frontal view, the image can first be input into a trained 3D model for 3D modeling to generate a profile 3D model. Then, the profile 3D model is rotated by a pose angle until it is converted into a frontal 3D model. Finally, the frontal 3D model is rendered in 2D to output the final 2D frontal image. It is understandable that the method of driving the rotation of the profile 3D model's attitude angle can be, but is not limited to, establishing a spatial rectangular coordinate system with the center of the profile 3D model as the origin. The X and Y axes can be correspondingly set on the projection plane of the profile 3D model, and the Z axis can be perpendicular to the projection plane. By driving the profile 3D model to rotate along the X, Y, and Z axes respectively, the attitude angles of the profile 3D model around the X-axis, Y-axis, and Z-axis can be made 0 (or, in other words, roll = 0, yaw = 0, pitch = 0 in the profile 3D model). It should be noted that the face in a frontal image is symmetrical, while the face in a profile image is not.

[0071] For example, see here. Figure 1 The illustration shows a common processing effect of frontal face transformation of a face image provided by an embodiment of this application. For example... Figure 1 As shown, Figure 1Figure 1a illustrates an initial image including a profile view. This initial image can be input into a trained 3D model for 3D modeling to generate an initial image 3D model. This initial image 3D model is then rotated by a pose angle until it transforms into a frontal face 3D model. The frontal face 3D model can be found in [reference needed]. Figure 1 Figure 1b shows the 3D models corresponding to the three pose angles. The 3D model in the middle can be considered the frontal 3D model, and the 3D models on the sides can be considered the side 3D models. Given a frontal 3D model, it can be rendered in 2D to output the final 2D frontal image, such as... Figure 1 The image shown in 1c is the frontal target image corresponding to the initial image.

[0072] However, it's important to note that the aforementioned 3D models are primarily trained using frontal face images. To better perform 3D modeling of the input face image, a frontal view is generally required. Therefore, when the input face image is a profile view, the 2D frontal face image output by the 3D model based on the constructed profile view cannot guarantee the consistency of the identity characteristics and skin texture reconstruction of the corresponding profile view image. Furthermore, this 3D model typically requires at least two input face images, limiting its applicability and impacting the user's image processing experience.

[0073] Based on the aforementioned technical deficiencies, please refer to Figure 2 The diagram shown is an architectural schematic of an image processing system provided in an embodiment of this application.

[0074] like Figure 2 As shown, the image processing system may include at least a mobile terminal 201 and a server 202, wherein:

[0075] Mobile terminal 201 can be used to acquire a side profile image whose posture angle meets preset conditions, and send the side profile image to server 202 corresponding to mobile terminal 201, so that server 202 can obtain a vector corresponding to the side profile image. It is understood that the posture angle of the side profile image can be determined according to a spatial rectangular coordinate system established by the side profile image. Taking the center of the face in the side profile image as the origin as an example, the X-axis and Y-axis can be set on the plane where the side profile image is located, and the Z-axis can be perpendicular to the plane where the side profile image is located. The posture angle of the side profile image can include posture angles rotated around the X-axis, around the Y-axis, and around the Z-axis. In this embodiment, the posture angle meeting the preset conditions can be any posture angle rotated around a coordinate axis equal to 0, for example, but not limited to, posture angles rotated around the X-axis equal to 0, posture angles rotated around the Y-axis equal to 0, or posture angles rotated around the Z-axis equal to 0. Preferably, the posture angle rotated around the Z-axis is equal to 0. It should be noted that when any attitude angle rotating around a coordinate axis is equal to 0, it is permissible, but not limited to, any one of the other two attitude angles rotating around the coordinate axis also being equal to 0.

[0076] The mobile terminal 201 can acquire a profile image either through its camera or by searching for it in a third-party application. When acquiring the image using the camera, the user can control the mobile terminal 201 to open an application capable of taking photos, such as, but not limited to, a camera app or a photo editing app, and capture an image with a face. Similarly, when acquiring the image through a third-party application, the user can open a search-based third-party application installed on the mobile terminal 201, such as, but not limited to, a browser, and search for images with a face in the corresponding search interface. It is understood that if the pose angle of the profile image acquired by the mobile terminal 201 in the above manner does not meet preset conditions, the mobile terminal 201 can preprocess the acquired profile image to obtain a profile image with pose angles that meet the preset conditions. Taking the example where the attitude angle satisfies the preset condition that the attitude angle around the Z-axis is equal to 0, the mobile terminal 201 can control the side face image to rotate along the Z-axis of the spatial rectangular coordinate system established by the side face image, so that the angle between the face represented in the side face image and the Y-axis of the spatial rectangular coordinate system established by the side face image is 0.

[0077] The mobile terminal 201 involved in this embodiment may be a smartphone, tablet computer, desktop computer, laptop computer, notebook computer, ultra-mobile personal computer (UMPC), handheld computer, PC device, personal digital assistant (PDA), router device, virtual reality device, etc.

[0078] After receiving a side-face image from the mobile terminal 201 whose pose angle meets preset conditions, the server 202 can obtain a vector corresponding to the side-face image. It is understood that the vector can be obtained, but is not limited to, using a trained deep learning neural network. After obtaining the vector corresponding to the side-face image, the server 202 can perform a mirroring operation on the side-face image to obtain an image symmetrical to it, and then obtain the vector corresponding to the symmetrical image. The mirroring operation on the side-face image can also be implemented in the mobile terminal 201. For example, the mobile terminal 201 can use a third-party application capable of performing mirroring operations, such as but not limited to Photoshop (PS), to place the side-face image on the processing interface for mirroring, and then send the mirrored side-face image to the server 202.

[0079] Furthermore, after obtaining the vector corresponding to the profile image and the vector corresponding to the image symmetrically set to the profile image, server 202 can determine the target vector based on the two vectors and input the target vector into the image generation model to obtain the target face image, where the target face image is the frontal face image corresponding to the profile image. It is understood that the image generation model here can be trained from multiple random vectors and the sample images corresponding to each of the multiple random vectors. The specific training process will be explained in the following embodiments and will not be elaborated upon here.

[0080] The first server 202 involved in this embodiment is specifically, but not limited to, a hardware server, a virtual server, a cloud server, etc., and may also be a terminal, specifically, but not limited to, a desktop, laptop, notebook computer, ultra-mobile personal computer (UMPC), handheld computer, netbook, personal digital assistant (PDA), routing device, gateway device, etc.

[0081] It should also be noted that the image processing system mentioned above is not limited to being executed jointly by the mobile terminal 201 and the server 202. For example, it can also be executed by the mobile terminal 201 or the server 202 alone. This embodiment is not limited to this.

[0082] Next, this application will explain and describe several embodiments of the image processing method.

[0083] Please see Figure 3 , Figure 3 A schematic flowchart of an image processing method provided in an embodiment of this application is shown.

[0084] like Figure 3 As shown, the image processing method may include at least the following steps:

[0085] Step 302: Obtain the first face image and obtain the first vector corresponding to the first face image.

[0086] Specifically, when performing frontal face processing on an image, a profile image whose pose angles meet preset conditions can be obtained first. The pose angles of this profile image can be determined based on a spatial rectangular coordinate system established by the profile image. Here, taking the center of the face in the profile image as the origin as an example, the X-axis and Y-axis can be set on the plane where the profile image is located, and the Z-axis can be perpendicular to the plane where the profile image is located. The pose angles of this profile image can include pose angles rotated around the X-axis, pose angles rotated around the Y-axis, and pose angles rotated around the Z-axis. It can be understood that the preset condition for the pose angles to be met can be that any one of the pose angles rotated around the X-axis, the Y-axis, and the Z-axis is equal to 0. For example, but not limited to, the pose angles rotated around the X-axis being equal to 0, the pose angles rotated around the Y-axis being equal to 0, or the pose angles rotated around the Z-axis being equal to 0. In this preferred embodiment, the pose angles rotated around the Z-axis being equal to 0 can be selected.

[0087] This example uses the preset condition that the attitude angle must satisfy, where the attitude angle around the Z-axis is equal to 0. (See also...) Figure 4 The illustration shows a schematic diagram of different pose angles of a face image provided by an embodiment of this application. For example... Figure 4 As shown, Figure 4 In the image, 4a and 4b can be represented as two side profile images of the same face. 4a can be represented as a side profile image with a non-zero pose angle when rotated around the Z-axis, and 4b can be represented as a side profile image with a zero pose angle when rotated around the Z-axis (i.e., corresponding to the first face image mentioned above). For Figure 4 The profile image represented by 4a needs to be aligned so that the pose angle of the profile image rotated around the Z-axis is adjusted to match the Z-axis. Figure 4 The pose angle of the profile image represented by 4b in the figure is consistent with the rotation around the Z-axis.

[0088] After obtaining the first face image, a first vector corresponding to the first face image can be obtained, where the first vector can be obtained based on a trained deep learning neural network. It is understood that the deep learning neural network mentioned in this embodiment can output random face images based on the input vector. Based on this, multiple different random vectors can be input into the deep learning neural network. Each random face image output by the deep learning neural network corresponding to the random vector is matched with the first face image. When the matching result meets the requirements, the random vector corresponding to the random face image that meets the requirements can be used as the first vector corresponding to the first face image.

[0089] The method of matching the random face image with the first face image mentioned here can be, but is not limited to, comparing the similarity of each random face image with the first face image separately. The reference target for the similarity comparison can be the feature points extracted from the image, such as eyes, nose, mouth, and contours. The random face image with the highest similarity result is regarded as the closest to the first face image, and the random vector corresponding to the random face image with the highest similarity result can be used as the first vector corresponding to the first face image.

[0090] Step 304: Mirror the first face image to obtain the second face image, and obtain the second vector corresponding to the second face image.

[0091] Specifically, after acquiring the first face image, a mirroring operation can be performed on the first face image to obtain a second face image. The profile represented by the second face image is mirror-symmetrical to the profile represented by the first face image, and the pose angle of the second face image also meets preset conditions. (See here for more information.) Figure 5 The diagram shown is a schematic representation of a mirrored face image provided in an embodiment of this application. Figure 5 As shown, Figure 5 In this context, 5a can be represented as the first face image, whose pose angle around the Z-axis is equal to 0. Figure 5 5b in the diagram can be represented as a second face image that is mirror-symmetrical to the first face image. Its orientation angle around the Z-axis is also 0, and the profile of the second face image is vertically mirror-symmetrical to the profile of the first face image. It can be understood that the profile of the second face image can also be horizontally mirror-symmetrical to the profile of the first face image. However, since the orientation angle of the second face image, which is horizontally mirror-symmetrical to the profile of the first face image, around the Z-axis is not 0 (actually 180°), it is necessary to perform a horizontal flipping operation on the second face image to obtain a second face image with the same orientation angle as the first face image.

[0092] Furthermore, after obtaining a second face image that is a mirror image of the first face image, a second vector corresponding to the second face image can also be obtained. This second vector can be obtained based on a trained deep learning neural network. It is understood that the deep learning neural network mentioned in this embodiment can output random face images based on the input vectors. Based on this, multiple different random vectors can be input into the deep learning neural network. Each random face image output by the deep learning neural network corresponding to a random vector is matched with the second face image. When the matching result meets the requirements, the random vector corresponding to the random face image that meets the requirements can be used as the second vector corresponding to the second face image.

[0093] The method of matching the random face image with the first face image mentioned here can be, but is not limited to, comparing the similarity of each random face image with the first face image separately. The reference target for the similarity comparison can be the feature points extracted from the image, such as eyes, nose, mouth, and contours. The random face image with the highest similarity result is regarded as the closest to the first face image, and the random vector corresponding to the random face image with the highest similarity result can be used as the first vector corresponding to the first face image.

[0094] It is understandable that although the second face image is mirror-symmetric to the first face image, the random face image with the highest similarity to the second face image is different from the random face image with the highest similarity to the first face image, and their corresponding random vectors are also different.

[0095] Step 306: Determine the target vector based on the first vector and the second vector, and input the target vector into the image generation model to obtain the target face image.

[0096] Specifically, after obtaining the first vector corresponding to the first face image and the second vector corresponding to the second face image, a target vector can be determined by combining the first and second vectors. This target vector is then input into a trained image generation model to obtain a target face image that represents the frontal face of the first face image. The image generation model can be trained using multiple random vectors and sample images corresponding to each of these random vectors.

[0097] In this embodiment of the application, by mirroring the acquired side face image, a frontal face image is obtained by combining two mirror-symmetrical side face images while ensuring the consistency of the face image identity. This makes the generated frontal face image more similar to the side face image and has wider applicability.

[0098] As an optional embodiment, obtaining the first face image includes:

[0099] Obtain the initial face image;

[0100] Adjust the pose angle of the initial face image until the pose angle of the initial face image meets the preset conditions, and use the initial face image whose pose angle meets the preset conditions as the first face image.

[0101] When performing frontal face conversion on an image, it is difficult to directly obtain the first face image because the pose angle of the first face image needs to meet the preset conditions. Generally, the initial face image can be preprocessed to obtain the first face image.

[0102] Specifically, an unprocessed initial face image can be obtained first. This initial face image can be understood as an easily accessible face image, such as a face image directly captured by a camera or obtained directly through a search. It is understood that since the unprocessed initial face image may contain faces that are too small or unclear, face detection can be performed on the initial face image after acquisition, and a face detection algorithm can be used to extract the region image containing the face. The face detection algorithm can, but is not limited to, first determining whether facial feature points exist in the initial face image, then labeling the initial face image with these feature points if they are found, and finally determining the region image containing all facial feature points within the initial face image based on the labeled feature points. The face detection algorithm mentioned here can be any conventional face recognition technology, which will not be elaborated upon here, and this embodiment is not limited to the face detection algorithm implementation method mentioned above.

[0103] Furthermore, after extracting the region image including the face from the initial face image, a spatial Cartesian coordinate system can be established based on the extracted initial face image, and the pose angle of the extracted initial face image can be adjusted so that the pose angle of the extracted initial face image meets a preset condition. The preset condition can be that the angle between the vertical axis of the plane containing the first face image and the face represented by the first face image is 0.

[0104] This example uses the pose angle of the initial face image as the pose angle rotated around the Z-axis. (See also...) Figure 6 The illustration shows another example of a face image with different pose angles provided by an embodiment of this application. For example... Figure 6 As shown, Figure 6In the diagram, 6a can be represented as a profile image with a non-zero pose angle when rotated around the Z-axis. Specifically, the pose angle can be the angle θ between the Y-axis of the plane containing the profile image and the face represented by the profile image. It can be understood that a calibration line (represented as a dashed line in 6a) passing through the origin can be set in the profile image to align the face. The face represented by the aforementioned profile image can be represented by this calibration line. In this case, the pose angle of the profile image rotating around the Z-axis can be the angle between the calibration line and the Y-axis, and when the calibration line coincides with the Y-axis, it indicates that the pose angle around the Z-axis is equal to 0. Figure 6 In this context, 6b can be represented as a profile image with a pose angle of 0 when rotated around the Z-axis (the calibration line coincides with the Y-axis, meaning the pose angle meets a preset condition). For example, this can be achieved by... Figure 6 The profile image represented by 6a in the figure is rotated clockwise by θ around the origin to obtain... Figure 6 The side profile image represented by 6b in the figure can be used to make the posture angle of the side profile image rotated around the Z-axis meet the preset conditions.

[0105] In this embodiment of the application, the pose angle of the acquired initial face image can be adjusted to quickly acquire a face image whose pose angle meets the preset conditions, thereby improving the efficiency and quality of image processing.

[0106] As another option in this embodiment, the image generation model includes a first generation network and a second generation network;

[0107] The first generative network is used to generate random face images based on the input random vector;

[0108] The second generator network is trained on sample images based on known prediction values. The sample images include random face images and real face images. The random face images are input into the second generator network to obtain the first prediction value, and the real face images are input into the second generator network to obtain the second prediction value.

[0109] The image generation model is used to train the first generation network based on the predicted values ​​corresponding to random face images obtained by the second generation network, so that the trained first generation network is input into the second generation network based on random face images obtained by random vectors to obtain target predicted values ​​belonging to a preset threshold range.

[0110] See here. Figure 7 The diagram shown illustrates the processing flow of an image generation model provided in an embodiment of this application. Figure 7As shown, the first generator network can be considered an image generation model used to generate random face images based on input random vectors. Here, the random vectors can be, but are not limited to, one or more random vectors that satisfy a normal distribution, and each random vector input to the first generator network produces a different random face image. It is understood that since the random face images are generated by the first generator network, they are not equivalent to real face images. The second generator network can be considered an image discrimination model used to obtain a predicted value representing whether an input sample image belongs to a real image. It is understood that when the input sample image is a random face image generated by the first generator network, the second generator network outputs a first predicted value representing that it does not belong to a real image, for example, but not limited to, a first predicted value of 0. When the input sample image is a real face image, the second generator network outputs a second predicted value representing that it belongs to a real image, for example, but not limited to, a second predicted value of 1. The real face images here can be, but are not limited to, multiple face images that cover at least one of the following factors: different scenes, different face rotation angles, different skin tones, different races, different genders, different age groups, or different lighting intensities.

[0111] During the training of the image generation model, since a second generation network (i.e., an image discrimination model) is included, its training optimization process can be understood as finding a Nash balance between the first and second generation networks. In other words, the purpose of training the first generation network is to enable it to generate a near-realistic random face image based on the input random vector, and the purpose of training the second generation network is to enable it to generate a near-realistic prediction value based on the input random face image generated by the first generation network. The overall training process can be understood as the alternating iterative training of the first and second generation networks.

[0112] Specifically, when training the image generation model, a preset number of real face images can be set, such as ten real face images with different face rotation angles, and the expected number of iterations (training times) S can also be set. The model follows a Gaussian distribution z ~ N(0, 1). ZA random vector (or noise vector) of the same number as the preset sample is first sampled and input into the first generator network with initialized parameters to obtain a random face image. This random face image is obviously an unreal face image. Then, the random face image is converted into a vector representation, which can be denoted as G(Z). A real face image is randomly selected and converted into a vector representation, which can be denoted as X. Then, G(Z) and X can be used as inputs to the second generator network to obtain a prediction value between 0 and 1. 0 can be used to represent that the input image does not belong to a real face image, and 1 can be used to represent that the input image belongs to a real face image. The objective function of the second generator network is constructed based on this prediction value, which can be expressed by the following formula (1):

[0113] D=(1-y)×log(1-D(G(Z)))+y×log D(X) (1)

[0114] In this network, when the input vector to the second generator network corresponds to a real face image, D(X) is the predicted output value of the second generator network, and the objective function of the second generator network aims to make D(X) approach 1. When the input vector to the second generator network corresponds to a random face image, D(G(Z)) is the predicted output value of the second generator network, and the objective function of the second generator network aims to make D(G(Z)) approach 0. Here, the objective function of the second generator network can be iteratively trained using gradient descent, and the parameters of the second generator network can be optimized based on the training results.

[0115] Furthermore, after the parameters of the second generator network are optimized, the first generator network can construct its objective function based on the predicted values ​​obtained from the second generator network, which can be specifically expressed by the following equation (2):

[0116] G=(1-y)×log(1-D(G(Z)))×(2× D (G(Z))-1) (2)

[0117] in, D This can be represented as the predicted category of the second generator network, or it can be understood as classifying the obtained predicted values. For example, the predicted category can be 0 when the predicted value is between 0 and 0.5, and the predicted category can be 1 when the predicted value is between 0.5 and 1. The objective function of the first generator network here aims to make the random face image corresponding to G(Z) approximate the real face image. The objective function of the first generator network can be iteratively trained based on the gradient descent method, and the parameters of the first generator network can be optimized based on the training results.

[0118] Next, the objective function of the second generator network can be optimized based on multiple real face images and a corresponding number of random face images. The optimized objective function of the second generator network can be expressed by the following equation (3):

[0119] max D = E X~pr [log D(X)]+E X~pg [log(1-D(X))] (3)

[0120] Here, X can be represented as any vector input to the second generator network, pr can be represented as the distribution of real face images, and pg can be represented as the distribution of random face images.

[0121] Next, by combining the optimized second generator network objective function and the first generator network objective function mentioned above, the objective function V(D, G) of the image generation model can be obtained, which can be specifically expressed by the following equation (4):

[0122]

[0123] In this model, the first part of the objective function V(D,G) can be represented as the entropy of the distribution of real face images passing through the second generation network, whose purpose is to maximize the predicted value to 1. The second part of the objective function V(D,G) can be represented as the entropy of the distribution of random face images passing through the first generation network, whose purpose is to maximize the predicted value obtained by inputting the generated random face image into the second generation network to 0.

[0124] It should be noted that when the prediction value obtained by inputting the random face image obtained by the first generation network into the second generation network is 0.5 or close to 0.5, it indicates that the second generation network cannot distinguish the authenticity of the input face image, and it can be determined that the image generation model has been trained. At this time, the target vector can be input into the first generation network of the image generation model to obtain the target face image.

[0125] Please see Figure 8 , Figure 8 A flowchart illustrating another image processing method provided in an embodiment of this application is shown.

[0126] like Figure 8 As shown, the image processing method may include at least the following steps:

[0127] Step 802: Obtain the first face image.

[0128] Specifically, step 802 is the same as step 302, and will not be elaborated further here.

[0129] Step 804: Input the first random vector into the image generation model to obtain the third face image.

[0130] The first random vector here can be, but is not limited to, a random vector that satisfies a normal distribution. The image generation model can include a first generation network and a second generation network, wherein the first generation network is used to obtain random face images based on the input random vector, and the second generation network is used to train on sample images with known prediction values.

[0131] Specifically, a random vector can be collected from vectors that satisfy a normal distribution and input into the first generation network in the image generation model to obtain a random face image, which can then be used as a third face image.

[0132] Step 806: Construct a first loss function based on the first random vector, the first face image, and the third face image.

[0133] Specifically, the first random vector can be denoted as Z, the third face image can be converted into a vector representation denoted as G(Z), the first face image can be converted into a vector representation denoted as X, and a first loss function can be constructed based on the first random vector, the first face image, and the third face image. Z Specifically, it can be expressed by the following formula (5):

[0134]

[0135] Step 808: Optimize the first loss function to obtain the first vector corresponding to the first face image.

[0136] Specifically, the first random vector is iteratively optimized with the goal of minimizing ||G(Z)-X|| in the above formula (5), so that the random face image obtained by inputting the optimized first random vector into the first generator network is as close as possible to the first face image. Here, the expected number of iteration steps (training times) S can be set, and the first loss function is iteratively trained based on the gradient descent method, and the first random vector is optimized according to the training results.

[0137] Step 810: Mirror the first face image to obtain the second face image, and obtain the second vector corresponding to the second face image.

[0138] Specifically, step 810 is the same as step 304, so I will not go into details here.

[0139] Step 812: Determine the target vector based on the first vector and the second vector, and input the target vector into the image generation model to obtain the target face image.

[0140] Specifically, step 812 is the same as step 304, and will not be elaborated further here.

[0141] In this embodiment, the first vector corresponding to the first face image can be obtained through iterative optimization, which can improve the processing speed of obtaining the first vector and ensure the accuracy of the obtained first vector. This can make the generated frontal face image more similar to the side face image and have wider applicability.

[0142] As a preferred embodiment, obtaining the second vector corresponding to the second face image may specifically include:

[0143] The second random vector is input into the image generation model to obtain the fourth face image;

[0144] A second loss function is constructed based on the second random vector, the second face image, and the fourth face image;

[0145] The second loss function is optimized to obtain the second vector corresponding to the second face image.

[0146] Specifically, the method for obtaining the second vector corresponding to the second face image is the same as the method for obtaining the first vector corresponding to the first face image. A random vector can be collected from vectors that satisfy a normal distribution and input into the first generative network in the image generation model to obtain a random face image, which can then be used as the fourth face image. It is understood that since the vectors transformed from the second face image and the first face image mentioned above are different, the second random vector can also be the same as the first random vector. This allows for a faster and more accurate acquisition of the second vector corresponding to the second face image after the first vector corresponding to the first face image has been obtained, thereby improving the overall efficiency and accuracy of image processing.

[0147] The subsequent steps for constructing the second loss function based on the second random vector, the second face image, and the fourth face image can be found in step 806 above. The steps for optimizing the second loss function to obtain the second vector corresponding to the second face image can be found in step 808 above, and will not be elaborated further here.

[0148] Please see Figure 9 , Figure 9 A flowchart illustrating another image processing method provided in an embodiment of this application is shown.

[0149] like Figure 9 As shown, the image processing method may include at least the following steps:

[0150] Step 902: Obtain the first face image and obtain the first vector corresponding to the first face image.

[0151] Specifically, step 902 is the same as step 302, or the step of obtaining the first vector corresponding to the first face image in step 902 can be referred to steps 804 to 808, which will not be elaborated here.

[0152] Step 904: Mirror the first face image to obtain the second face image, and obtain the second vector corresponding to the second face image.

[0153] Specifically, step 904 is the same as step 304, or the step of obtaining the second vector corresponding to the second face image in step 904 can also be referred to steps 804 to 808, which will not be elaborated here.

[0154] Step 906: Calculate the average vector of the first vector and the second vector, and use the average vector as the target vector.

[0155] Specifically, based on the characteristics of vector decoupling, a linear interpolation operation can be performed on the first vector and the second vector, where the average vector of the first vector and the second vector is calculated. For example, if the first vector is represented by B and the second vector by C, the target vector D can be represented by the following equation (6):

[0156]

[0157] See also: Figure 10 The illustration shows a schematic diagram of the image processing effect provided by an embodiment of this application. For example... Figure 10 As shown, Figure 10 10a in the image can be represented as a side profile image whose pose angles meet preset conditions. Figure 10 In this context, 10b can be represented as a side-face image obtained by mirroring a side-face image whose pose angle meets preset conditions. The average vector obtained by calculating the vectors corresponding to the side-face image represented by 10a and the vectors corresponding to the side-face image represented by 10b is then input into the image generation model to obtain the following result: Figure 10 The 10c in the image represents the frontal face.

[0158] It is understood that this embodiment is not limited to performing linear interpolation on the first vector and the second vector to obtain the average vector. For example, the target vector can also be calculated by weighted summation of the first vector and the second vector.

[0159] In this embodiment, the characteristics of vector decoupling can be utilized to perform linear interpolation on the first vector and the second vector to obtain a target vector that combines the features of the first vector and the features of the second vector. This makes the generated frontal face image more similar to the side face image and has wider applicability.

[0160] Please see Figure 11 The diagram shown is a structural schematic of an image processing apparatus provided in an embodiment of this specification.

[0161] like Figure 11 As shown, the image processing device may include at least a first acquisition module 1101, a second acquisition module 1102, and a processing module 1103, wherein:

[0162] The first acquisition module 1101 is used to acquire a first face image and acquire a first vector corresponding to the first face image; the first face image is a side face image whose pose angle meets preset conditions;

[0163] The second acquisition module 1102 is used to perform a mirroring operation on the first face image to obtain a second face image, and to acquire a second vector corresponding to the second face image;

[0164] The processing module 1103 is used to determine the target vector based on the first vector and the second vector, and input the target vector into the image generation model to obtain the target face image; the image generation model is trained by multiple random vectors and sample images corresponding to each of the multiple random vectors, and the target face image is a frontal face image.

[0165] In some possible embodiments, the first acquisition module 1101 includes:

[0166] The acquisition unit is used to acquire the initial face image;

[0167] The first processing unit is used to adjust the pose angle of the initial face image until the pose angle of the initial face image meets the preset conditions, and to use the initial face image whose pose angle meets the preset conditions as the first face image.

[0168] In some possible embodiments, the preset condition is that the angle between the vertical axis of the plane where the first face image is located and the face represented by the first face image is 0.

[0169] In some possible embodiments, the first acquisition module 1101 further includes:

[0170] The second processing unit is used to input the first random vector into the image generation model to obtain the third face image;

[0171] The first construction unit is used to construct a first loss function based on a first random vector, a first face image, and a third face image;

[0172] The first optimization unit is used to optimize the first loss function to obtain the first vector corresponding to the first face image.

[0173] In some possible embodiments, the second acquisition module 1102 includes:

[0174] The third processing unit is used to input the second random vector into the image generation model to obtain the fourth face image;

[0175] The second construction unit is used to construct a second loss function based on the second random vector, the second face image, and the fourth face image;

[0176] The second optimization unit is used to optimize the second loss function to obtain the second vector corresponding to the second face image.

[0177] In some possible embodiments, the processing module 1103 is specifically used for:

[0178] Calculate the average vector of the first vector and the second vector, and use the average vector as the target vector.

[0179] In some possible embodiments, the image generation model includes a first generation network and a second generation network;

[0180] The first generative network is used to generate random face images based on the input random vector;

[0181] The second generator network is trained on sample images based on known prediction values. The sample images include random face images and real face images. The random face images are input into the second generator network to obtain the first prediction value, and the real face images are input into the second generator network to obtain the second prediction value.

[0182] The image generation model is used to train the first generation network based on the predicted values ​​corresponding to random face images obtained by the second generation network, so that the trained first generation network is input into the second generation network based on random face images obtained by random vectors to obtain target predicted values ​​belonging to a preset threshold range.

[0183] Please see Figure 12 The diagram shown is a structural schematic of another image processing apparatus provided in an embodiment of this specification.

[0184] like Figure 12 As shown, the image processing device 1200 may include at least one processor 1201, at least one network interface 1204, a user interface 1203, a memory 1205, and at least one communication bus 1202.

[0185] The communication bus 1202 can be used to realize the connection and communication of the above components.

[0186] The user interface 1203 may include buttons, and the optional user interface may also include a standard wired interface or a wireless interface.

[0187] The network interface 1204 may include, but is not limited to, Bluetooth modules, NFC modules, Wi-Fi modules, etc.

[0188] The processor 1201 may include one or more processing cores. The processor 1201 connects to various parts within the electronic device 1200 using various interfaces and lines. It executes various functions of the routing device 1200 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1205, and by calling data stored in the memory 1205. Optionally, the processor 1201 may be implemented using at least one hardware form of DSP, FPGA, or PLA. The processor 1201 may integrate one or more of the following: CPU, GPU, and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 1201 and may be implemented as a separate chip.

[0189] The memory 1205 may include RAM or ROM. Optionally, the memory 1205 may include a non-transitory computer-readable medium. The memory 1205 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 1205 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 1205 may also be at least one storage device located remotely from the aforementioned processor 1201. Figure 12 As shown, the memory 1205, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an image processing application.

[0190] Specifically, the processor 1201 can be used to call the image processing application stored in the memory 1205 and perform the following operations:

[0191] Obtain a first face image and obtain a first vector corresponding to the first face image; the first face image is a profile image whose pose angle meets preset conditions;

[0192] The first face image is mirrored to obtain the second face image, and the second vector corresponding to the second face image is obtained.

[0193] The target vector is determined based on the first vector and the second vector, and the target vector is input into the image generation model to obtain the target face image. The image generation model is trained by multiple random vectors and sample images corresponding to each of the multiple random vectors. The target face image is a frontal face image.

[0194] In some possible embodiments, when the processor 1201 acquires the first face image, it specifically performs the following:

[0195] Obtain the initial face image;

[0196] Adjust the pose angle of the initial face image until the pose angle of the initial face image meets the preset conditions, and use the initial face image whose pose angle meets the preset conditions as the first face image.

[0197] In some possible embodiments, the preset condition is that the angle between the vertical axis of the plane where the first face image is located and the face represented by the first face image is 0.

[0198] In some possible embodiments, when the processor 1201 obtains the first vector corresponding to the first face image, it specifically performs the following:

[0199] The first random vector is input into the image generation model to obtain the third face image;

[0200] A first loss function is constructed based on the first random vector, the first face image, and the third face image;

[0201] The first loss function is optimized to obtain the first vector corresponding to the first face image.

[0202] In some possible embodiments, when the processor 1201 obtains the second vector corresponding to the second face image, it specifically performs the following:

[0203] The second random vector is input into the image generation model to obtain the fourth face image;

[0204] A second loss function is constructed based on the second random vector, the second face image, and the fourth face image;

[0205] The second loss function is optimized to obtain the second vector corresponding to the second face image.

[0206] In some possible embodiments, when the processor 1201 determines the target vector based on the first vector and the second vector, it specifically performs the following:

[0207] Calculate the average vector of the first vector and the second vector, and use the average vector as the target vector.

[0208] In some possible embodiments, the image generation model includes a first generation network and a second generation network;

[0209] The first generative network is used to generate random face images based on the input random vector;

[0210] The second generator network is trained on sample images based on known prediction values. The sample images include random face images and real face images. The random face images are input into the second generator network to obtain the first prediction value, and the real face images are input into the second generator network to obtain the second prediction value.

[0211] The image generation model is used to train the first generation network based on the predicted values ​​corresponding to random face images obtained by the second generation network, so that the trained first generation network is input into the second generation network based on random face images obtained by random vectors to obtain target predicted values ​​belonging to a preset threshold range.

[0212] This specification also provides a computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform the above-described instructions. Figure 3 or Figure 8 or Figure 9 One or more steps in the illustrated embodiment. If the constituent modules of the above-described electronic device are implemented as software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium.

[0213] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this specification are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)).

[0214] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks. Unless otherwise specified, the technical features of this embodiment and its implementation can be combined arbitrarily.

[0215] The embodiments described above are merely preferred embodiments of this specification and are not intended to limit the scope of this specification. Any modifications and improvements made by those skilled in the art to the technical solutions of this specification without departing from the spirit of this specification should fall within the protection scope defined by the claims of this specification.

Claims

1. An image processing method, characterized in that, include: A first face image is obtained, and a first vector corresponding to the first face image is obtained; the first face image is a profile image whose pose angle meets preset conditions; The first face image is mirrored to obtain the second face image, and the second vector corresponding to the second face image is obtained. A target vector is determined based on the first vector and the second vector, and the target vector is input into an image generation model to obtain a target face image; the image generation model is trained by multiple random vectors and sample images corresponding to each of the multiple random vectors, and the target face image is a frontal face image; The step of obtaining the first vector corresponding to the first face image includes: The first random vector is input into the image generation model to obtain the third face image; A first loss function is constructed based on the first random vector, the first face image, and the third face image; The first loss function is optimized to obtain a first vector corresponding to the first face image.

2. The method according to claim 1, characterized in that, The acquisition of the first face image includes: Obtain the initial face image; Adjust the pose angle of the initial face image until the pose angle of the initial face image meets the preset condition, and use the initial face image whose pose angle meets the preset condition as the first face image.

3. The method according to claim 2, characterized in that, The preset condition is that the angle between the vertical axis of the plane where the first face image is located and the face represented by the first face image is 0.

4. The method according to claim 1, characterized in that, The step of obtaining the second vector corresponding to the second face image includes: The second random vector is input into the image generation model to obtain the fourth face image; A second loss function is constructed based on the second random vector, the second face image, and the fourth face image; The second loss function is optimized to obtain a second vector corresponding to the second face image.

5. The method according to any one of claims 1-4, characterized in that, The step of determining the target vector based on the first vector and the second vector includes: Calculate the average vector of the first vector and the second vector, and use the average vector as the target vector.

6. The method according to claim 5, characterized in that, The image generation model includes a first generation network and a second generation network; The first generative network is used to generate random face images based on the input random vector; The second generator network is trained on sample images with known prediction values; the sample images include the random face images and real face images, the random face images are input into the second generator network to obtain a first prediction value, and the real face images are input into the second generator network to obtain a second prediction value; The image generation model is used to train the first generation network based on the predicted value corresponding to the random face image obtained by the second generation network, so that the trained first generation network is input into the second generation network based on the random face image obtained by the random vector to obtain a target predicted value belonging to a preset threshold range.

7. An image processing apparatus, characterized in that, include: The first acquisition module is used to acquire a first face image and acquire a first vector corresponding to the first face image; the first face image is a side face image whose pose angle meets preset conditions; The second acquisition module is used to perform a mirroring operation on the first face image to obtain a second face image, and to acquire a second vector corresponding to the second face image; The processing module is used to determine a target vector based on the first vector and the second vector, and input the target vector into an image generation model to obtain a target face image; the image generation model is trained by multiple random vectors and sample images corresponding to each of the multiple random vectors, and the target face image is a frontal face image; The first acquisition module further includes: The second processing unit is used to input the first random vector into the image generation model to obtain a third face image; The first construction unit is used to construct a first loss function based on the first random vector, the first face image, and the third face image; The first optimization unit is used to optimize the first loss function to obtain a first vector corresponding to the first face image.

8. The apparatus according to claim 7, characterized in that, The first acquisition module includes: The acquisition unit is used to acquire the initial face image; The first processing unit is used to adjust the pose angle of the initial face image until the pose angle of the initial face image meets the preset condition, and to use the initial face image whose pose angle meets the preset condition as the first face image.

9. The apparatus according to claim 8, characterized in that, The preset condition is that the angle between the vertical axis of the plane where the first face image is located and the face represented by the first face image is 0.

10. The apparatus according to claim 7, characterized in that, The second acquisition module includes: The third processing unit is used to input the second random vector into the image generation model to obtain the fourth face image; The second construction unit is used to construct a second loss function based on the second random vector, the second face image, and the fourth face image; The second optimization unit is used to optimize the second loss function to obtain a second vector corresponding to the second face image.

11. The apparatus according to any one of claims 7-10, characterized in that, The processing module is specifically used for: Calculate the average vector of the first vector and the second vector, and use the average vector as the target vector.

12. The apparatus according to claim 11, characterized in that, The image generation model includes a first generation network and a second generation network; The first generative network is used to generate random face images based on the input random vector; The second generator network is trained on sample images based on known prediction values. The sample images include random face images and real face images. The random face images are input into the second generator network to obtain the first prediction value, and the real face images are input into the second generator network to obtain the second prediction value. The image generation model is used to train the first generation network based on the predicted values ​​corresponding to random face images obtained by the second generation network, so that the trained first generation network is input into the second generation network based on random face images obtained by random vectors to obtain target predicted values ​​belonging to a preset threshold range.

13. An image processing apparatus, characterized in that, Including the processor and memory; The processor is connected to the memory; The memory is used to store executable program code; The processor runs a program corresponding to the executable program code stored in the memory to perform the method as described in any one of claims 1-6.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.