Image generation method and device, electronic equipment and storage medium

By constructing and using hidden vector generation models, the number of personal images required for LoRA model training is reduced, the experience of digital identity production is improved, the problem of difficult image acquisition in the existing technology is solved, and the promotion of digital identity is promoted.

CN119131865APending Publication Date: 2024-12-13DUXIAOMAN TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411284037.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The existing LoRA model requires a large number of personal images in digital identity production, which leads to poor experience of the target object and difficult operation, which in turn affects the promotion and use of digital identity.

Method used

By acquiring the original face image of the target object, constructing the first hidden vector and the second hidden vector of the reference face image, generating the target face image of the target object under different face postures, reducing the personal image demand for the target object.

Benefits of technology

It improves the experience of the target object in digital identity production, simplifies the image acquisition process, and promotes the promotion and use of digital identity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131865A_ABST
    Figure CN119131865A_ABST
Patent Text Reader

Abstract

The invention provides an image generation method and device, electronic equipment and a storage medium, and relates to the field of deep learning. In the application, after an original face image of a target object is obtained, a set number of third implicit vectors can be constructed according to a first implicit vector corresponding to the original face image and second implicit vectors respectively corresponding to a set number of reference face images determined by the number of face images required for training a LoRA model. In this way, after the set number of third implicit vectors are input into the pre-trained face image generation model, the target face images of the target object under the face poses corresponding to the set number of reference face images respectively can be generated. Therefore, when the digital identity is made for the target object, the target object does not need to provide more personal images, and only one original image needs to be provided, so that the experience feeling of the target object on making the digital identity is improved, and the popularization and the use of the data identity are facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of deep learning, and in particular to an image generation method, device, electronic device and storage medium. Background Art

[0002] With the rapid development of artificial intelligence generated content (AIGC) technology, diffusion models are widely used in various aspects of daily life. For example, the low-rank adaptation (LoRA) model, as a lightweight and stable diffusion model, can often be used to produce the digital identity of the target object.

[0003] Specifically, when creating a digital identity for a target object, a LoRA model related to the target object's digital identity creation can usually be trained based on a certain number (for example, 18) personal images provided by the target object, thereby generating the target object's digital identity through the trained LoRA model.

[0004] However, the training method of the LoRA model requires the target object to provide a large number of personal images and the personal images are highly private, which leads to the target object having a poor experience in digital identity creation (e.g., the operation is difficult) and then giving up the creation of digital identity, which is not conducive to the promotion and use of digital identity. Summary of the invention

[0005] The embodiments of the present application provide an image generation method, device, electronic device and storage medium to improve the target object's experience in digital identity production and facilitate the promotion and use of digital identity.

[0006] In a first aspect, an embodiment of the present application provides an image generation method, the method comprising:

[0007] Acquire an original image containing a target object, and perform face detection on the original image to obtain an original face image of the target object;

[0008] Based on the first latent vector corresponding to the original face image and the second latent vectors corresponding to the set number of reference face images, a set number of third latent vectors are constructed; wherein the first latent vector represents the face posture feature in the original face image, and each second latent vector represents the face posture feature in the corresponding reference face image, and the set number is determined according to the number of face images required for training the LoRA model;

[0009] A set number of third latent vectors are input into a pre-trained face image generation model to generate target face images of the target object under face postures corresponding to the set number of reference face images.

[0010] In an optional embodiment, performing face detection on the original image to obtain the original face image of the target object includes:

[0011] Perform face detection on the original image based on a preset face detection frame to obtain a corresponding face detection area;

[0012] If the face detection area contains multiple face key points set for the face detection frame, the original image is cropped based on the face detection area to obtain the original face image.

[0013] In an optional embodiment, the face image generation model is trained in the following manner:

[0014] Acquire multiple sample image combinations of the sample object; wherein each sample image combination includes two sample images, and the facial postures of the sample object in different sample images are different;

[0015] Based on a combination of multiple sample images, the face image generation model is iteratively trained for multiple times, and when it is determined that the image loss value of the face image generation model meets the convergence condition, the training of the face image generation model is stopped.

[0016] In an optional embodiment, obtaining a plurality of sample image combinations of a sample object includes:

[0017] Acquire video data information of a sample object; wherein the video data information includes: face change information of the sample object within a set continuous time range;

[0018] According to the set time interval, multiple frames of sample images are obtained from the video data information, and two adjacent frames of sample images in the multiple frames of sample images are taken as a sample image combination to obtain multiple sample image combinations.

[0019] In an optional embodiment, based on a combination of multiple sample images, the face image generation model is trained for multiple iterations, including:

[0020] During one training iteration, the following operations are performed:

[0021] Performing face detection on two sample images included in the first sample image combination respectively to obtain a first face image and a second face image; wherein the first sample image combination is any one of a plurality of sample image combinations;

[0022] Based on the latent vector corresponding to the first face image and the latent vector corresponding to the second face image, a fused latent vector is obtained; wherein the fused latent vector is used to indicate that the face posture of the sample object is adjusted from the face posture in the first face image to the face posture in the second face image;

[0023] Input the fused latent vector into the face image generation model to generate a third face image;

[0024] Based on the image loss value between the third facial image and the second facial image, model parameters of the facial image generation model are updated.

[0025] In an optional embodiment, obtaining a fused latent vector based on a latent vector corresponding to the first face image and a latent vector corresponding to the second face image includes:

[0026] Concatenate the latent vector corresponding to the first face image and the latent vector corresponding to the second face image to obtain a concatenated latent vector;

