Method and device for removing obstructions

By using the GAN model and face detection algorithm in the face recognition system, mask obstruction in the face image is removed, which solves the difficulty of users in facial recognition when wearing masks, and achieves a safe and efficient face recognition process.

CN113674178BActive Publication Date: 2025-05-02MIAOZHEN INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110987947.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-26
Publication Date
2025-05-02
Estimated Expiration
2041-08-26

AI Technical Summary

Technical Problem

In the epidemic and other scenarios, when users wear masks, they need to take off their masks during facial recognition, which poses a risk of virus transmission. How to remove obstructions in portrait photos has become an important research direction.

Method used

By obtaining the face image and its key point coordinates, inputting it into the preset GAN model for de-occlusion processing, using face detection, key point detection and GAN algorithms to remove mask occlusion in the face image.

Benefits of technology

It realizes removing obscurities in portrait photos without the need for users to take off their masks, reducing the risk of virus transmission, and improving the convenience of facial recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113674178B_ABST
    Figure CN113674178B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for removing occlusions, by obtaining a face image to be processed and the key point coordinates of the face image to be processed, the face image to be processed includes a face image with occlusions and a face image without occlusions; the face image to be processed and the key point coordinates of the face image to be processed are used as inputs, and input into a preset GAN model for removing occlusions to obtain a face image with occlusions removed; the face image with occlusions removed is used to generate a corresponding image with occlusions removed according to the key point coordinates of the face image to be processed. The present application sequentially adopts face detection, face key point detection, face quality assessment, face gan algorithm, etc., and by pre-shooting a face without a mask, it can then calculate and restore a portrait photo with a mask to a face without a mask, so as to achieve the purpose of removing occlusions in the portrait photo.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of face recognition technology, and in particular, to a method and device for removing obstructions. Background Art

[0002] Due to the epidemic, users must wear masks when visiting scenic spots and in cars. In these application scenarios, face recognition is required. During this process, the camera requires users to take off their masks when taking portrait photos to achieve face recognition.

[0003] However, this process may pose a risk of virus transmission. Therefore, how to remove occlusions in portrait photos has become an important research direction for technicians in this field. Summary of the invention

[0004] In view of the problem of face recognition in the prior art, the present application provides a method and device for removing occlusions, so as to achieve the purpose of removing occlusions in portrait photos.

[0005] In order to achieve the above objectives, this application provides the following technical solutions:

[0006] A method for removing an obstruction, comprising:

[0007] Acquire a face image to be processed and the coordinates of key points of the face image to be processed, wherein the face image to be processed includes a face image with an occlusion and a face image without an occlusion;

[0008] The face image to be processed and the key point coordinates of the face image to be processed are input into a preset GAN model for removing occlusions, so as to obtain a face image with occlusions removed;

[0009] The face image with the occlusion removed is used to generate a corresponding image with the occlusion removed according to the key point coordinates of the face image to be processed.

[0010] Furthermore, the step of obtaining the face image to be processed and the key point coordinates of the face image to be processed includes:

[0011] Acquire a picture to be processed, and perform face detection on the picture to be processed to obtain a face picture to be processed, wherein the picture to be processed includes: a face picture with an obstruction and a face picture without an obstruction;

[0012] Key point detection is performed on the face image to be processed to determine the positions of key face points in the face image to be processed.

[0013] Furthermore, performing face detection on the image to be processed includes:

[0014] Input the image to be processed into a face detection model, determine the coordinates of two vertices in the image to be processed, and generate a detection frame;

[0015] The detection frame is expanded according to preset parameters. When multiple face areas are detected, the detection frame with the largest area is determined to be the face area of ​​the image to be processed, and the coordinates of the face vertices cropped by the detection frame in the original image are recorded.

[0016] Furthermore, the step of performing key point detection on the face image to be processed to determine the positions of key face points in the face image to be processed includes:

[0017] Performing key point detection on the face image to be processed, and recording a preset number of key point coordinates;

