Face reconstruction method, model training method and related device
By combining the supervised face reconstruction model with two-dimensional and three-dimensional face data, the problem of mobile face reconstruction quality and speed is solved, and high-precision and fast face reconstruction is achieved, which is suitable for metaverse and digital human applications.
Patent Information
- Application Number
- CN202310198171.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-02
- Publication Date
- 2024-09-03
AI Technical Summary
It is difficult to achieve high-quality and fast face reconstruction on the mobile terminal with existing technology. Traditional methods require high-quality image data and have low reconstruction quality. Single-view methods lack depth information, resulting in large reconstruction errors.
A supervised face reconstruction model that combines two-dimensional and three-dimensional face data is used. Through feature extraction and the advantages of multi-view images, face reconstruction models of different granularities are integrated to improve reconstruction accuracy.
It achieves low-cost, high-precision face reconstruction on the mobile terminal, is suitable for metaverse and digital human applications, and improves the reconstruction speed and quality.
Smart Images

Figure CN118587752A
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology or machine learning technology, and in particular to a face reconstruction method, a model training method and related devices. Background Art
[0002] In life, the commercial application of face reconstruction technology was first seen in the film and game industries. The traditional reconstruction method requires users to take photos simultaneously in a set environment with a complex camera system, and use the obtained multiple high-quality photos to complete face reconstruction. With the rise of related concepts such as the metaverse and digital humans, many mobile applications have also generated the demand for users to perform high-quality facial reconstruction. Mobile users have relatively low requirements for reconstruction quality, but high requirements for reconstruction speed. At the same time, they cannot provide the high-quality image data required by traditional reconstruction methods. Therefore, traditional methods are not suitable for mobile users. Although in recent years, some technologies have also used neural networks to develop single-view face reconstruction technology, the reconstruction quality of these technologies is relatively low and cannot capture many key identity features of the face. At the same time, single-view reconstruction lacks depth information, resulting in large reconstruction errors at the forehead and chin. Therefore, how to provide a face reconstruction method that can be applied to mobile terminals and has high quality needs to be solved urgently. Summary of the invention
[0003] The embodiments of the present application provide a face reconstruction method, a model training method and related devices, which can realize a face reconstruction method that can be applied to mobile terminals and has high quality.
[0004] In a first aspect, an embodiment of the present application provides a face reconstruction method, which is applied to an electronic device, wherein the electronic device includes a face reconstruction model, and the face reconstruction model includes a first supervised face reconstruction model and a second supervised face reconstruction model, wherein the first supervised face reconstruction model is trained based on two-dimensional face data, and the second supervised face reconstruction model is trained based on three-dimensional face data, and the method includes:
[0005] Get the target face dataset;
[0006] When the target face data set includes two-dimensional face data and three-dimensional face data, performing feature extraction on the target face data set to obtain a first image feature and a second image feature, wherein the first image feature is an image feature corresponding to the two-dimensional face data, and the second image feature is an image feature corresponding to the three-dimensional face data;
[0007] Inputting the first image feature into the first supervised face reconstruction model to obtain a first face reconstruction result;
[0008] Inputting the second image feature into the second supervised face reconstruction model to obtain a second face reconstruction result;
[0009] A first final face reconstruction result is determined according to the first face reconstruction result and the second face reconstruction result.
[0010] In a second aspect, an embodiment of the present application provides a model training method, the method comprising:
[0011] Acquire a two-dimensional face data set, wherein the two-dimensional face data set includes a plurality of two-dimensional face images, each of which corresponds to a face;
[0012] Acquire a three-dimensional face data set, wherein the three-dimensional face data set includes multiple groups of three-dimensional face data sets, each group of face data sets corresponding to a face;
[0013] Using the two-dimensional face data set to train a first initial supervised face reconstruction model to obtain a first supervised face reconstruction model;
[0014] Using the three-dimensional face data set to train a second initial supervised face reconstruction model to obtain a second supervised face reconstruction model;
[0015] A face reconstruction model is constructed according to the first supervised face reconstruction model and the second supervised face reconstruction model.
[0016] In a third aspect, an embodiment of the present application provides a face reconstruction device, which is applied to an electronic device, wherein the electronic device includes a face reconstruction model, and the face reconstruction model includes a first supervised face reconstruction model and a second supervised face reconstruction model, wherein the first supervised face reconstruction model is trained based on two-dimensional face data, and the second supervised face reconstruction model is trained based on three-dimensional face data, and the device includes: an acquisition unit, an extraction unit, and a face reconstruction unit, wherein:
[0017] The acquisition unit is used to acquire a target face dataset;
[0018] The extraction unit is used to perform feature extraction on the target face data set when the target face data set includes two-dimensional face data and three-dimensional face data to obtain a first image feature and a second image feature, wherein the first image feature is an image feature corresponding to the two-dimensional face data, and the second image feature is an image feature corresponding to the three-dimensional face data;
[0019] The face reconstruction unit is used to input the first image feature into the first supervised face reconstruction model to obtain a first face reconstruction result; input the second image feature into the second supervised face reconstruction model to obtain a second face reconstruction result; and determine a first final face reconstruction result based on the first face reconstruction result and the second face reconstruction result.
[0020] In a fourth aspect, an embodiment of the present application provides a human model training device, the device comprising: an acquisition unit, a model training unit, wherein:
[0021] The acquisition unit is used to acquire a two-dimensional face data set, the two-dimensional face data set includes a plurality of two-dimensional face images, each of which corresponds to a face; and acquire a three-dimensional face data set, the three-dimensional face data set includes a plurality of groups of three-dimensional face data sets, each of which corresponds to a face;
[0022] The model training unit is used to train a first initial supervised face reconstruction model using the two-dimensional face data set to obtain a first supervised face reconstruction model; train a second initial supervised face reconstruction model using the three-dimensional face data set to obtain a second supervised face reconstruction model; and construct a face reconstruction model based on the first supervised face reconstruction model and the second supervised face reconstruction model.
[0023] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory is used to store one or more programs and is configured to be executed by the processor, wherein the program includes a method for executing some or all of the steps described in the first or second aspect.
[0024] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in the first aspect or the second aspect of the embodiment of the present application.
[0025] In a seventh aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect or the second aspect of the embodiment of the present application. The computer program product may be a software installation package.
[0026] The implementation of the embodiments of the present application has the following beneficial effects:
[0027] It can be seen that the face reconstruction method, model training method and related devices described in the embodiments of the present application are applied to an electronic device, and the electronic device includes a face reconstruction model, and the face reconstruction model includes a first supervised face reconstruction model and a second supervised face reconstruction model, wherein the first supervised face reconstruction model is trained based on two-dimensional face data, and the second supervised face reconstruction model is trained based on three-dimensional face data, and a target face data set is obtained. When the target face data set includes two-dimensional face data and three-dimensional face data, feature extraction is performed on the target face data set to obtain a first image feature and a second image feature, the first image feature is an image feature corresponding to the two-dimensional face data, and the second image feature is an image feature corresponding to the three-dimensional face data, and the first image feature is input into The first supervised face reconstruction model is input into the first supervised face reconstruction model to obtain a first face reconstruction result, the second image feature is input into the second supervised face reconstruction model to obtain a second face reconstruction result, and the first final face reconstruction result is determined according to the first face reconstruction result and the second face reconstruction result. On the one hand, since the face reconstruction model includes two supervised face reconstruction models, one is suitable for two-dimensional faces and the other is suitable for three-dimensional faces, and thus face reconstruction results of different dimensions are obtained, on the other hand, the data used for face reconstruction includes both two-dimensional face data and three-dimensional face data. The advantages of the two models can be utilized, as well as the multi-view face image advantage brought by the three-dimensional face data, to realize the fusion of face reconstruction models of different granularities, which helps to improve the accuracy of the face reconstruction model. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0029] Figure 1 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0030] Figure 2 It is a schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0031] Figure 3 It is a flowchart of a face reconstruction method provided in an embodiment of the present application;
[0032] Figure 4 It is a schematic diagram showing the comparison between face scanning data and face registration results provided in an embodiment of the present application;
[0033] Figure 5is a flowchart of another face reconstruction method provided in an embodiment of the present application;
[0034] Figure 6 is a flowchart of another face reconstruction method provided in an embodiment of the present application;
[0035] Figure 7 is a flowchart of another face reconstruction method provided in an embodiment of the present application;
[0036] Figure 8 It is a flowchart of a model training method provided in an embodiment of the present application;
[0037] Fig. 9 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0038] Fig.10 This is a block diagram of the functional units of a face reconstruction device provided in an embodiment of the present application;
[0039] Fig.11 It is a block diagram of the functional units of a model training device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0041] In order to better understand the solutions of the embodiments of the present application, the relevant terms and concepts that may be involved in the embodiments of the present application are first introduced below.
[0042] In a specific implementation, the electronic device may include various electronic devices with communication functions, such as handheld devices (smartphones, tablet computers, etc.), vehicle-mounted devices (navigators, assisted reversing systems, driving recorders, car refrigerators, etc.), wearable devices (smart bracelets, wireless headphones, smart watches, smart glasses, etc.), customer premise equipment (customer premise equipment, CPE), computing devices or other processing devices connected to a wireless modem, as well as various forms of user equipment (User Equipment, UE), mobile stations (Mobile Station, MS), virtual reality / augmented reality devices, terminal devices, etc. The electronic device may also be a base station or a server.
[0043] Of course, electronic devices may also include smart home devices, which may be at least one of the following: smart speakers, smart cameras, smart rice cookers, smart wheelchairs, smart massage chairs, smart furniture, smart dishwashers, smart televisions, smart refrigerators, smart electric fans, smart heaters, smart clothes drying racks, smart lights, smart routers, smart switches, smart switch panels, smart humidifiers, smart air conditioners, smart doors, smart windows, smart stoves, smart disinfection cabinets, smart toilets, sweeping robots, etc., without limitation here.
[0044] In the embodiments of the present application, face reconstruction technology is a basic technology in the field of virtual reality and augmented reality. Although there are relatively mature multi-view face reconstruction solutions in the fields of film and television and animation production, these solutions are limited in their use environment, have high costs, and are slow, and cannot meet the face reconstruction needs of ordinary users.
[0045] In the embodiment of the present application, a low-cost and high-precision face geometry reconstruction solution suitable for ordinary users can be implemented. This method uses two modal data: multi-view image data and three-dimensional face scanning data to train a neural network that can be used for high-precision face reconstruction. The reconstructed face model can be used to create realistic virtual images in related applications such as the metaverse, digital humans, and electronic games, which can greatly enhance the user experience.
[0046] In the embodiment of the present application, a low-cost and highly accurate multi-view face reconstruction system suitable for ordinary mobile users is provided. Based on the network obtained by unsupervised training using a large number of two-dimensional images, the method additionally uses three-dimensional face scanning data for strong supervised training to obtain a network for facial geometry reconstruction. Compared with the traditional multi-view reconstruction method, this method has a very obvious speed advantage and has lower requirements for input images; compared with the single-view reconstruction method, the reconstruction accuracy is significantly improved.
[0047] In the first part, the software and hardware operating environment of the technical solution disclosed in this application is introduced as follows.
[0048] As shown in the figure, Figure 11 shows a schematic diagram of the structure of the electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a compass 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195.
[0049] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0050] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor AP, a modem processor, a graphics processor GPU, an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processor NPU, etc. Among them, different processing units may be independent components or integrated into one or more processors. In some embodiments, the electronic device 100 may also include one or more processors 110. Among them, the controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. In some other embodiments, a memory may also be provided in the processor 110 for storing instructions and data. Exemplarily, the memory in the processor 110 may be a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. In this way, repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the electronic device 100 in processing data or executing instructions is improved. The processor may further include an image processor, which may be an image preprocessor (preprocess image signal processor, Pre-ISP), which may be understood as a simplified ISP, and which may also perform some image processing operations, for example, may obtain image statistical information.
[0051] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface and / or a USB interface, etc. Among them, the USB interface 130 is an interface that complies with the USB standard specification, and can specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and a peripheral device. The USB interface 130 can also be used to connect headphones to play audio through the headphones.
[0052] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0053] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0054] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193 and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0055] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, the baseband processor, and the like.
[0056] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0057] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G / 6G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0058] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0059] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0060] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a mini light-emitting diode (miniLED), MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or more display screens 194.
[0061] The electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.
[0062] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0063] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include one or more cameras 193.
[0064] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0065] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0066] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0067] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0068] The internal memory 121 can be used to store one or more computer programs, which include instructions. The processor 110 can execute the above instructions stored in the internal memory 121, so that the electronic device 100 executes the method of displaying page elements provided in some embodiments of the present application, as well as various applications and data processing. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system; the program storage area can also store one or more applications (such as a gallery, contacts, etc.). The data storage area can store data (such as photos, contacts, etc.) created during the use of the electronic device 100. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (UFS), etc. In some embodiments, the processor 110 can execute the method of displaying page elements provided in the embodiments of the present application, as well as other applications and data processing by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor 110. The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0069] The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
[0070] Among them, the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0071] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., X, Y, and Z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
[0072] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0073] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0074] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0075] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0076] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position where the display screen 194 is connected.
[0077] For example, Figure 2 The software structure diagram of the electronic device 100 is shown. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, respectively, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer. The application layer can include a series of application packages.
[0078] like Figure 2 As shown, the application layer may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0079] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0080] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0081] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0082] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0083] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0084] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0085] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0086] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0087] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0088] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0089] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0090] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0091] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0092] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0093] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0094] A 2D graphics engine is a drawing engine for 2D drawings.
[0095] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0096] In the second part, the face reconstruction method and related devices disclosed in the embodiments of the present application are introduced as follows.
[0097] See also Figure 3 , Figure 3 A face reconstruction method provided in an embodiment of the present application is applied to Figure 1 or Figure 2 The electronic device shown in the figure includes a face reconstruction model, the face reconstruction model includes a first supervised face reconstruction model and a second supervised face reconstruction model, wherein the first supervised face reconstruction model is trained based on two-dimensional face data, and the second supervised face reconstruction model is trained based on three-dimensional face data. The face reconstruction method may include the following steps:
[0098] 301. Obtain a target face dataset.
[0099] In an embodiment of the present application, the target face data set may include one or more face images or features of one or more face images, the face image may be a two-dimensional face image or a three-dimensional face image, and the one or more face images may include a face image of at least one person, that is, include face images of one or more persons. For example, the target face data set may include one or more face images of person A, and for another example, the target face data set includes one or more face images of person A.
[0100] In a specific implementation, the target face dataset can be obtained from itself or an external device.
[0101] To illustrate, in a specific implementation, public face pictures can be collected, and the position information of facial key points can be detected for subsequent self-supervised training, wherein the facial key point information is obtained by an open source facial key point detector. For example, 2,000,000 pictures can be finally obtained.
[0102] In an embodiment of the present application, the electronic device may include a face reconstruction model, and the face reconstruction model may include a first supervised face reconstruction model and a second supervised face reconstruction model, wherein the first supervised face reconstruction model is trained based on two-dimensional face data, and the second supervised face reconstruction model is trained based on three-dimensional face data. For example, the above 2,000,000 pictures can be used to train the first supervised face reconstruction model.
[0103] In a specific implementation, the first supervised face reconstruction model can be trained by combining face key point constraints and face rendering image constraints. That is, in a specific implementation, the difference before and after face reconstruction of the same face key point can be compared to construct a loss function, such as the L2 loss function. Alternatively, the face image can be rendered and the loss function can be constructed using the difference before and after face reconstruction of the same face key point before and after rendering.
[0104] In the specific implementation, the second supervised face reconstruction model can complete the training by calculating the distance constraints of the reconstruction results and the corresponding vertices of the three-dimensional face registration data to construct a loss function. Since there is a one-to-one correspondence between the generated model vertices and the vertices of the model obtained by three-dimensional face registration, the L2 loss function is directly calculated vertex by vertex.
[0105] In a specific implementation, the first supervised face reconstruction model may include a convolutional neural network model, the second supervised face reconstruction model may include a convolutional neural network model, and the first supervised face reconstruction model and the second supervised face reconstruction model may be different. The first supervised face reconstruction model may be understood as a self-supervised face reconstruction model, and the second supervised face reconstruction model may be understood as a strongly supervised face reconstruction model.
[0106] In the specific implementation, based on the unsupervised training of a large number of two-dimensional images to obtain the network, three-dimensional face scanning data is additionally used for strong supervised training to obtain a network for facial geometry reconstruction.
[0107] Optionally, when the electronic device includes a server, the above step 301, obtaining the target face data set, may include the following steps:
[0108] Acquire the target face dataset from the terminal device.
[0109] In the embodiment of the present application, when the electronic device includes a server, the target face data set can be obtained from the terminal device. That is, in a specific implementation, the neural network (face reconstruction model) can be deployed on the server, and the user can take his own multi-view photos and upload them on the client. After the reconstruction is completed on the server, the reconstruction result is sent back to the client, thereby reducing the amount of calculation and power consumption on the user side, and helping to achieve fast face reconstruction and improve face reconstruction efficiency with the help of cloud service functions.
[0110] 302. When the target face data set includes two-dimensional face data and three-dimensional face data, perform feature extraction on the target face data set to obtain a first image feature and a second image feature, wherein the first image feature is an image feature corresponding to the two-dimensional face data, and the second image feature is an image feature corresponding to the three-dimensional face data.
[0111] In a specific implementation, different compositions of face data sets can be input into different supervised face reconstruction models for processing, thereby obtaining different face reconstruction results.
[0112] In an embodiment of the present application, when the target face data set includes two-dimensional face data and three-dimensional face data, the target face data set can be input into an image feature extractor for feature extraction to obtain a first image feature and a second image feature, where the first image feature is an image feature corresponding to the two-dimensional face data, and the second image feature is an image feature corresponding to the three-dimensional face data.
[0113] In a specific implementation, the image feature extractor may include a convolutional neural network model.
[0114] In a specific implementation, different image feature extractors may be used for two-dimensional face data and three-dimensional face data to extract corresponding image features. For example, one image feature extractor may be used for two-dimensional face data and another image feature extractor may be used for three-dimensional face data. Of course, the same image feature extractor may also be used for two-dimensional face data and three-dimensional face data to extract corresponding image features.
[0115] In a specific implementation, three-dimensional face data can be used to obtain multi-view face images, that is, two-dimensional face images taken at different angles.
[0116] The first image feature may include at least one of the following: feature points, feature contours, feature vectors, feature images, etc., which are not limited here. The second image feature may include at least one of the following: feature points, feature contours, feature vectors, feature images, etc., which are not limited here.
[0117] 303. Input the first image feature into the first supervised face reconstruction model to obtain a first face reconstruction result.
[0118] In an embodiment of the present application, the first image feature can be input into a first supervised face reconstruction model to obtain a rough geometric representation, that is, a first face reconstruction result.
[0119] 304. Input the second image feature into the second supervised face reconstruction model to obtain a second face reconstruction result.
[0120] In an embodiment of the present application, the second image feature can be input into a second supervised face reconstruction model to obtain a vertex-by-vertex offset in the geometric model, that is, a second face reconstruction result.
[0121] 305. Determine a first final face reconstruction result according to the first face reconstruction result and the second face reconstruction result.
[0122] In an embodiment of the present application, the first face reconstruction result and the second face reconstruction result can be fused to obtain a first final face reconstruction result. Specifically, the final rough geometry can be added with the vertex-by-vertex offset to obtain a fine-grained geometry reconstruction result, that is, the final face reconstruction result.
[0123] In a specific implementation, for each vertex in the three-dimensional model, its position in the three-dimensional space is recorded as p, and a vertex offset Δp can be estimated. The vertex position of the final geometric model is p+Δp.
[0124] In an embodiment of the present application, the image feature extractor, the first supervised face reconstruction model and the second supervised face reconstruction model can be implemented based on the same convolutional neural network model or based on different neural network models.
[0125] Further, optionally, the following steps may also be included:
[0126] A1. When the target face data set includes only two-dimensional face data, extracting features from the target face data set to obtain a third image feature, where the third image feature is an image feature corresponding to the two-dimensional face data;
[0127] A2. Inputting the third image feature into the first supervised face reconstruction model to perform face reconstruction, and obtaining a third face reconstruction result;
[0128] A3. Determine a second final face reconstruction result according to the third face reconstruction result.
[0129] The third image feature may include at least one of the following: a feature point, a feature contour, a feature vector, a feature image, etc., which is not limited here.
[0130] In an embodiment of the present application, when the target face data set only includes two-dimensional face data, the target face data set can be feature extracted to obtain a second image feature, and the third image feature is the image feature corresponding to the two-dimensional face data. The third image feature is then input into the first supervised face reconstruction model for face reconstruction to obtain a rough geometric representation, i.e., a third face reconstruction result. The third face reconstruction result can be directly determined as the second final face reconstruction result, or the third face reconstruction result can be optimized, for example, rendering, filling, or interpolation can be performed to obtain the second final face reconstruction result.
[0131] Further, optionally, the following steps may also be included:
[0132] B1. When the target face data set includes only three-dimensional face data, extracting features from the target face data set to obtain a fourth image feature, where the fourth image feature is an image feature corresponding to the three-dimensional face data;
[0133] B2. Inputting the fourth image feature into the second supervised face reconstruction model to perform face reconstruction, and obtaining a fourth face reconstruction result;
[0134] B3. Determine a third final face reconstruction result according to the fourth face reconstruction result.
[0135] The fourth image feature may include at least one of the following: a feature point, a feature contour, a feature vector, a feature image, etc., which is not limited here.
[0136] In an embodiment of the present application, when the target face data set only includes three-dimensional face data, the target face data set can be feature extracted to obtain a fourth image feature, which is an image feature corresponding to the three-dimensional face data. The fourth image feature is then input into the second supervised face reconstruction model for face reconstruction to obtain a fourth face reconstruction result, and then the third final face reconstruction result is determined based on the fourth face reconstruction result. The fourth face reconstruction result can be directly determined as the third final face reconstruction result, or the fourth face reconstruction result can be optimized, for example, rendering, filling, or interpolation can be performed to obtain the fourth final face reconstruction result.
[0137] Further, optionally, the following steps may also be included:
[0138] C1. Obtain a two-dimensional face dataset, where the two-dimensional face dataset includes multiple two-dimensional face images, each of which corresponds to a human face;
[0139] C2. Acquire a three-dimensional face dataset, where the three-dimensional face dataset includes multiple groups of three-dimensional face datasets, each group of face datasets corresponding to a face;
[0140] C3. Using the two-dimensional face data set to train a first initial supervised face reconstruction model to obtain the first supervised face reconstruction model;
[0141] C4. Using the three-dimensional face data set to train a second initial supervised face reconstruction model to obtain the second supervised face reconstruction model;
[0142] C5. Construct the face reconstruction model according to the first supervised face reconstruction model and the second supervised face reconstruction model.
[0143] In a specific implementation, the first initial supervised face reconstruction model may include a convolutional neural network model, the second initial supervised face reconstruction model may include a convolutional neural network model, and the first initial supervised face reconstruction model and the second initial supervised face reconstruction model may be different. The first initial supervised face reconstruction model may be understood as a self-supervised face reconstruction model, and the second initial supervised face reconstruction model may be understood as a strongly supervised face reconstruction model.
[0144] In an embodiment of the present application, a two-dimensional face dataset is obtained, and the two-dimensional face dataset includes multiple two-dimensional face images, each of which corresponds to a face. For example, public face images can be collected, and then the positions of facial key points can be detected to facilitate subsequent self-supervised training.
[0145] In addition, you can also obtain a three-dimensional face dataset, which includes multiple groups of three-dimensional face datasets, each group of face datasets corresponds to a face. Specifically, collect public three-dimensional face scanning datasets, and use the non-rigid iterative closest point (NICP) algorithm to register the scan data to a face model with a given topology to facilitate subsequent strong supervision training.
[0146] Specifically, we can collect a public 3D face scan dataset and register the scan data to a fixed topology face model using a non-rigid iterative closest point algorithm. Figure 4 As shown, for some three-dimensional face scanning data sets, corresponding multi-view images are provided, and these multi-view images are directly used. For some data sets, corresponding multi-view images are not provided, and multi-view images with higher realism can also be obtained through rendering.
[0147] Next, a first initial supervised face reconstruction model can be trained using a two-dimensional face dataset to obtain a first supervised face reconstruction model, and then a second initial supervised face reconstruction model can be trained using a three-dimensional face dataset to obtain a second supervised face reconstruction model. Then, a face reconstruction model can be constructed based on the first supervised face reconstruction model and the second supervised face reconstruction model.
[0148] Optionally, the following steps may also be included:
[0149] D1, based on the target 3D face data;
[0150] D2. Obtaining a preset face reconstruction model corresponding to the target three-dimensional face data;
[0151] D3, inputting the target three-dimensional face data into the face reconstruction model to obtain a predicted face reconstruction model;
[0152] D4. Constructing a target loss function according to a constraint relationship between corresponding vertices between the preset face reconstruction model and the predicted face reconstruction model, wherein the target loss function is used to train the face reconstruction model.
[0153] In the embodiment of the present application, a corresponding preset face reconstruction model can be set in advance for the target three-dimensional face data. In a specific implementation, the preset face reconstruction model corresponding to the target three-dimensional face data can be obtained according to the target three-dimensional face data. Then, the target three-dimensional face data can be input into the face reconstruction model to obtain a predicted face reconstruction model, and then a target loss function is constructed according to the constraint relationship between the corresponding vertices between the preset face reconstruction model and the predicted face reconstruction model. The target loss function is used to train the face reconstruction model. That is, the training is completed by constructing a loss function by calculating the distance constraint between the reconstruction result and the corresponding vertex of the three-dimensional face registration data. Specifically, since there is a one-to-one correspondence between the generated model vertices and the vertices of the model obtained by the three-dimensional face registration, the L2 loss can be directly calculated vertex by vertex.
[0154] In a specific implementation, in an embodiment of the present application, a multi-view face reconstruction system based on a neural network of multimodal data is proposed, and its specific implementation process includes the following steps:
[0155] S1) Collect public face images and detect the locations of facial key points for subsequent self-supervised training.
[0156] S2) Collect public 3D face scan datasets and register the scan data to a face model with a given topology using the Non-Rigid Iterative Closest Point (NICP) algorithm to facilitate subsequent strong supervised training.
[0157] S3) uses the image data in S1) to train the self-supervised reconstruction part of the network; uses the strong supervision data in S2) to train the strong supervision reconstruction part of the network.
[0158] S4) The neural network is deployed on the server. Users can take their own multi-view photos and upload them on the client. After the reconstruction is completed on the server, the reconstruction results are sent back to the client.
[0159] It can be seen that in the embodiments of the present application, a low-cost and high-precision multi-view face reconstruction system suitable for ordinary mobile users can be provided. In a specific implementation, this method only requires an ordinary mobile monocular camera and a deep neural network to achieve it.
[0160] In the specific implementation, Figure 5 As shown, first, for the target face dataset, the image features of the multi-view face image can be obtained by using an image feature extractor based on a convolutional neural network. When there is only self-supervised image data but no strongly supervised 3D face scanning, the image features are input into the self-supervised reconstruction network (the first supervised face reconstruction model), and the rough geometric representation of the face is output. The rough geometry is the final reconstruction result, and the training is performed by combining the face key point constraint and the face rendering image constraint. When there are both self-supervised image data and strongly supervised 3D face scanning data, the strongly supervised network (the second supervised face reconstruction model) is used to estimate the vertex-by-vertex offset in the geometric model. The final rough geometry plus the vertex-by-vertex offset are added to obtain a fine-grained geometric reconstruction result, i.e., the face reconstruction result. In practical applications, the training can also be completed by calculating the distance constraint between the reconstruction result and the corresponding vertex of the 3D face registration data to construct a loss function.
[0161] It can be seen that the face reconstruction method described in the embodiment of the present application is applied to an electronic device, and the electronic device includes a face reconstruction model, and the face reconstruction model includes a first supervised face reconstruction model and a second supervised face reconstruction model, wherein the first supervised face reconstruction model is trained based on two-dimensional face data, and the second supervised face reconstruction model is trained based on three-dimensional face data, and a target face data set is obtained. When the target face data set includes two-dimensional face data and three-dimensional face data, feature extraction is performed on the target face data set to obtain a first image feature and a second image feature, the first image feature is an image feature corresponding to the two-dimensional face data, and the second image feature is an image feature corresponding to the three-dimensional face data, and the first image feature is input into the first supervised face reconstruction model. A supervised face reconstruction model is used to obtain a first face reconstruction result, and the second image feature is input into a second supervised face reconstruction model to obtain a second face reconstruction result. The first final face reconstruction result is determined according to the first face reconstruction result and the second face reconstruction result. On the one hand, since the face reconstruction model includes two supervised face reconstruction models, one is suitable for two-dimensional faces and the other is suitable for three-dimensional faces, and thus face reconstruction results of different dimensions are obtained, on the other hand, the data used for face reconstruction includes both two-dimensional face data and three-dimensional face data. The advantages of the two models and the multi-view face image advantage brought by the three-dimensional face data can be used to realize the fusion of face reconstruction models of different granularities, which helps to improve the accuracy of the face reconstruction model.
[0162] With the Figure 3 For details on the embodiments shown in the drawings, please refer to Figure 6 , Figure 6 Another face reconstruction method provided by the embodiment of the present application is applied to Figure 1 or Figure 2 The electronic device shown in the figure includes a face reconstruction model, and the face reconstruction model includes a first supervised face reconstruction model and a second supervised face reconstruction model, wherein the first supervised face reconstruction model is trained based on two-dimensional face data, and the second supervised face reconstruction model is trained based on three-dimensional face data, and specifically includes the following steps:
[0163] 601. Obtain a target face dataset;
[0164] 602. When the target face data set includes two-dimensional face data and three-dimensional face data, perform feature extraction on the target face data set to obtain a first image feature and a second image feature, wherein the first image feature is an image feature corresponding to the two-dimensional face data, and the second image feature is an image feature corresponding to the three-dimensional face data.
[0165] 603. Input the first image feature into the first supervised face reconstruction model to obtain a first face reconstruction result.
[0166] 604. Input the second image feature into the second supervised face reconstruction model to obtain a second face reconstruction result.
[0167] 605. Determine a first final face reconstruction result according to the first face reconstruction result and the second face reconstruction result.
[0168] 606. When the target face data set only includes two-dimensional face data, perform feature extraction on the target face data set to obtain a third image feature, where the third image feature is an image feature corresponding to the two-dimensional face data.
[0169] 607. Input the third image feature into the first supervised face reconstruction model to perform face reconstruction, and obtain a third face reconstruction result;
[0170] 608. Determine a second final face reconstruction result according to the third face reconstruction result.
[0171] 609. When the target face data set only includes three-dimensional face data, perform feature extraction on the target face data set to obtain a fourth image feature, where the fourth image feature is an image feature corresponding to the three-dimensional face data.
[0172] 610. Input the fourth image feature into the second supervised face reconstruction model to perform face reconstruction, and obtain a fourth face reconstruction result;
[0173] 611. Determine a third final face reconstruction result according to the fourth face reconstruction result.
[0174] The specific description of the above steps 601 to 611 can refer to the above Figure 3 The description of the face reconstruction method described is not repeated here.
[0175] It can be seen that the face reconstruction method described in the embodiment of the present application, on the one hand, since the face reconstruction model includes two supervised face reconstruction models, one suitable for two-dimensional faces and the other suitable for three-dimensional faces, thereby obtaining face reconstruction results of different dimensions; on the other hand, the data used for face reconstruction includes both two-dimensional face data and three-dimensional face data, and can utilize the advantages of the two models, as well as the advantages of multi-perspective face images brought by three-dimensional face data, to achieve the fusion of face reconstructed images of different granularities, which helps to improve the accuracy of the face reconstruction model. In addition, when two-dimensional face data and three-dimensional face data are included separately, it is possible to utilize face reconstruction models adapted to each other to achieve rapid face reconstruction.
[0176] With the Figure 3 For details on the embodiments shown in the drawings, please refer to Figure 7 , Figure 7 Another face reconstruction method provided by the embodiment of the present application is applied to Figure 1 or Figure 2 The electronic device shown in the figure includes a face reconstruction model, and the face reconstruction model includes a first supervised face reconstruction model and a second supervised face reconstruction model, wherein the first supervised face reconstruction model is trained based on two-dimensional face data, and the second supervised face reconstruction model is trained based on three-dimensional face data, and specifically includes the following steps:
[0177] 701. Obtain a two-dimensional face dataset, where the two-dimensional face dataset includes multiple two-dimensional face images, and each two-dimensional face image corresponds to a human face.
[0178] 702. Obtain a three-dimensional face dataset, where the three-dimensional face dataset includes multiple groups of three-dimensional face datasets, and each group of face datasets corresponds to a human face.
[0179] 703. Use the two-dimensional face data set to train a first initial supervised face reconstruction model to obtain the first supervised face reconstruction model.
[0180] 704. Use the three-dimensional face data set to train a second initial supervised face reconstruction model to obtain the second supervised face reconstruction model.
[0181] 705. Construct the face reconstruction model according to the first supervised face reconstruction model and the second supervised face reconstruction model.
[0182] 706. Obtain a target face dataset.
[0183] 707. When the target face data set includes two-dimensional face data and three-dimensional face data, perform feature extraction on the target face data set to obtain a first image feature and a second image feature, wherein the first image feature is an image feature corresponding to the two-dimensional face data, and the second image feature is an image feature corresponding to the three-dimensional face data.
[0184] 708. Input the first image feature into the first supervised face reconstruction model to obtain a first face reconstruction result.
[0185] 709. Input the second image feature into the second supervised face reconstruction model to obtain a second face reconstruction result.
[0186] 710. Determine a first final face reconstruction result according to the first face reconstruction result and the second face reconstruction result.
[0187] The specific description of the above steps 701 to 710 can refer to the above Figure 3 The description of the face reconstruction method described is not repeated here.
[0188] It can be seen that the face reconstruction method described in the embodiment of the present application can not only train a face reconstruction model with two supervised face reconstruction models, but also, on the one hand, since the face reconstruction model includes two supervised face reconstruction models, one suitable for two-dimensional faces and the other suitable for three-dimensional faces, face reconstruction results of different dimensions can be obtained. On the other hand, the data used for face reconstruction includes both two-dimensional face data and three-dimensional face data. The advantages of the two models and the multi-perspective face image advantages brought by the three-dimensional face data can be utilized to realize the fusion of face reconstruction models of different granularities, which helps to improve the accuracy of the face reconstruction model.
[0189] With the Figure 3 For details on the embodiments shown in the drawings, please refer to Figure 8 , Figure 8 This is a model training method provided in the embodiment of the present application, which is applied to Figure 1 or Figure 2 The electronic device shown specifically includes the following steps:
[0190] 801. Obtain a two-dimensional face dataset, where the two-dimensional face dataset includes multiple two-dimensional face images, and each two-dimensional face image corresponds to a human face.
[0191] 802. Obtain a three-dimensional face dataset, where the three-dimensional face dataset includes multiple groups of three-dimensional face datasets, and each group of face datasets corresponds to a human face.
[0192] 803. Use the two-dimensional face data set to train a first initial supervised face reconstruction model to obtain a first supervised face reconstruction model.
[0193] 804. Use the three-dimensional face data set to train a second initial supervised face reconstruction model to obtain a second supervised face reconstruction model.
[0194] 805. Construct a face reconstruction model according to the first supervised face reconstruction model and the second supervised face reconstruction model.
[0195] The specific description of the above steps 801 to 805 can refer to the above Figure 3 The description of the face reconstruction method described is not repeated here.
[0196] It can be seen that the model training method described in the embodiment of the present application obtains a two-dimensional face data set, the two-dimensional face data set includes multiple two-dimensional face images, each two-dimensional face image corresponds to a face, obtains a three-dimensional face data set, the three-dimensional face data set includes multiple groups of three-dimensional face data sets, each group of face data sets corresponds to a face, uses the two-dimensional face data set to train a first initial supervised face reconstruction model to obtain a first supervised face reconstruction model, uses the three-dimensional face data set to train a second initial supervised face reconstruction model to obtain a second supervised face reconstruction model, and according to the first supervised face reconstruction model and the second supervised face reconstruction model By constructing a face reconstruction model, a face reconstruction model with two supervised face reconstruction models can be trained. In addition, in the subsequent application stage, on the one hand, since the face reconstruction model includes two supervised face reconstruction models, one suitable for two-dimensional faces and the other suitable for three-dimensional faces, face reconstruction results of different dimensions can be obtained. On the other hand, the data used for face reconstruction includes both two-dimensional face data and three-dimensional face data. The advantages of the two models and the multi-view face image advantage brought by the three-dimensional face data can be used to realize the fusion of face reconstruction models of different granularities, which helps to improve the accuracy of the face reconstruction model.
[0197] In accordance with the above embodiment, please refer to Fig. 9 , Fig. 9 : is a structural schematic diagram of an electronic device provided by an embodiment of the present application. As shown in the figure, the electronic device includes a processor, a memory, a communication interface and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the processor. The electronic device includes a face reconstruction model, and the face reconstruction model includes a first supervised face reconstruction model and a second supervised face reconstruction model, wherein the first supervised face reconstruction model is trained based on two-dimensional face data, and the second supervised face reconstruction model is trained based on three-dimensional face data. In the embodiment of the present application, the program includes instructions for executing the following steps:
[0198] Get the target face dataset;
[0199] When the target face data set includes two-dimensional face data and three-dimensional face data, performing feature extraction on the target face data set to obtain a first image feature and a second image feature, wherein the first image feature is an image feature corresponding to the two-dimensional face data, and the second image feature is an image feature corresponding to the three-dimensional face data;
[0200] Inputting the first image feature into the first supervised face reconstruction model to obtain a first face reconstruction result;
[0201] Inputting the second image feature into the second supervised face reconstruction model to obtain a second face reconstruction result;
[0202] A first final face reconstruction result is determined according to the first face reconstruction result and the second face reconstruction result.
[0203] Optionally, the program further includes instructions for executing the following steps:
[0204] When the target face data set only includes two-dimensional face data, performing feature extraction on the target face data set to obtain a third image feature, where the third image feature is an image feature corresponding to the two-dimensional face data;
[0205] Inputting the third image feature into the first supervised face reconstruction model to perform face reconstruction, to obtain a third face reconstruction result;
[0206] A second final face reconstruction result is determined according to the third face reconstruction result.
[0207] Optionally, the program further includes instructions for executing the following steps:
[0208] When the target face data set only includes three-dimensional face data, performing feature extraction on the target face data set to obtain a fourth image feature, where the fourth image feature is an image feature corresponding to the three-dimensional face data;
[0209] Inputting the fourth image feature into the second supervised face reconstruction model to perform face reconstruction, to obtain a fourth face reconstruction result;
[0210] A third final face reconstruction result is determined according to the fourth face reconstruction result.
[0211] Optionally, the program further includes instructions for executing the following steps:
[0212] Acquire a two-dimensional face data set, wherein the two-dimensional face data set includes a plurality of two-dimensional face images, each of which corresponds to a face;
[0213] Acquire a three-dimensional face data set, wherein the three-dimensional face data set includes multiple groups of three-dimensional face data sets, each group of face data sets corresponding to a face;
[0214] Using the two-dimensional face data set to train a first initial supervised face reconstruction model to obtain the first supervised face reconstruction model;
[0215] Using the three-dimensional face data set to train a second initial supervised face reconstruction model to obtain the second supervised face reconstruction model;
[0216] The face reconstruction model is constructed according to the first supervised face reconstruction model and the second supervised face reconstruction model.
[0217] Optionally, the program further includes instructions for executing the following steps:
[0218] According to the target three-dimensional face data;
[0219] Acquire a preset face reconstruction model corresponding to the target three-dimensional face data;
[0220] Inputting the target three-dimensional face data into the face reconstruction model to obtain a predicted face reconstruction model;
[0221] A target loss function is constructed according to a constraint relationship between corresponding vertices between the preset face reconstruction model and the predicted face reconstruction model, and the target loss function is used to train the face reconstruction model.
[0222] Optionally, when the electronic device includes a server, in the aspect of acquiring the target face data set, the program includes instructions for executing the following steps:
[0223] Acquire the target face dataset from the terminal device.
[0224] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the execution process on the method side. It is understandable that, in order to realize the above functions, the electronic device includes a hardware structure and / or software module corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0225] The embodiment of the present application can divide the electronic device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0226] Fig.10This is a functional unit block diagram of a face reconstruction device 1000 involved in an embodiment of the present application. The face reconstruction device 1000 is applied to an electronic device, the electronic device includes a face reconstruction model, the face reconstruction model includes a first supervised face reconstruction model and a second supervised face reconstruction model, wherein the first supervised face reconstruction model is obtained by training based on two-dimensional face data, and the second supervised face reconstruction model is obtained by training based on three-dimensional face data, the device includes: an acquisition unit 1001, an extraction unit 1002, and a face reconstruction unit 1003, wherein,
[0227] The acquisition unit 1001 is used to acquire a target face dataset;
[0228] The extraction unit 1002 is used to perform feature extraction on the target face data set when the target face data set includes two-dimensional face data and three-dimensional face data to obtain a first image feature and a second image feature, wherein the first image feature is an image feature corresponding to the two-dimensional face data, and the second image feature is an image feature corresponding to the three-dimensional face data;
[0229] The face reconstruction unit 1003 is used to input the first image feature into the first supervised face reconstruction model to obtain a first face reconstruction result; input the second image feature into the second supervised face reconstruction model to obtain a second face reconstruction result; and determine a first final face reconstruction result based on the first face reconstruction result and the second face reconstruction result.
[0230] Optionally, the device 1000 is further specifically used for:
[0231] When the target face data set only includes two-dimensional face data, performing feature extraction on the target face data set to obtain a third image feature, where the third image feature is an image feature corresponding to the two-dimensional face data;
[0232] Inputting the third image feature into the first supervised face reconstruction model to perform face reconstruction, to obtain a third face reconstruction result;
[0233] A second final face reconstruction result is determined according to the third face reconstruction result.
[0234] Optionally, the device 1000 is further specifically used for:
[0235] When the target face data set only includes three-dimensional face data, performing feature extraction on the target face data set to obtain a fourth image feature, where the fourth image feature is an image feature corresponding to the three-dimensional face data;
[0236] Inputting the fourth image feature into the second supervised face reconstruction model to perform face reconstruction, to obtain a fourth face reconstruction result;
[0237] A third final face reconstruction result is determined according to the fourth face reconstruction result.
[0238] Optionally, the device 1000 is further specifically used for:
[0239] Acquire a two-dimensional face data set, wherein the two-dimensional face data set includes a plurality of two-dimensional face images, each of which corresponds to a face;
[0240] Acquire a three-dimensional face data set, wherein the three-dimensional face data set includes multiple groups of three-dimensional face data sets, each group of face data sets corresponding to a face;
[0241] Using the two-dimensional face data set to train a first initial supervised face reconstruction model to obtain the first supervised face reconstruction model;
[0242] Using the three-dimensional face data set to train a second initial supervised face reconstruction model to obtain the second supervised face reconstruction model;
[0243] The face reconstruction model is constructed according to the first supervised face reconstruction model and the second supervised face reconstruction model.
[0244] Optionally, the device 1000 is further specifically used for:
[0245] According to the target three-dimensional face data;
[0246] Acquire a preset face reconstruction model corresponding to the target three-dimensional face data;
[0247] Inputting the target three-dimensional face data into the face reconstruction model to obtain a predicted face reconstruction model;
[0248] A target loss function is constructed according to a constraint relationship between corresponding vertices between the preset face reconstruction model and the predicted face reconstruction model, and the target loss function is used to train the face reconstruction model.
[0249] Optionally, when the electronic device includes a server, in acquiring the target face data set, the acquiring unit 1001 is specifically used to:
[0250] Acquire the target face dataset from the terminal device.
[0251] It should be noted that the electronic device described in the embodiments of the present application is presented in the form of a functional unit. The term "unit" used here should be understood as the broadest possible meaning, and the object used to implement the functions described by each "unit" may be, for example, an integrated circuit ASIC, a single circuit, a processor (shared, dedicated or chipset) and memory for executing one or more software or firmware programs, a combinational logic circuit, and / or other suitable components that provide the above functions.
[0252] The acquisition unit 1001, the extraction unit 1002, and the face reconstruction unit 1003 may be a processor, which may be an artificial intelligence chip, NPU, CPU, GPU, etc., which is not limited here. Based on the above unit modules, the functions or steps of any of the above methods can be implemented.
[0253] Fig.11 1 is a functional unit block diagram of a model training device 1100 involved in an embodiment of the present application. The model training device 1100 is applied to an electronic device, and the device includes: an acquisition unit 1101 and a model training unit 1102, wherein:
[0254] The acquisition unit 1101 is used to acquire a two-dimensional face data set, wherein the two-dimensional face data set includes multiple two-dimensional face images, each of which corresponds to a face; and acquire a three-dimensional face data set, wherein the three-dimensional face data set includes multiple groups of three-dimensional face data sets, each of which corresponds to a face;
[0255] The model training unit 1102 is used to train a first initial supervised face reconstruction model using the two-dimensional face data set to obtain a first supervised face reconstruction model; train a second initial supervised face reconstruction model using the three-dimensional face data set to obtain a second supervised face reconstruction model; and construct a face reconstruction model based on the first supervised face reconstruction model and the second supervised face reconstruction model.
[0256] It should be noted that the electronic device described in the embodiments of the present application is presented in the form of a functional unit. The term "unit" used here should be understood as the broadest possible meaning, and the object used to implement the functions described by each "unit" may be, for example, an integrated circuit ASIC, a single circuit, a processor (shared, dedicated or chipset) and memory for executing one or more software or firmware programs, a combinational logic circuit, and / or other suitable components that provide the above functions.
[0257] Among them, the acquisition unit 1101 and the model training unit 1102 can be a processor, and the processor can be an artificial intelligence chip, NPU, CPU, GPU, etc., which is not limited here. Based on the above unit modules, the functions or steps of any of the above methods can be implemented.
[0258] This embodiment also provides a chip, wherein the chip can be used to implement any method in the above embodiments.
[0259] This embodiment also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the above-mentioned computer program enables a computer to execute the embodiments of the present application to implement any method in the above-mentioned embodiments.
[0260] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement any method in the above-mentioned embodiments.
[0261] In addition, an embodiment of the present application also provides a face reconstruction device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes any one of the methods in the above-mentioned method embodiments.
[0262] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.
[0263] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0264] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0265] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0266] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0267] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially 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, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0268] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A face reconstruction method, characterized in that: Applied to an electronic device, the electronic device includes a face reconstruction model, the face reconstruction model includes a first supervised face reconstruction model and a second supervised face reconstruction model, wherein the first supervised face reconstruction model is trained based on two-dimensional face data, and the second supervised face reconstruction model is trained based on three-dimensional face data, and the method includes: Get the target face dataset; When the target face data set includes two-dimensional face data and three-dimensional face data, performing feature extraction on the target face data set to obtain a first image feature and a second image feature, wherein the first image feature is an image feature corresponding to the two-dimensional face data, and the second image feature is an image feature corresponding to the three-dimensional face data; Inputting the first image feature into the first supervised face reconstruction model to obtain a first face reconstruction result; Inputting the second image feature into the second supervised face reconstruction model to obtain a second face reconstruction result; A first final face reconstruction result is determined according to the first face reconstruction result and the second face reconstruction result.
2. The face reconstruction method according to claim 1, characterized in that: The method further comprises: When the target face data set only includes two-dimensional face data, performing feature extraction on the target face data set to obtain a third image feature, where the third image feature is an image feature corresponding to the two-dimensional face data; Inputting the third image feature into the first supervised face reconstruction model to perform face reconstruction, to obtain a third face reconstruction result; A second final face reconstruction result is determined according to the third face reconstruction result.
3. The face reconstruction method according to claim 1 or 2, characterized in that: The method further comprises: When the target face data set only includes three-dimensional face data, performing feature extraction on the target face data set to obtain a fourth image feature, where the fourth image feature is an image feature corresponding to the three-dimensional face data; Inputting the fourth image feature into the second supervised face reconstruction model to perform face reconstruction, to obtain a fourth face reconstruction result; A third final face reconstruction result is determined according to the fourth face reconstruction result.
4. The face reconstruction method according to any one of claims 1 to 3, characterized in that: The method further comprises: Acquire a two-dimensional face data set, wherein the two-dimensional face data set includes a plurality of two-dimensional face images, each of which corresponds to a face; Acquire a three-dimensional face data set, wherein the three-dimensional face data set includes multiple groups of three-dimensional face data sets, each group of face data sets corresponding to a face; Using the two-dimensional face data set to train a first initial supervised face reconstruction model to obtain the first supervised face reconstruction model; Using the three-dimensional face data set to train a second initial supervised face reconstruction model to obtain the second supervised face reconstruction model; The face reconstruction model is constructed according to the first supervised face reconstruction model and the second supervised face reconstruction model.
5. The face reconstruction method according to any one of claims 1 to 4, characterized in that: The method further comprises: According to the target three-dimensional face data; Acquire a preset face reconstruction model corresponding to the target three-dimensional face data; Inputting the target three-dimensional face data into the face reconstruction model to obtain a predicted face reconstruction model; A target loss function is constructed according to a constraint relationship between corresponding vertices between the preset face reconstruction model and the predicted face reconstruction model, and the target loss function is used to train the face reconstruction model.
6. The face reconstruction method according to any one of claims 1 to 4, characterized in that: When the electronic device includes a server, the step of obtaining a target face data set includes: Acquire the target face dataset from the terminal device.
7. A model training method, characterized in that: The method comprises: Acquire a two-dimensional face data set, wherein the two-dimensional face data set includes a plurality of two-dimensional face images, each of which corresponds to a face; Acquire a three-dimensional face data set, wherein the three-dimensional face data set includes multiple groups of three-dimensional face data sets, each group of face data sets corresponding to a face; Using the two-dimensional face data set to train a first initial supervised face reconstruction model to obtain a first supervised face reconstruction model; Using the three-dimensional face data set to train a second initial supervised face reconstruction model to obtain a second supervised face reconstruction model; A face reconstruction model is constructed according to the first supervised face reconstruction model and the second supervised face reconstruction model.
8. A face reconstruction device, characterized in that: Applied to an electronic device, the electronic device includes a face reconstruction model, the face reconstruction model includes a first supervised face reconstruction model and a second supervised face reconstruction model, wherein the first supervised face reconstruction model is obtained by training based on two-dimensional face data, and the second supervised face reconstruction model is obtained by training based on three-dimensional face data, the device includes: an acquisition unit, an extraction unit, and a face reconstruction unit, wherein, The acquisition unit is used to acquire a target face dataset; The extraction unit is used to perform feature extraction on the target face data set when the target face data set includes two-dimensional face data and three-dimensional face data to obtain a first image feature and a second image feature, wherein the first image feature is an image feature corresponding to the two-dimensional face data, and the second image feature is an image feature corresponding to the three-dimensional face data; The face reconstruction unit is used to input the first image feature into the first supervised face reconstruction model to obtain a first face reconstruction result; input the second image feature into the second supervised face reconstruction model to obtain a second face reconstruction result; and determine a first final face reconstruction result based on the first face reconstruction result and the second face reconstruction result.
9. A model training device, characterized in that: The device comprises: an acquisition unit and a model training unit, wherein: The acquisition unit is used to acquire a two-dimensional face data set, the two-dimensional face data set includes a plurality of two-dimensional face images, each of which corresponds to a face; and acquire a three-dimensional face data set, the three-dimensional face data set includes a plurality of groups of three-dimensional face data sets, each of which corresponds to a face; The model training unit is used to train a first initial supervised face reconstruction model using the two-dimensional face data set to obtain a first supervised face reconstruction model; train a second initial supervised face reconstruction model using the three-dimensional face data set to obtain a second supervised face reconstruction model; and construct a face reconstruction model based on the first supervised face reconstruction model and the second supervised face reconstruction model.
10. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory is used to store one or more programs and is configured to be executed by the processor, wherein the program includes instructions for executing the steps in the method according to any one of claims 1 to 7.
11. A computer-readable storage medium, characterized in that: A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 7.
