Face detection method and device, computer and storage medium

By migrating the calculation task of face detection to the server and performing multiple detections of real-time image frames, the problem of low pass rate of H5 face scanning mode is solved, and more efficient identity authentication is achieved.

CN119091483APending Publication Date: 2024-12-06WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411054854.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

Due to the limited computing power of the terminal in the H5 face scanning mode, it is impossible to analyze and detect the collected images in time, resulting in a low pass rate.

Method used

The calculation task during face detection is migrated to the server of the face detection system, and the real-time collected picture frames are detected multiple times according to the target operation sequence to improve the pass rate of the H5 face scanning mode.

Benefits of technology

By migrating the computing tasks to the server, the pass rate of the H5 face-scanning mode is improved, the problem of insufficient computing power of the terminal is solved, and faster and more accurate identity authentication is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119091483A_ABST
    Figure CN119091483A_ABST
Patent Text Reader

Abstract

The invention discloses a face detection method and device, a computer and a storage medium. The method comprises the steps of obtaining a first face frame which is drawn according to face frame parameters and corresponds to a first operation; performing quality detection on the plurality of first picture frames to obtain a plurality of second picture frames; when it is detected that the number of picture frames meeting a first proportion condition in the multiple second picture frames is larger than a first number, obtaining a second face frame drawn according to face frame parameters and corresponding to a second operation; performing quality detection on the plurality of third picture frames to obtain a plurality of fourth picture frames; when it is detected that the number of the picture frames meeting a second proportion condition in the fourth picture frames is larger than a second number, fifth picture frames meeting the second proportion condition are obtained; and performing face detection on the fifth picture frame to obtain a face detection result. The calculation task is migrated to the server of the face detection system, and the image frames collected in real time are detected for multiple times, so that the passing rate of the H5 face scanning mode is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of identity authentication, and in particular to a face detection method, device, computer and storage medium. Background Art

[0002] The use of face detection for identity authentication has been widely used in many fields, especially in scenarios such as mobile payment that require payment verification. Using face recognition mode for face detection can achieve fast and secure identity authentication.

[0003] Currently, the H5 face recognition mode mainly relies on the terminal recording video. During this process, the back-end system will analyze the relevant frames of the video to identify the user's specific actions. However, this solution has obvious defects. The computing power of the H5 terminal is limited and it is unable to analyze and detect the collected images in time, resulting in a low pass rate for the H5 face recognition mode. Summary of the invention

[0004] The embodiments of the present application provide a face detection method, device, computer and storage medium, which helps to improve the pass rate of the H5 face scanning mode by migrating the computing tasks required for face detection to the server of the face detection system and performing multiple detections on the real-time collected image frames according to the target operation sequence.

[0005] In a first aspect, an embodiment of the present application provides a face detection method, which is applied to a server of a face detection system, and the method includes:

[0006] Obtaining a first face frame drawn by the H5 application client according to face frame parameters and a first operation of a target operation sequence, wherein the face frame parameters include near-end face frame parameters and far-end face frame parameters, and the first operation is a move-in operation corresponding to the near-end face frame or a move-out operation corresponding to the far-end face frame;

[0007] Performing quality detection on a plurality of first picture frames collected in real time to obtain a plurality of second picture frames that pass the quality detection, wherein the first picture frames include the first face frames;

[0008] When it is detected that the number of picture frames satisfying the first proportion condition among the plurality of second picture frames is greater than the first number, a second face frame drawn by the H5 application client according to a second operation of the face frame parameter and the target operation sequence is obtained, where the second operation is a move-in operation corresponding to the near-end face frame or a move-out operation corresponding to the far-end face frame;

[0009] Performing quality detection on a plurality of third picture frames collected in real time to obtain a plurality of fourth picture frames that pass the quality detection, wherein the third picture frames include the second face frame;

[0010] When it is detected that the number of picture frames satisfying the second proportion condition in the plurality of fourth picture frames is greater than the second number, obtaining a fifth picture frame satisfying the second proportion condition in the plurality of fourth picture frames;

[0011] Perform face detection on the fifth image frame to obtain a face detection result.

[0012] In a second aspect, an embodiment of the present application provides a face detection device, comprising:

[0013] an acquisition module, configured to acquire a first face frame drawn by the H5 application client according to the face frame parameters and the first operation of the target operation sequence; and to acquire a second face frame drawn by the H5 application client according to the face frame parameters and the second operation of the target operation sequence when it is detected that the number of picture frames satisfying the first proportion condition in the plurality of second picture frames is greater than the first number;

[0014] A detection module is used to perform quality detection on multiple first picture frames collected in real time to obtain multiple second picture frames that pass the quality detection; and to perform quality detection on multiple third picture frames collected in real time to obtain multiple fourth picture frames that pass the quality detection; and to obtain a fifth picture frame that meets the second proportion condition among the multiple fourth picture frames when it is detected that the number of picture frames that meet the second proportion condition among the multiple fourth picture frames is greater than the second number; and to perform face detection on the fifth picture frame to obtain a face detection result.

[0015] In a third aspect, an embodiment of the present application provides a face detection device, comprising:

[0016] A memory, a processor, and an executable program code stored in the memory and executable on the processor, wherein the processor executes the method as described in any one of the first aspects when executing the executable program code.

[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a face detection program is stored. The face detection program includes execution instructions, and the execution instructions are used to execute the method as described in any one of the first aspects.

[0018] In a fifth aspect, the present application provides a computer program product, which, when executed by a processor, is used to implement the method as described in any one of the first aspects.

[0019] By implementing the embodiment of the present application, the server of the face detection system first obtains the first face frame drawn by the H5 application client according to the face frame parameters and the first operation of the target operation sequence; then performs quality detection on the multiple first picture frames collected in real time to obtain multiple second picture frames that pass the quality detection; then, when it is detected that the number of picture frames that meet the first proportion condition in the multiple second picture frames is greater than the first number, obtain the second face frame drawn by the H5 application client according to the second operation of the face frame parameters and the target operation sequence; then performs quality detection on the multiple third picture frames collected in real time to obtain multiple fourth picture frames that pass the quality detection; when it is detected that the number of picture frames that meet the second proportion condition in the multiple fourth picture frames is greater than the second number, obtain the fifth picture frame that meets the second proportion condition in the multiple fourth picture frames; finally, perform face detection on the fifth picture frame to obtain the face detection result. By migrating the computing tasks required for face detection to the server of the face detection system and performing multiple detections on the real-time collected picture frames according to the target operation sequence, it is beneficial to improve the pass rate of the H5 face scanning mode. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.

[0021] Figure 1 is an architecture diagram of a face detection system provided in an embodiment of the present application;

[0022] Figure 2 is a flow chart of a face detection method provided in an embodiment of the present application;

[0023] Figure 3 It is a schematic diagram of a quality detection interface provided in an embodiment of the present application;

[0024] Figure 4 This is a schematic diagram of an interface showing a face frame ratio provided in an embodiment of the present application;

[0025] Figure 5 This is a schematic diagram of an interface for face ratio detection provided in an embodiment of the present application;

[0026] Figure 6 This is a flow chart of an algorithm for face ratio detection provided in an embodiment of the present application;

[0027] Figure 7 This is a schematic diagram of face frame calculation provided by an embodiment of the present application;

[0028] Figure 8 is a flow chart of an algorithm for detecting whether a face is located in a face frame provided in an embodiment of the present application;

[0029] Fig. 9 This is a flow chart of an algorithm for sending a gradient percentage provided in an embodiment of the present application;

[0030] Fig.10 It is an algorithm flow chart of a message interaction mechanism provided in an embodiment of the present application;

[0031] Fig.11 is a structural diagram of a hardware version updating device provided in an embodiment of the present application;

[0032] Fig.12 It is a structural diagram of a computer provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present application.

[0034] The terms "first", "second", "third", etc. in the specification, claims and drawings of this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0035] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0036] The use of face detection for identity authentication has been widely used in many fields, especially in scenarios such as mobile payment that require payment verification. Using face recognition mode for face detection can achieve fast and secure identity authentication.