[0027] The facial posture feature fusion operation is performed on the spliced ​​latent vector to obtain the fused latent vector.

[0028] In an optional embodiment, the time of the video data corresponding to the first facial image is earlier than the time of the video data corresponding to the second facial image.

[0029] In a second aspect, an embodiment of the present application further provides an image generating device, the device comprising:

[0030] An image acquisition module is used to acquire an original image containing a target object, and perform face detection on the original image to obtain an original face image of the target object;

[0031] A vector construction module, for constructing a set number of third latent vectors based on the first latent vector corresponding to the original face image and the second latent vectors corresponding to the set number of reference face images; wherein the first latent vector represents the face posture feature in the original face image, and each second latent vector represents the face posture feature in the corresponding reference face image, and the set number is determined according to the number of face images required for training the LoRA model;

[0032] The image generation module is used to input a set number of third latent vectors into a pre-trained face image generation model to generate target face images of the target object under face postures corresponding to the set number of reference face images.

[0033] In an optional embodiment, when performing face detection on an original image to obtain an original face image of a target object, the image acquisition module is specifically used to:

[0034] Perform face detection on the original image based on a preset face detection frame to obtain a corresponding face detection area;

[0035] If the face detection area contains multiple face key points set for the face detection frame, the original image is cropped based on the face detection area to obtain the original face image.

[0036] In an optional embodiment, the face image generation model is trained by the image generation module in the following manner:

[0037] Acquire multiple sample image combinations of the sample object; wherein each sample image combination includes two sample images, and the facial postures of the sample object in different sample images are different;

[0038] Based on a combination of multiple sample images, the face image generation model is iteratively trained for multiple times, and when it is determined that the image loss value of the face image generation model meets the convergence condition, the training of the face image generation model is stopped.

[0039] In an optional embodiment, when acquiring a combination of multiple sample images of a sample object, the image generation module is specifically used to:

[0040] Acquire video data information of a sample object; wherein the video data information includes: face change information of the sample object within a set continuous time range;

[0041] According to the set time interval, multiple frames of sample images are obtained from the video data information, and two adjacent frames of sample images in the multiple frames of sample images are taken as a sample image combination to obtain multiple sample image combinations.

[0042] In an optional embodiment, when the face image generation model is iteratively trained multiple times based on a combination of multiple sample images, the image generation module is specifically used to:

[0043] During one training iteration, the following operations are performed:

[0044] Performing face detection on two sample images included in the first sample image combination respectively to obtain a first face image and a second face image; wherein the first sample image combination is any one of the multiple sample image combinations;

[0045] Based on the latent vector corresponding to the first face image and the latent vector corresponding to the second face image, a fused latent vector is obtained; wherein the fused latent vector is used to indicate that the face posture of the sample object is adjusted from the face posture in the first face image to the face posture in the second face image;

[0046] Input the fused latent vector into the face image generation model to generate a third face image;

[0047] Based on the image loss value between the third facial image and the second facial image, model parameters of the facial image generation model are updated.

[0048] In an optional embodiment, when obtaining a fused latent vector based on the latent vector corresponding to the first face image and the latent vector corresponding to the second face image, the image generation module is specifically used to:

[0049] Concatenate the latent vector corresponding to the first face image and the latent vector corresponding to the second face image to obtain a concatenated latent vector;

[0050] The facial posture feature fusion operation is performed on the spliced ​​latent vector to obtain the fused latent vector.

[0051] In a third aspect, an embodiment of the present application further provides an electronic device, including:

[0052] Processor; and

[0053] Memory for storing programs,

[0054] The program includes instructions, which, when executed by a processor, cause the processor to execute the image generation method as described in the first aspect.

[0055] In a fourth aspect, an embodiment of the present application further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the image generation method as described in the first aspect.

[0056] In a fifth aspect, the present application provides a computer program product, which, when called by a computer, enables the computer to execute the steps of the image generation method as described in the first aspect.

[0057] The beneficial effects of this application are as follows:

[0058] In the image generation method provided in the embodiment of the present application, after obtaining the original facial image of the target object, a set number of third latent vectors can be constructed based on the first latent vector corresponding to the original facial image and the second latent vectors corresponding to the set number of reference facial images determined by the number of facial images required for training the LoRA model. In this way, after the set number of third latent vectors are input into the pre-trained facial image generation model, the target facial image of the target object in the facial posture corresponding to the set number of reference facial images can be generated. That is, multiple facial images of the target object required for training the LoRA model (such as the original human image and the set number of target facial images) are obtained.

[0059] It can be seen from this that when creating a digital identity for a target object, the target object no longer needs to provide a large number of personal images, but only needs to provide one personal image (such as an original image), which improves the target object's experience in digital identity creation and is conducive to the promotion and use of digital identity.

[0060] In addition, other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described here are used to provide a further understanding of the present application, constitute a part of the present application, and do not constitute an improper limitation on the present application. In the drawings:

[0062] Figure 1 A schematic diagram of an optional system architecture applicable to the embodiments of the present application;

[0063] Figure 2 A schematic diagram of an implementation flow of an image generation method provided in an embodiment of the present application;

[0064] Figure 3 A schematic diagram of a scene for obtaining an original image provided in an embodiment of the present application;

[0065] Figure 4 A schematic diagram of a process of cropping an original image provided in an embodiment of the present application;

[0066] Figure 5 A schematic diagram of a scenario for extracting a first latent vector and a second latent vector provided in an embodiment of the present application;

