High-dynamic face detection and recognition method and device and computer equipment
By using YOLOv8 model and TensorRT acceleration, combined with face recognition model for feature extraction and matching, the problem of insufficient accuracy and speed in high dynamic environments of traditional face recognition systems is solved, and high-precision and high-speed face detection and recognition are achieved.
Patent Information
- Application Number
- CN202411601571.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-11-11
AI Technical Summary
Traditional face recognition systems are difficult to achieve high-precision and high-speed face detection and recognition in high-dynamic environments.
The YOLOv8 model is used for face detection, and the acceleration and weighting are quantified through TensorRT, and feature extraction and matching are combined with the face recognition model to achieve highly dynamic face recognition.
High-precision and high-speed facial detection and recognition are achieved in large-scale populations, optimize the running speed and resource consumption of the model, and are suitable for high-dynamic environments.
Smart Images

Figure CN119559677A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of face recognition technology, and in particular to a high-dynamic face detection and recognition method, device and computer equipment. Background Art
[0002] With the increasing development of modern information technology, biometric recognition technology has been widely used in access control systems, and face recognition technology is one of the more common ones. Face recognition technology has the advantages of being fast, intuitive, and contactless. It is the mainstream technology for identity authentication and can play an extremely important role in access control systems. However, with the development of modern science and technology, traditional face recognition systems can no longer meet further needs in terms of recognition accuracy, the number of people detected and recognized per unit time, and the integration scale of the system. Therefore, in places with large-scale traffic such as community streets, schools, buses, subways, and railway stations, it is particularly urgent to make full use of emerging technologies such as big data, artificial intelligence, deep learning, and face recognition to provide a large-scale, highly dynamic, and high-speed face recognition biometric recognition system. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a high-dynamic face detection and recognition method, device and computer equipment, aiming to improve the face recognition speed and recognition accuracy in high dynamics.
[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is: a high-dynamic face detection and recognition method, comprising:
[0005] Use the face dataset to train the YOLOv8 model and obtain a preliminary face detection model;
[0006] The preliminary face detection model is accelerated and weighted quantized through TensorRT to obtain a weighted quantized face detection model.
[0007] Input the video stream to be detected into the weighted quantized face detection model for face detection, and perform coordinate cropping and correction alignment on the detected face;
[0008] The corrected and aligned face is passed through a face recognition model to extract features, and the extracted features are matched with the facial features in the face database to identify the identity of the face.
[0009] Furthermore, the preliminary face detection model is accelerated by TensorRT and weighted quantized to obtain a weighted quantized face detection model, including:
[0010] Convert a preliminary face detection model into ONNX format, wherein the preliminary face detection model is FP32 weights;
[0011] Load the preliminary face detection model in ONNX format and create the corresponding TensorRT execution engine;
[0012] Select a subset from the validation set as the calibration dataset;
[0013] Input the calibration data set into a preliminary face detection model and collect activation statistics of the face detection model, wherein the activation statistics include the maximum and minimum activation values of each neural network layer;
[0014] Input activation statistics into a calibration algorithm to calculate the optimal scaling factor;
[0015] According to the optimal scaling factor, the FP32 weights of the face detection model are converted into INT8 weights by symmetric linear quantization to generate a quantized face detection model.
[0016] Furthermore, the formula used for symmetric linear quantization is:
[0017]
[0018] in:
[0019] X int It represents the quantized INT8 integer value;
[0020] X represents the original FP32 value;
[0021] clip(x; a, c) represents the clip function; a=-2 b-1 ,c=2 b-1 -1;
[0022] Z represents the zero point of the mapping, which is used to adjust the offset;
[0023] S represents the scaling factor;
[0024] It represents the mathematical function of approximate integer;
[0025] x represents the value before quantization;
[0026] a represents the upper limit of quantization a=-128;
[0027] c represents the lower limit of quantization c=127;
[0028] b represents the number of bits of the data type. For INT8, b=8.
[0029] Furthermore, the step of inputting the video stream to be detected into the weighted quantized face detection model for face detection includes:
[0030] After the video stream to be detected is input into the weighted quantized face detection model, the face in each frame of the video stream is detected and the face in each frame of the video stream is selected using a target box.
[0031] Furthermore, the coordinate clipping and correction alignment of the detected face includes:
[0032] According to the coordinates of the target frame, the face in each frame of the video stream is cropped;
[0033] The cropped face is rotated and translated so that the key points of the face can match the pre-defined standard positions.
[0034] Furthermore, extracting features of the corrected and aligned face through a face recognition model, and matching the extracted features with face features in a face database to identify the identity of the face includes:
[0035] The corrected and aligned face is subjected to feature extraction through a face recognition model, and a multi-dimensional feature vector is output;
[0036] Calculate the Euclidean distance between the multi-dimensional feature vector and all face feature vectors in the face database;
[0037] If the Euclidean distance is less than a preset threshold, it is determined that the face belongs to the corresponding user in the face database. If the Euclidean distance is greater than the preset threshold, it is determined that the face does not belong to the user in the face database.
[0038] Furthermore, the high-dynamic face detection and recognition method further includes:
[0039] The faces that are judged not to belong to the face database and the corresponding user names are stored in the face database.
[0040] The present invention also provides a high-dynamic face detection and recognition device, comprising:
[0041] The face detection model training module is used to train the YOLOv8 model using the face dataset to obtain a preliminary face detection model;
[0042] The model acceleration and quantization module is used to accelerate the preliminary face detection model through TensorRT and perform weight quantization to obtain a weighted face detection model;
[0043] The face detection and preprocessing module is used to input the video stream to be detected into the weighted quantized face detection model for face detection, and to perform coordinate cropping and correction alignment on the detected face;
[0044] The face identity recognition module is used to extract features of the corrected and aligned face through a face recognition model, and match the extracted features with the face features in the face database to identify the identity of the face.
[0045] The present invention also provides a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the high-dynamic face detection and recognition method as described in any one of the above items is implemented.
[0046] The present invention also provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the high-dynamic face detection and recognition method as described in any one of the above items can be implemented.
[0047] The beneficial effects of the present invention are: the preliminary face detection model is accelerated and weighted by TensorRT to obtain a weighted face detection model, which optimizes the running speed and resource consumption of the face model, and can perform high-precision face detection and recognition in real time in a large crowd with limited computing resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The specific structure of the present invention is described in detail below in conjunction with the accompanying drawings.
[0049] Figure 1 A flow chart of a high dynamic face detection and recognition method according to an embodiment of the present invention;
[0050] Figure 2 A block diagram of a high dynamic face detection and recognition device according to an embodiment of the present invention;
[0051] Figure 3 This is a schematic diagram of the INT8 quantization principle based on the Min-Max calibration algorithm according to an embodiment of the present invention;
[0052] Figure 4 A schematic block diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0055] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0056] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0057] like Figure 1 As shown, an embodiment of the present invention is: a high-dynamic face detection and recognition method, comprising the steps of:
[0058] S10. Use the face dataset to train the YOLOv8 model to obtain a preliminary face detection model.
[0059] In this embodiment, the YOLOv8 model is trained using a public face dataset (VGGFace2), which is a large-scale face recognition dataset developed by the Visual Geometry Group (VGG) of the University of Oxford. Containing more than 3 million face images of more than 9,000 subjects, the model is trained using this large-scale face dataset, so that the trained face detection model has higher generalization ability and detection accuracy.
[0060] S20. The preliminary face detection model is accelerated and weighted quantized through TensorRT to obtain a weighted quantized face detection model.
[0061] In this embodiment, TensorRT is a deep learning inference acceleration library provided by NVIDIA, which can significantly improve the inference speed of deep learning models. It also supports quantization, which can further reduce the size of face detection models and improve operating efficiency. INT8 quantization belongs to the symmetric signed quantization type. In this quantization strategy, the Float32 (FP32) data range is: -3.4×10 Λ 38~+3.4×10 Λ38 linear quantization to INT8 range: -128 ~ 127. This can reduce the size of the system memory used by the face detection model, and at the same time convert a large number of Float32 multiplication calculations in the network into multiplication calculations between INT8 data, greatly improving the inference calculation speed of the face detection model. Use TensorRT's optimization and quantization functions to improve the speed and efficiency of face detection inference by the face detection model, thereby achieving high dynamics. Using TensorRT to accelerate the INT8 quantization of the preliminary face detection model is a very effective way to greatly improve the inference speed, especially on edge devices with limited computing power.
[0062] In a specific embodiment, the step of accelerating the preliminary face detection model through TensorRT and performing weight quantization to obtain the weight quantized face detection model includes the following steps:
[0063] S21. Convert a preliminary face detection model into ONNX format, wherein the preliminary face detection model is FP32 weights.
[0064] In this embodiment, the trained face detection model is usually in .pt format, that is, a PyTorch model, which is converted into ONNX format to ensure that the face detection model can be more widely used in different platforms and tools, including TensorRT.
[0065] S22. Load the preliminary face detection model in ONNX format and create the corresponding TensorRT execution engine.
[0066] In this embodiment, the corresponding TensorRT execution engine is created as a .engine file.
[0067] S23. Select a subset from the validation set as a calibration data set.
[0068] In this embodiment, a subset is selected from the validation set as a calibration data set, and the calibration data set can cover various situations that the face detection model may encounter in actual use.
[0069] S24. Input the calibration data set into a preliminary face detection model, and collect activation statistics of the face detection model, wherein the activation statistics include the maximum and minimum activation values of each neural network layer.
[0070] In this embodiment, the activation statistics of the face detection model are collected to provide a data basis for calculating the scaling factor. The purpose of data calibration is to find an optimal quantization parameter to minimize the error between the data represented by INT8 and the original Float32 data, and maintain the accuracy of the quantized model.
[0071] S25, inputting the activation statistical data into the calibration algorithm to calculate the optimal scaling factor.
[0072] In this embodiment, Figure 3 As shown, the collected activation statistics are used to run a calibration algorithm (Min-Max calibration) to calculate the optimal scaling factor. The scaling factor is used to quantize FP32 weights and activations to INT8.
[0073] S26. According to the optimal scaling factor, convert the FP32 weights of the face detection model into INT8 weights by symmetric linear quantization to generate a quantized face detection model.
[0074] In a specific embodiment, the formula used for symmetric linear quantization is:
[0075]
[0076] in:
[0077] X int It represents the quantized INT8 integer value;
[0078] X represents the original FP32 value;
[0079] clip(x; a, c) represents the clip function; a=-2 b-1 ,c=2 b-1 -1;
[0080] Z represents the zero point of the mapping, which is used to adjust the offset;
[0081] S represents the scaling factor;
[0082] It represents the mathematical function of approximate integer;
[0083] x represents the value before quantization;
[0084] a represents the upper limit of quantization a=-128;
[0085] c represents the lower limit of quantization c=127;
[0086] b represents the number of bits of the data type. For INT8, b=8.
[0087] S30, inputting the video stream to be detected into the weighted quantized face detection model to perform face detection, and performing coordinate cropping and correction alignment on the detected face.
[0088] In a specific embodiment, in step S30, inputting the video stream to be detected into the weighted quantized face detection model to perform face detection includes the following steps:
[0089] S31, after inputting the video stream to be detected into the weighted quantized face detection model, detect the face in each frame of the video stream, and select the face in each frame of the video stream by using a target frame.
[0090] In this embodiment, a face detection model accelerated by TensorRT is used to perform high-dynamic face detection on the input video stream. Each frame prediction output result of the YOLOv8 algorithm returns a result object. The result object has the attribute boxes, which represents each detected target box, and here represents each detected face. Each box has the attribute xyxy, which represents the (xmin, ymin, xmax, ymax) coordinate information of the four fixed points of the target box. Based on this xyxy coordinate attribute, the position of each face on the image can be located corresponding to four positions. According to this coordinate information, it can be cut down to obtain the face image in the image.
[0091] In a specific embodiment, in step S30, performing coordinate cropping and correction alignment on the detected face includes:
[0092] S32, cropping the face in each frame of the video stream according to the coordinates of the target frame;
[0093] S33, rotating and translating the cropped face so that key points of the face can match predefined standard positions.
[0094] In this embodiment, the cropped face is rotated and translated so that key points of the face (such as eyes, nose, mouth, etc.) can be accurately matched to predefined standard positions. Extracting facial feature vectors requires inputting a 112×112×3 image, so the image needs to be resized.
[0095] S40, extracting features of the corrected and aligned face through a face recognition model, and matching the extracted features with face features in a face database to identify the identity of the face.
[0096] In this embodiment, InsightFace is a deep learning-based face recognition library that provides a variety of state-of-the-art face recognition models and methods, such as deep learning-based face recognition models (convolutional neural networks CNN) to extract facial features. Its unique ArcFace face recognition model uses an improved loss function, angular margin loss, to optimize the discrimination of facial features. The ArcFace face recognition model is particularly effective for large-scale crowd face recognition because it can provide a compact and highly discriminative feature space, so that the distance between feature vectors of different people is larger, and the feature vectors of the same person under different conditions are closer; and the ArcFace face recognition model has high feature extraction efficiency because the unique network structure and the highly optimized characteristics of GPU devices support it for large-scale high-dynamic face recognition.
[0097] In a specific embodiment, step S40 includes:
[0098] S41, extracting features of the corrected and aligned face through a face recognition model, and outputting a multi-dimensional feature vector.
[0099] In this embodiment, calling the insightface.app.FaceAnalysis() method can load the face recognition model. The loaded ArcFace face recognition model performs feature extraction on the aligned and corrected face image and outputs a 512-dimensional feature vector.
[0100] S42. Calculate the Euclidean distance between the multidimensional feature vector and all face feature vectors in the face database.
[0101] S43. If the Euclidean distance is less than a preset threshold, it is determined that the face belongs to the corresponding user in the face database. If the Euclidean distance is greater than the preset threshold, it is determined that the face does not belong to the user in the face database.
[0102] In a specific embodiment, the high dynamic face detection and recognition method further includes the steps of:
[0103] S44, storing the face determined not to belong to the face database and the corresponding user name in the face database.
[0104] In this embodiment, the face_recognit io.register(img, user_name="") method is called to add a new face to the face database, and the feature vector of the face and the corresponding user name are stored in the database in the dictionary data type.
[0105] In summary, in terms of face detection, after the face detection model is accelerated and quantized by TensorRT, it performs at 150-175FPS on edge mobile devices such as NVIDIA Jetson Orin NX, thus realizing the system's high-dynamic face detection characteristics.
[0106] In terms of face recognition, the ArcFace face recognition model is used to extract features. It increases the decision boundary in the feature space by outputting high-dimensional feature vectors and normalizing the feature vectors and adding additive angular intervals, effectively enhancing the compactness within the class and the separability between classes, thereby realizing the system's large-scale, high-precision face recognition characteristics.
[0107] like Figure 2 As shown, another embodiment of the present invention is: a high-dynamic face detection and recognition device, comprising:
[0108] A face detection model training module 10 is used to train a YOLOv8 model using a face data set to obtain a preliminary face detection model;
[0109] The model acceleration and quantization module 20 is used to accelerate the preliminary face detection model through TensorRT and perform weight quantization to obtain a weight quantized face detection model;
[0110] The face detection and preprocessing module 30 is used to input the video stream to be detected into the weighted quantized face detection model for face detection, and to perform coordinate cropping and correction alignment on the detected face;
[0111] The face identity recognition module 40 is used to extract features of the corrected and aligned face through a face recognition model, and match the extracted features with face features in a face database to identify the identity of the face.
[0112] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned high-dynamic face detection and recognition device can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and brevity of description, it will not be repeated here.
[0113] The above-mentioned data encryption device based on encryption algorithm can be implemented in the form of a computer program. The computer program can be used in Figure 4 Runs on the computer device shown.
[0114] See also Figure 4 , Figure 45 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a terminal or a server, wherein the terminal may be an electronic device with communication functions such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of multiple servers.
[0115] See also Figure 4 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .
[0116] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a high-dynamic face detection and recognition method.
[0117] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
[0118] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a high-dynamic face detection and recognition method.
[0119] The network interface 505 is used to communicate with other devices over the network. Figure 4 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0120] The processor 502 is used to run the computer program 5032 stored in the memory to implement the high-dynamic face detection and recognition method as described above.
[0121] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0122] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0123] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the high-dynamic face detection and recognition method as described above.
[0124] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, or any other computer-readable storage medium that can store program codes.
[0125] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0126] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0127] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0128] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
[0129] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A high-dynamic face detection and recognition method, characterized in that: include: Use the face dataset to train the YOLOv8 model and obtain a preliminary face detection model; The preliminary face detection model is accelerated and weighted quantized through TensorRT to obtain a weighted quantized face detection model; Input the video stream to be detected into the weighted quantized face detection model for face detection, and perform coordinate cropping and correction alignment on the detected face; The corrected and aligned face is passed through a face recognition model to extract features, and the extracted features are matched with the facial features in the face database to identify the identity of the face.
2. The high-dynamic face detection and recognition method according to claim 1, characterized in that: The preliminary face detection model is accelerated by TensorRT and weighted quantized to obtain a weighted quantized face detection model including: Convert a preliminary face detection model into ONNX format, wherein the preliminary face detection model is FP32 weights; Load the preliminary face detection model in ONNX format and create the corresponding TensorRT execution engine; Select a subset from the validation set as the calibration dataset; Input the calibration data set into a preliminary face detection model and collect activation statistics of the face detection model, wherein the activation statistics include the maximum and minimum activation values of each neural network layer; Input activation statistics into a calibration algorithm to calculate the optimal scaling factor; According to the optimal scaling factor, the FP32 weights of the face detection model are converted into INT8 weights by symmetric linear quantization to generate a quantized face detection model.
3. The high dynamic face detection and recognition method according to claim 1, characterized in that: The formula used for symmetric linear quantization is: in: X int It represents the quantized INT8 integer value; X represents the original FP32 value; clipx; a, c represent clip function; a=-2 b-1 ,c=2 b-1 -1; Z represents the zero point of the mapping, which is used to adjust the offset; S represents the scaling factor; ·It represents a mathematical function that is approximately rounded; x represents the value before quantization; a represents the upper limit of quantization a=-128; c represents the lower limit of quantization c=127; b represents the number of bits of the data type. For INT8, b=8.
4. The high-dynamic face detection and recognition method according to claim 1, characterized in that: The step of inputting the video stream to be detected into the weighted quantized face detection model for face detection comprises: After the video stream to be detected is input into the weighted quantized face detection model, the face in each frame of the video stream is detected and the face in each frame of the video stream is selected using a target box.
5. The high-dynamic face detection and recognition method according to claim 1, characterized in that: The coordinate clipping and correction alignment of the detected face includes: According to the coordinates of the target frame, the face in each frame of the video stream is cropped; The cropped face is rotated and translated so that the key points of the face can match the pre-defined standard positions.
6. The high-dynamic face detection and recognition method according to claim 1, characterized in that: The step of extracting features of the corrected and aligned face through a face recognition model, and matching the extracted features with face features in a face database to identify the identity of the face includes: The corrected and aligned face is subjected to feature extraction through a face recognition model, and a multi-dimensional feature vector is output; Calculate the Euclidean distance between the multi-dimensional feature vector and all face feature vectors in the face database; If the Euclidean distance is less than a preset threshold, it is determined that the face belongs to the corresponding user in the face database. If the Euclidean distance is greater than the preset threshold, it is determined that the face does not belong to the user in the face database.
7. The high-dynamic face detection and recognition method according to claim 6, characterized in that: Also includes: The faces that are judged not to belong to the face database and the corresponding user names are stored in the face database.
8. A high-dynamic face detection and recognition device, characterized in that: include: The face detection model training module is used to train the YOLOv8 model using the face dataset to obtain a preliminary face detection model; The model acceleration and quantization module is used to accelerate the preliminary face detection model through TensorRT and perform weight quantization to obtain a weighted face detection model; The face detection and preprocessing module is used to input the video stream to be detected into the weighted quantized face detection model for face detection, and to perform coordinate cropping and correction alignment on the detected face; The face identity recognition module is used to extract features of the corrected and aligned face through a face recognition model, and match the extracted features with the face features in the face database to identify the identity of the face.
9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the high-dynamic face detection and recognition method according to any one of claims 1 to 7 when executing the computer program.
10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the high-dynamic face detection and recognition method according to any one of claims 1 to 7 can be implemented.
Citation Information
Patent Citations
Model quantification processing system and model quantification processing method
CN114298291A
Image deep false detection acceleration method and system based on quantization technology
CN115719520A
Lightweight face forgery detection model construction method and device, equipment and storage medium
CN116168433A
Method for detecting whether a face is masked, masked-face recognition device, and computer storage medium
US20220327862A1