[0037] Currently, the H5 face recognition mode mainly relies on the terminal recording video. During this process, the back-end system will analyze the relevant frames of the video to identify the user's specific actions. However, this solution has obvious defects. The computing power of the H5 terminal is limited and it is unable to analyze and detect the collected images in time, resulting in a low pass rate for the H5 face recognition mode.

[0038] In view of the above problems, the embodiment of the present application provides a face detection method, device, computer and storage medium. The server of the face detection system first obtains a first face frame drawn by the H5 application client according to the face frame parameters and the first operation of the target operation sequence; then performs quality detection on multiple first picture frames collected in real time to obtain multiple second picture frames that pass the quality detection; then, when it is detected that the number of picture frames that meet the first proportion condition in the multiple second picture frames is greater than the first number, obtains the second face frame drawn by the H5 application client according to the second operation of the face frame parameters and the target operation sequence; then performs quality detection on multiple third picture frames collected in real time to obtain multiple fourth picture frames that pass the quality detection; when it is detected that the number of picture frames that meet the second proportion condition in the multiple fourth picture frames is greater than the second number, obtains the fifth picture frame that meets the second proportion condition in the multiple fourth picture frames; finally, performs face detection on the fifth picture frame to obtain the face detection result. By migrating the computing tasks required for face detection to the server of the face detection system and performing multiple detections on the real-time collected picture frames according to the target operation sequence, it is beneficial to improve the pass rate of the H5 face scanning mode.

[0039] See also Figure 1 , Figure 1 This is an architecture diagram of a face detection system provided in an embodiment of the present application. The face detection system 100 includes an H5 application client 101 and a face detection system server 102, wherein the H5 application client 101 refers to a web page or application that can run the HTML5 standard, and the face detection system server 102 refers to a remote computer device used to process a large number of computing tasks and store data. The H5 application client 101 establishes two-way communication with the face detection system server 102 through a real-time communication module. After the connection is established, the H5 application client 101 and the face detection system server 102 can both initiate communication with each other.

[0040] Specifically, after the H5 application client 101 establishes a long connection with the face detection system server 102, the H5 application client 101 obtains the picture frames collected by the camera in real time at a speed of 15 to 20 picture frames per second, and then sends the picture frames to the face detection system server 102 through the long connection. The face detection system server 102 detects and analyzes the received picture frames, and returns the detection results to the H5 application client 101 after the detection is completed, so that the H5 application client can perform subsequent operations. Finally, the face detection system server 102 verifies the person of the picture frames that pass the detection, and sends the face detection results to the H5 application client 101 for display. Among them, the speed and frequency at which the H5 application client 101 obtains the picture frames collected by the camera can be dynamically issued by the face detection system server 102. For example, the face detection system server 102 sets the resolution of the picture transmitted in real time by the H5 application client 101 to 480*640, and transmits 15 frames per second.

[0041] Among them, the terminals used by the system and method of this solution are not limited to H5 application clients, but can also be other terminals such as PC terminals and SDK terminals, which are not limited here.

[0042] Based on this, the present application provides a face detection method, device, computer and storage medium, and the present application is described in detail below in conjunction with the accompanying drawings.

[0043] See also Figure 2 , Figure 2 is a flow chart of a face detection method provided in an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:

[0044] Step a, obtaining a first face frame drawn by the H5 application client according to face frame parameters and the first operation of the target operation sequence;

[0045] Among them, the face frame parameters include near-end face frame parameters and far-end face frame parameters. The face frame parameters are randomly generated by the server of the face detection system and sent to the client of the H5 web application. The client of the H5 web application then draws the face frame according to the face frame parameters. Specifically, the face frame parameters generally include the starting point coordinates, the face frame length and the face frame height. After receiving the face frame parameters, the client of the H5 web application uses the Canvas element and JavaScript to draw.

[0046] Wherein, the near-end face frame parameter includes a near-end face frame size parameter, and the near-end face frame size parameter is between a first size threshold and a second size threshold, and the far-end face frame parameter includes a far-end face frame size parameter, and the far-end face frame size parameter is between a third size threshold and a fourth size threshold, wherein the random generation requires to ensure that the far-end face frame size parameter differs from the near-end face frame size parameter by no less than a fifth size threshold. Exemplarily, the first size threshold is 0.30, the second size threshold is 0.42, then the near-end face frame size parameter should be between 0.30-0.42, the fifth size threshold is 0.23, then the third size threshold is 0.65 at this time, to ensure that the difference between the third size threshold and the second size threshold is not less than the fifth size threshold, the fourth size threshold is 0.70, then the far-end face frame size parameter should be between 0.65-0.70, at this time, the near-end face frame size parameter randomly generated by the server of the face detection system is 0.35, and the far-end face frame size parameter is 0.68.

[0047] Among them, the target operation sequence consists of a move-in operation and a move-out operation. The target operation sequence may include one or more move-in operations and move-out operations. The order of the move-in operation and the move-out operation in the target operation sequence is pre-set by the user on the client of the face detection system. For example, the target operation sequence may be [move-in operation, move-out operation] or [move-out operation, move-in operation], wherein the face frame drawn corresponding to the move-in operation is the near-end face frame, and the face frame drawn corresponding to the move-out operation is the far-end face frame.

[0048] The face frame drawn according to the face frame parameters can be adjusted to an ellipse, a circle, a rectangle or other shapes as needed, and the shape of the face frame is not limited here.

[0049] Step b, performing quality detection on a plurality of first picture frames collected in real time, and obtaining a plurality of second picture frames that pass the quality detection;

[0050] The first image frame collected includes a first face frame drawn by the H5 application client.