[0067] Figure 6 A schematic diagram of a specific application scenario of an existing image generation provided in an embodiment of the present application;

[0068] Figure 7 A schematic diagram of an implementation flow of a method for training a facial image generation model provided in an embodiment of the present application;

[0069] Figure 8 A schematic flow chart of a method for iterative training of a face image generation model provided in an embodiment of the present application;

[0070] Fig. 9 A method based on the embodiment of the present application is provided Figure 2 Schematic diagram of specific application scenarios;

[0071] Fig.10 A schematic diagram of the structure of an image generating device provided in an embodiment of the present application;

[0072] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0073] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes and are not intended to limit the scope of protection of the present application.

[0074] It should be understood that the various steps described in the method implementation of the present application can be performed in different orders and / or performed in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.

[0075] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0076] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0077] The names of the messages or information exchanged between multiple devices in the embodiments of the present application are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0078] Some of the terms used in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.

[0079] 1. Artificial intelligence (AI): It is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology of computer science, which attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.

[0080] Artificial intelligence technology is a comprehensive discipline. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction system, mechatronics, etc. Among them, the pre-trained model is also called the big model or basic model. After fine-tuning, it can be widely used in downstream tasks in various directions of artificial intelligence. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0081] 2. Computer vision (CV) technology: Computer vision is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision such as using cameras and computers to replace human eyes to identify and measure targets, and further perform graphic processing to make computer processing into images that are more suitable for human eye observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multidimensional data. Large model technology has brought important changes to the development of computer vision technology. Pre-trained models in the field of vision such as swin-transformer, vision transformer (ViT for short), vision mixture of experts (V-MOE), and masked autoencoders (MAE) can be quickly and widely applied to downstream specific tasks after fine tuning. Computer vision technology generally includes image processing, image recognition, image semantic understanding, image retrieval, optical character recognition (OCR), video processing, video semantic understanding, video content / behavior recognition, three-dimensional (3D) object reconstruction, three-dimensional technology, virtual reality, augmented reality, simultaneous positioning and map construction, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.

[0082] 3. Face detection: It is a subtask in the field of computer vision, whose goal is to automatically locate and identify faces in digital images or video frames. Face detection algorithms usually output a rectangular bounding box indicating the location of the face found in the image. This is the first step in face-related processing such as face recognition, face attribute analysis, and expression recognition.

[0083] 4. Generative adversarial networks (GAN): It is a deep learning model consisting of two models: a generator and a discriminator. The generator is used to generate false data similar to real data, and the discriminator is used to distinguish between real data and false data. The generator and the discriminator learn from each other in an adversarial way. In the end, the generator can generate high-quality false data, and the discriminator can distinguish between real and false data more accurately. GAN has a wide range of applications in image generation, speech synthesis, natural language processing and other fields.

[0084] 5. Digital identity: It is a concept relative to physical identity. Physical identity refers to some physical objects that can prove the user's citizenship, such as identity cards, motor vehicle driver's licenses, xx area passes, home return permits, etc. The user's plain text identity information can be directly obtained through physical identity, while digital identity can be understood as presenting the user's identity information in the form of digital information. The informatization of digital identity can be a digital identity tag.

[0085] Based on the above-mentioned nouns and related terminology explanations, the design concept of the embodiments of the present application is briefly introduced below:

[0086] At present, various applications (applications, APPs) or products related to digital identity production usually require users (i.e., objects) to upload a certain number of personal images (for example, 15 to 20 personal life photos). After using the aforementioned certain number of personal images to train the LoRA model related to the user's digital identity production, the user's digital identity (or digital identity identifier) ​​can be generated through the trained LoRA model. Among them, requiring users to upload a certain number of personal images is to ensure that in the process of training the aforementioned LoRA model, the aforementioned LoRA model can fully learn the user's identity information in different facial postures (for example, front face, side face, lowered head, raised head, etc.). In this way, when the aforementioned LoRA model is combined with the basic diffusion model, a digital identity with a very high similarity to the user's identity can be generated.

[0087] However, requiring users to upload a certain number of personal images may be too cumbersome for most users, especially for some users who may not have too many personal images or are unwilling to upload too many personal images for personal privacy reasons. That is, the training method of the above-mentioned LoRA model requires the subject to provide a large number of personal images and the personal images are more private, which leads to the target subject's poor experience in digital identity production (e.g., the operation is more difficult), and then gives up the production of digital identity, which is not conducive to the promotion and use of digital identity.

[0088] In view of this, in order to improve the target object's experience of digital identity production and facilitate the promotion and use of digital identity, an embodiment of the present application proposes an image generation method, which specifically includes: obtaining an original image containing a target object, and performing face detection on the original image to obtain the original face image of the target object; then, based on the first latent vector corresponding to the original face image and the second latent vectors corresponding to a set number of reference face images, a set number of third latent vectors are constructed; wherein the first latent vector represents the facial posture features in the original face image, and each second latent vector represents the facial posture features in the corresponding reference face image, and the set number is determined according to the number of face images required for training the LoRA model; finally, the set number of third latent vectors are input into a pre-trained face image generation model to generate the target face image of the target object under the facial postures corresponding to the set number of reference face images.

[0089] In this way, when creating a digital identity for a target object, the target object no longer needs to provide more personal images, but only one personal image (such as an original image), which improves the target object's experience in creating a digital identity, thereby facilitating the promotion and use of digital identities. In addition, based on the multiple reference face images determined according to the number of face images required for training the LoRA model and the pre-trained face image generation model, target face images of the target object in multiple different face postures can be generated, thereby ensuring the subsequent training of the LoRA model, and then the digital identity of the target object can be created based on the trained LoRA model.