[0018] Calculating the tilt angle of the face according to the preset number of key point coordinates based on geometry, wherein the tilt angle of the face includes a pitch angle, a yaw angle, and a roll angle;

[0019] When the tilt angle of the face is greater than a threshold, it is determined that the face image to be processed does not meet the occlusion removal condition, and a description that the occlusion cannot be removed is fed back;

[0020] When the tilt angle of the face is less than a threshold, it is determined that the face image to be processed meets the occlusion removal condition, and the positions of the face key points in the face image to be processed are determined according to a preset number of key point coordinates.

[0021] A device for removing obstructions, comprising:

[0022] A first processing unit is used to obtain a face image to be processed and the coordinates of key points of the face image to be processed, wherein the face image to be processed includes a face image with an occlusion and a face image without an occlusion;

[0023] A second processing unit is used to input the face image to be processed and the key point coordinates of the face image to be processed into a preset GAN model for removing occlusions, so as to obtain a face image with occlusions removed;

[0024] The third processing unit is used to generate a corresponding removed-occlusion image from the removed-occlusion face image according to the key point coordinates of the face image to be processed.

[0025] Furthermore, the first processing unit is specifically configured to:

[0026] Acquire a picture to be processed, and perform face detection on the picture to be processed to obtain a face picture to be processed, wherein the picture to be processed includes: a face picture with an obstruction and a face picture without an obstruction;

[0027] Key point detection is performed on the face image to be processed to determine the positions of key face points in the face image to be processed.

[0028] Furthermore, performing face detection on the image to be processed includes:

[0029] Input the image to be processed into a face detection model, determine the coordinates of two vertices in the image to be processed, and generate a detection frame;

[0030] The detection frame is expanded according to preset parameters. When multiple face areas are detected, the detection frame with the largest area is determined to be the face area of ​​the image to be processed, and the coordinates of the face vertices cropped by the detection frame in the original image are recorded.

[0031] Furthermore, the first processing unit is specifically configured to:

[0032] Performing key point detection on the face image to be processed, and recording a preset number of key point coordinates;

[0033] Calculating the tilt angle of the face according to the preset number of key point coordinates based on geometry, wherein the tilt angle of the face includes a pitch angle, a yaw angle, and a roll angle;

[0034] When the tilt angle of the face is greater than a threshold, it is determined that the face image to be processed does not meet the occlusion removal condition, and a description that the occlusion cannot be removed is fed back;

[0035] When the tilt angle of the face is less than a threshold, it is determined that the face image to be processed meets the occlusion removal condition, and the positions of the face key points in the face image to be processed are determined according to a preset number of key point coordinates.

[0036] A storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the above-mentioned method for removing obstructions.

[0037] An electronic device comprises at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other via the bus; and the processor is used to call program instructions in the memory to execute the method for removing obstructions as described above.

[0038] The method and device for removing occlusions described in the present application obtains a face image to be processed and the key point coordinates of the face image to be processed, wherein the face image to be processed includes a face image with occlusions and a face image without occlusions; the face image to be processed and the key point coordinates of the face image to be processed are used as inputs, and are input into a preset GAN model for removing occlusions to obtain a face image with occlusions removed; the face image with occlusions removed is used to generate a corresponding image with occlusions removed based on the key point coordinates of the face image to be processed. The present application sequentially adopts face detection, face key point detection, face quality assessment, face gan algorithm, etc., and by pre-shooting a face without a mask, the portrait photo with a mask can then be calculated and restored to a face without a mask, so as to achieve the purpose of removing occlusions in the portrait photo. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] 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.

[0040] Figure 1 A schematic diagram of a method for removing obstructions disclosed in an embodiment of the present application;

[0041] Figure 2 A schematic diagram of face cropping disclosed in an embodiment of the present application;

[0042] Figure 3 A schematic diagram of the structure of a device for removing obstructions disclosed in an embodiment of the present application;

[0043] Figure 4 A schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0044] During the research, the applicant found that the existing technologies for face recognition with occlusions mainly use face forgery technology, such as face fraud and face swapping. These technologies are generally used for face replacement with different purposes. In these technologies, the proportion of the face in the image is not taken into consideration, and the same person is generally not used for face replacement.

