Algorithm service and deployment method integrating multiple face algorithms and providing uniform interface
By establishing a connection with the face algorithm API interface in the main service, providing a unified interface to process request data and results, the problem of integration and configuration management of multiple face algorithms in the prior art is solved, and unified management of multiple face algorithms is realized and platform complexity is reduced.
Patent Information
- Application Number
- CN202411727138.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-04
AI Technical Summary
It is difficult for the existing technology to effectively integrate multiple face algorithms and provide unified interfaces, resulting in the platform need to connect multiple algorithm services and adapt to multiple interfaces, which consumes a lot of manpower and time, and configuration management is difficult to be effective in a timely manner.
By deploying a face algorithm, it is encapsulated into an algorithm API interface according to standard interface specifications, and a connection with the algorithm API interface is established in the main service, providing a unified external interface receiving request data and sending processing results, realizing unified integration and management of multiple face algorithms.
It realizes the unified integration of multiple different face algorithms, and only provides one unified interface to the outside world, reducing the user's attention to the specific interface, connection method and configuration of the face algorithm, and reducing platform complexity and server pressure.
Smart Images

Figure CN119557014A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of face recognition, and in particular to an algorithm service and a deployment method that integrates multiple face algorithms and provides a unified interface. Background Art
[0002] General integrated algorithm services integrate a certain algorithm or a certain type of similar algorithms to solve a single problem, and then provide a unified interface to the outside world.
[0003] Face recognition is a method of confirming a person's identity using facial data. In order to be applicable to a variety of scenarios, face recognition has also begun to provide integrated algorithm services, such as DeepFace, a lightweight face recognition framework that integrates multiple cutting-edge deep learning models, such as VGG-Face, FaceNet, etc., with an accuracy that even exceeds human recognition capabilities. Using DeepFace, developers can implement complex facial recognition and attribute analysis through simple function calls, which is applicable to a variety of application scenarios.
[0004] However, there are many types of facial algorithms on the market, and each algorithm requires different server configurations and environments. Some algorithms cannot even run in a unified manner, which means that the platform needs to connect to multiple algorithm services and adapt to multiple types of interfaces in order to use each facial algorithm normally. This method requires a lot of manpower and time, and often fails to perform timely and effective configuration management of each service.
[0005] In summary, the technical issues that need to be solved as soon as possible are to integrate multiple different facial algorithms in a unified manner, provide only one set of interfaces to the outside world, and facilitate the configuration and management of algorithm parameters.
[0006] In order to solve the above problems, people have been seeking an ideal technical solution. Summary of the invention
[0007] The purpose of the present invention is to address the deficiencies of the prior art and thus provide an algorithm service method that integrates multiple face algorithms and provides a unified interface.
[0008] In order to achieve the above purpose, the technical solution adopted by the present invention is: an algorithm service deployment method that integrates multiple face algorithms and provides a unified interface, comprising: Deploy the face algorithm, encapsulate the face algorithm into an algorithm API interface according to the standard interface specification, and add the corresponding interface document to the deployment and installation file of the main service. The interface document at least includes the interface description, request format and response format; The main service is deployed according to the deployment installation file, and the main service establishes a connection with the algorithm API interface; the request data in a unified format sent by the platform caller is received through a unified external interface, and the face algorithm processing results in a unified format are sent to the platform caller, wherein the request data includes the photo to be identified and the algorithm requirements; the algorithm requirements in the request data are matched with the interface descriptions in all interface documents, the target algorithm API interface is determined, the format of the photo to be identified in the request data is converted according to the request format of the target algorithm API interface, the target algorithm API interface is called for processing, and the face algorithm processing results returned by the target algorithm API interface are converted into a unified format according to the response format of the target algorithm API interface.
[0009] Furthermore, deploying a face algorithm and encapsulating the face algorithm into an algorithm API interface according to a standard interface specification includes: Differentiate the types of face algorithms based on their programs and dynamic library files; If it is the first type of face algorithm, the face algorithm is directly integrated and deployed on the main service, and the sub-service is encapsulated into an algorithm API interface according to the standard interface specification; If it is the second type of face algorithm, a sub-service is established separately, and the face algorithm is deployed on the sub-service, and the sub-service is encapsulated into an algorithm API interface according to the standard interface specification.
[0010] Furthermore, if it is a first type of face algorithm, after encapsulating the sub-service into an algorithm API interface according to the standard interface specification, a default connection mode is selected as the interface connection mode and added to the configuration file; If it is the second type of face algorithm, after the sub-service is encapsulated into an algorithm API interface according to the standard interface specification, the sub-service connection method and the sub-service remote address are added to the configuration file.
[0011] Furthermore, if the main service is deployed first and the face algorithm is deployed later, after the face algorithm is deployed, the default connection method is selected as the interface connection method and added to the configuration file, or the sub-service connection method and the sub-service remote address are added to the configuration file, and then the main service is restarted to connect to the face algorithm; If the face algorithm is deployed first and the main service is deployed later, when deploying the main service, directly add the interface connection method or sub-service connection method and sub-service remote address to the configuration information of the main service.
[0012] The second aspect provides an algorithm service that integrates multiple face algorithms and provides a unified interface, including a main service and multiple face algorithm modules; each face algorithm module provides an algorithm API interface; The main service includes a unified external interface and a unified processing module; The unified external interface is used to receive request data in a unified format sent by the platform caller and send face algorithm processing results in a unified format to the platform caller, wherein the request data includes the photo to be identified and the algorithm requirements; The unified processing module is used to match the algorithm requirements in the request data with the interface descriptions in all interface documents, determine the target algorithm API interface, convert the format of the photo to be identified in the request data according to the request format of the target algorithm API interface, call the target algorithm API interface for processing, and convert the face algorithm processing results returned by the target algorithm API interface into a unified format according to the response format of the target algorithm API interface.
[0013] Compared with the prior art, the present invention has outstanding substantial features and significant progress. Specifically, the present invention is different from other face algorithms in that the face algorithm is moved back and a unified interface is provided to the outside, so that the user no longer needs to pay attention to the specific interface, connection method, configuration and other operations of the face algorithm; further, the type of face algorithm is distinguished according to the program, dynamic library file and operating environment of the face algorithm. For face algorithms that have special requirements for the operating environment or can provide separate services, a sub-service is established separately, and the face algorithm is deployed on the sub-service, and the face algorithm is started by calling the sub-service; for face algorithms that have no special requirements for the operating environment or cannot provide separate services, they are directly integrated into the main service and started with the main service; independently processing the algorithm service can reduce the complexity of the platform and reduce the pressure on a single server; and multiple deployment methods are suitable not only for face algorithms that have no special requirements for the environment, but also for face algorithms that have special requirements for the environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is a flowchart for implementing the first embodiment of the present invention.
[0015] Figure 2 It is a flowchart for implementing the second embodiment of the present invention.
[0016] Figure 3 It is a schematic block diagram for implementing embodiment 3 of the present invention.
[0017] Figure 4 It is a flow chart for implementing embodiment 3 of the present invention. DETAILED DESCRIPTION
[0018] The technical solution of the present invention is further described in detail below through specific implementation methods.
[0019] Example 1 This embodiment provides an algorithm service deployment method that integrates multiple face algorithms and provides a unified interface. Figure 1 Said, including: Deploy the face algorithm, encapsulate the face algorithm into an algorithm API interface according to the standard interface specification, and add the corresponding interface document to the deployment and installation file of the main service. The interface document at least includes an interface description, request method, request parameters and response format.
[0020] The interface description includes the interface name, interface address and interface purpose, wherein the interface purpose is used to describe the function and applicable scenario of the interface in detail; the request method generally includes HTTP method, grcp method and cgo method. Different methods correspond to different operations.
[0021] The request parameters include request header, path parameters, query parameters and request body; each parameter type should describe in detail its name, type, whether it is required and description.
[0022] The response format describes in detail the data structure returned when the API call succeeds or fails, usually including the status code, response body, etc.
[0023] In some embodiments, the interface document also includes sample code, error code and its description, and the sample code can help developers better understand how to use the API. Examples in different languages can be provided, such as JavaScript, Python, etc. The error code and its description section lists the error codes that the API may return and their corresponding descriptions, helping developers quickly locate and solve problems.
[0024] Deploy the main service according to the deployment installation file and establish a connection with the algorithm API interface.
[0025] At this time, the main service receives the request data in a unified format sent by the platform caller through a unified external interface and sends the face algorithm processing results in a unified format to the platform caller. The request data includes the photo to be recognized and the algorithm requirements. In specific implementation, the algorithm requirements include either the target algorithm type or the recognition result type.
[0026] It is understandable that since different face recognition algorithms have different requirements for photo clarity, the photo clarity adapted by the interface can also be set in the interface description of the interface document; and the clarity of the photo to be identified can be added to the algorithm requirements of the requested data so that an applicable face recognition algorithm can be selected subsequently based on the clarity.
[0027] Furthermore, the main service matches the algorithm requirements in the request data with the interface descriptions in all interface documents, determines the target algorithm API interface, converts the format of the photo to be identified in the request data according to the request format of the target algorithm API interface, calls the target algorithm API interface for processing, and converts the face algorithm processing results returned by the target algorithm API interface into a unified format according to the response format of the target algorithm API interface.
[0028] It can be understood that according to the provided face algorithm interface document, basic adaptation functions are performed in the main service to organize the request data into the format required by the face algorithm, and to organize the processing results of the face algorithm into a unified format and return them through a unified interface, which can ensure faster docking of multiple algorithms without affecting the use of other algorithms.
[0029] After the main service is deployed, start the main service, receive the request data sent by the platform caller, send the request data to the target face algorithm for processing through the target algorithm API interface, and receive the processing results of the target face algorithm through the target algorithm call interface and return them to the platform caller.
[0030] The above solution is different from other facial algorithms. It moves the facial algorithm to the back and realizes the unified integration of multiple different facial algorithms, but only provides a unified interface to the outside world, so that users no longer need to pay attention to the specific interface, connection method, configuration and other operations of the facial algorithm. The platform caller can access the corresponding facial algorithm by calling the unified external interface to realize the photo processing function.
[0031] In the specific implementation, before converting the format of the photos to be identified in the request data according to the request format of the target algorithm API interface, the photos to be identified can also be preprocessed first. The preprocessing includes general preprocessing operations such as grayscale, geometric transformation, image enhancement, etc. The purpose is to provide unified and normalized input for the model.
[0032] Furthermore, the main service is also provided with unified general parameters, such as comparison scores and return quantities, to uniformly configure and manage all face algorithms; at the same time, the main service is provided with basic algorithm parameters, and a parameter setting interface is provided to the platform caller to set parameters for a specified face algorithm separately. Through the above settings, face algorithms in different environments can be uniformly configured.
[0033] Furthermore, after the main service is started, it determines whether the face algorithm is available by determining whether the face algorithm is activated, so that when the face algorithm is not available, the corresponding face algorithm is not called. For some face algorithms, it can only be determined whether the face algorithm is available when it is called.
[0034] In addition, the allocation module also specifies a default face recognition algorithm. When there is no algorithm requirement in the request data, the unified processing module uses the default algorithm API interface as the target face algorithm and allocates the target algorithm API interface to the preprocessed request parameters.
[0035] Example 2 Furthermore, in actual use, some facial algorithms have special requirements for the server environment, such as the use of physical CPU, storage gateway and other information cannot be changed; for this reason, this embodiment classifies the facial algorithms when deploying them, and executes different deployment plans for different types of facial algorithms.
[0036] Specifically, Figure 2 As shown, the types of face algorithms are distinguished according to the face algorithm program, dynamic library file and operating environment; If it is the first type of face algorithm, the face algorithm is directly integrated and deployed on the main service, and the sub-service is encapsulated into an algorithm API interface according to the standard interface specification; If it is the second type of face algorithm, a sub-service is established separately, and the face algorithm is deployed on the sub-service, and the sub-service is encapsulated into an algorithm API interface according to the standard interface specification.
[0037] Preferably, the first type of face algorithm refers to one that has no special requirements for the operating environment or operating system, or provides dependent files such as dynamic libraries instead of separate services, or the program can be integrated into the service.
[0038] Specifically, special requirements for the operating environment include that information such as the use of physical CPU and storage gateway cannot be changed.
[0039] It can be understood that the second type of face algorithm is the opposite of the first type of face algorithm. It has special requirements for the operating environment or operating system, or provides a separate service, or the program cannot be integrated into the service, or it can be integrated into the service but is not started in the same thread as other algorithms.
[0040] Existing face algorithms are mainly divided into the following categories: (1) Algorithms that can be integrated into services, such as Megvii and Yuemian, can be directly integrated into the main service to enable unified usage functions; (2) It can be integrated into the service, but it cannot be started in the same thread as other algorithms. It needs to be pulled out as a sub-service according to the interface format of the main service calling algorithm, started separately, and called remotely; (3) Algorithms that have special requirements for the system, such as the Go version of Yizhi algorithm, have requirements for CPU hardware and are also called as sub-services separately; (4) What the manufacturer directly provides is an algorithm service and an interface to the outside world, such as Megvii tablets, SenseTime's face recognition platform, and Yizhi algorithm. These algorithm services do not need to be started or stopped, and can be directly configured and called using the main service.
[0041] Furthermore, for the first type of face algorithm, after encapsulating the sub-service into an algorithm API interface according to the standard interface specification, the default connection method is selected as the interface connection method and added to the configuration file; preferably, the default connection method is to directly call through cgo.
[0042] For the second type of face algorithm, after the sub-service is encapsulated into an algorithm API interface according to the standard interface specification, the sub-service connection method and the sub-service remote address are added to the configuration file.
[0043] Specifically, the subservice connection method is called through HTTP method, grcp method, etc.
[0044] The following is an example of configuring the remote address of a subservice: Long-range algorithm A: url: 127.0.0.1 token: xxxx.
[0045] It is understandable that different face algorithms require different configurations, so after connecting to a new face algorithm, the required configuration needs to be described in the deployment and installation document.
[0046] It should be noted that there is no special regulation for the deployment order of the main service and the face algorithm. You can deploy the main service first and then the face algorithm, or you can deploy the face algorithm first and then the main service.
[0047] Specifically, when the face algorithm is deployed first and then the main service is deployed, when the main service is deployed, the interface connection method or the sub-service connection method and the sub-service remote address are directly added to the configuration information of the main service without restarting the main service.
[0048] When deploying the main service first and then the face algorithm, after deploying the face algorithm, select the default connection method as the interface connection method and add it to the configuration file, or add the sub-service connection method and the sub-service remote address in the configuration file, and then restart the main service to connect to the face algorithm.
[0049] It can be understood that after the main service is deployed, if a face algorithm is added, the only way is to use the second method, that is, to select the default connection method as the interface connection method and add it to the configuration file, or to add the sub-service connection method and the sub-service remote address to the configuration file, and then restart the main service to connect to the face algorithm.
[0050] When in use, the sub-service is called through the main service, so that only one service is displayed to the outside world, but there are actually multiple algorithms.
[0051] It can be understood that, regardless of whether it is the first type of face algorithm or the second type of face algorithm, all configuration information can be placed in one place for configuration, so that deployment and implementation personnel can find and understand the corresponding configuration information more quickly.
[0052] It should be noted that since the sub-service is a remote connection, it is necessary to update the connection status of the sub-service through heartbeat access, so that after detecting that the sub-service stops abnormally and restarts, the login interface is called to access the sub-service to ensure that the remote algorithm service is normal and can be used without any sense of connection.
[0053] Furthermore, after the main service is started, whether the sub-service is available is determined by determining whether the corresponding port is open on the firewall; or whether the face algorithm is available is determined by determining whether the face algorithm is activated.
[0054] Specifically, for face algorithms that need to be activated before use, the main service activates the face algorithm through the activation interface; For face algorithms that do not have an activation interface, the algorithm will be directly returned as unsupported result or the default verification interface will be directly called to verify whether it is a normal interface, as the algorithm activation return status.
[0055] It can be seen that since there are many types of face algorithms, and each algorithm has different requirements for the operating system and control parameters, and even some algorithms cannot be run uniformly, this embodiment processes various algorithms through a unified management service, and only exposes and returns unified interface data to the outside, which is convenient for platform docking and use. Compared with the access and management of algorithms integrated into the platform end, the algorithm service proposed in this embodiment is processed independently, which can reduce the complexity of the platform and reduce the pressure on a single server.
[0056] Example 3 This embodiment uses an example in which a business platform needs to use four face algorithms to perform face recognition in a certain scenario to illustrate the technical solution of Embodiment 2.
[0057] Specifically, the four facial algorithms require Linux facial algorithm (Linux environment), Windows facial algorithm (Windows environment), docker facial algorithm (docker environment under Linux) and third-party tablet facial algorithm (third-party tablet). Since the activation of facial algorithms is generally bound to server hardware information, modifying server CPU, network card and other information will cause the facial algorithm to become invalid. Therefore, except for the docker facial algorithm that can be used without activation, the other facial algorithms do not use docker deployment services.
[0058] Based on the above case requirements, we analyze the face service. First, we analyze the four face algorithms in detail: The Linux face algorithm needs to be activated before it can be used, and provides dependent files such as dynamic libraries instead of separate services, so it needs to be integrated into the main service and started directly by the main service. It does not need to configure a remote connection address, and directly calls the corresponding API interface of the Linux face algorithm through cgo to use the Linux face algorithm. And the main service can be directly deployed on the Linux server to activate and use the algorithm.
[0059] The Windows face algorithm needs to be activated before it can be used, and provides dependent files such as dynamic libraries. Similar to the Linux face algorithm, it is not a separate service and needs to be integrated into the algorithm service, which directly starts the algorithm for use.
[0060] It should be noted that if the Windows face algorithm needs to be used at the same time as the Linux face algorithm, the remote connection address needs to be configured to directly call the Linux face algorithm service, but the caller's interface needs to be modified. Here, the caller's interface is no longer the interface provided by the Linux face algorithm, but the interface of the main service. Conversely, the Linux face algorithm service calls the Windows face algorithm service in the same way, and the calling interface format needs to be modified.
[0061] The docker face algorithm does not need to be activated and can be used directly. It is a runnable service packaged in docker. It provides RPCX and GRPC calling interfaces as remote algorithm modules. In the main service, configure the remote connection address of the corresponding algorithm, and call the corresponding interface of the docker face algorithm through the provided calling method; in addition, add a remote calling interface method to the place where the algorithm interface is originally called directly, and process the parameter format into the format required by the corresponding interface.
[0062] It should be noted that it is not necessary to deploy the Docker face algorithm and the main service on the same server.
[0063] The third-party tablet face algorithm does not need to be activated. It provides a face tablet device and can use http to call the interface. The specific configuration and calling method are similar to the docker face algorithm, except that the connection method is changed to http format.
[0064] Among them, for the docker face algorithm and the third-party tablet face algorithm, the main service updates the connection through heartbeat access, so that after the remote algorithm service stops abnormally and restarts, the login interface is called regularly to access the remote service to ensure that the remote algorithm service is normal and can be used without feeling.
[0065] It should be noted that some algorithm interfaces and parameters cannot be guaranteed to be completely consistent, so adaptation is required.
[0066] For example, for some face algorithms that do not support functions, such as the Docker face algorithm does not support the comparison function, and the third-party tablet face algorithm does not support the activation function interface, when the algorithm service calls a non-existent interface, it directly returns "algorithm not supported", or the third-party tablet directly calls the default verification interface to verify whether the interface is used normally, as the algorithm activation return status.
[0067] Example 4 The second aspect is to provide an algorithm service that integrates multiple face algorithms and provides a unified interface, such as Figure 3 As shown, it includes the main service and multiple face algorithm modules; each face algorithm module provides an algorithm API interface; The main service includes a unified external interface and a unified processing module; The unified external interface is used to receive request data in a unified format sent by the platform caller and send face algorithm processing results in a unified format to the platform caller, wherein the request data includes the photo to be identified and the algorithm requirements; The unified processing module is used to match the algorithm requirements in the request data with the interface descriptions in all interface documents, determine the target algorithm API interface, convert the format of the photo to be identified in the request data according to the request format of the target algorithm API interface, call the target algorithm API interface for processing, and convert the face algorithm processing results returned by the target algorithm API interface into a unified format according to the response format of the target algorithm API interface.
[0068] Furthermore, the algorithm service also includes a feature pool module, which is mainly required for the feature comparison function. After extracting the features, the user's unique identifier + features are stored in the feature pool; feature comparison is to upload a photo, extract the features of the photo, and compare it with the data in the feature pool one by one to find the ones with the highest similarity, and return the similarity score and the user's unique identifier such as student ID and ID.
[0069] Furthermore, the algorithm service also includes sub-services, each of which is deployed with a face recognition algorithm; The main service is also provided with a sub-service connection mode and a sub-service remote address. When the sub-service is called for processing, the target algorithm API interface of the sub-service is called according to the sub-service connection mode and the sub-service remote address.
[0070] Furthermore, for the sub-service, the main service determines the connection status of the sub-service through heartbeat access, and after detecting that the sub-service is restarted, calls the login interface to access the sub-service.
[0071] Furthermore, unified general parameters are set in the main service to uniformly configure and manage all face algorithms; at the same time, basic algorithm parameters are set in the main service, and a parameter setting interface is provided to the platform caller to set parameters for a specified face algorithm separately.
[0072] The usage process of this embodiment is as follows: Figure 4 As shown, including: Receive request data through a unified external interface; Perform preliminary conversion on the photo to be identified through preprocessing; Get unified system parameters; Arrange the request parameters and convert them into the parameter format required by the target algorithm API interface; Call the target algorithm API interface to pass the request parameters to the corresponding face algorithm for processing; Arrange the return values of the target algorithm API interface and unify the return value format; Return the result data in a unified format to the caller.
[0073] This embodiment uniformly processes the face algorithm in the face algorithm service module, which reduces the user's operation on the face algorithm, reduces the coupling between services, and connects more algorithms, which is almost imperceptible to the user. The interface and return information of the face algorithm are uniformly processed to provide template samples for the subsequent connection of more algorithms, and also reduces the situation where different algorithms return different information and need to be processed externally.
[0074] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or some technical features can be replaced by equivalents without departing from the spirit of the technical solution of the present invention, which should be included in the scope of the technical solution for protection of the present invention.
Claims
1. An algorithm service deployment method that integrates multiple face algorithms and provides a unified interface, characterized in that: include: Deploy the face algorithm, encapsulate the face algorithm into an algorithm API interface according to the standard interface specification, and add the corresponding interface document to the deployment and installation file of the main service. The interface document at least includes the interface description, request parameters and response format; The main service is deployed according to the deployment installation file, and the main service establishes a connection with the algorithm API interface; the request data in a unified format sent by the platform caller is received through a unified external interface, and the face algorithm processing results in a unified format are sent to the platform caller, wherein the request data includes the photo to be identified and the algorithm requirements; the algorithm requirements in the request data are matched with the interface descriptions in all interface documents, the target algorithm API interface is determined, the format of the photo to be identified in the request data is converted according to the request format of the target algorithm API interface, the target algorithm API interface is called for processing, and the face algorithm processing results returned by the target algorithm API interface are converted into a unified format according to the response format of the target algorithm API interface.
2. According to claim 1, the algorithm service deployment method integrating multiple face algorithms and providing a unified interface is characterized in that: Deploy the face algorithm and encapsulate the face algorithm into an algorithm API interface according to the standard interface specification, including: Differentiate the types of face algorithms based on their programs, dynamic library files, and operating environments; If it is the first type of face algorithm, the face algorithm is directly integrated and deployed on the main service, and the sub-service is encapsulated into an algorithm API interface according to the standard interface specification; If it is the second type of face algorithm, a sub-service is established separately, and the face algorithm is deployed on the sub-service, and the sub-service is encapsulated into an algorithm API interface according to the standard interface specification.
3. The algorithm service deployment method according to claim 2 that integrates multiple face algorithms and provides a unified interface, characterized in that: If it is the first type of face algorithm, after encapsulating the sub-service into an algorithm API interface according to the standard interface specification, select the default connection mode as the interface connection mode and add it to the configuration file; If it is the second type of face algorithm, after the sub-service is encapsulated into an algorithm API interface according to the standard interface specification, the sub-service connection method and the sub-service remote address are added to the configuration file.
4. The algorithm service deployment method according to claim 3 that integrates multiple face algorithms and provides a unified interface, characterized in that: If you deploy the main service first and then the face algorithm, after deploying the face algorithm, select the default connection method as the interface connection method and add it to the configuration file, or add the subservice connection method and subservice remote address in the configuration file, and then restart the main service to connect to the face algorithm. If you deploy the face algorithm first and then the main service, when deploying the main service, directly add the interface connection method or sub-service connection method and sub-service remote address to the configuration information of the main service.
5. The algorithm service deployment method that integrates multiple face algorithms and provides a unified interface according to any one of claims 1 to 4, characterized in that: When there is no algorithm requirement in the request data, the unified processing module uses the default algorithm API interface as the target face algorithm, which is the preprocessed request parameter target algorithm API interface.
6. The algorithm service deployment method according to claim 5 that integrates multiple face algorithms and provides a unified interface, characterized in that: After the main service is started, the availability of the sub-service is determined by judging whether the corresponding port is open in the firewall, or the availability of the face algorithm is determined by judging whether the face algorithm is activated.
7. An algorithm service that integrates multiple face algorithms and provides a unified interface, characterized by: Includes the main service and multiple face algorithm modules; each face algorithm module provides an algorithm API interface; The main service includes a unified external interface and a unified processing module; The unified external interface is used to receive request data in a unified format sent by the platform caller and send face algorithm processing results in a unified format to the platform caller, wherein the request data includes the photo to be identified and the algorithm requirements; The unified processing module is used to match the algorithm requirements in the request data with the interface descriptions in all interface documents, determine the target algorithm API interface, convert the format of the photo to be identified in the request data according to the request format of the target algorithm API interface, call the target algorithm API interface for processing, and convert the face algorithm processing results returned by the target algorithm API interface into a unified format according to the response format of the target algorithm API interface.
8. The algorithm service integrating multiple face algorithms and providing a unified interface according to claim 6, characterized in that: The algorithm service also includes sub-services, each of which is deployed with a face recognition algorithm; The main service is also provided with a sub-service connection mode and a sub-service remote address. When the sub-service is called for processing, the target algorithm API interface of the sub-service is called according to the sub-service connection mode and the sub-service remote address.
9. The algorithm service integrating multiple face algorithms and providing a unified interface according to claim 7, characterized in that: For the sub-service, the main service determines the connection status of the sub-service through heartbeat access, and after detecting that the sub-service is restarted, calls the logged-in interface to access the sub-service.
10. The algorithm service integrating multiple face algorithms and providing a unified interface according to claim 7, 8 or 9, characterized in that: The main service also has unified general parameters to uniformly configure and manage all face algorithms; at the same time, the main service has basic algorithm parameters and provides a parameter setting interface to the platform caller to set parameters for a specified face algorithm separately.
Citation Information
Cited By
Multi-protocol intelligent recognition method and system based on multi-manufacturer face recognition algorithm process scheduling
CN121541996A