[0090] In particular, the preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application, and the embodiments of the present application and the features in the embodiments may be combined with each other if there is no conflict.

[0091] See also Figure 1As shown, it is a schematic diagram of a system architecture applicable to an embodiment of the present application, and the system architecture may include: a terminal device (101a, 101b) and a server 102. The terminal device (101a, 101b) and the server 102 may exchange information through a communication network, wherein the communication mode adopted by the communication network may include: a wireless communication mode and a wired communication mode. Exemplarily, the terminal device (101a, 101b) may access the network through cellular mobile communication technology and communicate with the server 102. Wherein, the cellular mobile communication technology, for example, includes the fifth generation mobile communication (5th generation mobile networks, 5G) technology or the next generation mobile communication technology. Optionally, the terminal device (101a, 101b) may access the network through a short-range wireless communication mode and communicate with the server 102. Wherein, the short-range wireless communication mode, for example, includes wireless fidelity (wireless fidelity, Wi-Fi) technology.

[0092] The embodiment of the present application does not impose any restriction on the number of communication devices involved in the above system architecture. For example, the above system architecture may include more terminal devices, or fewer terminal devices, or other network devices. Figure 1 As shown, only the terminal devices (101a, 101b) and the server 102 are described as examples, and the above communication devices and their respective functions are briefly introduced below.

[0093] The terminal device (101a, 101b) is a device that can provide voice and / or data connectivity to users, and can be a device that supports wired and / or wireless connection.

[0094] Exemplarily, the terminal devices (101a, 101b) may include, but are not limited to: mobile phones, tablet computers, laptop computers, PDAs, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminal devices in industrial control, wireless terminal devices in unmanned driving, wireless terminal devices in smart grids, wireless terminal devices in transportation safety, wireless terminal devices in smart cities, or wireless terminal devices in smart homes, etc.

[0095] In addition, a related client may be installed on the terminal device (101a, 101b), and the client may be software, such as an APP, a browser, a short video software, etc., or a web page, a small program, etc.; it should be noted that in the embodiment of the present application, the terminal device (101a, 101b) may enable the above-mentioned client related to image generation to send the original image of the target object to the server 102 respectively, so as to perform subsequent image generation and other method steps.

[0096] Optionally, the terminal device (101a, 101b) can enable the above-mentioned client related to image generation to send video data information of the sample object to the server 102, so as to perform multiple iterations of training on the face image generation model.

[0097] Server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0098] It should be noted that if Figure 1 As shown, in an embodiment of the present application, a pre-trained facial image generation model is deployed on the server 102. The facial image generation model can generate a target facial image of the target object in the facial postures corresponding to a set number of reference facial images according to a set number of third latent vectors constructed by a first latent vector corresponding to the original facial image and a set number of second latent vectors corresponding to the reference facial images.

[0099] It is worth mentioning that in an embodiment of the present application, the server 102 can be used to obtain an original image containing a target object, and perform face detection on the original image to obtain the original face image of the target object; then, based on the first latent vector corresponding to the original face image, and the second latent vectors corresponding to a set number of reference face images, a set number of third latent vectors are constructed; wherein the first latent vector represents the facial posture features in the original face image, and each second latent vector represents the facial posture features in the corresponding reference face image, and the set number is determined according to the number of face images required for training the LoRA model; finally, the set number of third latent vectors are input into a pre-trained face image generation model to generate the target face image of the target object under the facial postures corresponding to the set number of reference face images.

[0100] The image generation method provided by the exemplary embodiment of the present application is described below in combination with the above-mentioned system architecture and with reference to the accompanying drawings. It should be noted that the above-mentioned system architecture is only shown to facilitate understanding of the spirit and principles of the present application, and the implementation of the present application is not limited in this regard.

[0101] See also Figure 2 As shown, it is a schematic diagram of an implementation process of an image generation method provided in an embodiment of the present application. The execution subject takes a server as an example. The specific implementation process of the method is as follows:

[0102] S201: Acquire an original image containing a target object, and perform face detection on the original image to obtain an original face image of the target object.

[0103] For example, see Figure 3 As shown, when executing step S201, the server can send an original image acquisition request to the terminal device of the target object, so that the target terminal will prompt the target object to upload the original image. After the user uploads the original image containing the target object, the target terminal can send the original image containing the target object to the server.

[0104] In an optional implementation, the server may perform face detection on the original image based on a preset face detection frame to obtain a corresponding face detection area; and, if the aforementioned face detection area contains multiple face key points set for the aforementioned face detection frame, the server may crop the original image based on the face detection area to obtain the original face image (that is, the sub-original image corresponding to the aforementioned face detection area).

[0105] The above-mentioned facial key points may be marking points for identifying facial features, for example, they may generally include: boundaries and feature points of eyes, nose, mouth, eyebrows, ears, etc. These facial key points may generally be used to extract facial features, perform face recognition, expression recognition, etc. This embodiment of the present application does not specifically limit this.

[0106] See also Figure 4 As shown in the figure, take the original image containing only one object, the target object, as an example. First, face detection needs to be performed on the original image containing the target object to obtain Figure 4 Then, if the detection area corresponding to the face detection frame does not contain multiple face key points set for the face detection frame, the face detection frame can be expanded according to a preset expansion size to obtain Figure 4 The face detection frame in B corresponds to the face detection area. At this time, the face detection area contains multiple face key points set for the face detection frame, that is, the face area. Figure 4 The face area in B is cropped to obtain Figure 4 The cropped image shown in C (i.e. the original face image). Figure 4 As shown in D, the aforementioned cropped image may also be adjusted (eg, enlarged or reduced) to a fixed size. It should be noted that in the embodiment of the present application, the expansion method of the aforementioned face detection frame is not specifically limited.

