Face recognition precision test method, device and equipment

By generating test data in various scenarios, the problem of low efficiency in face recognition accuracy testing was solved, achieving efficient and accurate testing results.

CN115797989BActive Publication Date: 2026-07-10CHINA MOBILE M2M +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE M2M
Filing Date
2021-08-31
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing face recognition accuracy testing methods suffer from low testing efficiency.

Method used

By acquiring the first image, multiple second images corresponding to the first image are generated, and the face recognition algorithm under test is called to perform recognition tests, including operations such as adjusting facial features, image blurring, and face replacement, to generate test data in various scenarios.

Benefits of technology

It enables data collection without the need for real-world scenarios, saving costs and improving testing efficiency, as well as enhancing the coverage depth and accuracy of tests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115797989B_ABST
    Figure CN115797989B_ABST
Patent Text Reader

Abstract

The application discloses a face recognition precision testing method, device and equipment, and relates to the IT application technical field.The method comprises the following steps: acquiring a first picture;generating a plurality of second pictures based on a scene corresponding to the first picture according to the first picture;calling a tested face recognition algorithm to perform identification testing on the first picture and the plurality of second pictures, and acquiring face recognition precision.The scheme of the application generates the second picture based on the scene corresponding to the first picture, so that data acquisition is not required in a real scene, the dependence on the scene is reduced, the coverage depth of the test is improved, the test cost is saved, and the test efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of IT application technology, and in particular to a method, apparatus and equipment for testing the accuracy of face recognition. Background Technology

[0002] In existing technologies, facial recognition is a biometric technology that identifies individuals based on their facial features. Common facial recognition algorithms include those based on facial feature points, those based on entire facial images, those based on templates, and those using neural networks. Regardless of the algorithm used, the requirement for recognition accuracy remains the same. Currently, testing facial recognition accuracy typically requires accumulating large amounts of facial image data from the internet using web scraping techniques to train and validate the algorithm. However, this validation method suffers from low testing efficiency. Summary of the Invention

[0003] The purpose of this application is to provide a method, apparatus, and device for testing the accuracy of face recognition, thereby solving the problem of low testing efficiency in existing face recognition accuracy testing methods.

[0004] To achieve the above objectives, this application provides a method for testing the accuracy of face recognition, comprising:

[0005] Get the first image;

[0006] Based on the first image, generate multiple second images based on the scene corresponding to the first image;

[0007] The face recognition algorithm under test is invoked to perform recognition tests on the first image and the multiple second images to obtain the face recognition accuracy.

[0008] Optionally, the method further includes:

[0009] Get the first parameter entered by the user on the graphical user interface;

[0010] Based on the first image, generate multiple second images based on the scene corresponding to the first image, including:

[0011] Based on the first parameter, the first image is adjusted to generate the plurality of second images;

[0012] The first parameter includes at least one of the following:

[0013] Should facial features be adjusted?

[0014] Gaussian blur radius;

[0015] Sharpening intensity;

[0016] Face replacement library identifier.

[0017] Optionally, the first image may be adjusted, including at least one of the following:

[0018] If facial features are selected to be adjusted, at least some facial features of the face in the first image are randomly adjusted.

[0019] The first image is blurred according to the Gaussian blur radius;

[0020] Based on the sharpening intensity, the first image is subjected to image sharpening processing;

[0021] If facial features are not adjusted, the first image is replaced and the image in the face replacement library corresponding to the face replacement library identifier is merged with the background.

[0022] Optionally, performing face replacement and background fusion on the first image and the image in the face replacement library corresponding to the face replacement library identifier includes:

[0023] Extract the facial marker matrix of the face in the first image and the facial marker matrix of the face in the face replacement library;

[0024] Based on the facial marker matrix of the face extracted from the first image and the facial marker matrix of the face in the face replacement library, the face in the face replacement library is overlaid on the face in the first image to obtain multiple third images;

[0025] The RGB values ​​of the color channels of each pixel position of the face in the first image and the RGB values ​​of the color channels of each pixel position of the face in the plurality of third images are extracted respectively.

[0026] The RGB values ​​of each pixel position of the face in the plurality of third images are adjusted to the RGB values ​​of each pixel position of the face in the first image.