[0051] Before quality detection is performed on the first acquired picture frame, a preprocessing operation may be performed on the first picture frame, and the preprocessing operation includes denoising, enhancement, normalization or filling, etc. One or more of the preprocessing operations may be selected to process the picture frame according to actual needs, wherein quality detection includes detection methods such as clarity detection, lighting condition detection, occlusion detection, and dynamic detection. Specifically, clarity detection is used to detect the clarity of the picture, which is usually evaluated by the contrast or frequency distribution of pixels in the picture, and finally removes the picture with low clarity; lighting condition detection is used to analyze the lighting conditions of the picture, including light intensity and light direction, and finally removes the picture with insufficient light or strong shadows; occlusion detection is used to detect whether the face in the picture is blocked, such as hands, sunglasses or sun hats, etc., and finally removes the picture that partially or completely blocks the face area; dynamic detection is used to detect whether the image is still or contains motion blur, which may cause the edge of the face to be blurred, affecting the accuracy of face detection. In actual application, one or more of these detection methods may be selected to perform quality detection.

[0052] Specifically, see Figure 3 , Figure 3 is a schematic diagram of a quality detection interface provided by an embodiment of the present application, such as Figure 3 As shown, in a certain picture frame S1, A is a face frame that has been drawn, and the server of the face detection system performs face detection on the face frame A, determines the face position in the face frame A and the bounding box B of the face, and then further performs occlusion detection on the face in the bounding box B, and determines that there is an occlusion C. At this time, it is determined that there is an occlusion in the face of the picture frame S1, and the quality detection fails. Among them, the algorithm for face detection can be a face detector based on deep learning, such as Multi-task Cascaded Convolutional Networks (MTCNN), Single Shot MultiBox Detector (SDD), etc. Among them, the way to determine whether the face is blocked can be pixel density analysis. Generally, the occlusion will cause the pixel density of the occlusion position to be significantly lower than the pixel density of other unblocked positions. After the pixel density of each small area in the bounding box is counted, it can be determined whether there is an occlusion according to the set pixel density threshold.

[0053] In a possible implementation manner, before detecting that the number of picture frames in which the proportion of faces in the first face frame in the second picture frame satisfies a first proportion condition is greater than a first number, the method further includes:

[0054] Determine whether the number of the multiple second picture frames is greater than the third number; when it is detected that the number of the multiple second picture frames is greater than the third number, determine whether the number of picture frames in the multiple second picture frames that meet the first proportion condition is greater than the first number.

[0055] Among them, the first proportion condition means that the proportion of the face in the picture frame to the first face frame is within the first proportion range. For example, the first proportion range is 80%-95%, and the calculated proportion of the face in the picture frame to the first face frame is 83%. At this time, the proportion of the face in the picture frame to the first face frame is within the first proportion range, so the picture frame satisfies the first proportion condition.

[0056] Among them, after the cumulative number of image frames that have passed the face quality detection exceeds the third number, it is considered that the current image quality is stable, and the face detection system server sends a first face frame matching message to the H5 application client, prompting the H5 application client that it has currently entered the first face frame matching process. In this process, the face detection system server calculates in real time the proportion of the face boundary box identified by the face detection algorithm in the second image frame to the first face frame.

[0057] Among them, different face frames correspond to different proportion conditions. When the face frame is a near-end face frame, the corresponding proportion condition is the near-end face frame proportion condition. When the face frame is a far-end face frame, the corresponding proportion condition is the far-end face frame proportion condition. The near-end face frame proportion condition and the far-end face frame proportion condition may be the same or different.

[0058] For example, see Figure 4 , Figure 4 is a schematic diagram of an interface of a face frame ratio provided in an embodiment of the present application, such as Figure 4 As shown, in a certain picture frame S2, the current first face frame is D, and the first proportion condition corresponding to the first face frame is that the proportion is between 85% and 100%. At this time, the face bounding box identified by the face detection algorithm is E, and the calculated size of the face bounding box E accounts for 87% of the size of the entire first face frame D, which meets the first proportion condition.

[0059] It can be seen that in this example, before calculating the proportion of the face frame to the entire image acquisition screen, ensuring that the number of picture frames that have passed quality inspection is greater than the target number is conducive to using more stable picture frames for proportion calculation, ensuring that the calculated face frame proportion data is more accurate and reliable.

[0060] In another possible implementation, before detecting that the number of picture frames in which the proportion of faces in the first face frame in the second picture frame satisfies a first proportion condition is greater than a first number, the method further includes:

[0061] Determine whether the time length for receiving the multiple second picture frames is greater than the first time length; when detecting whether the time length for receiving the multiple second picture frames is greater than the first time length, determine whether the number of picture frames in the multiple second picture frames that meet the first proportion condition is greater than the first number.

[0062] Among them, since the face detection system server sets the image resolution and the number of frames per second transmitted in real time by the H5 application client to be fixed values, in addition to using whether the number of multiple second image frames is greater than the third number as a measure of whether the current image acquisition state is stable, it is also possible to use the detection of whether the time length for receiving multiple second image frames is greater than the first time length as a measure of whether the current image acquisition state is stable.

[0063] For example, the face detection system server sets the image resolution of the H5 application client to be transmitted in real time to 480*640, and transmits 15 frames per second. The original criterion for whether the current image acquisition state is stable is to determine whether the number of multiple second image frames is greater than 15 frames. After converting the criterion from the number of image frames to the time length for receiving image frames, the criterion for whether the current image acquisition state is stable is now to determine whether the time length for receiving multiple second image frames is greater than 1s.

[0064] Among them, the first proportion condition means that the proportion of the face in the picture frame to the first face frame is within the first proportion range. For example, the first proportion range is 80%-95%, and the calculated proportion of the face in the picture frame to the first face frame is 83%. At this time, the proportion of the face in the picture frame to the first face frame is within the first proportion range, so the picture frame satisfies the first proportion condition.

[0065] Among them, after the cumulative number of image frames that have passed the face quality detection exceeds the third number, it is considered that the current image quality is stable, and the face detection system server sends a first face frame matching message to the H5 application client, prompting the H5 application client that it has currently entered the first face frame matching process. In this process, the face detection system server calculates in real time the proportion of the face boundary box identified by the face detection algorithm in the second image frame to the first face frame.

[0066] Among them, different face frames correspond to different proportion conditions. When the face frame is a near-end face frame, the corresponding proportion condition is the near-end face frame proportion condition. When the face frame is a far-end face frame, the corresponding proportion condition is the far-end face frame proportion condition. The near-end face frame proportion condition and the far-end face frame proportion condition may be the same or different.

[0067] It can be seen that in this example, the measurement standard is converted from the number of picture frames to the length of time for receiving picture frames, which realizes the stability evaluation of the picture acquisition state using multiple measurement standards, which is conducive to improving the reliability and accuracy of the picture acquisition state determination results.