[0107] Optionally, the server may use an open source face detection model (eg, insight face) to obtain a face detection frame in the original image, and use the face detection frame to crop out a face region in the original image to obtain an original face image.

[0108] In order to facilitate the subsequent extraction of facial posture features of the target object in the original facial image, if the target object in the original image is in a tilted state (for example, the target object's eyebrows are below and the mouth is above, etc.), the original image can be adjusted first (that is, adjusted to a state where the eyebrows are above and the mouth is below). The face in the adjusted original image may still be skewed to a certain extent, so the facial tilt angle of the target object in the original image can also be calculated based on the facial features, and the original image can be calibrated horizontally, such as using affine transformation to adjust the face to a horizontal state.

[0109] S202: Constructing a set number of third latent vectors based on the first latent vector corresponding to the original face image and the second latent vectors corresponding to a set number of reference face images.

[0110] The first latent vector represents the facial posture features in the original face image, and each second latent vector represents the facial posture features in the corresponding reference face image. Therefore, each constructed third latent vector can represent the facial posture features in the original face image and the facial posture features in the corresponding reference face image.

[0111] Optionally, the above-mentioned set number can be determined according to the number of face images required for training the LoRA model. For example, assuming that the number of face images required for training the LoRA model is 17, then based on the original face images, 16 face images of different face postures are required for training the LoRA model, so the above-mentioned set number can be 16.

[0112] Exemplarily, when executing step S202, refer to Figure 5As shown, the server can perform latent vector encoding on the original face image (Source) through the encoder (encoder) in encoder4editing (abbreviated as e4e). After receiving the original face image, encoder4editing can generate a latent vector, namely the first latent vector, through the encoder. Optionally, the aforementioned first latent vector can be expressed as latent_e4e. And, the server can also perform latent vector encoding on the above-mentioned set number of reference face images according to the preset deep 3D face reconnaissance (Deep3DFaceRecon) model. As shown Figure 5 As shown, taking any reference face image (i.e., the first reference face image) among the set number of reference face images as an example, the server can perform latent vector encoding on the first reference face image (Target) through the Deep3DFaceRecon model to generate a second latent vector. Optionally, the aforementioned second latent vector can be expressed as latent_deep3d.

[0113] Further, after obtaining the first latent vector latent_e4e and the second latent vector latent_deep3d, the server can concatenate the first latent vector latent_e4e and the second latent vector latent_deep3d to obtain a concatenated latent vector latent, and then perform a fully connected layer operation on the concatenated latent vector latent to fuse the facial posture features corresponding to the first latent vector latent_e4e and the second latent vector latent_deep3d to obtain a third latent vector. Optionally, the third latent vector can be expressed as latent_stylegan2.

[0114] S203: Input a set number of third latent vectors into a pre-trained face image generation model to generate target face images of the target object in face postures corresponding to the set number of reference face images.

[0115] The pre-trained face image generation model can be the pre-trained style GAN 2 model in the encoder4editing. Figure 6 As shown, after receiving an original face image (Source) and generating a first latent vector latent_e4e through the encoder, the existing encoder4editing can pass the first latent vector latent_e4e to the pretrained style GAN 2 model for encoding to generate an output image that is basically similar to the original face image, namely, the target face image (Target).

[0116] Of course, the above-mentioned pre-trained face image generation model can also be other network models, and the embodiments of the present application are not limited to this. For ease of understanding, the following description takes the above-mentioned face image generation model as the style GAN 2 model as an example.

[0117] In an alternative implementation, see Figure 7 As shown, the above-mentioned pre-trained face image generation model can be trained in the following way:

[0118] S701: Acquire a plurality of sample image combinations of a sample object.

[0119] Each sample image combination may include two sample images, and the facial postures of the sample objects in different sample images are different. In this way, after the facial image generation model is subsequently trained by the above-mentioned multiple sample image combinations, the pre-trained facial image generation model can generate a facial image with a different facial posture from the input image (i.e., the original facial image) according to the facial posture in the reference facial image, that is, generate a facial image with the facial posture in the reference facial image.

[0120] The above sample image combination can also be referred to as face posture matching data. Of course, it can also have other names. In the embodiments of the present application, no specific limitation is made to this.

[0121] In an optional implementation, when executing step S701, the server may obtain video data information of the sample object; wherein the video data information may include facial change information of the sample object within a set continuous time range; then, at a set time interval, multiple frames of sample images are obtained from the video data information, and two adjacent frames of sample images in the multiple frames of sample images are taken as a sample image combination to obtain multiple sample image combinations.

[0122] The above-set time interval may be a video data time interval, for example, the above-set time interval may be 2 seconds. Of course, the above-set time interval may also be a video data frame interval, for example, the above-set video data frame interval may be t frames, and t may be any value in [15, 30, 45, 60, 75, 90, 105]. This embodiment of the present application is not limited to this.

[0123] Exemplarily, taking the above-set time interval as t frames as an example, the server can use an open source image processing tool (for example, an open source computer vision library (Open CV)) to process the video data information of the above-mentioned sample object, and split the video data information into a series of independent sample images, that is, obtain multiple frames of sample images. Then, the server can use a frame extraction strategy to construct face posture pairing data (i.e., sample image combination). For example, the aforementioned multiple frames of sample images are sorted according to the order of their original frames; then, a starting frame is randomly selected, denoted as s; then, a video data frame interval is randomly selected in the value list of t [15, 30, 45, 60, 75, 90, 105]; finally, the sample image corresponding to the s-th frame and the sample image of the s+t-th frame are used as pairing data (i.e., sample image data combination).

[0124] For another example, if 200 frames of sample images are obtained from the video data information at a set time interval, two adjacent frames of sample images (for example, the first frame of sample image and the second frame of sample image) in the 200 frames of sample images are taken as a sample image combination, and 100 sample image combinations can be obtained.

[0125] It should be noted that the video data information of the sample object may include only the sample object, and of course, may also include one or more objects other than the sample object, which is not specifically limited in the embodiments of the present application. If the video data information of the sample object includes multiple objects, it is only necessary to filter out the sample image containing the sample object from the multiple frames of sample images obtained according to the video data information.

[0126] S702: Based on the combination of multiple sample images, perform multiple iterations of training on the face image generation model, and stop training the face image generation model when it is determined that the image loss value of the face image generation model meets the convergence condition.

[0127] Exemplarily, the convergence condition may be that the image loss value loss of the face image generation model reaches a set image loss threshold loss_threshold, or the loss reduction rate reaches a set reduction rate threshold lossrate_threshold.

[0128] In an alternative implementation, see Figure 8 As shown, during an iterative training process for the face image generation model, the server may use any one of the above-mentioned multiple sample image combinations, namely, the first sample image combination, to perform the following operations:

[0129] S801: Perform face detection on two sample images included in the first sample image combination to obtain a first face image and a second face image.

[0130] In an optional implementation, when executing step S801, the server may perform face detection on the two sample images based on a preset face detection frame to obtain face detection areas corresponding to the two sample images respectively (e.g., a first face detection area and a second face detection area); and, if the two face detection areas both contain multiple face key points set for the face detection frame, the server may crop the two sample images respectively based on the two face detection areas to obtain a first face image (i.e., a sub-sample image corresponding to the first face detection area) and a second face image (i.e., a sub-sample image corresponding to the second face detection area).

[0131] It should be noted that, in order to improve the accuracy of the face image generation model, when the number of sample image combinations is small, each of the multiple sample image combinations can be used for multiple iterative training of the face image generation model. Of course, if the number of sample image combinations is large, each of the multiple sample image combinations only needs to be used for one iterative training of the face image generation model to improve the generalization ability of the model.

[0132] S802: Obtain a fused latent vector based on the latent vector corresponding to the first face image and the latent vector corresponding to the second face image.

[0133] The fused latent vector is used to indicate that the facial posture of the sample object is adjusted from the facial posture in the first facial image to the facial posture in the second facial image. In other words, the first facial image is used as the original facial image (Source), that is, the input data of the facial image generation model, and the second facial image is used as the target facial image (Target), that is, the expected (or ideal) output data of the facial image generation model.

[0134] Exemplarily, when executing step S802, the server may perform latent vector encoding on the first face image through the encoder in encoder4editing to generate a latent vector latent_e4e corresponding to the first face image, and perform latent vector encoding on the second face image through the Deep3DFaceRecon model to generate a latent vector latent_deep3d corresponding to the second face image. Further, after obtaining the latent vector latent_e4e corresponding to the first face image and the latent vector latent_deep3d corresponding to the second face image, the server may concatenate the latent vector latent_e4e corresponding to the first face image and the latent vector latent_deep3d corresponding to the second face image, thereby obtaining a concatenated latent vector latent, and then perform a facial posture feature fusion operation on the concatenated latent vector latent (i.e., perform a fully connected layer operation on the concatenated latent vector latent) to obtain a fused latent vector latent_stylegan2.

[0135] In an optional implementation, the video data time corresponding to the first facial image is earlier than the video data time corresponding to the second facial image. For example, assuming that the video data time corresponding to the aforementioned video data information is 0 to 45 minutes, the video data time corresponding to the first facial image may be 20 minutes and 30 seconds, while the video data time corresponding to the second facial image may be 20 minutes and 45 seconds, that is, 20 minutes and 30 seconds is earlier than 20 minutes and 45 seconds. For another example, assuming that the number of sample image frames corresponding to the aforementioned video data information is 1000 frames in total and the video data frame interval is 30 frames, then the video data time corresponding to the first facial image may be the 270th frame of the sample image, and the video data time corresponding to the second facial image may be the 300th frame of the sample image.

[0136] S803: Input the fused latent vector into the face image generation model to generate a third face image.

[0137] Taking the face image generation model as the style GAN 2 model as an example, after the server inputs the fused latent vector latent_stylegan2 into the style GAN 2 model, the style GAN 2 model can decode the aforementioned fused latent vector latent_stylegan2 to obtain the face generated image predicted by the model (that is, the third face image, which can be recorded as Target').

[0138] S804: Based on the image loss value between the third facial image and the second facial image, update the model parameters of the facial image generation model.

[0139] Among them, the above-mentioned image loss value represents: the difference in facial posture between the third facial image and the second facial image, that is, the difference between the facial image generated by the above-mentioned facial image generation model and the target facial image.

[0140] Specifically, when executing step S804, the server can calculate the image loss value between the third face image (Target') and the second face image (ie, Target), thereby updating the model parameters of the style GAN 2 model according to the aforementioned image loss value. It should be noted that in the embodiment of the present application, the specific calculation method of the aforementioned image loss value and the specific types and categories of the model parameters of the face image generation model are not limited.

[0141] Based on the above method, after the training of the above-mentioned face image generation model is completed, it can generate a target face image with facial posture features similar to or the same as the reference face image according to the input original face image, and then after obtaining the number of face images that meet the training requirements of the LoRA model, it can be used for subsequent training of the LoRA model to create a digital identity.

[0142] Exemplarily, compared with the existing encoder4editing, the image generation method based on the above steps S201 to S203 achieves an improvement on the existing encoder4editing. Fig. 9 As shown in the figure, after receiving an original face image (Source), the improved encoder4editing can generate the first latent vector latent_e4e through the encoder; and can encode a reference face image (Target1) through the Deep3DFaceRecon model to obtain the second latent vector latent_deep3d, and then generate the target face image (Target2) under the face posture corresponding to the reference face image through the pre-trained style GAN 2 model. It can be seen that the improved encoder4editing can meet the needs of accurate adjustment of face posture, and further improve the reliability of the subsequent digital identity.

[0143] In summary, in the image generation method provided in the embodiment of the present application, after obtaining the original facial image of the target object, a set number of third latent vectors can be constructed based on the first latent vector corresponding to the original facial image and the second latent vectors corresponding to the set number of reference facial images determined by the number of facial images required for training the LoRA model. In this way, after the set number of third latent vectors are input into the pre-trained facial image generation model, the target facial images of the target object in the facial postures corresponding to the set number of reference facial images can be generated, that is, multiple facial images of the target object required for training the LoRA model are obtained. It can be seen that when making a digital identity for the target object, the target object no longer needs to provide more personal images, but only needs to provide one personal image (such as the original image), which improves the target object's experience in the production of digital identities, thereby facilitating the promotion and use of digital identities.

[0144] Further, based on the same technical concept, the embodiment of the present application provides an image generation device, which is used to implement the above method flow of the embodiment of the present application. Fig.10 As shown, the image generation device 1000 includes: an image acquisition module 1001, a vector construction module 1002 and an image generation module 1003, wherein:

[0145] The image acquisition module 1001 is used to acquire an original image containing a target object and perform face detection on the original image to obtain an original face image of the target object;

[0146] A vector construction module 1002 is used to construct a set number of third latent vectors based on the first latent vector corresponding to the original face image and the second latent vectors corresponding to the set number of reference face images respectively; wherein the first latent vector represents the face posture feature in the original face image, and each second latent vector represents the face posture feature in the corresponding reference face image, and the set number is determined according to the number of face images required for training the LoRA model;

[0147] The image generation module 1003 is used to input a set number of third latent vectors into a pre-trained face image generation model to generate target face images of the target object in face postures corresponding to a set number of reference face images.

[0148] In an optional embodiment, when performing face detection on an original image to obtain an original face image of a target object, the image acquisition module 1001 is specifically used to:

[0149] Perform face detection on the original image based on a preset face detection frame to obtain a corresponding face detection area;

[0150] If the face detection area contains multiple face key points set for the face detection frame, the original image is cropped based on the face detection area to obtain the original face image.

[0151] In an optional embodiment, the face image generation model is trained by the image generation module 1003 in the following manner:

[0152] Acquire multiple sample image combinations of the sample object; wherein each sample image combination includes two sample images, and the facial postures of the sample object in different sample images are different;

[0153] Based on a combination of multiple sample images, the face image generation model is iteratively trained for multiple times, and when it is determined that the image loss value of the face image generation model meets the convergence condition, the training of the face image generation model is stopped.

[0154] In an optional embodiment, when acquiring a combination of multiple sample images of a sample object, the image generation module 1003 is specifically used to:

[0155] Acquire video data information of a sample object; wherein the video data information includes: face change information of the sample object within a set continuous time range;

[0156] According to the set time interval, multiple frames of sample images are obtained from the video data information, and two adjacent frames of sample images in the multiple frames of sample images are taken as a sample image combination to obtain multiple sample image combinations.

[0157] In an optional embodiment, when the face image generation model is iteratively trained multiple times based on a combination of multiple sample images, the image generation module 1003 is specifically used to:

[0158] During one training iteration, the following operations are performed:

[0159] Performing face detection on two sample images included in the first sample image combination respectively to obtain a first face image and a second face image; wherein the first sample image combination is any one of the multiple sample image combinations;

[0160] Based on the latent vector corresponding to the first face image and the latent vector corresponding to the second face image, a fused latent vector is obtained; wherein the fused latent vector is used to indicate that the face posture of the sample object is adjusted from the face posture in the first face image to the face posture in the second face image;

[0161] Input the fused latent vector into the face image generation model to generate a third face image;

[0162] Based on the image loss value between the third facial image and the second facial image, model parameters of the facial image generation model are updated.

[0163] In an optional embodiment, when obtaining a fused latent vector based on the latent vector corresponding to the first face image and the latent vector corresponding to the second face image, the image generation module 1003 is specifically used to:

[0164] Concatenate the latent vector corresponding to the first face image and the latent vector corresponding to the second face image to obtain a concatenated latent vector;

[0165] The facial posture feature fusion operation is performed on the spliced ​​latent vector to obtain the fused latent vector.

[0166] Based on the description of the above method embodiment and device embodiment, the exemplary embodiment of the present invention further provides an electronic device, including: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program that can be executed by the at least one processor, and the computer program is used to enable the electronic device to perform the method according to the embodiment of the present invention when executed by the at least one processor.

[0167] An embodiment of the present application also provides a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute a method according to an embodiment of the present application.

[0168] An embodiment of the present application also provides a computer program product, including a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute a method according to an embodiment of the present application.

[0169] See also Fig.11 As shown, the structured block diagram of the electronic device 1100 that can be used as the server or client of the present application will now be described, which is an example of the hardware device that can be applied to various aspects of the present application. The electronic device is intended to represent the computer device of various forms of digital electronics, such as, laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only used as examples, and are not intended to limit the implementation of the present application described herein and / or required.

[0170] like Fig.11As shown, the electronic device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded from a storage unit 1108 to a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the device 1100 can also be stored. The computing unit 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0171] Multiple components in the electronic device 1100 are connected to the I / O interface 1105, including: an input unit 1106, an output unit 1107, a storage unit 1108, and a communication unit 1109. The input unit 1106 can be any type of device that can input information to the electronic device 1100, and the input unit 1106 can receive input digital or character information, and generate key signal input related to user settings and / or function control of the electronic device. The output unit 1107 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 1108 can include but is not limited to a disk, an optical disk. The communication unit 1109 allows the electronic device 1100 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, a WiFi device, a worldwide interoperability for microwave access (WiMax) device, a cellular communication device, and / or the like.

[0172] The computing unit 1101 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1101 performs the various methods and processes described above. For example, in some embodiments, the above-mentioned image generation method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1108. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 1100 via the ROM 1102 and / or the communication unit 1109. In some embodiments, the computing unit 1101 may be configured to perform the above-mentioned image generation method in any other appropriate manner (e.g., by means of firmware).

[0173] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0174] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM) or a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0175] As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0176] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tub (CRT) or a liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0177] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0178] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0179] Furthermore, it should be understood that what is disclosed above is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope covered by the present application.