[0027] Optionally, the face recognition algorithm under test is invoked to perform recognition tests on the first image and the plurality of second images to obtain the face recognition accuracy, including:

[0028] The face recognition algorithm under test is invoked to recognize the first image and the plurality of second images respectively, and the recognition results are obtained;

[0029] The face recognition accuracy is defined as the ratio of the number of correctly recognized images to the total number of recognized images in the recognition results.

[0030] Optionally, the method further includes:

[0031] The address of the face recognition algorithm under test is obtained based on the second parameter input by the user on the graphical user interface.

[0032] Based on the address of the face recognition algorithm under test, obtain the face recognition algorithm under test;

[0033] The second parameter includes at least one of the following:

[0034] The name of the environment in which the face recognition algorithm under test is located;

[0035] IP address;

[0036] Port number.

[0037] Optionally, the address of the tested face recognition algorithm is obtained based on the second parameter input by the user on the graphical user interface, including:

[0038] If the second parameter includes the name of the environment of the face recognition algorithm being tested, the IP address and port number corresponding to the environment name of the face recognition algorithm being tested are obtained according to the pre-configured correspondence.

[0039] This application also provides a face recognition accuracy testing device, comprising:

[0040] The first acquisition module is used to acquire the first image;

[0041] The generation module is used to generate multiple second images based on the scene corresponding to the first image, according to the first image.

[0042] The second acquisition module is used to call the face recognition algorithm under test to perform recognition tests on the first image and the plurality of second images, and to obtain the face recognition accuracy.

[0043] This application embodiment also provides a face recognition accuracy testing device, including: a processor, a memory, and a program stored in the memory and executable on the processor. When the program is executed by the processor, it implements the face recognition accuracy testing method as described above.

[0044] This application embodiment also provides a readable storage medium storing a program, which, when executed by a processor, implements the above-described functionality.

[0045] The method for testing the accuracy of face recognition.

[0046] The above-mentioned technical solution of this application has at least the following beneficial effects:

[0047] The face recognition accuracy testing method of this application embodiment first acquires a first image; second, based on the first image, generates multiple second images corresponding to the scene of the first image. In this way, data collection can be performed without real-world scenarios, saving testing costs and improving testing efficiency; finally, the face recognition algorithm under test is invoked to perform recognition tests on the first image and the multiple second images to obtain the face recognition accuracy. Thus, the limitations of face recognition accuracy testing are solved, and the coverage depth and accuracy of the test are improved. Attached Figure Description

[0048] Figure 1 This is a flowchart illustrating the face recognition accuracy testing method according to an embodiment of this application.

[0049] Figure 2 This is a schematic diagram of the structure of a face recognition accuracy testing device according to an embodiment of this application;

[0050] Figure 3 This is a schematic diagram of the structure of a face recognition accuracy testing device according to an embodiment of this application. Detailed Implementation

[0051] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0052] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0053] The following description, in conjunction with the accompanying drawings, details the face recognition accuracy testing method, apparatus, and device provided in this application through specific embodiments and application scenarios.

[0054] like Figure 1 The diagram shown is one of the flowcharts illustrating a method for testing the accuracy of face recognition according to an embodiment of this application. The method includes:

[0055] Step 101, Obtain the first image;

[0056] In this step, the first image can be a suitable background image selected based on the actual application scenario, and the first image can serve as the baseline image for other images being tested.

[0057] It should be noted that one or more of the first images can be obtained in this step, and the number of first images is not limited in this embodiment of the application.

[0058] Step 102: Generate multiple second images based on the scene corresponding to the first image, according to the first image;

[0059] Step 103: Call the face recognition algorithm under test to perform recognition tests on the first image and the multiple second images to obtain the face recognition accuracy.

[0060] The face recognition accuracy testing method of this application embodiment first acquires a first image; second, based on the first image, generates multiple second images corresponding to the scene of the first image. In this way, data collection can be performed without real-world scenarios, saving testing costs and improving testing efficiency; finally, the face recognition algorithm under test is invoked to perform recognition tests on the first image and the multiple second images to obtain the face recognition accuracy. Thus, the limitations of face recognition accuracy testing are solved, and the coverage depth and accuracy of the test are improved.

