Role face pinching method and system based on AI model, electronic equipment and storage medium
Through the AI model-based character face-pinching method, the human face substrate image and reference data are analyzed, virtual image encoding is generated and character face images are rendered, which solves the problem of low efficiency of 2D character face-pinching in the existing technology, and achieves efficient and diverse character appearance generation.
Patent Information
- Application Number
- CN202510336929.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2045-03-21
AI Technical Summary
The existing 2D characters have low face-pinching techniques, making it difficult to generate diverse character appearances, limiting the possibility of personalization.
The character face-pinching method based on AI model is adopted. By analyzing the data, the character gender and feature data are obtained, the corresponding face-pinching reasoning module is obtained, the virtual image encoding is generated, and the character face image is rendered based on differentiable rendering.
The face pinching efficiency is improved and the effect of "thousands of people and faces" is achieved. The generated character face images are highly diverse and personalized, reducing the complexity of development.
Smart Images

Figure CN119863590A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method, system, electronic device and storage medium for character face pinching based on an AI model. Background Art
[0002] Existing 2D character face-pinching technology mainly relies on manual drawing and some basic image processing technology. The traditional method requires drawing a large number of maps for each character, which is particularly time-consuming and labor-intensive in games with a large number of NPCs. At the same time, due to the reliance on manual drawing, it is difficult to produce sufficiently diverse character appearances, limiting the possibility of personalization. In game engines such as Unity, it is necessary to consider resource storage and runtime loading efficiency, and manual drawing for character face-pinching increases the complexity of development.
[0003] Currently, no effective solution has been proposed for the problem of low efficiency of 2D character face pinching methods in related technologies. Summary of the invention
[0004] The embodiments of the present application provide a method, system, electronic device and storage medium for character face pinching based on an AI model, so as to at least solve the problem of low efficiency of the 2D character face pinching method in the related art.
[0005] In a first aspect, an embodiment of the present application provides a character face pinching method based on an AI model, the method comprising: Acquire a human face base image and reference data, and analyze the reference data to obtain character gender and character feature data; Obtaining a face-pinching inference module corresponding to the gender of the character, and generating a virtual image code based on the face-pinching inference module and the character feature data, wherein the face-pinching inference module includes a combination rule of multiple facial features; The human face base image is redrawn according to the virtual image code to obtain a character face image, and the character face image is rendered based on a differentiable rendering method.
[0006] In some embodiments, the reference data includes reference images and keywords describing character characteristics, and analyzing the reference data to obtain character gender and character characteristic data includes: Extracting features from the reference image using a preset visual model; Determine the identity features, facial features, facial contour features, expression features and style features of the character based on the extraction results and the keywords; The identity features, the facial features, the facial contour features, the expression features and the style features are dynamically associated through a cross-attention mechanism to obtain the character feature data.
[0007] In some embodiments, generating the virtual image code based on the face pinching reasoning module and the character feature data includes: The character feature data is encoded into a latent vector, and the face pinching reasoning module obtains an effective parameter combination based on a pre-built rule library and the latent vector; The valid parameter combination is decoded into a virtual image code recognizable by a game engine.
[0008] In some embodiments, the rule base includes: Physical constraint rules, used to restrict the parameter space by pre-set weight matrices; Style coupling rules, used to dynamically activate or mask parameter dimensions through style embedding vectors; User preference rules are used to increase the weight of specific features for specific user groups based on collaborative filtering learning historical data.
[0009] In some embodiments, the virtual image code includes macroscopic layer parameters, mesoscopic layer parameters and microscopic layer parameters; and redrawing the human face base image according to the virtual image code to obtain the character face image includes: The macro-layer parameters are controlled by a classification network, the meso-layer parameters are controlled by a key point regression network, and the micro-layer parameters are controlled by StyleMapGAN to redraw the human face base image and obtain the character face image.
[0010] In some embodiments, the method further comprises: After rendering the character face image based on a differentiable rendering method, displaying the character face image through an interactive interface; The face pinching parameters are adjusted according to the received parameter adjustment instruction to update the character's facial image, wherein the parameter adjustment instruction is generated based on the character's facial image displayed on the interactive interface.
[0011] In some embodiments, the method further comprises: Performing content-style decoupling on the reference image and the character face image to obtain a content vector and a style vector, wherein the content vector is used to control the structure of the facial features, and the style vector is used to control the rendering method; The style vector is adjusted to generate a character face image of a target style.
[0012] In a second aspect, an embodiment of the present application provides a character face-pinching system based on an AI model, the system comprising: An analysis module, used to obtain a facial base image and reference data, and analyze the reference data to obtain character gender and character feature data; An encoding module, used to obtain a face-pinching reasoning module corresponding to the gender of the character, and generate a virtual image code based on the face-pinching reasoning module and the character feature data, wherein the face-pinching reasoning module contains a combination rule of multiple facial features; A generation module is used to redraw the human face base image according to the virtual image code to obtain a character face image, and render the character face image based on a differentiable rendering method.
[0013] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for character face pinching based on the AI model as described in the first aspect above is implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the character face pinching method based on the AI model as described in the first aspect above.
[0015] Compared with the related art, the AI model-based character face pinching method provided in the embodiment of the present application obtains the face base image and reference data, analyzes the reference data to obtain the character gender and character feature data; obtains the face pinching reasoning module corresponding to the character gender, generates a virtual image code based on the face pinching reasoning module and the character feature data, and the face pinching reasoning module contains a combination rule of multiple face features; redraws the face base image according to the virtual image code to obtain the character face image, and renders the character face image based on the differentiable rendering method, which solves the problem of low efficiency of the 2D character face pinching method. The face pinching reasoning module dynamically calls the rules to generate the virtual image code, and does not require hard-coded logical judgment, which improves the efficiency of face pinching. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 is a flow chart of a character face pinching method based on an AI model according to an embodiment of the present application; Figure 2 is a schematic diagram of generating five sense organs according to an embodiment of the present application; Figure 3 is a schematic diagram of generating a hairstyle according to an embodiment of the present application; Figure 4 This is a flow chart of a character face pinching method based on an AI model according to an embodiment of the present application; Figure 5This is a structural block diagram of a character face pinching system based on an AI model according to an embodiment of the present application; Figure 6 It is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0018] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.
[0019] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0020] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantity limitation, and may indicate the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0021] This embodiment provides a character face pinching method based on an AI model. Figure 1 is a flowchart of a method for pinching a character's face based on an AI model according to an embodiment of the present application. Figure 1 As shown, the process includes the following steps: Step S101, obtaining a facial base image and reference data, and analyzing the reference data to obtain character gender and character feature data.
[0022] The face base image is the base for redrawing the face pinching component. In this embodiment, the reference data includes reference images and / or keywords describing the characteristics of the character. The keywords can respectively describe the facial features, facial contours, expressions, character identities, etc. It should be noted that the reference image and the face handover image can be a face photo uploaded by the user through an input device such as a camera or scanner, or a face photo generated by AI.
[0023] In some embodiments, the reference data includes reference images and keywords describing character characteristics, and the character gender and character characteristic data obtained by analyzing the reference data in step S101 include: Step S1011, extracting features from the reference image using a preset visual model.
[0024] Step S1012, determining the character's identity features, facial features, facial contour features, expression features, and style features based on the extraction results and keywords.
[0025] Step S1013, dynamically associate identity features, facial features, facial contour features, expression features and style features through a cross-attention mechanism to obtain character feature data.
[0026] This embodiment achieves feature fusion by using a joint embedding space. Optionally, VisionTransformer is used to simultaneously extract identity, face, expression, and style features, and dynamically associate feature dimensions through a cross-attention mechanism.
[0027] The joint embedding space maps data from different modalities or feature sources into the same embedding space, allowing different types of data to share the same representation. Features from different sources (such as vision, text, etc.) can be effectively fused, and their respective information can complement each other to make up for the lack of information that may exist in a single modality. At the same time, the risk of overfitting of a single feature source can be reduced.
[0028] Step S102, obtaining a face-pinching reasoning module corresponding to the gender of the character, and generating a virtual image code based on the face-pinching reasoning module and the character feature data, wherein the face-pinching reasoning module includes a combination rule of multiple facial features.
[0029] In this embodiment, the face pinching reasoning module is a generator (such as GAN, VAE), and the face pinching reasoning module includes combination rules of multiple facial features, such as face shape, hairstyle, eyebrows, eyes, etc.
[0030] Optionally, gender is determined through a lightweight CNN (such as ResNet-18 fine-tuning), and different generator branches (face pinching inference modules) are selected based on the determination results. For example, a generator that enlarges the eye proportion and reduces the range of the jaw angle is used for female characters, and a generator that strengthens the brow bone contour and increases the facial angles is used for male characters.
[0031] The AI model is lightweight and optimized to achieve fast reasoning and low-latency face-pinching effects on mobile devices. While ensuring the quality of face-pinching, it can achieve efficient face-pinching on devices with limited resources.
[0032] In some embodiments, generating the avatar code based on the face pinching inference module and the character feature data in step S102 includes: Step S1021, encoding the character feature data into a latent vector, and the face pinching reasoning module obtains an effective parameter combination based on a pre-built rule library and the latent vector; Step S1022, decoding the valid parameter combination into a virtual image code recognizable by the game engine.
[0033] This embodiment encodes artistic specifications (such as facial feature proportion constraints) as a learnable rule base. When generating human faces, the rules are dynamically called through the attention mechanism to generate the encoding of the virtual image, rather than hard-coded logical judgment. Compared with the limitations of traditional technology that relies on fixed layered maps, the architecture of this embodiment achieves the unity of style independence and parameter generation.
[0034] In some embodiments, the rule base includes: Physical constraint rules are used to limit the parameter space through a preset weight matrix. For example, the position of the facial features must meet the "three parts and five eyes" ratio.
[0035] Style coupling rules are used to dynamically activate or mask parameter dimensions through style embedding vectors, for example, prohibiting cartoon-like big eyes in realistic style.
[0036] User preference rules are used to increase the weight of specific features for specific user groups based on collaborative filtering learning historical data, for example, Asian users prefer soft contours.
[0037] The input features are encoded into latent vectors, valid parameter combinations are screened through the rule base, and the valid parameter combinations are decoded into parameter encodings (e.g., JSON format) recognizable by the game engine through the generative model.
[0038] It should be noted that the face-pinching features and rules in the AI model can be adjusted to adapt to changing market demands and user preferences.
[0039] Step S103, redrawing the face base image according to the virtual image code to obtain a character face image, and rendering the character face image based on a differentiable rendering method.
[0040] The masked part of the face base image is redrawn according to the virtual image code, and the corresponding generated component file is output.
[0041] Due to reliance on manual drawing, it is difficult for traditional methods to produce sufficiently diverse character appearances, limiting the possibility of personalization. This embodiment uses AI technology to analyze facial images (reference images) based on deep learning, automatically generates virtual character faces with similar features, and achieves the effect of "one thousand faces for one thousand people".
[0042] This embodiment uses differentiable rendering to calculate the LPIPS perceptual loss of the generated image and the target image, and directly back-propagates the optimization parameters. The face-pinching parameters are directly used as optimizable variables in image generation, which improves the adaptability to non-realistic styles.
[0043] Personalized recommendations are achieved through user preference rules. Collaborative filtering algorithms are used to automatically adjust parameter distribution based on player behavior data (e.g., Asian users prefer soft contours, while European and American users prefer high cheekbones).
[0044] In some embodiments, the virtual image code includes macroscopic layer parameters, mesoscopic layer parameters and microscopic layer parameters; in step S103, the face base image is redrawn according to the virtual image code to obtain the character face image, including: The macro-layer parameters are controlled by the classification network, the meso-layer parameters are controlled by the key point regression network, and the micro-layer parameters are controlled by StyleMapGAN to redraw the face base image and obtain the character face image.
[0045] Optionally, the macro layer includes but is not limited to face shape and gender, the meso layer includes but is not limited to facial features proportions, and the micro layer includes but is not limited to texture details.
[0046] In order to make the virtual image more realistic, it is necessary to improve the expressiveness of the face pinching system in details, such as the rendering of skin texture, hair and other resources. The AI technology of this embodiment can provide more sophisticated facial feature recognition and rendering technology to enhance the realism of the virtual image. In this embodiment, in order to increase the speed of AI model reasoning, GPU can be used for accelerated calculation, improve computing efficiency, and reduce dependence on hardware resources.
[0047] Figure 2 is a schematic diagram of generating five sense organs according to an embodiment of the present application, Figure 3 is a schematic diagram of generating a hairstyle according to an embodiment of the present application. Figure 4 This is a flow chart of a character face pinching method based on an AI model according to an embodiment of the present application.
[0048] Through the above steps, the AI model-based character face pinching method provided by the embodiment of the present application obtains the face base image and reference data, analyzes the reference data to obtain the character gender and character feature data; obtains the face pinching reasoning module corresponding to the character gender, generates a virtual image code based on the face pinching reasoning module and the character feature data, and the face pinching reasoning module contains a combination rule of multiple face features; redraws the face base image according to the virtual image code to obtain the character face image, and renders the character face image based on the differentiable rendering method, which solves the problem of low efficiency of the 2D character face pinching method. The face pinching reasoning module dynamically calls the rules to generate the virtual image code, does not require hard-coded logical judgment, and improves the face pinching efficiency.
[0049] The end-to-end AI model that uses a joint optimization of the generator and feature extractor can directly optimize the face-pinching parameters through back propagation, automatically generating and adjusting the facial features of the character, thereby improving production efficiency, reducing costs, and providing more diverse character appearances. At the same time, AI technology can analyze real face images through deep learning, automatically generate virtual character faces with similar features, and achieve the effect of "one thousand faces for one thousand people".
[0050] Through deep learning training, the above AI model can work stably under different lighting and angles, improve recognition accuracy and face pinching precision. At the same time, it can process high-resolution facial images and generate detailed 2D character faces.
[0051] In some embodiments, the method further comprises: After rendering the character's face image based on the differentiable rendering method, the character's face image is displayed through an interactive interface.
[0052] The face pinching parameters are adjusted according to the received parameter adjustment instructions to update the character's facial image, wherein the parameter adjustment instructions are generated based on the character's facial image displayed on the interactive interface.
[0053] Users can upload pictures, adjust face-pinching parameters (such as the size and position of facial features) through the interactive interface, and preview the generated character face image in real time. Users can also confirm the final face-pinching result through the interactive interface, and the system will output and save the 2D character face image.
[0054] The real-time preview function allows users to instantly see the adjustment effects, enhancing the interactivity and user satisfaction of the face-pinching process.
[0055] In some embodiments, the method further comprises: Decouple the reference image and the character's face image from content and style to obtain a content vector and a style vector. The content vector is used to control the structure of the facial features, and the style vector is used to control the rendering method. By adjusting the style vector, a character face image of the target style is generated.
[0056] This embodiment can generate facial images of multiple styles. Optionally, the multi-style processing implementation specifically includes: Facial region segmentation: Use lightweight models (such as 3DDFA v2) for real-time face pose estimation, separate key facial regions (such as facial features and contours), and optimize edge detection accuracy through morphological methods. Use variational level sets at the shader level to build a high-dimensional space segmentation model and extract multi-resolution contour features.
[0057] Blend shape parameterization: Based on the multilinear facial model, facial geometry is decomposed into independent parameters, including vertex mode parameters, expression mode parameters, and identity mode parameters. Mode parameters are used to control the basic facial structure, expression mode parameters are used to manage expression blend shape weights, and identity mode parameters are used to handle personalized feature differences. Parameter decoupling is achieved through N-mode SVD, providing a mathematical basis for multi-branch rendering.
[0058] Style decoupled encoding: Using the StyleGAN3 architecture, the reference image and the character face image are decomposed into content latent codes (controlling the structure of facial features) and style latent codes (controlling rendering techniques), and cross-style generation is achieved by adjusting the style vector.
[0059] Multi-branch rendering pipeline: The realistic style branch uses 3DMM parameters to reconstruct the 3D mesh, combined with PBR materials and real-time lighting calculations; the two-dimensional branch uses Command Buffer layered rendering, and pursues the final effect and style through NPR rendering technology; the ink style branch migrates ink features based on convolutional neural networks, combined with morphological simulation of smudge levels.
[0060] Style transfer reinforcement learning: Build a style discriminator network and use adversarial training to force the generated results to conform to the target style distribution (such as training a thick painting style discriminator with the WikiArt dataset).
[0061] This embodiment introduces neural style transfer technology (such as AdaIN) to separate content and style features, so that the same model can handle multiple styles such as photo realism, two-dimensional, and CG thick painting.
[0062] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0063] This embodiment also provides a character face-pinching system based on an AI model, which is used to implement the above embodiments and preferred implementation modes, and will not be repeated here. As used below, the terms "module", "unit", "sub-unit", etc. can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0064] Figure 5 is a structural block diagram of a character face pinching system based on an AI model according to an embodiment of the present application, such as Figure 5 As shown, the system includes: The analysis module 51 is used to obtain a facial base image and reference data, and analyze the reference data to obtain the character gender and character feature data.
[0065] The encoding module 52 is used to obtain the face-pinching reasoning module corresponding to the gender of the character, and generate the virtual image code based on the face-pinching reasoning module and the character feature data. The face-pinching reasoning module contains a combination rule of multiple facial features.
[0066] The generation module 53 is used to redraw the face base image according to the virtual image code to obtain the character face image, and render the character face image based on the differentiable rendering method.
[0067] In some embodiments, the reference data includes reference images and keywords describing characteristics of a person, and the analysis module 51 includes: The extraction module is used to extract features from the reference image through a preset visual model.
[0068] The feature analysis module is used to determine the identity features, facial features, facial contour features, expression features and style features of the character based on the extraction results and keywords.
[0069] The association module is used to dynamically associate identity features, facial features, facial contour features, expression features and style features through a cross-attention mechanism to obtain character feature data.
[0070] In some embodiments, the encoding module 52 includes: The parameter determination module is used to encode the character feature data into a latent vector, and the face pinching reasoning module obtains an effective parameter combination based on the pre-built rule base and latent vector.
[0071] The decoding module is used to decode the valid parameter combination into the virtual image code recognizable by the game engine.
[0072] In some embodiments, the rule base includes: Physical constraint rules are used to restrict the parameter space by pre-set weight matrices.
[0073] Style coupling rules are used to dynamically activate or mask parameter dimensions through style embedding vectors.
[0074] User preference rules are used to increase the weight of specific features for specific user groups based on collaborative filtering learning historical data.
[0075] In some embodiments, the virtual image encoding includes macroscopic layer parameters, mesoscopic layer parameters and microscopic layer parameters; the generation module 53 includes: The parameter control module is used to control the macro-layer parameters through the classification network, the meso-layer parameters through the key point regression network, and the micro-layer parameters through StyleMapGAN to redraw the face base image and obtain the character face image.
[0076] In some embodiments, the AI model-based character face-pinching system further includes: The display module is used to display the character face image through an interactive interface after rendering the character face image based on the differentiable rendering method.
[0077] The modification module is used to adjust the face pinching parameters according to the received parameter adjustment instructions to update the character's facial image, wherein the parameter adjustment instructions are generated based on the character's facial image displayed on the interactive interface.
[0078] In some embodiments, the AI model-based character face-pinching system further includes: The rendering module is used to perform content-style decoupling on the reference image and the character face image to obtain a content vector and a style vector. The content vector is used to control the structure of the facial features, and the style vector is used to control the rendering method. The style determination module is used to generate a character face image of a target style by adjusting the style vector.
[0079] Through the above system, the analysis module 51 obtains the facial base image and reference data, analyzes the reference data to obtain the character's gender and character feature data, the encoding module 52 obtains the face pinching reasoning module corresponding to the character's gender, generates a virtual image code based on the face pinching reasoning module and the character feature data, the face pinching reasoning module contains a combination rule of multiple facial features, the generation module 53 redraws the facial base image according to the virtual image code to obtain the character's face image, and renders the character's face image based on the differentiable rendering method, solving the problem of low efficiency of the 2D character face pinching method. The face pinching reasoning module dynamically calls the rules to generate the virtual image code, does not require hard-coded logical judgment, and improves the efficiency of face pinching.
[0080] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0081] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0082] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0083] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program: S1, obtain the face base image and reference data, analyze the reference data to obtain the role gender and role feature data.
[0084] S2, obtaining a face-pinching reasoning module corresponding to the gender of the character, and generating a virtual image code based on the face-pinching reasoning module and the character feature data, wherein the face-pinching reasoning module contains a combination rule of multiple facial features.
[0085] S3, redrawing the face base image according to the virtual image code to obtain the character face image, and rendering the character face image based on the differentiable rendering method.
[0086] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0087] In one embodiment, Figure 6 is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application, such as Figure 6 As shown, an electronic device is provided, which may be a server, and its internal structure diagram may be as shown in Figure 6 As shown. The electronic device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store data. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a character face pinching method based on an AI model is implemented.
[0088] Those skilled in the art will understand that Figure 6 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0089] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0090] Those skilled in the art should understand that the technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0091] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A character face pinching method based on AI model, characterized in that: The method comprises: Acquire a human face base image and reference data, and analyze the reference data to obtain character gender and character feature data; Obtaining a face-pinching inference module corresponding to the gender of the character, and generating a virtual image code based on the face-pinching inference module and the character feature data, wherein the face-pinching inference module includes a combination rule of multiple facial features; The human face base image is redrawn according to the virtual image code to obtain a character face image, and the character face image is rendered based on a differentiable rendering method.
2. The method according to claim 1, characterized in that The reference data includes reference images and keywords describing character features, and the step of analyzing the reference data to obtain character gender and character feature data includes: Extracting features from the reference image using a preset visual model; Determine the identity features, facial features, facial contour features, expression features and style features of the character based on the extraction results and the keywords; The identity features, the facial features, the facial contour features, the expression features and the style features are dynamically associated through a cross-attention mechanism to obtain the character feature data.
3. The method according to claim 1, characterized in that The generating of the virtual image code based on the face pinching reasoning module and the character feature data comprises: The character feature data is encoded into a latent vector, and the face pinching reasoning module obtains an effective parameter combination based on a pre-built rule library and the latent vector; The valid parameter combination is decoded into a virtual image code recognizable by a game engine.
4. The method according to claim 3, characterized in that The rule base includes: Physical constraint rules, used to restrict the parameter space by pre-set weight matrices; Style coupling rules, used to dynamically activate or mask parameter dimensions through style embedding vectors; User preference rules are used to increase the weight of specific features for specific user groups based on collaborative filtering learning historical data.
5. The method according to claim 1, characterized in that The virtual image code includes macroscopic layer parameters, mesoscopic layer parameters and microscopic layer parameters; and redrawing the face base image according to the virtual image code to obtain the character face image includes: The macro-layer parameters are controlled by a classification network, the meso-layer parameters are controlled by a key point regression network, and the micro-layer parameters are controlled by StyleMapGAN to redraw the human face base image and obtain the character face image.
6. The method according to claim 1, characterized in that The method further comprises: After rendering the character face image based on a differentiable rendering method, displaying the character face image through an interactive interface; The face pinching parameters are adjusted according to the received parameter adjustment instruction to update the character's facial image, wherein the parameter adjustment instruction is generated based on the character's facial image displayed on the interactive interface.
7. The method according to claim 2, characterized in that The method further comprises: Performing content-style decoupling on the reference image and the character face image to obtain a content vector and a style vector, wherein the content vector is used to control the structure of the facial features, and the style vector is used to control the rendering method; The style vector is adjusted to generate a character face image of a target style.
8. A character face-pinching system based on an AI model, characterized in that: The system comprises: An analysis module, used to obtain a facial base image and reference data, and analyze the reference data to obtain character gender and character feature data; An encoding module, used to obtain a face-pinching reasoning module corresponding to the gender of the character, and generate a virtual image code based on the face-pinching reasoning module and the character feature data, wherein the face-pinching reasoning module contains a combination rule of multiple facial features; A generation module is used to redraw the human face base image according to the virtual image code to obtain a character face image, and render the character face image based on a differentiable rendering method.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for character face pinching based on the AI model as described in any one of claims 1 to 7 is implemented.
10. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the character face pinching method based on the AI model as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Virtual character face pinching method and system, storage medium and processing terminal
CN116052241A
Virtual image generation method, device and equipment based on user state
CN117132689A
Virtual image generation method and device, electronic equipment and storage medium
CN118967930A
Method for generating a virtual image using noise in latent space and computing device for the same method
KR102663123B1
High resolution conditional face generation
US20230162407A1
Cited By
Face image generation system, device and equipment based on parameterized style framework
CN121330236A
Facial image generation system, apparatus and device based on parameterized style framework
CN121330236B
Animation generation method based on artificial intelligence
CN121353485A
An AI-based animation generation method
CN121353485B