Claims

1. An image generation method, characterized in that: include: Acquire an original image containing a target object, and perform face detection on the original image to obtain an original face image of the target object; Based on the first latent vector corresponding to the original face image and the second latent vectors corresponding to the set number of reference face images, construct the set number of third latent vectors; wherein the first latent vector represents the facial posture feature in the original face image, and each second latent vector represents the facial posture feature in the corresponding reference face image, and the set number is determined according to the number of face images required for training the LoRA model; The set number of third latent vectors are input into a pre-trained face image generation model to generate target face images of the target object in face postures corresponding to the set number of reference face images respectively.

2. The method according to claim 1, characterized in that The performing face detection on the original image to obtain the original face image of the target object includes: Performing face detection on the original image based on a preset face detection frame to obtain a corresponding face detection area; If the face detection area includes a plurality of face key points set for the face detection frame, the original image is cropped based on the face detection area to obtain the original face image.

3. The method according to claim 1 or 2, characterized in that The face image generation model is trained in the following way: Acquire multiple sample image combinations of the sample object; wherein each sample image combination includes two sample images, and the facial postures of the sample object in different sample images are different; Based on the multiple sample image combinations, the face image generation model is iteratively trained for multiple times, and when it is determined that the image loss value of the face image generation model meets the convergence condition, the training of the face image generation model is stopped.