[0061] Here, we will explain how to obtain the first image:

[0062] Method 1: Obtain the first image uploaded by the user in the graphical user interface; that is, the user can select a suitable baseline image according to the specific needs of the test, and upload the first image to the device or system that performs the face recognition accuracy test method of the present application embodiment through the operation on the graphical user interface.

[0063] Method 2: Obtain the first image corresponding to the application scenario selected by the user on the user graphical interface from the pre-configured image library; that is, the device or system that performs the face recognition accuracy test method of this application embodiment has pre-stored baseline images for various scenarios. The device or system can select the baseline image that matches the application scenario input by the user from the pre-stored baseline images as the first image according to the application scenario selected by the user on the user graphical interface.

[0064] Furthermore, as an optional implementation, the method also includes:

[0065] Get the first parameter entered by the user on the graphical user interface;

[0066] In this step, the graphical user interface is a graphical user interface (GUI) implemented based on the Python pyqt5 library. Users can interact with the system or device that performs the face recognition accuracy test method of this application through the GUI.

[0067] Step 102: Based on the first image, generate multiple second images based on the scene corresponding to the first image, including:

[0068] Based on the first parameter, the first image is adjusted to generate the plurality of second images;

[0069] The first parameter includes at least one of the following:

[0070] Should facial features be adjusted?

[0071] Gaussian blur radius;

[0072] Sharpening intensity;

[0073] Face replacement library identifier.

[0074] In this optional implementation, the user can select, in the GUI graphical interface, whether to adjust the facial features of the face in the first image, whether to blur the first image and the value of the Gaussian blur radius, whether to sharpen the first image and the value of the sharpening intensity, and whether to replace the face in the first image and at least one of the following: face replacement library identifier. In this way, the user can personalize the adjustment of the first image according to their needs, and the coverage depth of the test image is improved.

[0075] As a specific implementation, the first image is adjusted, including at least one of the following:

[0076] If facial features are selected to be adjusted, at least some facial features of the face in the first image are randomly adjusted.

[0077] Here, the process of randomly adjusting facial features is explained:

[0078] This code uses Python's dlib library to extract facial features, including the face, eyes, nose, mouth, and eyebrows. The `random_organs()` function is then used to randomly process and fine-tune these facial features. For example, the mouth feature is used as a case study.

[0079] Mouth(smooth)=random_organs(face.organs['mouth'],β)

[0080] Where β is an adjustment parameter, randomly generated between 0.1 and 1.0, and face.organs['mouth'] is the obtained facial feature mouth object.

[0081] It should be noted that existing technologies cannot modify facial features or the modification is too difficult, resulting in incomplete scene coverage when facial features are changed. This alternative implementation achieves accurate testing of local changes in the tested face by randomly adjusting facial features, thus solving the limitation of face recognition algorithm accuracy testing.

[0082] The first image is blurred according to the Gaussian blur radius;

[0083] Here, the specific implementation of image blurring is explained:

[0084] According to the formula P0=P1*δ, the first image is blurred, where P1 is the image before blurring, P0 is the radius after blurring, and δ is the Gaussian blur radius, which ranges from 0 to 10. The larger the radius, the higher the degree of blurring.

[0085] It should be noted that for face recognition algorithms, the recognition results will differ when the clarity of the face image is different. In the existing technology, it is difficult to construct a face image with different clarity and it cannot be quantified. Therefore, in this optional implementation, the image is blurred by setting the Gaussian blur radius to construct images with different clarity. In this way, the problem of incomplete coverage of the image clarity range can be solved, the coverage depth of the test can be improved, and accurate testing can be achieved.

[0086] Based on the sharpening intensity, the first image is subjected to image sharpening processing;

[0087] Here, the specific implementation of image sharpening processing is explained:

[0088] According to the formula P0=P1*λ, the first image is sharpened, where P1 is the image before sharpening, P0 is the image after sharpening, and λ is the sharpening intensity, ranging from 0 to 10. The greater the sharpening intensity, the higher the degree of sharpening.