[0045] To this end, the present application provides a method and device for removing occlusions, the purpose of which is to achieve the purpose of removing occlusions in portrait photos.

[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0047] Please see attached Figure 1 , is a schematic diagram of a method for removing obstructions provided in an embodiment of the present application. Figure 1 As shown, the embodiment of the present application provides a method for removing obstructions, the method comprising the following steps:

[0048] S101: Acquire a face image to be processed and the coordinates of key points of the face image to be processed, wherein the face image to be processed includes a face image with an occlusion and a face image without an occlusion.

[0049] In this step, the face image to be processed is a face image that has undergone face detection, face key point detection, and face quality assessment, including a face image with occlusions and a face image without occlusions.

[0050] The acquisition of unobstructed images is mainly through pre-storage, and the user uses the program to collect unobstructed faces in advance, which are generally sequential images. It should be noted that for the acquisition of a video of unobstructed faces, the algorithm in the embodiment of the present application splits the video into frames, and performs key point detection on the face, calculates the face whose offset angle is less than the threshold, and combines the face quality assessment model to obtain unobstructed faces (one or more).

[0051] For the collection of obstructed faces, during the use of the system, the user completes the shooting of obstructed portraits and then uploads them to the application system of the embodiment of the present application in a variety of ways.

[0052] It should be noted that face detection is to obtain the face position from a portrait image, but since there may be multiple faces in a picture, in the embodiment of the present application, only the position of the largest face, that is, the most core face, is obtained.

[0053] Furthermore, it should be noted that the key point detection of the face is performed on the face image cropped from the face detection. In the embodiment of the present application, a 98-point key point detection model is used for calculation to obtain the position of each key point. Among them, the key point position has two functions: first, the key point can calculate the tilt angle of the face based on geometry, including three parameters: pitch angle, yaw angle, and roll angle. According to these three parameters, it is analyzed whether the face can be occluded and removed. When the deflection range is greater than the threshold, the occlusion removal step will not be performed. Secondly, the position of the key point is used as structured data and input into the face occlusion model for auxiliary calculation.

[0054] Furthermore, it should be noted that face quality assessment is to evaluate the clarity, brightness, etc. of the face through a neural network classification model, and quantify the result into a score between 0 and 1, the higher the better.

[0055] Furthermore, the above-mentioned obtaining of the face image to be processed and the key point coordinates of the face image to be processed includes:

[0056] Acquire a picture to be processed, and perform face detection on the picture to be processed to obtain a face picture to be processed, wherein the picture to be processed includes: a face picture with an obstruction and a face picture without an obstruction;

[0057] Key point detection is performed on the face image to be processed to determine the positions of key face points in the face image to be processed.

[0058] It should be noted that the above-mentioned face detection on the image to be processed includes:

[0059] Input the image to be processed into a face detection model, determine the coordinates of two vertices in the image to be processed, and generate a detection frame;

[0060] The detection frame is expanded according to preset parameters. When multiple face areas are detected, the detection frame with the largest area is determined to be the face area of ​​the image to be processed, and the coordinates of the face vertices cropped by the detection frame in the original image are recorded.

[0061] In the embodiment of the present application, the face detection process is as follows: Figure 2 As shown in the figure, the face detection model is used here to obtain the coordinates of two vertices, and then the detection frame is slightly expanded to increase the face area. When multiple faces are detected, the face with the largest detection frame area is selected by default, and the user is prompted to select a specific face. Finally, the coordinates of the cropped face vertices in the original image are recorded.

[0062] Furthermore, the above-mentioned key point detection on the face image to be processed to determine the position of the face key points in the face image to be processed includes:

[0063] Performing key point detection on the face image to be processed, and recording a preset number of key point coordinates;

[0064] Calculating the tilt angle of the face according to the preset number of key point coordinates based on geometry, wherein the tilt angle of the face includes a pitch angle, a yaw angle, and a roll angle;