4. The method according to claim 3, characterized in that The step of obtaining a combination of multiple sample images of the sample object comprises: Acquire video data information of the sample object; wherein the video data information includes: face change information of the sample object within a set continuous time range; At a set time interval, multiple frames of sample images are obtained from the video data information, and two adjacent frames of sample images in the multiple frames of sample images are taken as a sample image combination to obtain the multiple sample image combinations.

5. The method according to claim 3, characterized in that The performing multiple iterative training on the face image generation model based on the multiple sample image combinations includes: During one training iteration, the following operations are performed: Performing face detection on two sample images included in the first sample image combination respectively to obtain a first face image and a second face image; wherein the first sample image combination is any one of the multiple sample image combinations; Based on the latent vector corresponding to the first face image and the latent vector corresponding to the second face image, a fused latent vector is obtained; wherein the fused latent vector is used to indicate that the face posture of the sample object is adjusted from the face posture in the first face image to the face posture in the second face image; Inputting the fused latent vector into the face image generation model to generate a third face image; Based on the image loss value between the third facial image and the second facial image, the model parameters of the facial image generation model are updated.

6. The method according to claim 5, characterized in that The obtaining of a fused latent vector based on the latent vector corresponding to the first face image and the latent vector corresponding to the second face image includes: splicing the latent vector corresponding to the first face image and the latent vector corresponding to the second face image to obtain a spliced ​​latent vector; A face posture feature fusion operation is performed on the spliced ​​latent vector to obtain the fused latent vector.

7. The method according to claim 5 or 6, characterized in that The video data time corresponding to the first facial image is earlier than the video data time corresponding to the second facial image.

8. An image generating device, characterized in that: include: An image acquisition module is used to acquire an original image containing a target object, and perform face detection on the original image to obtain an original face image of the target object; A vector construction module, configured to construct the set number of third latent vectors based on the first latent vector corresponding to the original face image and the second latent vectors corresponding to the set number of reference face images; wherein the first latent vector represents the face posture feature in the original face image, and each second latent vector represents the face posture feature in the corresponding reference face image, and the set number is determined according to the number of face images required for training the LoRA model; The image generation module is used to input the set number of third latent vectors into a pre-trained face image generation model to generate target face images of the target object in the face postures corresponding to the set number of reference face images.

9. An electronic device, comprising: processor; as well as Memory for storing programs, The program includes instructions, which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.