[0089] If facial features are not adjusted, the first image is replaced and the image in the face replacement library corresponding to the face replacement library identifier is merged with the background.

[0090] In other words, when processing the first image, one can choose between adjusting facial features and face swapping.

[0091] It should be noted that when performing face replacement, the face_replacement() function in the face recognition accuracy testing device, system or equipment of this application embodiment can be enabled to realize face replacement and background fusion according to abstract mathematical methods.

[0092] As a specific implementation, the first image is compared with the image in the face replacement library corresponding to the face replacement library identifier, and face replacement and background fusion are performed, including:

[0093] Extract the facial marker matrix of the face in the first image and the facial marker matrix of the face in the face replacement library;

[0094] Specifically, the dlib library in Python is used to extract facial markers, resulting in two facial marker matrices: one for the first image and one for the image from the face replacement library. Each row contains a set of coordinates corresponding to a specific facial feature.

[0095] Based on the facial marker matrix of the face extracted from the first image and the facial marker matrix of the face in the face replacement library, the face in the face replacement library is overlaid on the face in the first image to obtain multiple third images;

[0096] Specifically, the first vector of the facial marker matrix can be rotated, translated, and scaled using algorithms to fit the points of the second vector as closely as possible. This allows the second image to be overlaid on the first image using the same transformation, achieving face matching. The abstract mathematical expression is as follows:

[0097]

[0098] Where R is an orthogonal matrix, s is a scalar, T is a two-dimensional vector, and p i and q i The rows of the face marker matrix are searched for T, s, and R. The result of the above expression is minimized. After adjustment, the face in the image from the face replacement library is mapped to the face in the first image using the CV2.warpAffine function in Python's OpenCV library, achieving seamless face replacement.

[0099] The RGB values ​​of the color channels of each pixel position of the face in the first image and the RGB values ​​of the color channels of each pixel position of the face in the plurality of third images are extracted respectively.

[0100] It should be noted that after the face replacement is completed, the cv2.split function in the OpenCV library of Python in the apparatus, device or system of the face recognition accuracy test method of this application is used to read the RGB values ​​of the color channels of each pixel position of the face in the first image and the RGB values ​​of the color channels of each pixel position of the face in the third image.

[0101] The RGB values ​​of each pixel position of the face in the plurality of third images are adjusted to the RGB values ​​of each pixel position of the face in the first image.

[0102] In this step, the RGB values ​​of each pixel position of the face in the plurality of third images are adjusted to the RGB values ​​of each pixel position of the face in the first image, so that the RGB values ​​of each pixel position of the face in the plurality of third images are equal to the RGB values ​​of each pixel position of the face in the first image, thereby completing the background fusion of the images.

[0103] Specifically, the background function can be fused using P1(r,g,b) = replace(P0(r,g,b)), where is the RGB value of a pixel on the face in the first image, and is the RGB value of the same pixel on the face in the second image.

[0104] By replacing faces, the system eliminates the scenario dependence of face recognition algorithm accuracy testing, enabling the generation of data sources under various scenarios in the apparatus, device, or system executing the face recognition accuracy testing method of this application embodiment. This solves the problem in the prior art testing methods where images obtained from the Internet are often artistic photos and stills of celebrities, which differ greatly from the real-world scenarios of face recognition and cannot fully cover the scene of the image, resulting in inaccurate test results.

[0105] Furthermore, after generating multiple second images based on the scene corresponding to the first image, the method further includes: storing the second images, specifically, naming and storing the second images by prefixing them with a name and adding a number.

[0106] As an optional implementation, step 103 involves calling the face recognition algorithm under test to perform a recognition test on the first image and the plurality of second images to obtain the face recognition accuracy, including:

[0107] The face recognition algorithm under test is invoked to recognize the first image and the plurality of second images respectively, and the recognition results are obtained;

[0108] In this step, the face recognition algorithm under test is invoked to perform cyclic recognition tests on the first image and multiple second images to obtain test results, and the test results are displayed in the log module of the apparatus, device or system that executes the face recognition accuracy test method of this application embodiment.

[0109] The face recognition accuracy is defined as the ratio of the number of correctly recognized images to the total number of recognized images in the recognition results.

