Image processing method and device, storage medium and computer device
By extracting facial image features and using a facial processing model to generate and adjust the facial parameters of virtual avatars, the problem of existing technologies failing to meet users' personalization and beautification needs is solved, thus realizing the beautification and personalization of virtual avatars.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-08
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies for converting facial images into virtual avatars cannot meet users' needs for personalization and enhancement.
By extracting features from facial images, facial processing models are used to generate and adjust the facial parameters of virtual avatars, including beautification and stylization models, to achieve automatic adjustment of the virtual avatar's face.
It enables the generation of virtual avatars based on facial images to have beautification effects and personalization, meeting the diverse needs of users.
Smart Images

Figure CN114757836B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of images, and more specifically, to an image processing method, apparatus, storage medium, and computer device. Background Technology
[0002] With the development of 3D rendering technology and the widespread availability of hardware capable of supporting 3D rendering, in today's era of widespread short videos and live streaming, it is an obvious trend to transform real-world objects, especially their faces, into 3D virtual avatars and incorporate them into videos. However, in the process of converting facial images into virtual avatars, simply pursuing consistency between the modeled results and sample images is insufficient to meet user needs.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This invention provides an image processing method, apparatus, storage medium, and computer device to at least solve the technical problem in the related art that converting facial images into virtual images cannot meet user needs.
[0005] According to one aspect of the present invention, an image processing method is provided, comprising: acquiring a facial image of an object; extracting facial features from the facial image; generating a face of a virtual avatar based on the facial features, wherein the face of the virtual avatar is represented by a first set of facial parameters; inputting the first set of facial parameters into a facial processing model to obtain a second set of facial parameters, wherein the facial processing model is obtained by machine training using a first dataset, the first dataset including: a facial image, a first set of facial parameters to be processed, and a second set of facial parameters after processing the face; and adjusting the face of the virtual avatar based on the second set of facial parameters.
[0006] Optionally, when the face processing model includes a first beautification model, inputting the first face parameter set into the face processing model to obtain the second face parameter set includes: inputting the first face parameter set into the first beautification model to obtain a first beautification parameter set for the face, wherein the second face parameter set includes the first beautification parameter set, and the first beautification model is obtained by machine training using a second dataset, the second dataset including: a face photo, a face parameter set of the face of a virtual avatar corresponding to the face photo, and a first adjusted face parameter set after adjusting the face based on the face photo; adjusting the face of the virtual avatar according to the second face parameter set includes: adjusting the face of the virtual avatar according to the first beautification parameter set to obtain the beautified face of the virtual avatar.
[0007] Optionally, when the face processing model includes a second beautification model, inputting the first face parameter set into the face processing model to obtain the second face parameter set includes: inputting the first face parameter set into the second beautification model to obtain a second beautification parameter set for the face, wherein the second face parameter set includes: a second beautification parameter set, the second beautification model is obtained by machine training using a third dataset, the third dataset includes: a beautified photo corresponding to the face photo, a face parameter set of the virtual image's face corresponding to the beautified photo, and a second adjusted face parameter set after adjusting the face based on the beautified photo; adjusting the face of the virtual image according to the second face parameter set includes: adjusting the face of the virtual image according to the second beautification parameter set to obtain the beautified face of the virtual image.
[0008] Optionally, when the face processing model includes a first stylization model, inputting the first face parameter set into the face processing model to obtain the second face parameter set includes: inputting the first face parameter set into the first stylization model to obtain a first stylization parameter set for the face, wherein the second face parameter set includes: the first stylization parameter set, the first stylization model being obtained through machine training using a fourth dataset, the fourth dataset including: a face photo, a face parameter set of the virtual avatar corresponding to the face photo, and a third adjusted face parameter set after adjusting the face based on the face photo; adjusting the face of the virtual avatar according to the second face parameter set includes: adjusting the face of the virtual avatar according to the first stylization parameter set to obtain the stylized face of the virtual avatar.
[0009] Optionally, when the face processing model includes a second stylization model, inputting the first face parameter set into the face processing model to obtain the second face parameter set includes: inputting the first face parameter set into the second stylization model to obtain a second stylization parameter set for the face, wherein the second face parameter set includes: the second stylization parameter set, the second stylization model being obtained through machine training using a fifth dataset, the fifth dataset including: a cartoon photo corresponding to the face photo, a face parameter set for the face of the virtual character corresponding to the cartoon photo, and a fourth adjusted face parameter set after adjusting the face based on the cartoon photo; adjusting the face of the virtual character according to the second face parameter set includes: adjusting the face of the virtual character according to the second stylization parameter set of the face to obtain the stylized face of the virtual character.
[0010] Optionally, generating the face of the virtual avatar based on the facial features includes: inputting the facial features into an adversarial generative model to obtain a cartoon image corresponding to the facial image, wherein the adversarial generative model is obtained by machine training using a sixth dataset, the sixth dataset including: a facial image, and a cartoon image after the facial image has been cartoonized; extracting the cartoon features of the cartoon image, and generating the face of the virtual avatar based on the cartoon features.
[0011] Optionally, the set of facial parameters includes a set of fusion deformation values of facial features.
[0012] Optionally, the facial image includes: a sculpted image obtained after sculpting the face.
[0013] According to another aspect of the present invention, an image processing method is also provided, comprising: acquiring a first dataset, wherein the first dataset includes: a face image, a first set of face parameters to be processed, and a second set of face parameters after processing the face, wherein the face is the face of a virtual image corresponding to the face image, and the face of the virtual image is generated based on the face features in the face image; and performing machine training using the first dataset to obtain a face processing model.
[0014] Optionally, the face processing model includes at least one of the following: a beautification model for enhancing the face of the virtual avatar; and a stylization model for stylizing the face of the virtual avatar.
[0015] According to another aspect of the present invention, an image processing method is also provided, comprising: receiving a facial image at an interactive interface; and displaying a processed face of a virtual avatar at the interactive interface, wherein the processed face of the virtual avatar is generated based on a second set of facial parameters, the second set of facial parameters being obtained by processing a first set of facial parameters, the first set of facial parameters representing an unprocessed face of the virtual avatar, and the unprocessed face of the virtual avatar being generated based on facial features of the facial image.
[0016] Optionally, before displaying the virtual avatar's face on the interactive interface, the method further includes: displaying options on the interactive interface, wherein the options are used to select a face processing method, wherein the face processing method includes at least one of the following: a beautification method that enhances the face of the virtual avatar, and a stylization method that stylizes the face of the virtual avatar; receiving a selection of the option and displaying the face of the virtual avatar corresponding to the selection on the interactive interface, wherein the face of the virtual avatar corresponding to the selection is generated by processing the first face parameter set using the face processing method corresponding to the selection to obtain a second face parameter set.
[0017] According to another aspect of the present invention, an image processing apparatus is also provided, comprising: a first acquisition module for acquiring a facial image of an object; a first extraction module for extracting facial features from the facial image; a first generation module for generating a face of a virtual avatar based on the facial features, wherein the face of the virtual avatar is represented by a first set of facial parameters; a first processing module for inputting the first set of facial parameters into a facial processing model to obtain a second set of facial parameters, wherein the facial processing model is obtained by machine training using a first dataset, the first dataset including: a facial image, a first set of facial parameters to be processed, and a second set of facial parameters after processing the face; and a first adjustment module for adjusting the face of the virtual avatar based on the second set of facial parameters.
[0018] According to another aspect of the present invention, an image processing apparatus is also provided, comprising: a second acquisition module, configured to acquire a first dataset, wherein the first dataset includes: a face image, a first set of face parameters to be processed, and a second set of face parameters after processing the face, wherein the face is the face of a virtual image corresponding to the face image, and the face of the virtual image is generated based on the face features in the face image; and a first training module, configured to perform machine training using the first dataset to obtain a face processing model.
[0019] According to another aspect of the present invention, an image processing apparatus is also provided, comprising: a first receiving module for receiving a facial image at an interactive interface; and a first display module for displaying a processed face of a virtual avatar at the interactive interface, wherein the processed face of the virtual avatar is generated based on a second set of facial parameters, the second set of facial parameters being obtained by processing a first set of facial parameters, the first set of facial parameters representing an unprocessed face of the virtual avatar, and the unprocessed face of the virtual avatar being generated based on facial features of the facial image.
[0020] According to another aspect of the present invention, a storage medium is also provided, the storage medium including a stored program, wherein, when the program is executed, the device where the storage medium is located controls the execution of the image processing method described in any one of the above embodiments.
[0021] According to another aspect of the present invention, a computer device is also provided, comprising: a memory and a processor, the memory storing a computer program; the processor being configured to execute the computer program stored in the memory, wherein the computer program, when executed, causes the processor to perform the image processing method described in any of the preceding embodiments.
[0022] In this embodiment of the invention, a face processing model is used to extract facial features from a face image and generate a virtual image's face. Then, the facial parameters of the virtual image are input into the face processing model and adjusted, thereby achieving the purpose of automatically adjusting the face of the virtual image. This realizes the technical effect of processing the face of a virtual image generated from a face image, and solves the technical problem in related technologies that converting face images into virtual images cannot meet user needs. Attached Figure Description
[0023] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0024] Figure 1 This is a block diagram of a computer terminal hardware structure for implementing an image processing method according to an embodiment of the present invention;
[0025] Figure 2 This is a flowchart of an image processing method according to Embodiment 1 of the present invention;
[0026] Figure 3 This is a flowchart of image processing method two according to Embodiment 1 of the present invention;
[0027] Figure 4 This is a flowchart of image processing method three according to Embodiment 1 of the present invention;
[0028] Figure 5 This is a schematic diagram illustrating a training material generation method according to an optional embodiment of the present invention;
[0029] Figure 6 This is a schematic diagram of a stylized network training process according to an optional embodiment of the present invention;
[0030] Figure 7 This is a schematic diagram of an image processing method according to an optional embodiment of the present invention;
[0031] Figure 8 This is a schematic diagram of a cartoon-style character creation process according to an optional embodiment of the present invention;
[0032] Figure 9 This is a structural block diagram of an image processing apparatus according to Embodiment 2 of the present invention;
[0033] Figure 10 This is a structural block diagram of the image processing apparatus 2 according to Embodiment 3 of the present invention;
[0034] Figure 11 This is a structural block diagram of the image processing apparatus three according to Embodiment 4 of the present invention;
[0035] Figure 12 This is a structural block diagram of a computer terminal according to an embodiment of the present invention. Detailed Implementation
[0036] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0037] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0038] Example 1
[0039] According to an embodiment of the present invention, an embodiment of an image processing method is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0040] The method embodiment provided in Embodiment 1 of this application can be executed in a mobile terminal, computer terminal or similar computing device. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing an image processing method is shown. Figure 1As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0041] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0042] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the image processing method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-mentioned application vulnerability detection method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0043] The transmission device is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of computer terminal 10. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0044] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0045] Under the aforementioned operating environment, this application provides the following: Figure 2 The image processing method shown. Figure 2 This is a flowchart of an image processing method according to Embodiment 1 of the present invention, as follows: Figure 2 As shown, the method includes the following steps:
[0046] Step S202: Obtain the face image of the object;
[0047] Step S204: Extract facial features from the face image;
[0048] Step S206: Generate the face of the virtual avatar based on facial features, wherein the face of the virtual avatar is represented by a first set of facial parameters;
[0049] Step S208: Input the first set of facial parameters into the facial processing model to obtain the second set of facial parameters. The facial processing model is obtained by machine training using the first dataset. The first dataset includes: facial images, the first set of facial parameters to be processed, and the second set of facial parameters after processing the face.
[0050] Step S210: Adjust the face of the virtual avatar according to the second set of facial parameters.
[0051] Through the above steps, a face processing model is used to extract facial features from a face image and generate a virtual avatar's face. Then, the facial parameters of the virtual avatar are input into the face processing model and adjusted, achieving the goal of automatically adjusting the virtual avatar's face. This realizes the technical effect of processing the face of a virtual avatar generated from a face image, thereby solving the technical problem in related technologies where converting face images into virtual avatars cannot meet user needs. As a result, the face of a virtual avatar generated from a face image has both beautification and personalization effects.
[0052] As an optional embodiment, the face can include a human face, an animal face, etc. The face processing model can be a face optimization model used to optimize the set of facial parameters of a virtual avatar. For example, this face optimization model can be used to adjust the set of facial parameters of a virtual avatar to make the virtual avatar's face more aesthetically pleasing; or, for example, it can be used to adjust the set of facial parameters of a virtual avatar to make the virtual avatar's face more stylized. Through this face optimization model, the displayed virtual avatar's face can better meet the user's personalized requirements.
[0053] As an optional embodiment, the face processing model may include a first beautification model. When the face processing model includes a first beautification model, a first set of face parameters can be input into the first beautification model to obtain a second set of face parameters: The first set of face parameters is input into the first beautification model to obtain a first beautification parameter set for the face, wherein the second set of face parameters includes the first beautification parameter set. The first beautification model is obtained through machine training using a second dataset, which includes: a face photo, a set of face parameters for the face of a virtual avatar corresponding to the face photo, and a first set of adjusted face parameters after adjusting the face based on the face photo; adjusting the virtual avatar's face according to the second set of face parameters includes: adjusting the virtual avatar's face according to the first beautification parameter set to obtain a beautified face for the virtual avatar. When beautifying a face, the face is beautified according to the needs of most users. Therefore, the first beautification model is used to process the set of face parameters, and the first beautification parameter set obtained from the processing is used to beautify the set of face parameters of the virtual avatar, thus achieving the beautification of the virtual avatar's face. It should be noted that the dataset used to train the first beautification model includes facial photos, the set of facial parameters for the corresponding virtual avatar's face, and the first set of adjusted facial parameters after adjusting the face based on the facial photos. This dataset can be collected as follows: invite a large number of users to take photos of their faces, generate virtual avatar facial movements based on the photos, present the generated virtual avatar face to the users, and then provide an interface for adjusting the set of facial parameters. Users are guided to adjust the generated facial model for beautification purposes. The user-input photo, the set of facial parameters for the virtual avatar generated from the photo, and the set of facial parameters adjusted by the user are then used as training data for the first beautification model. Since the training data is adjusted by users based on realistic aesthetics, it better reflects users' beautification needs, making subsequent adjustments to the set of facial parameters using the first beautification model more realistic and accurate. The set of facial parameters can be Blendshape values, and the first beautification model can be a neural network model.
[0054] As an optional embodiment, the face processing model may include a second beautification model. When the face processing model includes a second beautification model, a first set of face parameters can be input into the second beautification model to obtain a second set of face parameters: The first set of face parameters is input into the second beautification model to obtain a second beautification parameter set for the face, wherein the second set of face parameters includes: a second beautification parameter set; the second beautification model is obtained through machine training using a third dataset, the third dataset including: a beautified photo corresponding to the face photo, a set of face parameters for the face of the virtual avatar corresponding to the beautified photo, and a second set of adjusted face parameters after adjusting the face based on the beautified photo; adjusting the face of the virtual avatar according to the beautification parameter set includes: adjusting the face of the virtual avatar according to the second beautification parameter set to obtain a beautified face of the virtual avatar.
[0055] Optionally, this embodiment provides another method for training a model to beautify the face of a virtual avatar. The training dataset used by the second beautification model may include a beautified photo corresponding to a face photo, a set of facial parameters for the virtual avatar's face corresponding to the beautified photo, and a second set of adjusted facial parameters after adjusting the face based on the beautified photo. That is, before generating the virtual avatar's face from the face image, the face image is beautified first, avoiding the subsequent parameter tuning process, thus overcoming the problem of low efficiency caused by users' unfamiliarity with manual parameter tuning. The set of facial parameters can be Blendshape values, and the second beautification model can be a neural network model.
[0056] As an optional embodiment, the face processing model may include a first stylization model. When the face processing model includes a first stylization model, a first set of face parameters can be input into the first stylization model to obtain a second set of face parameters: The first set of face parameters is input into the first stylization model to obtain a first set of stylized face parameters, wherein the second set of face parameters includes: the first set of stylized face parameters; the first stylization model is obtained through machine training using a fourth dataset; the fourth dataset includes: a face photograph, a set of face parameters for the face of a virtual avatar corresponding to the face photograph, and a third set of adjusted face parameters after adjusting the face based on the face photograph; adjusting the face of the virtual avatar according to the second set of face parameters includes: adjusting the face of the virtual avatar according to the first set of stylized face parameters to obtain a stylized face of the virtual avatar.
[0057] Using the first stylization model, users can enhance the stylistic features of a virtual avatar's face, resulting in a more personalized and distinctive appearance. The trained first stylization model can be a neural network model, and the set of facial parameters can be Blendshape values.
[0058] As an optional embodiment, the face processing model may include a second stylization model. When the face processing model includes a second stylization model, a first set of face parameters can be input into the second stylization model to obtain a second set of stylized face parameters: The first set of face parameters is input into the second stylization model to obtain a second set of stylized face parameters, wherein the second set of face parameters includes: a second set of stylized face parameters; the second stylization model is obtained through machine training using a fifth dataset, which includes: a cartoon image corresponding to the face photo; a set of face parameters for the face of the virtual avatar corresponding to the cartoon image; and a fourth set of adjusted face parameters after adjusting the face based on the cartoon image; adjusting the face of the virtual avatar according to the second set of face parameters includes: adjusting the face of the virtual avatar according to the second set of stylized face parameters to obtain a stylized face of the virtual avatar.
[0059] Optionally, this embodiment can provide users with a cartoonish virtual avatar's face that matches a facial image. Cartoonish image processing cannot be achieved simply by adjusting the user's facial parameter set; therefore, a second stylization model can be used to assist in transforming the facial image into a cartoonish photograph. Then, the virtual avatar's face can be adjusted accordingly based on the cartoonish photograph to obtain a highly cartoonish virtual avatar's face.
[0060] As an optional embodiment, generating a virtual avatar's face based on facial features can be achieved as follows: Facial features are input into an adversarial generative model to obtain a cartoon image corresponding to the facial image. The adversarial generative model is trained using a sixth dataset, which includes: a facial image and a cartoonized version of the facial image. Cartoon features are extracted from the cartoon image, and the virtual avatar's face is generated based on these features. The adversarial generative model can be a trained adversarial generative neural network, obtained through deep learning by machine, capable of cartoonizing facial images.
[0061] As an optional embodiment, the facial parameter set may include a set of blended deformation values for facial features. Specifically, the facial parameter set may be a blendshape value. Through the facial parameter set, a precise description of specific facial features can be achieved; changing the facial parameter set can alter the shape, style, and other detailed features of the facial image.
[0062] As an optional embodiment, the facial image may include a sculpted image obtained after pinching the face. Using a sculpted image can expand the range of images that can be processed, providing users with a wider range of facial image processing services.
[0063] Figure 3This is a flowchart of the second image processing method according to Embodiment 1 of the present invention, as follows: Figure 3 As shown, the method includes the following steps:
[0064] Step S302: Obtain the first dataset, which includes: a face image, a first set of face parameters to be processed, and a second set of face parameters after processing the face. The face is the face of the virtual image corresponding to the face image, and the face of the virtual image is generated based on the face features in the face image.
[0065] Step S304: Use the first dataset for machine training to obtain the face processing model.
[0066] Through the above steps, a face processing model is obtained by using the first dataset for machine training. This achieves the goal of obtaining a model that can process the face images of virtual characters, thus providing a basic technical effect for using the face processing model to process virtual characters generated from face images. In this way, the face of the virtual character can be efficiently beautified and personalized.
[0067] As an optional embodiment, the face processing model may include at least one of the following: a beautification model for enhancing the face of a virtual avatar; and a stylization model for stylizing the face of a virtual avatar. The beautification model can enhance the face of a virtual avatar, for example, by altering some features of the virtual avatar's face to better suit the user's aesthetic preferences; the stylization model can alter the style of the virtual avatar's face, for example, by strengthening or weakening some stylistic features of the virtual avatar's face, making the resulting virtual avatar's face more personalized. Through beautification and / or stylization models, users can obtain a better user experience when converting facial images into virtual images than simply pursuing consistency between the modeled result and the sample image, allowing users to pursue more free and personalized virtual image processing results.
[0068] Figure 4 This is a flowchart of the third image processing method according to Embodiment 1 of the present invention, as follows: Figure 4 As shown, the method includes the following steps:
[0069] Step S402: Receive a facial image on the interactive interface;
[0070] Step S404: Display the processed face of the virtual avatar on the interactive interface. The processed face of the virtual avatar is generated based on the second face parameter set, which is obtained by processing the first face parameter set. The first face parameter set represents the unprocessed face of the virtual avatar, which is generated based on the facial features of the face image.
[0071] Through the above steps, an interactive interface is used to receive facial images. By displaying the face of a virtual avatar on the interactive interface, the purpose of presenting the face image of a virtual avatar generated from the facial image to the user is achieved. This realizes the technical effect of presenting the processing result of the facial image, thereby solving the technical problem in related technologies that converting facial images into virtual avatars cannot meet user needs. As a result, the face of the virtual avatar generated from the facial image has a beautification effect and is personalized.
[0072] As an optional embodiment, before displaying the virtual avatar's face on the interactive interface, the process of generating the virtual avatar's face can be adjusted as follows: Options are displayed on the interactive interface, where the options are used to select a face processing method, which includes at least one of the following: a beautification method to enhance the virtual avatar's face, and a stylization method to stylize the virtual avatar's face; the user receives the selection of an option and displays the virtual avatar's face corresponding to the selection on the interactive interface, wherein the virtual avatar's face corresponding to the selection is generated using a second face parameter set obtained by processing a first face parameter set using the face processing method corresponding to the selection. By setting options for the user and converting the facial image into the virtual avatar's face image according to the user's selection, the user can participate in the process of generating the virtual avatar's face, allowing the user to obtain more free and personalized facial image processing results, thus improving user autonomy and satisfaction.
[0073] Figure 5 This is a schematic diagram illustrating a training material generation method according to an optional embodiment of the present invention. Figure 5 As shown, in this optional embodiment, taking the face as an example and the face processing model as an example, the training material for the face optimization model can be obtained in the following way:
[0074] Method 1: Generate a facial model based on a face photo to obtain a set of facial parameters for the facial model, where the aggregated facial parameters can be blendshape coefficients; then, the person in the photo adjusts the generated facial model to obtain a satisfactory optimized facial model, and record the optimized aggregated facial parameters at this time, i.e., the modified blendshape coefficients.
[0075] Method 2: Based on a facial photo, perform beautification processing on the facial photo to obtain a beautified photo; based on the beautified photo, generate a facial model and obtain a set of facial parameters for the facial model, where the aggregated facial parameters can be blendshape coefficients; then, others adjust the generated facial model to obtain an optimized facial model that meets the expectations of the person making the adjustment, and record the optimized aggregated facial parameters at this time, i.e., the modified blendshape coefficients.
[0076] Method 3: Generate a facial model based on a face photo, and obtain a set of facial parameters for the facial model. The aggregated facial parameters can be blendshape coefficients. The generated facial model is then adjusted by another person, for example, by adjusting stylistic features, to obtain an optimized facial model that meets the expectations of the person making the adjustment. The optimized aggregated facial parameters at this time are recorded, which are the modified blendshape coefficients.
[0077] Figure 6 This is a schematic diagram of a stylized network training process according to an optional embodiment of the present invention. Figure 6 As shown, the materials used to train the stylization network can include the following three parts: photos, blendshape coefficients, and modified blendshape coefficients. Photos and blendshape coefficients can be used as input data, while the modified blendshape coefficients can be used as annotation results. The annotation process can be performed using a pre-trained initial model or manually.
[0078] Figure 7 This is a schematic diagram of an image processing method according to an optional embodiment of the present invention. Figure 7 As shown, after the user inputs a photo, the automatic face-shaping system first generates an initial facial model. Then, the facial model and the input photo are input into either a stylization network or a beautification network to adjust the initial facial model, resulting in the generation results of the two networks. Finally, the results generated by the two networks are used as the final output options for the user.
[0079] Figure 8 This is a schematic diagram of a cartoon-style character creation process according to an optional embodiment of the present invention, such as... Figure 8 As shown, the following stylization network can also be used to stylize facial images: the input image is directly stylized by using a generative adversarial network to highlight facial features, for example, to generate a cartoon-style photo, and then the generated cartoon-style photo is input into an automatic photo face-shaping system to obtain the face image of the virtual image and the stylized blendshape value corresponding to the image.
[0080] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0081] Through the above description of the embodiments, those skilled in the art can clearly understand that the image processing method according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0082] Example 2
[0083] According to an embodiment of the present invention, an apparatus for implementing the above-described image processing method is also provided. Figure 9 This is a structural block diagram of an image processing apparatus according to Embodiment 2 of the present invention, as shown below. Figure 9 As shown, the device includes: a first acquisition module 92, a first extraction module 94, a first generation module 96, a first processing module 98, and a first adjustment module 99. The device will now be described in detail:
[0084] The first acquisition module 92 is used to acquire the facial image of the object;
[0085] The first extraction module 94 is connected to the first acquisition module 92 and is used to extract facial features from the face image.
[0086] The first generation module 96 is connected to the first extraction module 94 and is used to generate the face of the virtual image based on facial features, wherein the face of the virtual image is represented by a first set of facial parameters.
[0087] The first processing module 98 is connected to the first generation module 96 and is used to input the first face parameter set into the face processing model to obtain the second face parameter set. The face processing model is obtained by machine training using the first dataset. The first dataset includes: face image, the first face parameter set to be processed, and the second face parameter set after processing the face.
[0088] The first adjustment module 99 is connected to the first processing module 98 and is used to adjust the face of the virtual image according to the second set of facial parameters.
[0089] It should be noted that the first acquisition module 92, the first extraction module 94, the first generation module 96, the first processing module 98, and the first adjustment module 99 mentioned above correspond to steps S202 to S210 in Embodiment 1. Multiple modules implement the same instances and application scenarios as their corresponding steps, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the above modules, as part of the device, can run on the computer terminal 10 provided in Embodiment 1.
[0090] Example 3
[0091] According to an embodiment of the present invention, an apparatus for implementing the above-described image processing method two is also provided. Figure 10 This is a structural block diagram of the image processing apparatus 2 according to Embodiment 3 of the present invention, as follows: Figure 10 As shown, the device includes a second acquisition module 102 and a first training module 104. The device will be described in detail below:
[0092] The second acquisition module 102 is used to acquire a first dataset, wherein the first dataset includes: a face image, a first set of face parameters to be processed, and a second set of face parameters after processing the face, wherein the face is the face of a virtual image corresponding to the face image, and the face of the virtual image is generated based on the face features in the face image;
[0093] The first training module 104, connected to the second acquisition module 102, is used to perform machine training using the first dataset to obtain a face processing model.
[0094] It should be noted that the second acquisition module 102 and the first training module 104 mentioned above correspond to steps S302 to S304 in Embodiment 1. The two modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in Embodiment 1.
[0095] Example 4
[0096] According to an embodiment of the present invention, an apparatus for implementing the above-described image processing method three is also provided. Figure 11 This is a structural block diagram of the image processing apparatus three according to Embodiment 4 of the present invention, as shown below. Figure 11 As shown, the device includes a first receiving module 112 and a first display module 114. The device will be described in detail below.
[0097] The first receiving module 112 is used to receive facial images at the interactive interface;
[0098] The first display module 114 is connected to the first receiving module 112 and is used to display the processed face of the virtual image on the interactive interface. The processed face of the virtual image is generated by adjusting according to the second face parameter set. The second face parameter set is obtained by processing the first face parameter set. The first face parameter set represents the unprocessed face of the virtual image. The unprocessed face of the virtual image is generated according to the facial features of the face image.
[0099] It should be noted that the first receiving module 112 and the first display module 114 mentioned above correspond to steps S402 to S404 in Embodiment 1. The two modules and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in Embodiment 1.
[0100] Example 5
[0101] Embodiments of the present invention can provide a computer terminal, which can be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the computer terminal can also be replaced by a mobile terminal or other terminal device.
[0102] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.
[0103] In this embodiment, the computer terminal described above can execute the program code for the following steps in the image processing method of the application: acquiring a facial image of an object; extracting facial features from the facial image; generating a virtual avatar's face based on the facial features, wherein the virtual avatar's face is represented by a first set of facial parameters; inputting the first set of facial parameters into a facial processing model to obtain a second set of facial parameters, wherein the facial processing model is obtained by machine training using a first dataset, the first dataset including: a facial image, a first set of facial parameters to be processed, and a second set of facial parameters after processing the face; adjusting the virtual avatar's face based on the second set of facial parameters.
[0104] Optionally, Figure 12 This is a structural block diagram of a computer terminal according to an embodiment of the present invention. Figure 12 As shown, the computer terminal may include one or more (only one is shown in the figure) processors 122, memory 124, etc.
[0105] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the image processing method and apparatus in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned image processing method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0106] The processor can access information and applications stored in memory via a transmission device to perform the following steps: acquiring a facial image of an object; extracting facial features from the facial image; generating a virtual avatar's face based on the facial features, wherein the virtual avatar's face is represented by a first set of facial parameters; inputting the first set of facial parameters into a facial processing model to obtain a second set of facial parameters, wherein the facial processing model is obtained through machine training using a first dataset, the first dataset including: a facial image, a first set of facial parameters to be processed, and a second set of facial parameters after processing the face; and adjusting the virtual avatar's face based on the second set of facial parameters.
[0107] Optionally, the processor may also execute program code for the following steps: When the face processing model includes a first beautification model, inputting a first set of face parameters into the face processing model to obtain a second set of face parameters, including: inputting the first set of face parameters into the first beautification model to obtain a first set of beautification parameters for the face, wherein the second set of face parameters includes the first set of beautification parameters, and the first beautification model is obtained through machine training using a second dataset, the second dataset including: a face photo, a set of face parameters for the face of a virtual avatar corresponding to the face photo, and a first set of adjusted face parameters after adjusting the face based on the face photo; adjusting the face of the virtual avatar according to the second set of face parameters, including: adjusting the face of the virtual avatar according to the first set of beautification parameters to obtain a beautified face of the virtual avatar.
[0108] Optionally, the processor may also execute program code for the following steps: When the face processing model includes a second beautification model, inputting a first face parameter set into the face processing model to obtain a second face parameter set includes: inputting the first face parameter set into the second beautification model to obtain a second beautification parameter set for the face, wherein the second face parameter set includes: a second beautification parameter set, the second beautification model being trained using a third dataset, the third dataset including: a beautified photo corresponding to the face photo, a face parameter set of the virtual image's face corresponding to the beautified photo, and a second adjusted face parameter set after adjusting the face based on the beautified photo; adjusting the virtual image's face according to the second face parameter set includes: adjusting the virtual image's face according to the second beautification parameter set to obtain the beautified face of the virtual image.
[0109] Optionally, the processor may also execute program code for the following steps: When the face processing model includes a first stylization model, inputting a first face parameter set into the face processing model to obtain a second face parameter set includes: inputting the first face parameter set into the first stylization model to obtain a first stylization parameter set for the face, wherein the second face parameter set includes: the first stylization parameter set, the first stylization model being trained using a fourth dataset, the fourth dataset including: a face photograph, a face parameter set of the virtual image's face corresponding to the face photograph, and a third adjusted face parameter set after adjusting the face based on the face photograph; adjusting the virtual image's face according to the second face parameter set includes: adjusting the virtual image's face according to the first stylization parameter set to obtain a stylized face of the virtual image.
[0110] Optionally, the processor may also execute program code for the following steps: When the face processing model includes a second stylization model, inputting a first face parameter set into the face processing model to obtain a second face parameter set includes: inputting the first face parameter set into the second stylization model to obtain a second stylization parameter set for the face, wherein the second face parameter set includes: a second stylization parameter set, the second stylization model being trained using a fifth dataset, the fifth dataset including: a cartoon photo corresponding to the face photo, a face parameter set of the virtual image's face corresponding to the cartoon photo, and a fourth adjusted face parameter set after adjusting the face based on the cartoon photo; adjusting the virtual image's face according to the second face parameter set includes: adjusting the virtual image's face according to the second stylization parameter set of the face to obtain a stylized face of the virtual image.
[0111] Optionally, the processor may also execute program code for the following steps: generating the face of a virtual avatar based on facial features, including: inputting facial features into an adversarial generative model to obtain a cartoon image corresponding to the face image, wherein the adversarial generative model is trained on a sixth dataset, the sixth dataset including: a face image, and a cartoon image after the face image is cartoonized; extracting cartoon features from the cartoon image, and generating the face of the virtual avatar based on the cartoon features.
[0112] Optionally, the processor may also execute program code that includes the following steps: the facial parameter set includes a set of fused deformation values of facial features.
[0113] Optionally, the processor may also execute program code for the following steps: the face image includes: a sculpted face image obtained after sculpting the face.
[0114] Optionally, the processor may also execute program code for the following steps: obtaining a first dataset, wherein the first dataset includes: a face image, a first set of face parameters to be processed, and a second set of face parameters after processing the face, wherein the face is the face of a virtual image corresponding to the face image, and the face of the virtual image is generated based on the face features in the face image; and using the first dataset for machine training to obtain a face processing model.
[0115] Optionally, the processor may also execute program code that includes at least one of the following steps: the face processing model includes a beautification model for beautifying the face of a virtual character; and a stylization model for stylizing the face of a virtual character.
[0116] Optionally, the processor may also execute program code that performs the following steps: receiving a facial image at an interactive interface; displaying the processed face of a virtual avatar at an interactive interface, wherein the processed face of the virtual avatar is generated based on a second set of facial parameters, the second set of facial parameters being obtained by processing a first set of facial parameters, the first set of facial parameters representing the unprocessed face of the virtual avatar, and the unprocessed face of the virtual avatar being generated based on the facial features of the facial image.
[0117] Optionally, the processor may also execute program code that performs the following steps: before displaying the face of the virtual avatar on the interactive interface, it further includes: displaying options on the interactive interface, wherein the options are used to select a face processing method, wherein the face processing method includes at least one of the following: a beautification method for enhancing the face of the virtual avatar, and a stylization method for stylizing the face of the virtual avatar; receiving the selection of the option, and displaying the face of the virtual avatar corresponding to the selection on the interactive interface, wherein the face of the virtual avatar corresponding to the selection is generated by processing the first face parameter set using the face processing method corresponding to the selection to obtain a second face parameter set.
[0118] Those skilled in the art will understand that Figure 12 The structure shown is for illustrative purposes only. The computer terminal can also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a mobile internet device (MID), a PAD, and other terminal devices. Figure 12 This does not limit the structure of the aforementioned electronic devices. For example, a computer terminal may also include components that are more... Figure 12 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 12 The different configurations shown.
[0119] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0120] Example 6
[0121] Embodiments of the present invention also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the image processing method provided in Embodiment 1.
[0122] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0123] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: acquiring a facial image of an object; extracting facial features from the facial image; generating a virtual avatar's face based on the facial features, wherein the virtual avatar's face is represented by a first set of facial parameters; inputting the first set of facial parameters into a facial processing model to obtain a second set of facial parameters, wherein the facial processing model is obtained by machine training using a first dataset, the first dataset including: a facial image, a first set of facial parameters to be processed, and a second set of facial parameters after processing the face; and adjusting the virtual avatar's face based on the second set of facial parameters.
[0124] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: when the face processing model includes a first beautification model, inputting a first face parameter set into the face processing model to obtain a second face parameter set includes: inputting the face parameter set into the first beautification model to obtain a first beautification parameter set for the face, wherein the second face parameter set includes the first beautification parameter set, and the first beautification model is obtained by machine training using a second dataset, the second dataset including: a face photo, a face parameter set of the face of the virtual image corresponding to the face photo, and a first adjusted face parameter set after adjusting the face based on the face photo; adjusting the face of the virtual image according to the second face parameter set includes: adjusting the face of the virtual image according to the first beautification parameter set to obtain a beautified face of the virtual image.
[0125] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: when the face processing model includes a second beautification model, inputting a first face parameter set into the face processing model to obtain a second face parameter set includes: inputting the first face parameter set into the second beautification model to obtain a second beautification parameter set for the face, wherein the second face parameter set includes: a second beautification parameter set, the second beautification model is obtained by machine training using a third dataset, the third dataset includes: a beautified photo corresponding to the face photo, a face parameter set of the face of the virtual image corresponding to the beautified photo, and a second adjusted face parameter set after adjusting the face according to the beautified photo; adjusting the face of the virtual image according to the second face parameter set includes: adjusting the face of the virtual image according to the second beautification parameter set to obtain the beautified face of the virtual image.
[0126] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: when the face processing model includes a first stylization model, inputting a first face parameter set into the face processing model to obtain a second face parameter set includes: inputting the first face parameter set into the first stylization model to obtain a first stylization parameter set of the face, wherein the second face parameter set includes: the first stylization parameter set, the first stylization model being obtained by machine training using a fourth dataset, the fourth dataset including: a face photo, a face parameter set of the face of the virtual image corresponding to the face photo, and a third adjusted face parameter set after adjusting the face based on the face photo; adjusting the face of the virtual image according to the second face parameter set includes: adjusting the face of the virtual image according to the first stylization parameter set to obtain a stylized face of the virtual image.
[0127] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: when the face processing model includes a second stylization model, inputting a first face parameter set into the face processing model to obtain a second face parameter set includes: inputting the first face parameter set into the second stylization model to obtain a second stylization parameter set for the face, wherein the second face parameter set includes: a second stylization parameter set, the second stylization model being obtained by machine training using a fifth dataset, the fifth dataset including: a cartoon photo corresponding to the face photo, a face parameter set of the virtual image's face corresponding to the cartoon photo, and a fourth adjusted face parameter set after adjusting the face based on the cartoon photo; adjusting the virtual image's face according to the second face parameter set includes: adjusting the virtual image's face according to the second stylization parameter set of the face to obtain a stylized face of the virtual image.
[0128] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: generating the face of a virtual avatar based on facial features, including: inputting facial features into an adversarial generative model to obtain a cartoon image corresponding to the face image, wherein the adversarial generative model is obtained by machine training using a sixth dataset, the sixth dataset including: a face image, and a cartoon image after the face image is cartoonized; extracting cartoon features from the cartoon image, and generating the face of the virtual avatar based on the cartoon features.
[0129] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: the facial parameter set includes a set of fused deformation values of facial features.
[0130] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: the face image includes: a face-pinching image obtained after pinching the face.
[0131] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: obtaining a first dataset, wherein the first dataset includes: a face image, a first set of face parameters to be processed, and a second set of face parameters after processing the face, wherein the face is the face of a virtual image corresponding to the face image, and the face of the virtual image is generated based on the face features in the face image; using the first dataset for machine training to obtain a face processing model.
[0132] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: the face processing model includes at least one of the following: a beautification model for beautifying the face of a virtual avatar; a stylization model for stylizing the face of a virtual avatar.
[0133] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: receiving a facial image at an interactive interface; displaying the processed face of a virtual avatar at the interactive interface, wherein the processed face of the virtual avatar is generated based on a second set of facial parameters, the second set of facial parameters being obtained by processing a first set of facial parameters, the first set of facial parameters representing the unprocessed face of the virtual avatar, and the unprocessed face of the virtual avatar being generated based on the facial features of the facial image.
[0134] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: before displaying the face of the virtual avatar on the interactive interface, the method further includes: displaying options on the interactive interface, wherein the options are used to select a face processing method, wherein the face processing method includes at least one of the following: a beautification method for enhancing the face of the virtual avatar, and a stylization method for stylizing the face of the virtual avatar; receiving the selection of the option, and displaying the face of the virtual avatar corresponding to the selection on the interactive interface, wherein a second face parameter set is generated after processing the face parameter set with the face processing method corresponding to the selection on the face of the virtual avatar corresponding to the selection.
[0135] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0136] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0137] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0138] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0139] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0140] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0141] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. An image processing method, characterized by, The method comprises: acquiring a face image of an object; extracting a face feature in the face image; generating a face of a virtual image according to the face feature, wherein the face of the virtual image is represented by a first face parameter set; inputting the first face parameter set into a face processing model to obtain a second face parameter set, wherein the face processing model is trained by a first data set and an adjusted face parameter set after processing the face, the first data set comprising: a face image, a first face parameter set to be processed, and the adjusted face parameter set after processing the face; adjusting the face of the virtual image according to the second face parameter set.
2. The method of claim 1, wherein, In a case where the face processing model comprises a first beautification model, inputting the first face parameter set into the face processing model to obtain the second face parameter set comprises: inputting the first face parameter set into the first beautification model to obtain a first beautification parameter set of the face, wherein the second face parameter set comprises the first beautification parameter set, the first beautification model is trained by a second data set, and the second data set comprises: a face photo, a face parameter set of a face of a virtual image corresponding to the face photo, and a first adjusted face parameter set after adjusting the face according to the face photo; adjusting the face of the virtual image according to the second face parameter set comprises: adjusting the face of the virtual image according to the first beautification parameter set to obtain a beautified face of the virtual image.
3. The method of claim 1, wherein, In a case where the face processing model comprises a second beautification model, inputting the first face parameter set into the face processing model to obtain the second face parameter set comprises: inputting the first face parameter set into the second beautification model to obtain a second beautification parameter set of the face, wherein the second face parameter set comprises the second beautification parameter set, the second beautification model is trained by a third data set, and the third data set comprises: a beautified face photo corresponding to the face photo, a face parameter set of a face of a virtual image corresponding to the beautified face photo, and a second adjusted face parameter set after adjusting the face according to the beautified face photo; adjusting the face of the virtual image according to the second face parameter set comprises: adjusting the face of the virtual image according to the second beautification parameter set to obtain a beautified face of the virtual image.
4. The method of claim 1, wherein, In a case where the face processing model comprises a first stylization model, inputting the first face parameter set into the face processing model to obtain the second face parameter set comprises: inputting the first facial parameter set into the first stylization model to obtain a first stylization parameter set of the face, wherein the second facial parameter set comprises the first stylization parameter set, the first stylization model is obtained by machine training using a fourth data set, the fourth data set comprises a face photo, a facial parameter set of a face of a virtual image corresponding to the face photo, and a third adjusted facial parameter set obtained by adjusting a face according to the face photo; adjusting the face of the virtual image according to the second facial parameter set, comprising: adjusting the face of the virtual image according to the first stylization parameter set to obtain a stylized face of the virtual image.
5. The method of claim 1, wherein, In the case that the face processing model comprises a second stylization model, inputting the first facial parameter set into the face processing model to obtain the second facial parameter set, comprising: inputting the first facial parameter set into the second stylization model to obtain a second stylization parameter set of the face, wherein the second facial parameter set comprises the second stylization parameter set, the second stylization model is obtained by machine training using a fifth data set, the fifth data set comprises a cartoon photo corresponding to the face photo, a facial parameter set of a face of a virtual image corresponding to the cartoon photo, and a fourth adjusted facial parameter set obtained by adjusting a face according to the cartoon photo; adjusting the face of the virtual image according to the second facial parameter set, comprising: adjusting the face of the virtual image according to the second stylization parameter set of the face to obtain a stylized face of the virtual image.
6. The method of claim 1, wherein, generating a face of a virtual image according to the facial features, comprising: inputting the facial features into a generative adversarial network to obtain a cartoon image corresponding to the face image, wherein the generative adversarial network is obtained by machine training using a sixth data set, the sixth data set comprises a face image and a cartoon image obtained by cartoonizing the face image; extracting cartoon features of the cartoon image and generating the face of the virtual image according to the cartoon features.
7. The method according to any one of claims 1 to 6, characterized in that, The facial parameter set comprises a set of fusion deformation values of facial features.
8. The method of claim 7, wherein, The face image comprises a pinched face image obtained after pinching the face.
9. An image processing method characterized by, comprising: obtaining a first data set, wherein the first data set comprises a face image, a first facial parameter set to be processed, and an adjusted facial parameter set obtained by processing a face, wherein the face is a face of a virtual image corresponding to the face image, and the face of the virtual image is generated according to facial features in the face image; obtaining a face processing model by machine training using the first facial parameter set to be processed and the adjusted facial parameter set obtained by processing the face in the first data set.
10. The method of claim 9, wherein, The face processing model comprises at least one of: a beautification model for beautifying the face of the virtual image; a stylization model for stylizing the face of the virtual image.
11. An image processing method, characterized by, comprising: receiving a face image in an interactive interface; display a processed face of the virtual image in the interactive interface, wherein the processed face of the virtual image is generated according to a second face parameter set, the second face parameter set is obtained by processing a first face parameter set by using a face processing model, the first face parameter set represents an unprocessed face of the virtual image, the unprocessed face of the virtual image is generated according to face features of the face image, the face processing model is trained by using a first data set, the first data set includes the first face parameter set to be processed, and an adjusted face parameter set after processing the face, and the face processing model is obtained by machine training.
12. The method of claim 11, wherein, Before displaying the face of the virtual image in the interactive interface, the method further includes: displaying an option in the interactive interface, wherein the option is used to select a face processing mode, and the face processing mode includes at least one of a beautifying mode for beautifying the face of the virtual image and a stylizing mode for stylizing the face of the virtual image; receiving a selection of the option, and displaying a face of the virtual image corresponding to the selection in the interactive interface, wherein the face of the virtual image corresponding to the selection is generated by processing the first face parameter set by using a face processing mode corresponding to the selection.
13. An image processing apparatus characterized by comprising: The method includes: a first acquisition module configured to acquire a face image of an object; a first extraction module configured to extract face features in the face image; a first generation module configured to generate a face of a virtual image according to the face features, wherein the face of the virtual image is represented by a first face parameter set; a first processing module configured to input the first face parameter set into a face processing model to obtain a second face parameter set, wherein the face processing model is trained by using a first data set, the first data set includes a first face parameter set to be processed and an adjusted face parameter set after processing a face, and the face processing model is obtained by machine training, and the face of the virtual image is generated according to face features in a face image; a first adjustment module configured to adjust the face of the virtual image according to the second face parameter set.
14. An image processing apparatus characterized by comprising: The method includes: a second acquisition module configured to acquire a first data set, wherein the first data set includes a face image, a first face parameter set to be processed, and an adjusted face parameter set after processing a face, wherein the face is a face of a virtual image corresponding to the face image, and the face of the virtual image is generated according to face features in the face image; a first training module configured to train a face processing model by using the first face parameter set to be processed and the adjusted face parameter set after processing the face in the first data set.
15. An image processing apparatus characterized by comprising: The method includes: a first receiving module configured to receive a face image in an interactive interface; The first display module is configured to display a processed face of a virtual image on the interactive interface, wherein the processed face of the virtual image is generated according to a second face parameter set, the second face parameter set is obtained by processing a first face parameter set by using a face processing model, the first face parameter set represents an unprocessed face of the virtual image, the unprocessed face of the virtual image is generated according to face features of the face image, the face processing model uses a first face parameter set to be processed in a first data set and a set of adjusted face parameters after processing the face, and is obtained by machine training, and the first data set includes the face image, the first face parameter set to be processed, and the set of adjusted face parameters after processing the face.
16. A storage medium, characterized by The storage medium includes a stored program, wherein the program controls a device in which the storage medium is located to perform the image processing method of any one of claims 1 to 12 when the program is running.
17. A computer device, comprising: The device comprises: a memory and a processor, the memory stores a computer program; the processor is configured to execute the computer program stored in the memory, and the computer program causes the processor to perform the image processing method of any one of claims 1 to 12 when the computer program is running.
Citation Information
Patent Citations
Virtual face-lifting method and device for face photographing
CN108765273A
Model training method, image processing method and device, equipment and medium
CN109902767A