[0068] Step c, when it is detected that the number of picture frames satisfying the first proportion condition among the plurality of second picture frames is greater than the first number, obtaining a second face frame drawn by the H5 application client according to the face frame parameters and the second operation of the target operation sequence;

[0069] Step d, performing quality detection on the multiple third picture frames collected in real time to obtain multiple fourth picture frames that pass the quality detection;

[0070] The collected third picture frame includes a second face frame drawn by the H5 application client.

[0071] Among them, before performing quality detection on the acquired third picture frame, the third picture frame can be preprocessed, and the preprocessing operations include denoising, enhancement, normalization or filling, etc., and one or more of the preprocessing operations can be selected to process the picture frame according to actual needs. Among them, quality detection includes clarity detection, lighting condition detection, occlusion detection, dynamic detection and other detection methods. In actual application, one or more of these detection methods can be selected to perform quality detection.

[0072] In a possible implementation manner, before detecting that the number of picture frames satisfying the second proportion condition in the plurality of fourth picture frames is greater than the second number, the method further includes:

[0073] Determine whether the number of the multiple fourth picture frames is greater than the fourth number; when it is detected that the number of the multiple fourth picture frames is greater than the fourth number, determine whether the number of picture frames in the multiple fourth picture frames that meet the second proportion condition is greater than the second number.

[0074] Among them, the second proportion condition means that the proportion of the face in the picture frame to the second face frame is within the second proportion range. For example, the second proportion range is 80%-95%. The calculated proportion of the face in the picture frame to the second face frame is 83%. At this time, the proportion of the face in the picture frame to the second face frame is within the second proportion range, so the picture frame satisfies the second proportion condition.

[0075] Among them, after the cumulative number of picture frames that have passed the face quality detection exceeds the fourth number, it is considered that the current picture quality is stable, and the face detection system server sends a second face frame matching message to the H5 application client, prompting the H5 application client that it has currently entered the second face frame matching process. In this process, the face detection system server calculates in real time the proportion of the face boundary box identified by the face detection algorithm in the fourth picture frame to the second face frame.

[0076] Among them, different face frames correspond to different proportion conditions. When the face frame is a near-end face frame, the corresponding proportion condition is the near-end face frame proportion condition. When the face frame is a far-end face frame, the corresponding proportion condition is the far-end face frame proportion condition. The near-end face frame proportion condition and the far-end face frame proportion condition may be the same or different.

[0077] For example, in a certain picture frame S2, the second proportion condition corresponding to the second face frame is that the proportion is between 90% and 100%. At this time, the face bounding box is identified according to the face detection algorithm, and the calculated size of the face bounding box accounts for 87% of the size of the entire second face frame, which does not meet the second proportion condition.

[0078] It can be seen that in this example, before calculating the proportion of the face frame to the entire image acquisition screen, ensuring that the number of picture frames that have passed quality inspection is greater than the target number is conducive to using more stable picture frames for proportion calculation, ensuring that the calculated face frame proportion data is more accurate and reliable.

[0079] In another possible implementation manner, before detecting that the number of picture frames satisfying the second proportion condition in the plurality of fourth picture frames is greater than the second number, the method further includes:

[0080] Determine whether the time length for receiving the multiple fourth picture frames is greater than the second time length; when detecting whether the time length for receiving the multiple fourth picture frames is greater than the second time length, determine whether the number of picture frames in the multiple fourth picture frames that meet the second proportion condition is greater than the second number.

[0081] Among them, since the face detection system server sets the image resolution and the number of frames per second transmitted in real time by the H5 application client to be fixed values, in addition to using whether the number of multiple fourth image frames is greater than the second number as a measure of whether the current image acquisition state is stable, it is also possible to use the time length for receiving multiple fourth image frames as a measure of whether the current image acquisition state is stable by detecting whether it is greater than the second time length.

[0082] For example, the face detection system server sets the image resolution of the H5 application client to be transmitted in real time to 480*640, and transmits 15 frames per second. The original criterion for whether the current image acquisition state is stable is to determine whether the number of multiple second image frames is greater than 15 frames. After converting the criterion from the number of image frames to the time length for receiving image frames, the criterion for whether the current image acquisition state is stable is now to determine whether the time length for receiving multiple second image frames is greater than 1s.

[0083] Among them, the first proportion condition means that the proportion of the face in the picture frame to the first face frame is within the first proportion range. For example, the first proportion range is 80%-95%, and the calculated proportion of the face in the picture frame to the first face frame is 83%. At this time, the proportion of the face in the picture frame to the first face frame is within the first proportion range, so the picture frame satisfies the first proportion condition.

[0084] Among them, after the cumulative number of image frames that have passed the face quality detection exceeds the third number, it is considered that the current image quality is stable, and the face detection system server sends a first face frame matching message to the H5 application client, prompting the H5 application client that it has currently entered the first face frame matching process. In this process, the face detection system server calculates in real time the proportion of the face boundary box identified by the face detection algorithm in the second image frame to the first face frame.

[0085] Among them, different face frames correspond to different proportion conditions. When the face frame is a near-end face frame, the corresponding proportion condition is the near-end face frame proportion condition. When the face frame is a far-end face frame, the corresponding proportion condition is the far-end face frame proportion condition. The near-end face frame proportion condition and the far-end face frame proportion condition may be the same or different.

[0086] It can be seen that in this example, the measurement standard is converted from the number of picture frames to the length of time for receiving picture frames, which realizes the stability evaluation of the picture acquisition state using multiple measurement standards, which is conducive to improving the reliability and accuracy of the picture acquisition state determination results.

[0087] In a possible implementation, the method further includes:

[0088] When it is detected that the second picture frame does not meet the first proportion condition, a first prompt message is sent according to the relationship between the proportion of the face in the second picture frame in the first face frame and the first proportion range; when it is detected that the fourth picture frame does not meet the second proportion condition, a second prompt message is sent according to the relationship between the proportion of the face in the fourth picture frame in the second face frame and the second proportion range.

[0089] Among them, when the proportion of the human face in the first face frame in the second picture frame is less than the lower limit of the first proportion range, the first prompt information is used to prompt the user to approach the image acquisition device; when the proportion of the human face in the first face frame in the second picture frame is greater than the upper limit of the first proportion range, the first prompt information is used to prompt the user to stay away from the image acquisition device; when the proportion of the human face in the second face frame in the fourth picture frame is less than the lower limit of the second proportion range, the second prompt information is used to prompt the user to approach the image acquisition device; when the proportion of the human face in the second face frame in the fourth picture frame is greater than the upper limit of the second proportion range, the second prompt information is used to prompt the user to stay away from the image acquisition device.

[0090] Specifically, when calculating the proportion of the face in the face frame in the picture frame, the model can be used to calculate the minimum face bounding box coordinates. The minimum face bounding box is a rectangular box, and the four vertices of the rectangular box are all located in the face frame. After the face bounding box coordinates are calculated, the proportion of the face bounding box in the face frame is obtained by calculating the size of the face bounding box and the size of the face frame.