[0110] Furthermore, as an optional implementation, the method also includes:

[0111] The address of the face recognition algorithm under test is obtained based on the second parameter input by the user on the graphical user interface.

[0112] Based on the address of the face recognition algorithm under test, obtain the face recognition algorithm under test;

[0113] The second parameter includes at least one of the following:

[0114] The name of the environment in which the face recognition algorithm under test is located;

[0115] IP address;

[0116] Port number.

[0117] In this optional implementation, the user inputs a second parameter on the graphical user interface. The second parameter includes at least one of the name, IP address, and port number of the environment of the face recognition algorithm under test. Based on the second parameter input by the user, the network address of the face recognition algorithm under test can be determined accordingly.

[0118] Specifically, when the second parameter includes the name of the face recognition algorithm environment being tested, the IP address and port number corresponding to the name of the face recognition algorithm environment being tested are obtained according to the pre-configured correspondence.

[0119] In other words, if the second parameter input by the user only includes the name of the face recognition algorithm environment under test, the IP address and port corresponding to the name of the face recognition algorithm environment under test can be automatically associated through a pre-configured file (pre-configured correspondence) and displayed on the interface.

[0120] The following describes the face recognition accuracy testing method of this application embodiment as an example. The device is based on the Python pyqt5 library to implement a GUI graphical interface. The device includes a module for the address of the algorithm under test, a background image upload module, a test image data generation module, a test startup module, and a log module. The specific implementation of each module is as follows:

[0121] The module for the address of the algorithm under test (DUT) allows you to preset the name, IP address, and port number of the DUT environment through a configuration file. By selecting the name of the DUT environment, it automatically associates the corresponding IP address and port, which are then displayed on the device's interface. Alternatively, you can manually configure the name, IP address, and port of the DUT environment. Data from this module is passed as parameters to the test startup module.

[0122] Background image upload module: Selects a suitable background image as the baseline image (first image) for generating other test images based on the actual application scenario. This image is passed as a parameter to the test image data generation module.

[0123] The test image data generation module uses a baseline image uploaded via the background image upload module and a pre-set face-swapping image library. Based on this image, it performs face replacement, color balance adjustment, and blur / sharpening. After generation, the generated images are stored with names prefixed with names and numbers.

[0124] Test Startup Module: This requires selecting the folder containing the test image data source. This can be an image data source generated by the device or a crawled web image. Simultaneously, it verifies whether an address exists in the "Address Module of the Algorithm Under Test." If both the test address and the data source exist, the program loops through the image data source to test the algorithm's accuracy.

[0125] Log module: Records operation logs of all the above modules, and receives the return values ​​of the algorithm under test to generate test results, and records the result set.

[0126] The face recognition accuracy testing method of this application embodiment realizes that during the face recognition algorithm testing process, the device automatically generates a large number of different face images based on the scene, while adjusting the image clarity and facial feature changes. Through the input parameters, the testing device automatically constructs test data of complex scenes, and finally automatically calls the recognition algorithm to perform face recognition accuracy testing, effectively improving the test coverage and making the test results more accurate.

[0127] Figure 2 This is a schematic diagram of the structure of a face recognition accuracy testing device according to an embodiment of this application. The device includes:

[0128] The first acquisition module 201 is used to acquire the first image;

[0129] The generation module 202 is used to generate multiple second images based on the scene corresponding to the first image, according to the first image;

[0130] The second acquisition module 203 is used to call the face recognition algorithm under test to perform recognition tests on the first image and the plurality of second images, and to obtain the face recognition accuracy.

[0131] The face recognition accuracy testing device of this application embodiment firstly acquires a first image using a first acquisition module 201. Secondly, a generation module 202 generates multiple second images based on the scene corresponding to the first image, thus eliminating the need for data collection in a real-world scenario, saving testing costs and improving testing efficiency. Finally, a second acquisition module 203 calls the face recognition algorithm under test to perform recognition tests on the first image and the multiple second images to obtain the face recognition accuracy. This overcomes the limitations of face recognition accuracy testing and improves the coverage depth and accuracy of the test.

[0132] The face recognition accuracy testing device in this application embodiment also includes:

[0133] The third acquisition module is used to acquire the first parameter input by the user on the graphical user interface;

[0134] The generation module 202 is specifically used for:

[0135] Based on the first parameter, the first image is adjusted to generate the plurality of second images;

[0136] The first parameter includes at least one of the following:

[0137] Should facial features be adjusted?

[0138] Gaussian blur radius;

[0139] Sharpening intensity;

[0140] Face replacement library identifier.

[0141] In the face recognition accuracy testing device of this application embodiment, the generation module 202, when adjusting the first image, specifically performs at least one of the following:

[0142] If facial features are selected to be adjusted, at least some facial features of the face in the first image are randomly adjusted.

[0143] The first image is blurred according to the Gaussian blur radius;

[0144] Based on the sharpening intensity, the first image is subjected to image sharpening processing;

[0145] If facial features are not adjusted, the first image is replaced and the image in the face replacement library corresponding to the face replacement library identifier is merged with the background.

[0146] In the face recognition accuracy testing device of this application embodiment, when the generation module 202 performs face replacement and background fusion between the first image and the image in the face replacement library corresponding to the face replacement library identifier, it is specifically used for:

[0147] Extract the facial marker matrix of the face in the first image and the facial marker matrix of the face in the face replacement library;

[0148] Based on the facial marker matrix of the face extracted from the first image and the facial marker matrix of the face in the face replacement library, the face in the face replacement library is overlaid on the face in the first image to obtain multiple third images;

[0149] The RGB values ​​of the color channels of each pixel position of the face in the first image and the RGB values ​​of the color channels of each pixel position of the face in the plurality of third images are extracted respectively.

[0150] The RGB values ​​of each pixel position of the face in the plurality of third images are adjusted to the RGB values ​​of each pixel position of the face in the first image.

[0151] In the face recognition accuracy testing device of this application embodiment, the second acquisition module 203 includes:

[0152] The first acquisition submodule is used to call the face recognition algorithm under test to recognize the first image and the plurality of second images respectively, and obtain the recognition results;

[0153] The determination submodule is used to determine the face recognition accuracy as the ratio of the number of correctly recognized images to the total number of recognized images in the recognition results.

[0154] The face recognition accuracy testing device in this application embodiment also includes:

[0155] The second acquisition submodule is used to acquire the address of the face recognition algorithm under test based on the second parameter input by the user on the graphical user interface;

[0156] The third acquisition submodule is used to acquire the face recognition algorithm under test based on the address of the face recognition algorithm under test;

[0157] The second parameter includes at least one of the following:

[0158] The name of the environment in which the face recognition algorithm under test is located;

[0159] IP address;

[0160] Port number.

[0161] The second acquisition submodule of the face recognition accuracy testing device in this application embodiment is specifically used for:

[0162] If the second parameter includes the name of the environment of the face recognition algorithm being tested, the IP address and port number corresponding to the environment name of the face recognition algorithm being tested are obtained according to the pre-configured correspondence.

[0163] like Figure 3 The diagram shown is a structural schematic of a face recognition accuracy testing device according to an embodiment of this application. It includes a processor 300, a memory 320, and a program stored in the memory 320 and executable on the processor 300. When the program is executed by the processor 300, it implements the various processes of the face recognition accuracy testing method embodiment described above and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0164] The transceiver 310 is used to receive and send data under the control of the processor 300. Figure 3 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits together, represented by one or more processors (processor 300) and memory (memory 320). The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 310 can be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. For different devices, processor 300 is responsible for managing the bus architecture and general processing, while memory 320 can store data used by processor 300 during operation.