[0065] When the tilt angle of the face is greater than a threshold, it is determined that the face image to be processed does not meet the occlusion removal condition, and a description that the occlusion cannot be removed is fed back;

[0066] When the tilt angle of the face is less than a threshold, it is determined that the face image to be processed meets the occlusion removal condition, and the positions of the face key points in the face image to be processed are determined according to a preset number of key point coordinates.

[0067] S102: The face image to be processed and the coordinates of key points of the face image to be processed are input into a preset GAN model to perform occlusion removal processing to obtain a face image with occlusions removed.

[0068] In this step, a GAN network is used to remove face occlusion. Specifically, its basic network structure is as follows: the input layer of the network contains two faces, one is an occluded face, and the other is a pre-photographed unobstructed face; the face key points are input into the middle of the hidden layer of the network to assist in face generation; the output layer of the network will output a face of the same size as the input occluded face, and the difference between the output and the occluded face is that there is no mask on the face.

[0069] S103: Generate a corresponding image without occlusions from the face image without occlusions according to the key point coordinates of the face image to be processed.

[0070] In this step, after obtaining the face image with occlusions removed, it is necessary to use the coordinates of the face vertices cropped by the detection frame in the original image to map the unobstructed face back to the original portrait image, obtain the corresponding image without occlusions, and finally feed back the image without occlusions to the user.

[0071] It should be noted that the embodiments of the present application introduce networks and algorithms such as face detection, face key points, and face generation to crop, extract, and remove obstructions from obstructed portrait images. The above processes can all be implemented on a GPU server. Users only need to upload obstructed portrait images and unobstructed face images (such as selfies without masks, videos, etc.), which can effectively solve the problem that it is inconvenient for users to take off masks when taking pictures in crowded scenes. In addition, the solution of the embodiments of the present application can also be adjusted to remove obstructions such as glasses and jewelry on the face according to user needs after simply adjusting the training data.

[0072] The embodiment of the present application provides a method for removing occlusions, by obtaining a face image to be processed and the key point coordinates of the face image to be processed, wherein the face image to be processed includes a face image with occlusions and a face image without occlusions; the face image to be processed and the key point coordinates of the face image to be processed are used as inputs, and input into a preset GAN model for removing occlusions to obtain a face image with occlusions removed; the face image with occlusions removed is used to generate a corresponding image with occlusions removed according to the key point coordinates of the face image to be processed. The present application sequentially adopts face detection, face key point detection, face quality assessment, face gan algorithm, etc., and by pre-shooting a face without a mask, the portrait photo with a mask can then be calculated and restored to a face without a mask, so as to achieve the purpose of removing occlusions in the portrait photo.

[0073] See also Figure 3 Based on the method for removing obstructions disclosed in the above embodiment, this embodiment correspondingly discloses a device for removing obstructions, the device comprising:

[0074] The first processing unit 31 is used to obtain a face image to be processed and the coordinates of key points of the face image to be processed, wherein the face image to be processed includes a face image with an occlusion and a face image without an occlusion;

[0075] The second processing unit 32 is used to input the face image to be processed and the key point coordinates of the face image to be processed into a preset GAN model to perform occlusion removal processing to obtain a face image with occlusions removed;

[0076] The third processing unit 33 is used to generate a corresponding image without occlusions from the face image without occlusions according to the key point coordinates of the face image to be processed.

[0077] Furthermore, the first processing unit 31 is specifically configured to:

[0078] Acquire a picture to be processed, and perform face detection on the picture to be processed to obtain a face picture to be processed, wherein the picture to be processed includes: a face picture with an obstruction and a face picture without an obstruction;

[0079] Key point detection is performed on the face image to be processed to determine the positions of key face points in the face image to be processed.

[0080] Furthermore, the first processing unit 31 is specifically configured to:

[0081] Input the image to be processed into a face detection model, determine the coordinates of two vertices in the image to be processed, and generate a detection frame;