[0091] For example, see Figure 5 , Figure 5 is a schematic diagram of an interface for face ratio detection provided in an embodiment of the present application, such as Figure 5 As shown, the first proportion range is 80% to 95%. The coordinates of the four vertices of the face bounding box I calculated by the model are [0,10], [0,15], [10,10] and [10,15] respectively. The coordinates of the four vertices of the first face frame H are [0,0], [0,20], [10,0], [10,20] respectively. At this time, the proportion of the face bounding box I to the face frame H is obtained by the size of the face bounding box I and the size of the face frame H, which is (15-10)*(15-10) / (20-0)*(10-0)=12.5%. 12.5% ​​is less than the lower limit of the first proportion range. Therefore, the first prompt information G is displayed on the display screen F of the image acquisition device to prompt the user to approach the image acquisition device.

[0092] Among them, taking the first face frame as an example, in a certain picture frame S3, the face position and the face bounding box size are determined according to the face detection algorithm. At this time, it is determined that the face bounding box size accounts for 40% of the first face frame size. The first proportion condition is that the face bounding box size accounts for 80% to 95% of the first face frame size. At this time, the picture frame S3 does not meet the first proportion condition, and the face bounding box in the picture frame S3 accounts for much less than 80%. Therefore, in order to make the face bounding box in the picture frame obtained by subsequent acquisition account for 80% to 95%, the user is prompted to approach the image acquisition device through the first prompt information. Similarly, if the face bounding box size determined by the face algorithm accounts for more than the upper limit of the first proportion range, the face proportion is too high at this time. In order to make the face bounding box in the picture frame obtained by subsequent acquisition account for 80% to 95%, the user is prompted to stay away from the image acquisition device through the first prompt information.

[0093] Among them, see Figure 6 , Figure 6 is a flow chart of an algorithm for face ratio detection provided in an embodiment of the present application, such as Figure 6 As shown, Figure 6 The left side shows the overall process of face ratio detection, where each process is described in detail as follows:

[0094] Process 1: Face stage refers to a state that the user enters after opening the H5 application client and entering the face detection interface. This state is mainly used to check whether the face is complete or normal. Specifically, it detects whether the face in the picture frame is aligned with the center of the face frame. If the face is not located in the center of the face frame, a prompt message is displayed on the display screen of the image acquisition device to guide the user to adjust the face so that the image on the page is as centered as possible;

[0095] Process 2: Recording stage, that is, recording stage, in order to meet the completeness of data and business, the current face usually records a facial action, such as nodding, blinking, shaking head, opening mouth, etc. In this stage, the user's face will be recorded and a comparison video will be produced for subsequent third-party face comparison.

[0096] Process three: Single live body, this process is used to notify the H5 application client that the face detection system server is performing face comparison, and the H5 application client can enter the waiting result page. For example, the H5 application client can display "Please wait for the detection result" in the blank area of ​​the display screen of the image acquisition device.

[0097] Process 4: Downstream flow is closed. This stage is used to notify the H5 application client that the face detection process has ended and the H5 application client can stop transmitting image and video data frames to the face detection system server through the real-time channel. After receiving this message, the H5 application client will no longer push the stream and suspend the transmission of image and video frame data.

[0098] Process 5: result stage. In this stage, the face detection system server sends the final face detection result to the H5 application client, and the H5 application client displays the face detection result in a blank area of ​​the display screen of the image acquisition device. For example, the H5 application client can display "face comparison successful" in a blank area of ​​the display screen of the image acquisition device.

[0099] in, Figure 6 The flowchart on the right is the specific process of the farc lose stage. In this process, before entering the remote process from satisfying the remote process and entering the near-end process from satisfying the near-end process, it is necessary to determine the state integrity. Specifically, it is necessary to use an algorithm to identify that the cumulative number of stable frames has reached N, that is, the number of picture frames that have passed the quality detection has accumulated to N frames, where N is a preset positive integer.

[0100] Among them, matching the near end and matching the far end involve parameters matchLevel and matchDegree respectively, satisfying the near end and satisfying the far end involve parameters matchLevel, matchDegree and tipType respectively. Specifically, the relevant parameters and descriptions are as follows:

[0101] The parameter matchLevel is the matching gradient value, which is used to calculate the distance between the user and the screen. Only when the distance between the user and the screen reaches a certain distance, that is, the ratio of the face bounding box to the face frame reaches a certain percentage, for example, greater than 25%, the face detection system server will send a message to the H5 application client to inform that the near-end matching has been completed;

[0102] The parameter matchDegree is the actual calculated value of the match, and the matching gradient value matchLeve l is obtained by the actual value of mathDegree and the gradient calculation method. For example, in the matching near-end process on the right, the two parameters of the matching gradient value and the matching actual calculated value are matchLeve l:50, matchDegree 0.52, indicating that the current face bounding box accounts for 0.52 of the face box at the current stage, and the matching gradient value is 50 after the matching gradient value conversion.

[0103] The parameter t ipType is a description of the message type. For example, when the parameter t ipType is 0, it means that the face detection system server sends an endpoint message to indicate that the corresponding state has been entered. Figure 6 Enter to meet the near end; when the parameter tipType is 1, the face detection system server sends a tip message; when the parameter tipType is 2, a percentage message is sent to notify the H5 application client of the current stage and the degree of face matching.

[0104] Among them, in addition to determining the distance between the user and the image acquisition device according to the ratio of the user's face to the face frame through the parameter matchLevel, the distance between the user and the image acquisition device is also directly determined by methods such as infrared equipment or distance sensing devices.

[0105] It can be seen that in this example, the distance between the person and the camera is indirectly inferred by calculating the proportion of the face frame in the image, and then the face frame proportion is used to guide the user to the appropriate position for face detection, which can improve the success rate and accuracy of detection. At the same time, by prompting the person to be located in the center of the image, it is helpful to avoid detection failure or inaccuracy due to position offset.

[0106] In one possible implementation, see Fig. 9 , Fig. 9 This is a flow chart of a gradient percentage delivery algorithm provided by an embodiment of the present application. The gradient percentage delivery algorithm sends a message to the H5 application client only when the distance between the user and the screen reaches a certain percentage, for example, the percentage is greater than 25%. Fig. 9 As shown, the H5 application client obtains the real-time picture frame collected by the camera, draws the near-end face frame according to the near-end face frame size parameter s in the face frame parameters, and then obtains the resolution of the real-time picture frame, that is, the width (width) and height (height) of the picture, calculates the height (headHeight) and width (headWidth) of the minimum face rectangular frame, and then obtains the average percentage of face matching based on the width (width) and height (height) of the picture frame and the calculated height (headHeight) and width (headWidth) of the minimum face rectangular frame. The calculation formula is as follows:

[0107] precent=((headWidth / width / s)+(headHeight / height / s)) / 2,

[0108] Among them, precent is the average percentage of face matching, headWidth is the width of the smallest face rectangular box, headHeight is the height of the smallest face rectangular box, width is the width of the picture, height is the height of the picture, and s is the near-end face box size parameter.

[0109] Among them, after calculating the average percentage of face matching, the current gradient Pnow is calculated through the average percentage of face matching and the gradient conversion module. Specifically, the corresponding relationship between the average percentage of face matching and the gradient is as follows: when the average percentage of face matching is greater than or equal to 0% and less than 25%, the current gradient Pnow is 0; when the average percentage of face matching is greater than or equal to 25% and less than 50%, the current gradient Pnow is 1; when the average percentage of face matching is greater than or equal to 50% and less than 75%, the current gradient Pnow is 2; when the average percentage of face matching is greater than or equal to 75% and less than 100%, the current gradient Pnow is 3; when the average percentage of face matching is greater than or equal to 100%, the current gradient Pnow is 4.

[0110] Among them, after the current gradient Pnow is calculated by the average percentage of face matching and the gradient conversion module, the gradient Pnow is compared with the parameter Plast. When the current gradient Pnow is not equal to the parameter Plast, a gradient message is sent to update the parameter Plast to be equal to the current gradient Pnow. Among them, the algorithm initializes Plast to be empty, that is, there is no percentage progress message in the current cache. As the face moves to a distance, the algorithm calculates the face ratio in real time. The gradient Pnow calculated between the current and the next two picture frames are not equal, indicating that the change exceeds 25%, and a progress message should be sent to the H5 application client.

[0111] Among them, the gradient Pnow in the gradient percentage delivery algorithm and the scale index defined by the gradient Pnow can be modified as needed. If more sensitive feedback is required, the change difference value can be adjusted to a smaller value. For example, the range of each gradient is 10%, and the average percentage of face matching corresponding to gradient 0 should be greater than or equal to 0% and less than 10%, and so on. In this way, there can be a total of 11 gradients. After the algorithm sends a gradient message each time, it also updates the cache parameter Plast to the gradient value of this time.

[0112] It can be seen that in this example, by using the width and height dimensions for average calculation, after testing and verification, the average calculation can well adapt to different face shapes and facial features of different ethnic groups. The use of the average percentage calculation algorithm is conducive to further improving the efficiency of user action completion.

[0113] Step e: when it is detected that the number of picture frames satisfying the second proportion condition in the plurality of fourth picture frames is greater than the second number, obtaining a fifth picture frame satisfying the second proportion condition in the plurality of fourth picture frames;

[0114] Step f: performing face detection on the fifth image frame to obtain a face detection result.

[0115] In a possible implementation, the method further includes:

[0116] The sixth picture frame collected in real time is detected to determine whether there is a face in the sixth picture frame; if it is detected that there is no face in the sixth picture frame, steps a to f are executed again.

[0117] Among them, see Figure 7 and Figure 8 , Figure 7 is a schematic diagram of face bounding box calculation provided by an embodiment of the present application, Figure 8 is a flowchart of an algorithm for detecting whether a face is located in a face frame provided by an embodiment of the present application. Figure 7 As shown, Figure 7 In the process, the face position and face bounding box are first identified by the face detection algorithm, and then the four points of the smallest face rectangular box are obtained, namely Figure 7 Coordinate point 1, coordinate point 2, coordinate point 3 and coordinate point 4 in the figure are used to determine the position and size of the face bounding box.

[0118] Specifically, if Figure 8 As shown, the H5 application client collects the picture frames collected by the camera in real time, and then sends the picture frames to the face detection system server, and the face detection system server processes the picture frames collected in real time.

[0119] Among them, the resolution of the image is w*h, the face frame parameter a can measure the size of the face frame, which indicates the proportion of the face frame to the image. The size of the drawn face frame can be changed by modifying the value of the parameter a. s is the minimum value of w and h, and b is the product of s and a. When the face frame is an ellipse or other irregular shapes, the face frame is converted into a standard rectangle to facilitate subsequent calculations. The rectangle can be uniquely determined by obtaining the coordinates of the upper left corner and the lower right corner. Specifically, the upper left corner coordinates and the lower right corner coordinates of the face frame are calculated as follows: the abscissa of the upper left corner coordinate is w / 2-b / 2, the ordinate of the upper left corner coordinate is h / 2-b / 2, the abscissa of the lower right corner coordinate is w / 2+b / 2, and the ordinate of the lower right corner coordinate is h / 2+b / 2. Then, the width tmpW and height tmpH of the face, as well as the four coordinates of the face boundary box are determined according to the face detection algorithm.

[0120] Among them, when the coordinates of the face boundary box are not located in the rectangular frame formed by the coordinates of the face frame, it is considered that the face is not in or is not completely in the face frame. The H5 application client displays a prompt message on the display screen of the image acquisition device to prompt the user to the corresponding camera. For example, the resolution of a picture is 1280*720 pixels. According to the face frame parameters, the proportion of the face frame in the image is determined to be 0.2 of the width of the entire image and 0.3 of the height of the entire image. At this time, it is assumed that the center position of the face frame is [640,3100], that is, the center position of the picture. According to the resolution of the image and the face frame parameters, the coordinates of the upper left corner of the face frame are determined to be [512,468], and the coordinates of the lower right corner are [768,252]. At this time, the coordinates of the upper left corner of the smallest face rectangular frame are [568,352], and the coordinates of the lower right corner of the smallest face rectangular frame are [627,242]. At this time, the vertical coordinate of the coordinates of the lower right corner of the smallest face rectangular frame is smaller than the vertical coordinate of the coordinates of the lower right corner of the face frame. Therefore, it is determined that the face is not completely located in the face frame. The H5 application client displays "Please face the camera" on the display screen of the image acquisition device.

[0121] It can be seen that in this example, by comparing the position information of the vertex coordinates of the face rectangular frame with the vertex coordinates of the image acquisition frame, it is possible to accurately determine whether the face is located in the expected image acquisition area, thereby avoiding the problem of poor image quality caused by face position offset. At the same time, when it is detected that the face is not in the image acquisition frame, by promptly reminding the user to aim the camera, the user can be helped to adjust the posture or position, which is conducive to improving the success rate of subsequent face detection.

[0122] In one possible implementation, see Fig.10 , Fig.10 is a flowchart of a message merging notification algorithm provided by the embodiment of this solution, such as Fig.10As shown, first, the H5 application client obtains the real-time image frame collected by the camera, and sends the image frame to the server of the face detection system. When the server of the face detection system detects that the current image frame is the first image frame received, it replies with a confirmation message to the H5 application client. If the server of the face detection system detects that the current image frame is not the first image frame received, but a subsequent image frame, it calculates whether the timestamp Tnow of the currently received image frame is the difference S between the time current of the last reply confirmation frame sent, S=Tnow-current, and determines whether the difference S is greater than M, M is a preset time length, specifically, M can be the time frequency of the reply confirmation frame, for example, the server of the current face detection system needs to send a reply confirmation frame information to the H5 application client every 800ms, if the difference S is greater than M, the server of the face detection system sends a confirmation message to the H5 application client, if the difference S is less than M, the server of the face detection system does not reply with a confirmation message.