[0165] This application also provides a readable storage medium storing a program. When executed by a processor, this program implements various processes of the face recognition accuracy testing method embodiment and achieves the same technical effect. To avoid repetition, it will not be described again here. The readable storage medium may be, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0166] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0167] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principles described in this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for testing the accuracy of face recognition, characterized in that, include: Get the first image; Based on the first image, generate multiple second images based on the scene corresponding to the first image; The face recognition algorithm under test is invoked to perform recognition tests on the first image and the plurality of second images to obtain the face recognition accuracy; The method further includes: Obtain the first parameter input by the user on the graphical user interface; wherein the graphical user interface is a graphical user interface implemented based on the Python pyqt5 library; Based on the first image, generate multiple second images based on the scene corresponding to the first image, including: Based on the first parameter, the first image is adjusted to generate the plurality of second images; The first parameter includes at least one of the following: Should facial features be adjusted? Gaussian blur radius; Sharpening intensity; Face replacement library identifier; The method further includes: The address of the face recognition algorithm under test is obtained based on the second parameter input by the user on the graphical user interface. Based on the address of the face recognition algorithm under test, obtain the face recognition algorithm under test; The second parameter includes at least one of the following: The name of the environment in which the face recognition algorithm under test is located; IP address; Port number; The step of obtaining the address of the tested face recognition algorithm based on the second parameter input by the user on the graphical user interface includes: If the second parameter includes the name of the environment of the face recognition algorithm under test, the IP address and port number corresponding to the environment name of the face recognition algorithm under test are obtained according to the pre-configured correspondence.

2. The method according to claim 1, characterized in that, Adjustments to the first image include at least one of the following: If facial features are selected to be adjusted, at least some facial features of the face in the first image are randomly adjusted. The first image is blurred according to the Gaussian blur radius; Based on the sharpening intensity, the first image is subjected to image sharpening processing; If facial features are not adjusted, the first image is replaced and the image in the face replacement library corresponding to the face replacement library identifier is merged with the background.

3. The method according to claim 2, characterized in that, The process of replacing the first image with the image in the face replacement library corresponding to the face replacement library identifier and then merging the image with the background includes: Extract the facial marker matrix of the face in the first image and the facial marker matrix of the face in the face replacement library; Based on the facial marker matrix of the face extracted from the first image and the facial marker matrix of the face in the face replacement library, the face in the face replacement library is overlaid on the face in the first image to obtain multiple third images; The RGB values ​​of the color channels of each pixel position of the face in the first image and the RGB values ​​of the color channels of each pixel position of the face in the plurality of third images are extracted respectively. The RGB values ​​of each pixel position of the face in the plurality of third images are adjusted to the RGB values ​​of each pixel position of the face in the first image.

4. The method according to claim 1, characterized in that, The face recognition algorithm under test is invoked to perform recognition tests on the first image and the plurality of second images to obtain the face recognition accuracy, including: The face recognition algorithm under test is invoked to recognize the first image and the plurality of second images respectively, and the recognition results are obtained; The face recognition accuracy is defined as the ratio of the number of correctly recognized images to the total number of recognized images in the recognition results.

5. A testing device for face recognition accuracy, characterized in that, include: The first acquisition module is used to acquire the first image; The generation module is used to generate multiple second images based on the scene corresponding to the first image, according to the first image. The second acquisition module is used to call the face recognition algorithm under test to perform recognition tests on the first image and the multiple second images, and to obtain the face recognition accuracy. The third acquisition module is used to acquire the first parameter input by the user on the graphical user interface; wherein the graphical user interface is a graphical user interface implemented based on the Python pyqt5 library; The generation module is specifically used for: Based on the first parameter, the first image is adjusted to generate the plurality of second images; The first parameter includes at least one of the following: Should facial features be adjusted? Gaussian blur radius; Sharpening intensity; Face replacement library identifier; The second acquisition submodule is used to acquire the address of the face recognition algorithm under test based on the second parameter input by the user on the graphical user interface; The third acquisition submodule is used to acquire the face recognition algorithm under test based on the address of the face recognition algorithm under test; The second parameter includes at least one of the following: The name of the environment in which the face recognition algorithm under test is located; IP address; Port number; The second acquisition submodule is specifically used for: If the second parameter includes the name of the environment of the face recognition algorithm under test, the IP address and port number corresponding to the environment name of the face recognition algorithm under test are obtained according to the pre-configured correspondence.

6. A testing device for face recognition accuracy, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements a method for testing the accuracy of face recognition as described in any one of claims 1 to 4.

7. A readable storage medium, characterized in that, The readable storage medium stores a program that, when executed by a processor, implements a method for testing the accuracy of face recognition as described in any one of claims 1 to 4.