[0082] The detection frame is expanded according to preset parameters. When multiple face areas are detected, the detection frame with the largest area is determined to be the face area of ​​the image to be processed, and the coordinates of the face vertices cropped by the detection frame in the original image are recorded.

[0083] Furthermore, the first processing unit 31 is specifically configured to:

[0084] Performing key point detection on the face image to be processed, and recording a preset number of key point coordinates;

[0085] Calculating the tilt angle of the face according to the preset number of key point coordinates based on geometry, wherein the tilt angle of the face includes a pitch angle, a yaw angle, and a roll angle;

[0086] When the tilt angle of the face is greater than a threshold, it is determined that the face image to be processed does not meet the occlusion removal condition, and a description that the occlusion cannot be removed is fed back;

[0087] When the tilt angle of the face is less than a threshold, it is determined that the face image to be processed meets the occlusion removal condition, and the positions of the face key points in the face image to be processed are determined according to a preset number of key point coordinates.

[0088] The device for removing obstructions includes a processor and a memory. The first processing unit, the second processing unit and the third processing unit are all stored in the memory as program units. The processor executes the program units stored in the memory to implement corresponding functions.

[0089] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the purpose of removing the occlusion in the portrait photo can be achieved by adjusting the kernel parameters.

[0090] An embodiment of the present application provides a storage medium on which a program is stored. When the program is executed by a processor, the method for removing obstructions is implemented.

[0091] An embodiment of the present application provides a processor, which is used to run a program, wherein the method for removing obstructions is executed when the program is run.

[0092] The present application embodiment provides an electronic device, such as Figure 4 As shown, the electronic device 40 includes at least one processor 401, and at least one memory 402 and a bus 403 connected to the processor; wherein the processor 401 and the memory 402 communicate with each other via the bus 403; the processor 401 is used to call the program instructions in the memory 402 to execute the above-mentioned method of removing obstructions.

[0093] The electronic devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0094] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing the following method steps:

[0095] Acquire a face image to be processed and the coordinates of key points of the face image to be processed, wherein the face image to be processed includes a face image with an occlusion and a face image without an occlusion;

[0096] The face image to be processed and the key point coordinates of the face image to be processed are input into a preset GAN model for removing occlusions, so as to obtain a face image with occlusions removed;

[0097] The face image with the occlusion removed is used to generate a corresponding image with the occlusion removed according to the key point coordinates of the face image to be processed.

[0098] Furthermore, the step of obtaining the face image to be processed and the key point coordinates of the face image to be processed includes:

[0099] Acquire a picture to be processed, and perform face detection on the picture to be processed to obtain a face picture to be processed, wherein the picture to be processed includes: a face picture with an obstruction and a face picture without an obstruction;

[0100] Key point detection is performed on the face image to be processed to determine the positions of key face points in the face image to be processed.

[0101] Furthermore, performing face detection on the image to be processed includes:

[0102] Input the image to be processed into a face detection model, determine the coordinates of two vertices in the image to be processed, and generate a detection frame;

[0103] The detection frame is expanded according to preset parameters. When multiple face areas are detected, the detection frame with the largest area is determined to be the face area of ​​the image to be processed, and the coordinates of the face vertices cropped by the detection frame in the original image are recorded.

[0104] Furthermore, the step of performing key point detection on the face image to be processed to determine the positions of key face points in the face image to be processed includes:

[0105] Performing key point detection on the face image to be processed, and recording a preset number of key point coordinates;

[0106] Calculating the tilt angle of the face according to the preset number of key point coordinates based on geometry, wherein the tilt angle of the face includes a pitch angle, a yaw angle, and a roll angle;

[0107] When the tilt angle of the face is greater than a threshold, it is determined that the face image to be processed does not meet the occlusion removal condition, and a description that the occlusion cannot be removed is fed back;

[0108] When the tilt angle of the face is less than a threshold, it is determined that the face image to be processed meets the occlusion removal condition, and the positions of the face key points in the face image to be processed are determined according to a preset number of key point coordinates.