[0123] It can be seen that in this example, by using the message merging notification algorithm, it is possible to effectively avoid the face detection system server from sending unnecessary confirmation information to the H5 application client, avoid channel message congestion problems, and save message sending calls.

[0124] See also Fig.11 , Fig.11 is a structural diagram of a face detection device provided in an embodiment of the present application, such as Fig.11 As shown, the face detection device 1100 includes:

[0125] The acquisition module 1101 is used to acquire a first face frame drawn by the H5 application client according to the face frame parameters and the first operation of the target operation sequence; and when it is detected that the number of picture frames satisfying the first proportion condition in the plurality of second picture frames is greater than the first number, acquire a second face frame drawn by the H5 application client according to the face frame parameters and the second operation of the target operation sequence;

[0126] The detection module 1102 is used to perform quality detection on multiple first picture frames collected in real time to obtain multiple second picture frames that pass the quality detection; and to perform quality detection on multiple third picture frames collected in real time to obtain multiple fourth picture frames that pass the quality detection; and to obtain a fifth picture frame that meets the second proportion condition among the multiple fourth picture frames when it is detected that the number of picture frames that meet the second proportion condition among the multiple fourth picture frames is greater than the second number; and to perform face detection on the fifth picture frame to obtain a face detection result.

[0127] In a possible implementation, before detecting that the number of picture frames in which the ratio of faces in the first face frame to the ratio of faces to faces in the second face frame satisfies a first ratio condition is greater than a first number, the detection module 1102 is further used to: determine whether the number of the multiple second picture frames is greater than a third number; and when detecting that the number of the multiple second picture frames is greater than the third number, determine whether the number of picture frames in the multiple second picture frames that satisfies the first ratio condition is greater than the first number.

[0128] In a possible implementation, before detecting that the number of picture frames in the multiple fourth picture frames that meet the second proportion condition is greater than the second number, the detection module 1102 is also used to: determine whether the number of the multiple fourth picture frames is greater than the fourth number; when detecting that the number of the multiple fourth picture frames is greater than the fourth number, determine whether the number of picture frames in the multiple fourth picture frames that meet the second proportion condition is greater than the second number.

[0129] In a possible implementation, the first proportion condition refers to that the proportion of the face in the picture frame to the first face frame is within a first proportion range, and the second proportion condition refers to that the proportion of the face in the picture frame to the second face frame is within a second proportion range.

[0130] In a possible implementation, the detection module 1102 is also used to: when it is detected that the second picture frame does not meet the first proportion condition, send a first prompt message based on the relationship between the proportion of the face in the second picture frame in the first face frame and the first proportion range; when it is detected that the fourth picture frame does not meet the second proportion condition, send a second prompt message based on the relationship between the proportion of the face in the fourth picture frame in the second face frame and the second proportion range.

[0131] In a possible implementation, when the proportion of the human face in the first face frame in the second picture frame is less than the lower limit of the first proportion range, the first prompt information is used to prompt the user to approach the image acquisition device; when the proportion of the human face in the first face frame in the second picture frame is greater than the upper limit of the first proportion range, the first prompt information is used to prompt the user to stay away from the image acquisition device; when the proportion of the human face in the second face frame in the fourth picture frame is less than the lower limit of the second proportion range, the second prompt information is used to prompt the user to approach the image acquisition device; when the proportion of the human face in the second face frame in the fourth picture frame is greater than the upper limit of the second proportion range, the second prompt information is used to prompt the user to stay away from the image acquisition device.

[0132] In a possible implementation, the detection module 1102 is further used to: detect the sixth picture frame collected in real time to determine whether there is a face in the sixth picture frame; if it is detected that there is no face in the sixth picture frame, re-execute steps a to f.

[0133] It is worth noting that the specific functional implementation of the face detection device 1100 is shown in the above Figure 2 The description of the face detection method shown in the figure, for example, the acquisition module 1101 is used to implement the relevant contents of step a and step c, and the detection module 1102 is used to implement the relevant contents of step b, step d, step e and step f. The various units or modules in the face detection device 1100 can be respectively or completely combined into one or several other units or modules to constitute, or one (some) of the units or modules can be further divided into multiple smaller units or modules in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present invention. The above-mentioned units or modules are divided based on logical functions. In practical applications, the functions of one unit (or module) are implemented by multiple units (or modules), or the functions of multiple units (or modules) are implemented by one unit (or module).

[0134] Based on the description of the above method embodiments and related device embodiments, please refer to Fig.12 , a schematic diagram of the structure of a computer 1200 provided in an embodiment of the present invention. Fig.12 The computer 1200 shown includes a processor 1201, a memory 1202, a communication interface 1203 and a bus 1204. The processor 1201, the memory 1202 and the communication interface 1203 are connected to each other through the bus 1204.

[0135] Optionally, the memory 1202 is a ROM, a static storage device, a dynamic storage device or a RAM.

[0136] The memory 1202 can store programs. When the executable program code stored in the memory 1202 is executed by the processor 1201, the processor 1201 and the communication interface 1203 are used to execute Figure 2 The various steps of the face detection method of the illustrated embodiment.

[0137] The processor 1201 adopts a general-purpose CPU, a microprocessor, an application-specific integrated circuit ASIC, a GPU or one or more integrated circuits to execute relevant programs to perform the face detection method of the method embodiment of the present application.

[0138] The processor 1201 can also be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the face detection method of the present application can be completed by the hardware integrated logic circuit in the processor 1201 or the instruction in the form of software. Optionally, the processor 1201 is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component. The processor can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor is a microprocessor or the processor is any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or a combination of hardware and software modules in the decoding processor to execute. The optional software module is located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the memory 1202, and the processor 1201 reads the information in the memory 1202, and combines its hardware to complete the functions required to be performed by the acquisition module 1101 and the detection module 1102 included in a face detection device 1100 of an embodiment of the present application, or executes the face detection method of the method embodiment of the present application.

[0139] The communication interface 1203 uses a transceiver or other related device such as, but not limited to, a transceiver.

[0140] The bus 1204 may include a path for transmitting information between various components of the computer 1200 (eg, the memory 1202 , the processor 1201 , and the communication interface 1203 ).

[0141] It should be noted that although Fig.12 The computer 1200 shown only shows a memory, a processor, and a communication interface, but in the specific implementation process, those skilled in the art should understand that the computer 1200 also includes other devices necessary for normal operation. At the same time, based on specific needs, those skilled in the art should understand that the computer 1200 may also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that the computer 1200 may also include only the devices necessary for implementing the embodiments of the present application, and does not necessarily include Fig.12 All devices shown in .

