A method, device, equipment and system for constructing a person image recognition system
By building a human image recognition system and using basic frameworks and plug-ins to generate business codes, the problems of low development efficiency and high cost in the existing technology are solved, and efficient development and maintenance are achieved.
Patent Information
- Application Number
- CN201910666702.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-23
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2039-07-30
AI Technical Summary
When developing online systems with the same or similar business processes, existing online systems have low efficiency, high costs, and problems of repeated development and maintenance.
Provides a method for building a human image recognition system. It generates business code by acquiring the basic framework and responding to plug-in loading instructions, and integrates the basic framework to build the system. It uses a group of image acquisition plug-ins and neural network model plug-ins to adapt to different business scenarios. need.
It improves development efficiency, reduces repeated development workload, facilitates maintenance, and meets the development needs of different business scenarios.
Smart Images

Figure CN110472516B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet communication technology, and in particular to a method, device, equipment and system for constructing a person image recognition system. Background Art
[0002] Artificial Intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. With the research and progress of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields.
[0003] Existing online systems are often based on a certain type of application scenario, and different business codes often need to be written for each different type of application scenario. Even for each segmented business scenario under a certain type of application scenario, a code library is established to build the online system according to the different needs of each segmented business scenario. For example, if the business processes in business scenario 1 and business scenario 2 are the same or similar, the repeated development of the same type of modules in the business scenario will bring about high development and maintenance costs. Therefore, for the development of online systems with the same or similar business processes, a more effective solution needs to be provided to reduce code development costs and maintenance expenses. Summary of the invention
[0004] In order to solve the problems of low efficiency and high cost in the development of online systems with the same or similar business processes in the existing technology, the present invention provides a method, device, equipment and system for constructing a person image recognition system:
[0005] In one aspect, the present invention provides a method for constructing a person image recognition system, the method comprising:
[0006] Get the basic framework for building a person image recognition system;
[0007] In response to a received plug-in loading instruction, determining a plug-in to be loaded, wherein the plug-in loading instruction carries configuration parameters pointing to at least one service plug-in;
[0008] Based on the configuration script and the configuration parameters of the plug-in to be loaded, generating a business code for building the person image recognition system;
[0009] Integrate the business code with the basic framework to build the character image recognition system;
[0010] The business plug-in includes at least one selected from the group consisting of an image acquisition plug-in and a neural network model plug-in, and the configuration parameters of the neural network model plug-in point to at least one neural network model for character image recognition.
[0011] On the other hand, a device for constructing a person image recognition system is provided, the device comprising:
[0012] Basic framework acquisition module: used to obtain the basic framework for building a person image recognition system;
[0013] A plug-in confirmation module to be loaded: used to determine a plug-in to be loaded in response to a received plug-in loading instruction, wherein the plug-in loading instruction carries configuration parameters pointing to at least one business plug-in;
[0014] A business code generation module: used to generate business codes for constructing the person image recognition system based on a configuration script and configuration parameters of the plug-in to be loaded;
[0015] Fusion module: used to fuse the business code with the basic framework to build the character image recognition system;
[0016] The business plug-in includes at least one selected from the group consisting of an image acquisition plug-in and a neural network model plug-in, and the configuration parameters of the neural network model plug-in point to at least one neural network model for character image recognition.
[0017] On the other hand, an electronic device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method for constructing a person image recognition system as described above.
[0018] On the other hand, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the method for constructing a character image recognition system as described above.
[0019] The present invention provides a method, device, equipment and system for constructing a person image recognition system, which has the following technical effects:
[0020] The present invention is applied to the development of a person image recognition system. It can greatly improve the development efficiency of developers and meet different development requirements of different business scenarios. In the form of a plug-in, it can reduce the workload of repeated development and facilitate maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 is a schematic diagram of an application environment provided by an embodiment of the present invention;
[0023] Figure 2 It is a flowchart of a method for constructing a person image recognition system provided by an embodiment of the present invention;
[0024] Figure 3 It is a business process diagram of a corresponding system applied to a small smart store business scenario provided by an embodiment of the present invention;
[0025] Figure 4 It is a business process diagram of a corresponding system applied to a large-scale smart shopping mall business scenario provided by an embodiment of the present invention;
[0026] Figure 5 It is a flow chart of updating and using a plug-in for a person image recognition system provided by an embodiment of the present invention;
[0027] Figure 6 This is a business process diagram of a person image recognition system provided by an embodiment of the present invention;
[0028] Figure 7 It is also a business process diagram of the person image recognition system provided by an embodiment of the present invention;
[0029] Fig. 9 It is a block diagram of a device for constructing a person image recognition system provided by an embodiment of the present invention;
[0030] Fig.10 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0031] 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 only 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 making creative work are within the scope of protection of the present invention.
[0032] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] See also Figure 1 , Figure 1 01 is a schematic diagram of an application environment provided by an embodiment of the present invention, which may include a client 01 and a server 02, wherein the client and the server are connected via a network. A user sends a person image to the server via the client, and the server recognizes the received person image. It should be noted that Figure 1 Just an example.
[0034] Specifically, the client 01 may include physical devices such as smart phones, desktop computers, tablet computers, laptops, digital assistants, smart wearable devices, etc., and may also include software running in physical devices, such as web pages provided to users by some service providers, or applications provided to users by these service providers.
[0035] Specifically, in the embodiments of this specification, the server 02 may include an independently operated server, or a distributed server, or a server cluster composed of multiple servers. The server 02 may include a network communication unit, a processor, a memory, and the like.
[0036] It should be noted that for character images that are associated with user information, when the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0037] The following describes a specific embodiment of a method for constructing a person image recognition system of the present invention. Figure 2 It is a flowchart of a method for constructing a person image recognition system provided by an embodiment of the present invention. This specification provides method operation steps as described in the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or server product is executed, it can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment) according to the method shown in the embodiment or the drawings. Specifically, Figure 2 As shown, the method may include:
[0038] S201: Acquire a basic framework for building a person image recognition system;
[0039] In the embodiments of the present invention, the person image recognition system applied to a certain type of application scenario often has the same or similar business processes. For example, when applied to a smart store application scenario where person image recognition is required, Figure 3 The functional modules shown are designed for small smart store business scenarios. Figure 4 The functional modules shown are designed for large-scale smart shopping mall business scenarios. Figure 3 , 4 It can be seen that the two business scenarios have the same or similar business processes: video input device (hardware module) -> image acquisition module (used to obtain streams from the video input device) -> algorithm module (used to identify the acquired images) -> storage module -> auxiliary module (such as for processing logs, monitoring, etc.). Among them, compared with the functional modules set up for small store business scenarios, the functional modules set up for large shopping mall business scenarios have more camera types set up in the hardware modules and more dimensions for image recognition in the algorithm modules.
[0040] Considering the same or similar business processes of the person image recognition system applied to a certain type of application scenario, a corresponding basic framework can be set up, which can provide a basic code library, a public class library, a basic service interface, etc. for the person image recognition system built for a specific business scenario. Obtaining the basic framework for building a person image recognition system can reduce the large development costs caused by repeated development to a certain extent. For example, for the business scenarios shown in 3 and 4, it is no longer necessary to develop an image acquisition module from scratch.
[0041] Of course, application scenarios that require character image recognition are not limited to smart stores (stores, shopping malls), but can also be smart retail, smart communities, etc.
[0042] S202: Determine a plug-in to be loaded in response to a received plug-in loading instruction, wherein the plug-in loading instruction carries configuration parameters pointing to at least one service plug-in;
[0043] In an embodiment of the present invention, the business plug-in is a functional module setting corresponding to the business process for implementing the person image recognition system. The business plug-in may include at least one selected from the group consisting of an image acquisition plug-in and a neural network model plug-in. According to the configuration parameters of at least one business plug-in in the plug-in loading instruction, it can be determined whether a certain business plug-in needs to be loaded. The business plug-in that needs to be loaded can be selected in a more fine-grained manner in combination with the specific needs of the business scenario.
[0044] In a specific embodiment, the neural network model plug-in corresponds to an algorithm module, and the configuration parameters of the neural network model plug-in point to at least one neural network model for character image recognition. The neural network model for character image recognition can be a neural network model for face detection, body detection, body tracking, head-body binding, face quality score, posture detection, etc. In actual applications, a smart store can perform character image recognition on users who come to the store based on the constructed character image recognition system. The user's activities in the smart store can be captured by a video input device (such as a camera), and the neural network model plug-in can perform character image recognition on the original images captured by the aforementioned shooting.
[0045] The neural network model corresponding to face detection can determine whether the original image contains a face; if there is a face, the face area can be cropped from the original image, and the position, size and face attribute analysis results of the face area can also be returned. Furthermore, the face attribute analysis results can include gender, expression (neutral, smiling, laughing), age (error estimated to be less than 5 years old), whether wearing glasses (ordinary glasses, sunglasses), whether wearing a hat, whether wearing a mask, etc.
[0046] The neural network model corresponding to human body detection can determine whether the original image contains a human body; if a human body is present, the human body region can be cropped from the original image, and the position, size and human body attribute analysis results of the human body region can also be returned. Furthermore, the human body attribute analysis results may include gender, height, weight, etc.
[0047] The neural network model corresponding to human body tracking can determine the movement trajectory of user A during the monitoring period based on the original images of user A captured by multiple cameras during the monitoring period. For example, user A and five other users are walking in a smart store together, and five cameras located at different locations in the smart store have captured original images of user A and the other five users. Based on the original images from the five cameras, the movement trajectory of user A (located from the six users) during the monitoring period can be determined.
[0048] Through the binding of the head and body to the corresponding neural network model, the original image of only the face (or the original image of only the torso + limbs) can be bound to the corresponding torso + limbs reference image (or face reference image) based on the recognition result of human body detection. For example, when user B walks in a smart store and a camera takes a picture of user B, the original image collected may not point to the face area of user B's face. The body area in the original image can be segmented out and bound to the corresponding face reference image (corresponding to user B) to obtain the recognition result pointing to user B.
[0049] The neural network model corresponding to the face quality score can evaluate the quality score of the original image according to the quality evaluation factors (such as the blur of the image, the occlusion of the target area in the image, etc.), and then the image that reaches the quality score threshold can be used for face detection, human body detection, face clustering (used to group the various face areas in an image set according to identity), face retrieval (for example, based on the face area of the original image, compare with N face images in the existing face library, find the most similar face or faces, and give a similarity ranking), etc. For example, since the cameras are set at different locations in the smart store, the shooting angles of different cameras are also different. User C at position A may be photographed by multiple cameras, and the original images captured by some cameras may be limited by angles, so the scores corresponding to the original images of user C are low. If user C shakes his head at this time, there may be blurry images in the original images of user C captured, and these original images with lower quality scores can be filtered.
[0050] The corresponding neural network model of posture detection can determine whether the facial posture or body posture in the original image meets the preset standard posture, for example, confirm whether a user is photographed facing the corresponding camera.
[0051] In practical applications, the neural network model configured by the neural network model plug-in (corresponding functions, mutual setting order, specific algorithms used, etc.) can be selected according to the needs of the application scenario. For example, a first neural network model used as a segmenter and a second neural network model used as a classifier can be selected. When in use, the original image can be set to be first input into the first neural network model for segmentation to obtain the target image, and then the target image can be input into the second neural network model for classification to obtain the recognition result. Specifically, the first neural network model can perform image segmentation based on MaskRCNN (instance segmentation algorithm). MaskRCNN combines the characteristics of FPN (Feature Pyramid Networks, Feature Pyramid Network Algorithm) / RPN (Region Proposal Network, Region Candidate Network Algorithm) / Classification (Classification Algorithm) / Detection (Detection Algorithm) well, and is suitable for image detection and segmentation. The basic network in the first neural network model can use the residual network ResNet101 to take into account both speed and accuracy. The basic network in the second neural network model can use Inception (a network model structure)-ResNet (residual network)-V2. Of course, the configuration of the neural network model in the neural network model plug-in is not limited to the above, and can be configured taking performance factors into consideration.
[0052] In another specific embodiment, the business plug-in may also include at least one selected from the group consisting of a log processing plug-in and a monitoring plug-in, wherein the log processing plug-in is used to process the log generated by the character image recognition system, and the monitoring plug-in is used to monitor the operating status of the character image recognition system.
[0053] The log processing module corresponding to the log processing plug-in can adopt distributed management, such as the form of a distributed database cluster, such as Figure 8 As shown, in the embodiment of this specification, the distributed database cluster may also include a distributed database cluster corresponding to the blockchain network, which may include distributed nodes 801, 808, 803, 804, 805 and 806. The distributed nodes may be connected via a communication link, such as a wired communication link or a wireless communication link.
[0054] The monitoring module corresponding to the monitoring plug-in can issue an alarm and display the alarm information to the developer when it detects that the monitoring indicator of a certain monitoring object meets the alarm condition in the alarm rule. The alarm information includes the information of the monitoring indicator and the information of the associated indicator different from the monitoring indicator. The location and time of the abnormality can be effectively located, and the problem can be solved. The setting of the monitoring object is divided into plug-ins, and even further settings can be made for the functional units in a plug-in.
[0055] S203: Generate a business code for constructing the person image recognition system based on the configuration script and the configuration parameters of the plug-in to be loaded;
[0056] In the embodiment of the present invention, the configuration script may be a SHELL script (a program written using the functions of a shell; shell is a command parser). Through the SHELL script, the required parameters (configuration parameters of the plug-in to be loaded) are input, which can be used to construct the business code of the person image recognition system. For example:
[0057] "→Desktop bash generator.sh
[0058] Start generating, please enter parameters as prompted
[0059] Please enter the project name: test
[0060] Whether to use soft decoding, enter true / false, the default is true: true
[0061] Select the plugin you want to load
[0062] 1. Face Detection
[0063] 2. Face quality score
[0064] 3. Human body detection
[0065] 4. Human body tracking
[0066] 5. Human head and body binding
[0067] 6. Posture detection
[0068] Split by space: 1 2 3 4 5 6
[0069] Whether a log processing plug-in is required, enter true / false, the default is false: false
[0070] Whether to need monitoring plug-in, enter true / false, the default is true: true
[0071] Loading...
[0072] Generate base code...
[0073] Loading algorithm module...
[0074] Loading edge modules...
[0075] Generation completed"
[0076] In this way, the various functional modules in the character image recognition business process are integrated in the form of plug-ins. The image acquisition module, algorithm module and auxiliary module can be released independently without interfering with each other, ensuring that the update of a single module does not affect the overall business logic and is easy to manage and maintain.
[0077] S204: integrating the business code with the basic framework to construct the person image recognition system;
[0078] In an embodiment of the present invention, the business code can be injected into the basic framework to obtain the person image recognition system. Specifically, according to the code injection rules configured in the basic framework, the business code can be injected into the basic framework to obtain a fusion code; the fusion code is compiled to obtain an executable code, and the executable code is run to implement the online application of the person image recognition system. Developers no longer need to write the code corresponding to the basic framework, which can reduce the workload caused by writing a large amount of repeated code and related debugging, testing, etc. in the development process. Developers only need to focus on the business logic itself corresponding to the specific business scenario.
[0079] In a specific embodiment, Figure 5 As shown, when the plug-in to be loaded includes the neural network model plug-in, the fusion of the business code and the basic framework to construct the person image recognition system includes:
[0080] S501: In response to the received plug-in update instruction, determining an initial network model corresponding to the neural network model plug-in, and acquiring a sample image of a person;
[0081] According to the plug-in update instruction, the initial network model can be determined to be a neural network model for face detection and / or a neural network model for body detection. Accordingly, a sample image of a person is obtained.
[0082] S502: Based on the person sample image, training the initial network model to obtain a target network model;
[0083] The initial network model can be trained based on sample images of people to obtain an intermediate network model; then the labeled test image is input into the intermediate network model for prediction to obtain the prediction result corresponding to the test image; then, based on the test image, according to the difference between the corresponding prediction result and the labeled mark, the model parameters corresponding to the intermediate network model are adjusted until the loss value corresponding to the difference converges to a preset threshold, so as to obtain the target network model.
[0084] S503: Based on the target network model, update the neural network model plug-in.
[0085] Updating the neural network model plug-in can make the corresponding algorithm module more adaptable to the needs of the application scenario. Integrating the various functional modules in the character image recognition business process in the form of plug-ins has low coupling and dependence between modules during updates, which is easier to maintain. Of course, corresponding parameter adjustments can also be made to the image acquisition plug-in, log processing plug-in, monitoring plug-in, etc. for updating. The updates of each plug-in can also be carried out synchronously, with a low degree of mutual influence. The update of each plug-in is not limited to the parameter adjustment of the preset basic components, etc., but also includes modification and supplementation of the corresponding basic components.
[0086] In another specific embodiment, Figure 5 As shown, when the plug-in to be loaded includes the image acquisition plug-in and the neural network model plug-in, the fusion of the business code and the basic framework to build the person image recognition system also includes:
[0087] S601: Based on the image acquisition plug-in, the person image to be processed is acquired;
[0088] In practical applications, such as Figure 6 , 7As shown, the original video stream can be obtained from a video input device (such as a ball camera, a gun camera, an AI camera); the original video stream is decoded to obtain a video frame, and the video frame includes at least one of the characters to be processed. The image acquisition module corresponding to the image acquisition plug-in can pull the original video stream from the camera, decode it to obtain a video frame, and then input the video frame into the algorithm module corresponding to the neural network model plug-in for processing. The character image recognition process performed in the algorithm module may include face detection, face quality score calculation, and human body detection, and the recognition results can be stored in a database for persistent storage.
[0089] S602: Based on the neural network model plug-in, the image of the person to be processed is input into each of the neural network models for recognition, so as to obtain each recognition result corresponding to the image of the person to be processed.
[0090] For different business scenarios, it may be necessary to combine neural network models with different person image recognition functions in the algorithm module corresponding to the neural network model plug-in. Figure 6 , 7 As shown, the embodiment of this specification proposes the concept of a customized algorithm pipeline to support different business logics with higher flexibility. The four algorithm modules of face detection, face quality filtering, face detection, and face similarity matching can be combined, and the algorithm module pointed to by the corresponding neural network model combination is defined as a face recognition pipeline. Based on the customized algorithm pipeline, you can only focus on the final output result and ignore the intermediate process, which is similar to combining multiple neural network models into a function, giving an input and getting an output. The algorithm module uses a GPU (Graphics Processing Unit) for calculation and processing. Based on the customized algorithm pipeline, the corresponding neural network model combination only needs to copy the corresponding data to the video memory once when in use, rather than copying the data once for each neural network model used, which can greatly improve the operating efficiency, while saving video memory resources and improving performance. Among them, the hardware environment in which the character image recognition system runs can be an X86 server equipped with a GPU.
[0091] Furthermore, the image acquisition module corresponding to the image acquisition plug-in can create a data writing thread, and the data writing thread corresponds to a shared memory queue; the data corresponding to the image of the person to be processed (such as the original data frame) is written into the shared memory queue through the data writing thread. Correspondingly, the algorithm module corresponding to the neural network model plug-in can create a data reading thread, and the data reading thread corresponds to the shared memory queue; the data corresponding to the image of the person to be processed (such as the original data frame) is read from the shared memory queue through the data reading thread; and then the image of the person to be processed is input into each of the neural network models for recognition, so as to obtain each recognition result corresponding to the image of the person to be processed. Communicating by means of a shared memory queue can ensure that the updates of the image acquisition module and the algorithm module will not affect each other.
[0092] The data writing thread writes the original data frame into the queue. The data written into the queue can be based on time sequence or based on the classification settings of different video input devices (for example, the camera is set with a corresponding identification mark, and the cameras 1-3 located at the entrance of the smart store correspond to the identification mark A, and the cameras 7-12 located at the cashier of the smart store correspond to the identification mark D). Correspondingly, the data reading thread can read data from the queue according to different dimensions. For example, batches can be processed uniformly according to dimensions such as time or number of images to improve computing efficiency. The existence of a shared memory queue allows the curve graph of the production speed of the image acquisition module and the consumption speed of the algorithm module to have spikes. For example, at a certain moment, the image acquisition module produces too fast. Due to the existence of the queue, the data will not be lost immediately. The algorithm module can slowly keep up with the production speed of the image acquisition module, so that the data input into the neural network model can be smoother.
[0093] It can be seen from the technical solutions provided in the above embodiments of this specification that the embodiments of this specification are applied to the development of a person image recognition system. The functional modules in the person image recognition business process are integrated in the form of plug-ins, and the business code for building the person image recognition system is generated based on the configuration script and the configuration parameters of the plug-in to be loaded. The basic framework and the business code are integrated to construct a person image recognition system. It can greatly improve the development efficiency of developers and meet the different development needs of different business scenarios. The form of a plug-in can reduce the workload of repeated development and is also easy to maintain.
[0094] The embodiment of the present invention also provides a device for constructing a person image recognition system, such as Fig. 9 As shown, the device comprises:
[0095] Basic framework acquisition module 910: used to acquire a basic framework for building a person image recognition system;
[0096] The plug-in confirmation module 920 to be loaded is used to determine the plug-in to be loaded in response to the received plug-in loading instruction, wherein the plug-in loading instruction carries configuration parameters pointing to at least one business plug-in;
[0097] Business code generation module 930: used to generate business code for building the person image recognition system based on the configuration script and the configuration parameters of the plug-in to be loaded;
[0098] Fusion module 940: used to fuse the business code with the basic framework to construct the person image recognition system;
[0099] The business plug-in includes at least one selected from the group consisting of an image acquisition plug-in and a neural network model plug-in, and the configuration parameters of the neural network model plug-in point to at least one neural network model for character image recognition.
[0100] In a specific embodiment, when the plug-in to be loaded includes the neural network model plug-in, the fusion module 940 includes:
[0101] A plug-in update instruction receiving unit: used to determine the initial network model corresponding to the neural network model plug-in in response to the received plug-in update instruction, and obtain a sample image of a person;
[0102] Model training unit: used for training the initial network model based on the person sample image to obtain a target network model;
[0103] Plug-in updating unit: used to update the neural network model plug-in based on the target network model.
[0104] It should be noted that the device in the device embodiment and the method embodiment are based on the same inventive concept.
[0105] An embodiment of the present invention provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement a method for constructing a person image recognition system as provided in the above method embodiment.
[0106] Further, Fig.10 The hardware structure diagram of an electronic device for implementing the method for constructing a person image recognition system provided by an embodiment of the present invention is shown. The device may participate in constituting or include the apparatus provided by an embodiment of the present invention. Fig.10As shown, the device 100 may include one or more (1002a, 1002b, ..., 1002n are used to illustrate) processors 1002 (the processor 1002 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1004 for storing data, and a transmission device 1006 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Fig.10 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.10 More or fewer components as shown, or with Fig.10 Different configurations are shown.
[0107] It should be noted that the one or more processors 1002 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the electronic device 100 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0108] The memory 1004 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the method in the embodiment of the present invention. The processor 1002 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, to implement the above-mentioned method for constructing a person image recognition system. The memory 1004 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1004 may further include a memory remotely arranged relative to the processor 1002, and these remote memories may be connected to the electronic device 100 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0109] The transmission device 1006 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the electronic device 100. In one example, the transmission device 1006 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 1006 can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.
[0110] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the electronic device 100 (or mobile device).
[0111] An embodiment of the present invention also provides a storage medium, which can be set in an electronic device to store at least one instruction, at least one program, a code set or an instruction set related to a method for constructing a person image recognition system in a method embodiment. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method for constructing a person image recognition system provided in the above method embodiment.
[0112] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0113] It should be noted that the sequence of the embodiments of the present invention described above is for description only and does not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0114] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and electronic device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0115] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0116] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for constructing a person image recognition system, characterized in that: The method comprises: Acquire a basic framework for building a person image recognition system, wherein the basic framework indicates a preset scenario, and the basic framework includes at least one of the following: a basic code library, a public class library, and a basic service interface; Determine a plurality of plug-ins to be loaded based on configuration parameters indicating respective ones of the plurality of service plug-ins carried in the plug-in loading instruction, wherein the plurality of plug-ins to be loaded include an image acquisition plug-in and at least two neural network model plug-ins; Generate a service code for constructing the person image recognition system based on a configuration script, configuration parameters of each of the plurality of plug-ins to be loaded, and a usage order corresponding to the at least two neural network model plug-ins, wherein the usage order is used to indicate the flow of the image acquired based on the image acquisition plug-in between the at least two neural network model plug-ins, the configuration parameters of the neural network model plug-in indicate a function to be used and / or an algorithm to be used of a neural network model for person image recognition, and the neural network model for person image recognition indicates a neural network model for face detection, body detection, body tracking, head-body binding, face quality score, and posture detection; Integrate the business code with the basic framework to build the character image recognition system; Among them, after the business code and the basic framework are integrated to construct the character image recognition system, the method also includes: acquiring the character image to be processed based on the image acquisition plug-in; when the usage order indicates that the image acquired based on the image acquisition plug-in does not flow between the at least two neural network model plug-ins, the character image to be processed is identified using the at least two neural network model plug-ins respectively to obtain at least two recognition results corresponding to the character image to be processed.
2. The method according to claim 1, characterized in that Before integrating the business code with the basic framework to construct the person image recognition system, the method further includes: In response to the received plug-in update instruction, determining an initial network model corresponding to the neural network model plug-in, and acquiring a sample image of a person; Based on the person sample images, training the initial network model to obtain a target network model; Based on the target network model, the neural network model plug-in is updated.
3. The method according to claim 1, characterized in that The step of acquiring the person image to be processed based on the image acquisition plug-in includes: Get the original video stream from the video input device; The original video stream is decoded to obtain a video frame, wherein the video frame includes at least one character image to be processed.
4. The method according to claim 1, characterized in that: The step of acquiring the person image to be processed based on the image acquisition plug-in includes: Creating a data writing thread, wherein the data writing thread corresponds to a shared memory queue; Writing the data corresponding to the to-be-processed character image into the shared memory queue through the data writing thread; Based on the at least two neural network model plug-ins, the person image to be processed is input into each of the neural network models for recognition, so as to obtain at least two recognition results corresponding to the person image to be processed, including: Creating a data reading thread, wherein the data reading thread corresponds to the shared memory queue; Reading data corresponding to the to-be-processed character image from the shared memory queue through the data reading thread; The image of the person to be processed is input into each of the neural network models for recognition to obtain at least two recognition results corresponding to the image of the person to be processed.
5. The method according to claim 1, characterized in that The business plug-in also includes at least one selected from the group consisting of a log processing plug-in and a monitoring plug-in, wherein the log processing plug-in is used to process the log generated by the character image recognition system, and the monitoring plug-in is used to monitor the operating status of the character image recognition system.
6. A device for constructing a person image recognition system, characterized in that: The device comprises: A basic framework acquisition module: used to acquire a basic framework for building a person image recognition system, wherein the basic framework indicates a preset scene, and the basic framework includes at least one of the following: a basic code library, a public class library, and a basic service interface; A plug-in confirmation module to be loaded: used to determine multiple plug-ins to be loaded based on the configuration parameters of the multiple business plug-ins carried in the plug-in loading instruction, wherein the multiple plug-ins to be loaded include an image acquisition plug-in and at least two neural network model plug-ins; A business code generation module: used to generate business code for building the person image recognition system based on a configuration script, configuration parameters of each of the multiple plug-ins to be loaded, and a usage order corresponding to the at least two neural network model plug-ins, wherein the usage order is used to indicate the flow of images acquired based on the image acquisition plug-in between the at least two neural network model plug-ins, the configuration parameters of the neural network model plug-in indicate a function to be used and / or an algorithm to be used of a neural network model for person image recognition, and the neural network model for person image recognition indicates a neural network model for face detection, body detection, body tracking, head-body binding, face quality score, and posture detection; Fusion module: used to fuse the business code with the basic framework to build the character image recognition system; The device is also used to: acquire a person image to be processed based on the image acquisition plug-in; and when the usage order indicates that the image acquired based on the image acquisition plug-in does not flow between the at least two neural network model plug-ins, identify the person image to be processed using the at least two neural network model plug-ins respectively to obtain at least two identification results corresponding to the person image to be processed.
7. The device according to claim 6, characterized in that The device also includes a plug-in update module, and the plug-in update module includes: A plug-in update instruction receiving unit: used to determine the initial network model corresponding to the neural network model plug-in in response to the received plug-in update instruction, and obtain a sample image of a person; Model training unit: used for training the initial network model based on the person sample image to obtain a target network model; Plug-in updating unit: used to update the neural network model plug-in based on the target network model.
8. The device according to claim 6, characterized in that The method of acquiring the image of the person to be processed based on the image acquisition plug-in includes: acquiring an original video stream from a video input device; decoding the original video stream to obtain a video frame, wherein the video frame includes at least one image of the person to be processed.
9. The device according to claim 6, characterized in that: The method of acquiring the to-be-processed person image based on the image acquisition plug-in includes: creating a data writing thread, wherein the data writing thread corresponds to a shared memory queue; and writing data corresponding to the to-be-processed person image into the shared memory queue through the data writing thread; Based on the at least two neural network model plug-ins, the image of the person to be processed is input into each of the neural network models for recognition, so as to obtain at least two recognition results corresponding to the image of the person to be processed, including: creating a data reading thread, the data reading thread corresponds to the shared memory queue; reading data corresponding to the image of the person to be processed from the shared memory queue through the data reading thread; inputting the image of the person to be processed into each of the neural network models for recognition, so as to obtain at least two recognition results corresponding to the image of the person to be processed.
10. The device according to claim 6, characterized in that The business plug-in also includes at least one selected from the group consisting of a log processing plug-in and a monitoring plug-in, wherein the log processing plug-in is used to process the log generated by the character image recognition system, and the monitoring plug-in is used to monitor the operating status of the character image recognition system.
11. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method for constructing a person image recognition system as described in any one of claims 1-5.
12. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method for constructing a person image recognition system as described in any one of claims 1-5.
Citation Information
Patent Citations
Service access method based on plugin and system thereof
CN103297381A
Face and pedestrian perception system based on depth camera
CN107301377A
Training method and apparatus of neural network, and object identification method and apparatus
CN108416440A
Data processing method and device of server
CN108694083A