[0109] The present application is described by flowcharts and / or block diagrams of the methods, devices (systems), and computer program products of the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0110] In a typical configuration, the device includes one or more processors (CPU), memory and bus. The device may also include input / output interface, network interface and the like.

[0111] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.

[0112] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0113] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0114] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0115] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for removing obstructions, characterized in that: include: Obtaining a face image to be processed and the key point coordinates of the face image to be processed, including: obtaining a picture to be processed, and performing face detection on the picture to be processed to obtain a face picture to be processed, wherein the picture to be processed includes: a face picture with an occlusion and a face picture without an occlusion; performing key point detection on the face picture to be processed to determine the position of the key points of the face in the face picture to be processed: performing key point detection on the face picture to be processed, and recording a preset number of key point coordinates, and calculating the inclination angle of the face according to geometry based on the preset number of key point coordinates, wherein the inclination angle of the face includes a pitch angle, a yaw angle, and a roll angle, and when the inclination angle of the face is greater than a threshold value, it is determined that the face picture to be processed does not meet the condition for removing the occlusion, and a description of the inability to remove the occlusion is fed back, and when the inclination angle of the face is less than a threshold value, it is determined that the face picture to be processed meets the condition for removing the occlusion, and the position of the key points of the face in the face picture to be processed is determined based on the preset number of key point coordinates; The face image to be processed and the key point coordinates of the face image to be processed are input into a preset GAN model for removing occlusions, so as to obtain a face image with occlusions removed; The face image with the occlusion removed is used to generate a corresponding image with the occlusion removed according to the key point coordinates of the face image to be processed.

2. The method according to claim 1, characterized in that Performing face detection on the image to be processed, including: Input the image to be processed into a face detection model, determine the coordinates of two vertices in the image to be processed, and generate a detection frame; The detection frame is expanded according to preset parameters. When multiple face areas are detected, the detection frame with the largest area is determined to be the face area of ​​the image to be processed, and the coordinates of the face vertices cropped by the detection frame in the original image are recorded.

3. A device for removing obstructions, characterized in that: include: A first processing unit is used to obtain a face image to be processed and key point coordinates of the face image to be processed, including: obtaining a picture to be processed, and performing face detection on the picture to be processed to obtain a face picture to be processed, wherein the picture to be processed includes: a face picture with an occlusion and a face picture without an occlusion; performing key point detection on the face picture to be processed to determine the position of key points of the face in the face picture to be processed: performing key point detection on the face picture to be processed, and recording a preset number of key point coordinates, and calculating the tilt angle of the face according to the preset number of key point coordinates according to geometry, wherein the tilt angle of the face includes a pitch angle, a yaw angle, and a roll angle; when the tilt angle of the face is greater than a threshold, it is determined that the face picture to be processed does not meet the condition for removing the occlusion, and a description of the inability to remove the occlusion is fed back; when the tilt angle of the face is less than a threshold, it is determined that the face picture to be processed meets the condition for removing the occlusion, and the position of the key points of the face in the face picture to be processed is determined according to the preset number of key point coordinates; A second processing unit is used to input the face image to be processed and the key point coordinates of the face image to be processed into a preset GAN model for removing occlusions, so as to obtain a face image with occlusions removed; The third processing unit is used to generate a corresponding removed-occlusion image from the removed-occlusion face image according to the key point coordinates of the face image to be processed.

4. The device according to claim 3, characterized in that The first processing unit is specifically configured to: Input the image to be processed into a face detection model, determine the coordinates of two vertices in the image to be processed, and generate a detection frame; The detection frame is expanded according to preset parameters. When multiple face areas are detected, the detection frame with the largest area is determined to be the face area of ​​the image to be processed, and the coordinates of the face vertices cropped by the detection frame in the original image are recorded.

5. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the method for removing obstructions according to any one of claims 1 to 2.

6. An electronic device, characterized in that: The electronic device includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other via the bus; and the processor is used to call program instructions in the memory to execute the method for removing obstructions as described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • Face shelter removal method, face shelter removal model construction method, equipment and medium

    CN108205659A