[0142] An embodiment of the present application provides a computer-readable storage medium, in which a computer program for electronic data exchange is stored. The computer program includes execution instructions, and the execution instructions are used to execute part or all of the steps of any face detection method recorded in the above-mentioned face detection method embodiment. The above-mentioned computer includes an electronic terminal device.

[0143] An embodiment of the present application provides a computer program product, wherein the computer program product includes a computer program, and the computer program can be operated to enable a computer to perform part or all of the steps of any face detection method recorded in the above method embodiments. The computer program product can be a software installation package.

[0144] It should be noted that, for the sake of simplicity, the embodiments of any of the aforementioned face detection methods are described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the present application.

[0145] The above is a detailed introduction to the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of a face detection method, device, computer and storage medium of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, based on the idea of ​​a face detection method, device, computer and storage medium of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0146] The present application is described with reference to the flowcharts and / or block diagrams of the methods, hardware products, 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.

[0147] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1The memory may include: a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0148] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "one" does not exclude multiple situations. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0149] A person skilled in the art can understand that all or part of the steps in the various methods of the method embodiments of any of the above-mentioned face detection methods can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a disk or an optical disk, etc.

[0150] It can be understood that any product that is controlled or configured to execute the processing method of the flowchart described in an embodiment of a face detection method of the present application, such as the device and computer program product of the above flowchart, falls within the scope of the related products described in the present application.

[0151] Obviously, those skilled in the art can make various changes and modifications to the face detection method, device, computer and storage medium provided by the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims

1. A face detection method, characterized in that: A server applied to a face detection system, wherein the server of the face detection system is in communication connection with an H5 application client, and the method comprises: Obtaining a first face frame drawn by the H5 application client according to face frame parameters and a first operation of a target operation sequence, wherein the face frame parameters include near-end face frame parameters and far-end face frame parameters, and the first operation is a move-in operation corresponding to the near-end face frame or a move-out operation corresponding to the far-end face frame; Performing quality detection on a plurality of first picture frames collected in real time to obtain a plurality of second picture frames that pass the quality detection, wherein the first picture frames include the first face frames; When it is detected that the number of picture frames satisfying the first proportion condition among the plurality of second picture frames is greater than the first number, a second face frame drawn by the H5 application client according to a second operation of the face frame parameter and the target operation sequence is obtained, where the second operation is a move-in operation corresponding to the near-end face frame or a move-out operation corresponding to the far-end face frame; Performing quality detection on a plurality of third picture frames collected in real time to obtain a plurality of fourth picture frames that pass the quality detection, wherein the third picture frames include the second face frame; When it is detected that the number of picture frames satisfying the second proportion condition in the plurality of fourth picture frames is greater than the second number, obtaining a fifth picture frame satisfying the second proportion condition in the plurality of fourth picture frames; Perform face detection on the fifth image frame to obtain a face detection result.

2. The method according to claim 1, characterized in that Before detecting that the number of picture frames in which the proportion of the face in the second picture frame to the first face frame satisfies a first proportion condition is greater than a first number, the method further includes: Determining whether the number of the plurality of second picture frames is greater than a third number; When it is detected that the number of the plurality of second picture frames is greater than the third number, it is determined whether the number of picture frames in the plurality of second picture frames that meet the first proportion condition is greater than the first number.

3. The method according to claim 1, characterized in that Before detecting that the number of picture frames satisfying the second proportion condition in the plurality of fourth picture frames is greater than the second number, the method further includes: determining whether the number of the plurality of fourth picture frames is greater than a fourth number; When it is detected that the number of the plurality of fourth picture frames is greater than the fourth number, it is determined whether the number of picture frames in the plurality of fourth picture frames that meet the second proportion condition is greater than the second number.

4. The method according to claim 2 or 3, characterized in that The first proportion condition refers to that the proportion of the face in the picture frame to the first face frame is within a first proportion range, and the second proportion condition refers to that the proportion of the face in the picture frame to the second face frame is within a second proportion range.

5. The method according to claim 4, characterized in that The method further comprises: When it is detected that the second picture frame does not meet the first proportion condition, sending a first prompt message according to the relationship between the proportion of the face in the second picture frame to the first face frame and the first proportion range; When it is detected that the fourth picture frame does not satisfy the second proportion condition, a second prompt message is sent according to a relationship between a proportion of the face in the fourth picture frame to the second face frame and the second proportion range.

6. The method according to claim 5, characterized in that When the proportion of the human face in the first face frame in the second picture frame is less than the lower limit of the first proportion range, the first prompt information is used to prompt the user to approach the image acquisition device; When the proportion of the human face in the first face frame in the second picture frame is greater than the upper limit of the first proportion range, the first prompt information is used to prompt the user to stay away from the image acquisition device; When the proportion of the second face frame occupied by the human face in the fourth picture frame is less than the lower limit of the second proportion range, the second prompt information is used to prompt the user to approach the image acquisition device; When the proportion of the human face in the second human face frame in the fourth picture frame is greater than the upper limit of the second proportion range, the second prompt information is used to prompt the user to stay away from the image acquisition device.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Detecting the plurality of first picture frames and / or the plurality of third picture frames to determine whether there is a human face in the plurality of first picture frames and / or the plurality of third picture frames; It is detected that there is no face in the multiple first picture frames and / or the multiple third picture frames, and the first face frame drawn by the H5 application client according to the face frame parameters and the first operation of the target operation sequence is re-acquired.

8. A face detection device, characterized in that: The device comprises: an acquisition module, configured to acquire a first face frame drawn by the H5 application client according to the face frame parameters and the first operation of the target operation sequence; and to acquire a second face frame drawn by the H5 application client according to the face frame parameters and the second operation of the target operation sequence when it is detected that the number of picture frames satisfying the first proportion condition in the plurality of second picture frames is greater than the first number; A detection module is used to perform quality detection on multiple first picture frames collected in real time to obtain multiple second picture frames that pass the quality detection; and to perform quality detection on multiple third picture frames collected in real time to obtain multiple fourth picture frames that pass the quality detection; and to obtain a fifth picture frame that meets the second proportion condition among the multiple fourth picture frames when it is detected that the number of picture frames that meet the second proportion condition among the multiple fourth picture frames is greater than the second number; and to perform face detection on the fifth picture frame to obtain a face detection result.

9. A computer, characterized in that: include: A memory, a processor, and an executable program code stored in the memory and executable on the processor, wherein the processor executes the steps of the face detection method according to any one of claims 1 to 7 when executing the executable program code.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a face detection program, wherein the face detection program includes execution instructions, and the execution instructions are used to execute the steps of the face detection method according to any one of claims 1 to 7.