Customer flow statistics method, device, electronic device and storage medium

By extracting pedestrians in the video stream to recognize the characteristics of the REID characteristics and store it to the customer's characteristic library, the problem of not high statistics in the existing technology in the existing technology has achieved higher statistical accuracy.

CN114565963BActive Publication Date: 2025-01-24CHENGDU JIAHUA CHAIN CLOUD TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210202424.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-03
Publication Date
2025-01-24
Estimated Expiration
2042-03-03

AI Technical Summary

Technical Problem

The prior art is not very accurate when calculating customer traffic, and it is prone to problems such as repeated statistics, uneven lighting or side face occlusion.

Method used

By obtaining the video stream of the preset area, the pedestrian re-identification ReID features are extracted, and when there is no matching feature in the customer feature database with a similarity greater than the preset threshold, the ReID features are stored in the customer feature database to determine the total number of customer traffic. .

Benefits of technology

Effectively avoid problems such as repeated statistics, uneven light or side face cover, and improve the accuracy of customer traffic statistics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114565963B_ABST
    Figure CN114565963B_ABST
Patent Text Reader

Abstract

The present application provides a customer flow statistics method, device, electronic device and storage medium, the method comprising: obtaining a video stream of a preset area; extracting a pedestrian re-identification ReID feature in the video stream; judging whether a feature whose similarity with the ReID feature is greater than a preset threshold is matched in the customer feature library; if not, storing the ReID feature in the customer feature library, and determining the total number of ReID features in the customer feature library as the total number of customer flow. By adding the ReID feature to the customer feature library only when no feature whose similarity with the ReID feature is greater than a preset threshold is matched in the customer feature library, the total number of ReID features in the customer feature library is used as the total number of customer flow, thereby avoiding repeated statistics, uneven lighting or side face occlusion, and effectively improving the accuracy of customer flow statistics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical fields of image recognition, video processing and deep learning, and more specifically, to a customer flow statistics method, device, electronic device and storage medium. Background Art

[0002] Customer flow statistics refer to the statistics of the number of visiting customers by offline stores. When there are many customers and they are queuing to enter the offline stores, they will be served in an assembly line manner. Therefore, the statistical results are usually called customer flow.

[0003] At present, infrared sensing and facial recognition are usually used to count customer flow. The infrared sensing method is low-cost, but there will be repeated counting (for example, customers who forget to buy other things repeatedly enter and exit offline stores, etc.), resulting in inaccurate customer flow. When using facial recognition, customers are required to face the camera and take off their hats and masks, and there must be no uneven lighting or side face obstructions, so that the customer flow can be accurately counted. However, in practice, it is difficult to do so, resulting in inaccurate customer flow. Therefore, the accuracy of customer flow statistics using infrared sensing and facial recognition is not high. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a customer flow statistics method, device, electronic device and storage medium, which are used to improve the problem of low accuracy in counting customer flow.

[0005] In the first aspect, the embodiment of the present application provides a method for counting customer flow, including: obtaining a video stream of a preset area; extracting a pedestrian re-identification ReID feature in the video stream, the ReID feature representing the global and local features of the same pedestrian in the image; determining whether a feature whose similarity with the ReID feature is greater than a preset threshold is matched in the customer feature library; if not, the ReID feature is stored in the customer feature library, and the total number of ReID features in the customer feature library is determined as the total number of customer flow. In the implementation process of the above scheme, by extracting the pedestrian re-identification ReID feature in the video stream of the pedestrian passing through the preset area, and only when there is no feature in the customer feature library whose similarity with the ReID feature is greater than the preset threshold, the ReID feature is added to the customer feature library, so that the total number of ReID features in the customer feature library is used as the total number of customer flow, thereby avoiding repeated statistics, uneven lighting or side face occlusion, and effectively improving the accuracy of customer flow statistics.

[0006] In an optional implementation of the first aspect, extracting pedestrian re-identification ReID features in a video stream includes: performing face detection on the video stream to obtain a face detection result; if the face detection result is that there is a face video frame in the video stream, and it is determined that the image quality of the face video frame is less than a preset threshold, then extracting the ReID features in the face video frame. In the implementation process of the above scheme, by extracting the ReID features in the face video frame only when there is a face video frame in the video stream and it is determined that the image quality of the face video frame is less than a preset threshold, it is avoided that the face video frame with image quality less than the preset threshold is used to exclude the employee ReID features in the customer feature library, and the accuracy of customer flow statistics is effectively improved.

[0007] In an optional implementation of the first aspect, after obtaining the face detection result, it also includes: if the face detection result is that there are face video frames in the video stream, and it is determined that the image quality of the face video frames is greater than a preset threshold, then extract the face features in the face video frames, and update the customer feature library according to the face features. In the implementation process of the above scheme, when the face detection result is that there are face video frames in the video stream, and it is determined that the image quality of the face video frames is greater than a preset threshold, extract the face features in the face video frames, and update the customer feature library according to the face features, so that the face video frames with image quality less than the preset threshold are used to exclude the employee ReID features in the customer feature library, thereby effectively improving the accuracy of customer flow statistics.

[0008] In an optional implementation of the first aspect, updating the customer feature library according to facial features includes: determining whether the facial features are found in the employee face library; if not, extracting the ReID features of the face video frame, and storing the ReID features in the customer feature library. In the implementation of the above solution, the ReID features of the face video frame are extracted and the customer feature library is updated only when the facial features are not found in the employee face library, that is, when the employee ReID features in the customer feature library are excluded, thereby effectively improving the accuracy of customer flow statistics based on the customer feature library.

[0009] In an optional implementation of the first aspect, after determining whether the facial features are found in the employee face database, the method further includes: if the facial features are found in the employee face database, extracting the ReID features of the face video frame, and deleting the ReID features whose similarity with the ReID features is greater than a preset threshold from the customer feature database. In the implementation of the above scheme, if the employee is confirmed to be an employee through the facial features, the ReID features of the employee are deleted from the customer feature database, thereby avoiding the problem of miscounting employees as customers, and effectively improving the accuracy of customer flow statistics based on the customer feature database.

[0010] In an optional implementation of the first aspect, after deleting the ReID feature whose similarity with the ReID feature is greater than a preset threshold from the customer feature library, it also includes: determining whether a feature whose similarity with the ReID feature is greater than a preset threshold is matched in the employee feature library; if not, storing the ReID feature in the employee feature library. In the implementation of the above scheme, if there is no match with the ReID feature in the employee feature library, the ReID feature is stored in the employee feature library, thereby updating the employee feature library to the latest state, effectively maintaining the employee feature library, and improving the accuracy of excluding the customer flow of employees according to the employee feature library.

[0011] In an optional implementation of the first aspect, storing the ReID feature in the customer feature library includes: after determining that no feature with a similarity with the ReID feature greater than a preset threshold is matched in the employee feature library, storing the ReID feature in the customer feature library. In the implementation of the above solution, by storing the ReID feature in the customer feature library when it is determined that no feature is matched in the employee feature library, the problem of miscounting employees as customers is avoided, thereby effectively improving the accuracy of customer flow statistics based on the customer feature library.

[0012] In a second aspect, an embodiment of the present application provides a customer flow statistics device, including: a video stream acquisition module, used to acquire a video stream of a preset area; a ReID feature extraction module, used to extract pedestrian re-identification ReID features in the video stream, the ReID features representing the global features and local features of the same pedestrian in the image; a ReID feature judgment module, used to judge whether a feature whose similarity with the ReID feature is greater than a preset threshold is matched in the customer feature library; a customer flow statistics module, used to store the ReID feature in the customer feature library if a feature whose similarity with the ReID feature is greater than a preset threshold is not matched in the customer feature library, and determine the total number of ReID features in the customer feature library as the total number of customer flows.

[0013] In an optional implementation of the second aspect, the ReID feature extraction module includes: a detection result acquisition module, which is used to perform face detection on a video stream to obtain a face detection result; a video feature extraction module, which is used to extract the ReID feature in the face video frame if the face detection result is that there is a face video frame in the video stream and it is determined that the image quality of the face video frame is less than a preset threshold.

[0014] In an optional implementation of the second aspect, the customer flow statistics device also includes: a customer feature library update module, which is used to extract facial features in the facial video frame if the face detection result is that there is a face video frame in the video stream and it is determined that the image quality of the face video frame is greater than a preset threshold, and update the customer feature library based on the facial features.

[0015] In an optional implementation of the second aspect, the customer feature library update module includes: a facial feature judgment module, used to determine whether the facial features are found in the employee face library; a first feature storage module, used to extract the ReID features of the face video frame if the facial features are not found in the employee face library, and store the ReID features in the customer feature library.

[0016] In an optional implementation of the second aspect, the customer feature library update module also includes: a ReID feature deletion module, which is used to extract the ReID feature of the face video frame if the facial feature is found in the employee face library, and delete the ReID feature whose similarity with the ReID feature is greater than a preset threshold from the customer feature library.

[0017] In an optional implementation of the second aspect, the customer feature library update module also includes: a feature matching judgment module, which determines whether a feature whose similarity with the ReID feature is greater than a preset threshold is matched in the employee feature library; a second feature storage module, which is used to store the ReID feature in the employee feature library if a feature whose similarity with the ReID feature is greater than a preset threshold is not matched in the employee feature library.

[0018] In an optional implementation of the second aspect, the customer flow statistics device further includes: a feature matching determination module, used to determine that no feature whose similarity with the ReID feature is greater than a preset threshold is matched in the employee feature library.

[0019] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory, the memory storing machine-readable instructions executable by the processor, and the machine-readable instructions performing the method described above when executed by the processor.

[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program executes the method described above when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 A flow chart of a customer flow statistics method provided by an embodiment of the present application is shown;

[0023] Figure 2 A schematic diagram of a process for extracting ReID features provided in an embodiment of the present application is shown;

[0024] Figure 3 A schematic diagram of the structure of a customer flow statistics device provided in an embodiment of the present application is shown;

[0025] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0026] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments in the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the embodiments of the present application claimed for protection, but merely represents the selected embodiments in the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the embodiments of the present application.

[0027] It is understandable that the "first" and "second" in the embodiments of the present application are used to distinguish similar objects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not necessarily limit the difference.

[0028] Before introducing the customer flow statistics method provided in the embodiment of the present application, some concepts involved in the embodiment of the present application are first introduced:

[0029] Person Re-IDentification (ReID), also known as pedestrian re-identification, is a technology that uses computer vision technology to determine whether there is a specific pedestrian in an image or video sequence.

[0030] Face detection is a computer technology that finds the position and size of a face in any digital image; face detection can detect facial features, such as the position and size of the face, and ignore anything else such as buildings, trees, and bodies.

[0031] Face recognition is a field of computer technology research. Face recognition belongs to biometric recognition technology, which distinguishes individuals of organisms (generally referring to humans) based on their biological characteristics; that is, a technology or system that confirms or searches for identities through faces.

[0032] It should be noted that the customer flow statistics method provided in the embodiment of the present application can be executed by an electronic device, where the electronic device refers to a device terminal or server with the function of executing a computer program, such as a smart phone, a personal computer, a tablet computer, a personal digital assistant or a mobile Internet device. A server refers to a device that provides computing services through a network, such as an x86 server and a non-x86 server, and a non-x86 server includes a mainframe, a minicomputer and a UNIX server.

[0033] The following introduces application scenarios where the customer flow statistics method is applicable. The application scenarios here include but are not limited to: using the customer flow statistics method to count the number of customers entering the offline store area, or using the customer flow statistics method to count the new customer flow to the convention and exhibition center within a preset time period (for example, within a day, within a week, etc.), that is, customers who come to the convention and exhibition center multiple times within the preset time period are counted only once, etc.

[0034] See also Figure 1 The flow chart of the customer flow statistics method provided by the embodiment of the present application is shown; the main idea of ​​the customer flow statistics method is to extract the pedestrian re-identification ReID features in the video stream of pedestrians passing through the preset area, and only add the ReID features to the customer feature library when there is no feature in the customer feature library whose similarity with the ReID feature is greater than a preset threshold, so as to use the total number of ReID features in the customer feature library as the total number of customer flow, thereby avoiding repeated statistics, uneven lighting or side face occlusion, and effectively improving the accuracy of customer flow statistics. The above-mentioned customer flow statistics method may include:

[0035] Step S110: Obtain a video stream of a preset area.

[0036] The preset area refers to the area that customers can pass through. This area is also the area that employees can pass through. This area can also be monitored and photographed by video cameras, such as: the entrance of an offline store, or the passage that customers must pass through when entering an offline store, etc.

[0037] Step S120: extracting pedestrian re-identification (ReID) features in the video stream, where the ReID features represent the global features and local features of the same pedestrian in the image.

[0038] ReID features refer to the global features and local features of the same person in the image, that is, the features that combine the global features and the local features. For example, when the local features of the customer's facial area cannot be obtained, the global features are used to count the traffic; when the local features can be obtained, the local features are used for statistics.

[0039] Step S130: Determine whether a feature whose similarity with the ReID feature is greater than a preset threshold is matched in the customer feature database.

[0040] Similarity refers to the degree of similarity between two target objects or two sample data. The similarity between two sample data can be calculated based on quantitative similarity indicators. In the specific practice, similarity indicators that can be used include: cosine distance, Euclidean distance, Hamming distance or information entropy, etc.; of course, in practice, complex modes such as the above-mentioned multiple combined weighted parameters can also be selected to calculate similarity.

[0041] Step S140: If no feature with a similarity greater than a preset threshold to the ReID feature is matched in the customer feature library, the ReID feature is stored in the customer feature library, and the total number of ReID features in the customer feature library is determined as the total number of customer traffic.

[0042] A specific implementation example of the above-mentioned step S140 is: if no feature whose similarity with the ReID feature is greater than a preset threshold is matched in the customer feature library, and after it is determined that no feature whose similarity with the ReID feature is greater than the preset threshold is matched in the employee feature library, the ReID feature is stored in the customer feature library, and the total number of ReID features in the customer feature library is determined as the total number of customer traffic.

[0043] It should be noted that the employee feature library is obtained by extracting the ReID features of employees in advance and storing the ReID features of employees in the employee feature library. The purpose of the employee feature library is to exclude the situation where employees are counted as customers, that is, the customer feature library can only store and count the ReID features of customers, but not the ReID features of employees. Therefore, the employee feature library can be used to avoid the situation where employees are counted as customers, which can further improve the accuracy of customer flow statistics.

[0044] As an optional implementation of step S110, obtaining the video stream of the preset area may be first obtaining all relevant video streams of a certain customer. A specific implementation method, for example, may be to draw a line at the door line of the video screen, and use this line as the dividing line for entering the offline store. Body detection and tracking may be performed on each video frame of the dividing line for entering the offline store, thereby capturing all relevant video streams of the same customer. These relevant video streams may be stored in a queue.

[0045] See also Figure 2 The flowchart of extracting ReID features provided by the embodiment of the present application is shown; as an optional implementation of step S120, the implementation of extracting the pedestrian re-identification ReID features in the video stream may include:

[0046] Step S121: Perform face detection on the video stream to obtain a face detection result.

[0047] The implementation method of the above step S121 is, for example: using a neural network model of face detection to perform face detection on a video stream to obtain a face detection result, which characterizes whether there are face video frames in the video stream, in two cases: the presence of face video frames (for example, employees' or customers') and the absence of face video frames. In practice, the neural network models for face detection that can be used in the embodiments of the present application may include: Multi-task Cascaded Convolutional Networks (MTCNN) and Region Convolutional Neural Networks (RCNN).

[0048] Step S122: If the face detection result is that there is a face video frame in the video stream, and it is determined that the image quality of the face video frame is less than a preset threshold, then extract the ReID feature in the face video frame.

[0049] An implementation example of the above step S122 is: if the face detection result is that there are face video frames in the video stream, and it is determined that the image quality of the face video frames is less than a preset threshold (for example: the image quality score of the face video frames is less than 80), then the ReID features in the face video frames are extracted. The specific implementation methods for extracting ReID features in face video frames in the embodiments of the present application include but are not limited to: using convolutional neural networks (CNN) or recurrent neural networks (RNN) to extract global features in face video frames, using image segmentation, skeleton key point positioning, and attention mechanisms, etc. to extract local features in face video frames, and then generating ReID features based on global features and local features.

[0050] As an optional implementation of step S120, after step S121, the following may also be included:

[0051] Step S123: If the face detection result shows that there are face video frames in the video stream, and it is determined that the image quality of the face video frames is greater than a preset threshold, facial features in the face video frames are extracted, and the customer feature library is updated based on the facial features.

[0052] An implementation example of the above step S123 is as follows: if the face detection result is that there is a face video frame in the video stream, and it is determined that the image quality of the face video frame is greater than a preset threshold (for example, the image quality score of the face video frame is greater than 80), then face recognition is performed on the face video frame to extract facial features in the face video frame, and the customer feature library is updated based on the facial features.

[0053] The implementation method of updating the customer feature database according to the facial features in step S123 above may include:

[0054] Step S123a: Determine whether facial features are found in the employee face database.

[0055] An implementation method of the above-mentioned step S123a is, for example: collecting employees' facial features in a legal manner in advance, and building an employee face database based on the employees' facial features; then, using an executable program compiled or interpreted by a preset programming language to determine whether the facial features extracted from the face video frame are found in the employee face database; wherein the programming languages ​​that can be used are, for example: C, C++, Java, BASIC, JavaScript, LISP, Shell, Perl, Ruby, Python and PHP, etc.

[0056] Step S123b: If the facial features are not found in the employee face database, the ReID features of the facial video frame are extracted and stored in the customer feature database.

[0057] An implementation example of the above step S123b is as follows: if the facial feature is not found in the employee face database, the facial feature is immediately deleted or eliminated, and then the ReID feature of the face video frame is extracted, and it is determined again that no feature with a similarity greater than a preset threshold with the ReID feature is matched in the employee feature database, and then it is determined that the ReID feature of the face video frame is the ReID feature of a new customer; then, the ReID feature is stored in the customer feature database as the ReID feature of the new customer. By excluding employees twice, the accuracy of customer flow statistics can be effectively further improved.

[0058] As an optional implementation, after step S123a, the following may also be included:

[0059] Step S123c: If the facial features are found in the employee face database, the ReID features of the facial video frame are extracted, and the ReID features whose similarity with the ReID features is greater than a preset threshold are deleted from the customer feature database.

[0060] As an optional implementation manner, after step S123c, the following may also be included:

[0061] Step S123d: Determine whether a feature whose similarity with the ReID feature is greater than a preset threshold is matched in the employee feature database.

[0062] Step S123e: If no feature with a similarity greater than a preset threshold to the ReID feature is matched in the employee feature library, the ReID feature is stored in the employee feature library.

[0063] For example, the implementation method of the above step S123d and step S123e is as follows: the above preset threshold can be set to 70%, 80% or 90%, etc. Assuming that it is set to 80% here, it can be determined whether a feature with a similarity greater than 80% with the ReID feature is matched in the employee feature library; if a feature with a similarity greater than 80% with the ReID feature is not matched in the employee feature library, the ReID feature is stored in the employee feature library. In the above implementation process, since there is no need to save the customer's facial features, only the customer's facial features are used to determine whether it is an employee, and they are immediately eliminated or deleted after use; therefore, the customer's privacy rights are effectively protected to comply with relevant privacy laws and regulations.

[0064] Optionally, as an optional implementation method of storing the ReID feature in the customer feature library, the implementation method is specifically as follows: after determining that no feature with a similarity greater than a preset threshold with the ReID feature is matched in the employee feature library, the ReID feature is stored in the customer feature library, and the total number of ReID features in the customer feature library is determined as the total number of customer flows. Of course, the customer feature library can be a total number of customer flows within a preset time period (e.g., one day, one week, etc.). In the actual process, if the total number of customer flows within one day is counted, all ReID features in the customer feature library can be cleared at 12 o'clock in the evening of the same day so that the customer flows can be re-counted the next day.

[0065] In the implementation process of the above scheme, the pedestrian re-identification ReID features are extracted from the video stream of pedestrians passing through the preset area, and the ReID features are added to the customer feature library only when there is no matching feature in the customer feature library whose similarity with the ReID features is greater than a preset threshold. The total number of ReID features in the customer feature library is used as the total number of customer flow, thereby avoiding repeated statistics, uneven lighting or side face occlusion, and effectively improving the accuracy of customer flow statistics.

[0066] See also Figure 3 The structure diagram of the customer flow statistics device provided in the embodiment of the present application is shown; the embodiment of the present application provides a customer flow statistics device 200, including:

[0067] The video stream acquisition module 210 is used to acquire the video stream of a preset area.

[0068] The ReID feature extraction module 220 is used to extract pedestrian re-identification (ReID) features in the video stream. The ReID features represent the global features and local features of the same pedestrian in the image.

[0069] The ReID feature determination module 230 is used to determine whether a feature whose similarity with the ReID feature is greater than a preset threshold is matched in the customer feature database.

[0070] The customer flow statistics module 240 is used to store the ReID feature in the customer feature library if no feature with a similarity greater than a preset threshold value is matched in the customer feature library, and determine the total number of ReID features in the customer feature library as the total number of customer flows.

[0071] Optionally, in an embodiment of the present application, the ReID feature extraction module includes:

[0072] The detection result acquisition module is used to perform face detection on the video stream and obtain face detection results.

[0073] The video feature extraction module is used to extract the ReID feature in the face video frame if the face detection result is that there is a face video frame in the video stream and it is determined that the image quality of the face video frame is less than a preset threshold.

[0074] Optionally, in the embodiment of the present application, the customer flow statistics device further includes:

[0075] The customer feature library update module is used to extract the facial features in the facial video frames if the face detection result shows that there are facial video frames in the video stream and it is determined that the image quality of the facial video frames is greater than a preset threshold, and update the customer feature library based on the facial features.

[0076] Optionally, in the embodiment of the present application, the customer feature library updating module includes:

[0077] The face feature judgment module is used to judge whether the face features are found in the employee face database.

[0078] The first feature storage module is used to extract the ReID feature of the face video frame if the face feature is not found in the employee face database, and store the ReID feature in the customer feature database.

[0079] Optionally, in the embodiment of the present application, the customer feature library updating module further includes:

[0080] The ReID feature deletion module is used to extract the ReID feature of the face video frame if the face feature is found in the employee face database, and delete the ReID feature whose similarity with the ReID feature is greater than a preset threshold from the customer feature database.

[0081] Optionally, in the embodiment of the present application, the customer feature library updating module further includes:

[0082] The feature matching judgment module judges whether a feature whose similarity with the ReID feature is greater than a preset threshold is matched in the employee feature database.

[0083] The second feature storage module is used to store the ReID feature in the employee feature library if no feature with a similarity with the ReID feature greater than a preset threshold is matched in the employee feature library.

[0084] Optionally, in the embodiment of the present application, the customer flow statistics device further includes:

[0085] The feature matching determination module is used to determine that no feature whose similarity with the ReID feature is greater than a preset threshold is matched in the employee feature database.

[0086] It should be understood that the device corresponds to the above-mentioned customer flow statistics method embodiment and can execute the various steps involved in the above-mentioned method embodiment. The specific functions of the device can be found in the above description. To avoid repetition, the detailed description is appropriately omitted here. The device includes at least one software function module that can be stored in a memory in the form of software or firmware or fixed in the operating system (OS) of the device.

[0087] See also Figure 4 The electronic device 300 provided in the embodiment of the present application includes: a processor 310 and a memory 320, wherein the memory 320 stores machine-readable instructions executable by the processor 310, and when the machine-readable instructions are executed by the processor 310, the above method is executed.

[0088] The embodiment of the present application further provides a computer-readable storage medium 330 , on which a computer program is stored. When the computer program is executed by the processor 310 , the above method is executed.

[0089] Among them, the computer-readable storage medium 330 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.

[0090] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0091] In several embodiments provided by the embodiments of the present application, it should be understood that the disclosed device and method can also be implemented in other ways. The device embodiments described above are only schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a part of a module, a program segment or a code, and a part of a module, a program segment or a code includes one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also be different from the order of occurrence marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which is mainly determined by the functions involved.

[0092] In addition, each functional module of each embodiment in the embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. In addition, in the description of this specification, the description of reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present application. In this specification, the schematic representation of the above terms does not necessarily have to be directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples without contradicting each other.

[0093] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0094] The above description is only an optional implementation manner of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the embodiments of the present application, which should be covered within the protection scope of the embodiments of the present application.

Claims

1. A customer flow statistics method, characterized in that: include: Get the video stream of the preset area; Extracting pedestrian re-identification (ReID) features in the video stream, wherein the ReID features represent global features and local features of the same pedestrian in the image; Determine whether a feature whose similarity with the ReID feature is greater than a preset threshold is matched in the customer feature database; If not, the ReID feature is stored in the customer feature library, and the total number of ReID features in the customer feature library is determined as the total number of customer traffic; The storing the ReID feature in the customer feature library comprises: after determining that no feature having a similarity with the ReID feature greater than a preset threshold is matched in the employee feature library, storing the ReID feature in the customer feature library; The extracting of pedestrian re-identification (ReID) features in the video stream includes: performing face detection on the video stream to obtain a face detection result; if the face detection result is that there is a face video frame in the video stream, and it is determined that the image quality of the face video frame is less than a preset threshold, then extracting the ReID features in the face video frame; if the face detection result is that there is a face video frame in the video stream, and it is determined that the image quality of the face video frame is greater than a preset threshold, then extracting the face features in the face video frame, and updating the customer feature library according to the face features; wherein, updating the customer feature library according to the face features includes: determining whether the face features are found in the employee face library; if not, extracting the ReID features of the face video frame, and storing the ReID features in the customer feature library.

2. The method according to claim 1, characterized in that After determining whether the facial features are found in the employee face database, the method further includes: If the facial feature is found in the employee face database, the ReID feature of the facial video frame is extracted, and the ReID features whose similarity with the ReID feature is greater than a preset threshold are deleted from the customer feature database.

3. The method according to claim 2, characterized in that After deleting the ReID feature whose similarity with the ReID feature is greater than a preset threshold from the customer feature database, the method further includes: Determine whether a feature whose similarity with the ReID feature is greater than a preset threshold is matched in the employee feature database; If not, the ReID feature is stored in the employee feature library.

4. A customer flow statistics device, characterized in that: include: A video stream acquisition module is used to acquire the video stream of a preset area; A ReID feature extraction module, used to extract pedestrian re-identification ReID features in the video stream, wherein the ReID features represent global features and local features of the same pedestrian in the image; A ReID feature judgment module, used to judge whether a feature with a similarity greater than a preset threshold to the ReID feature is matched in the customer feature database; A customer flow statistics module, for storing the ReID feature in the customer feature library if no feature with a similarity greater than a preset threshold value is matched in the customer feature library, and determining the total number of ReID features in the customer feature library as the total number of customer flows; The storing the ReID feature in the customer feature library comprises: after determining that no feature having a similarity with the ReID feature greater than a preset threshold is matched in the employee feature library, storing the ReID feature in the customer feature library; The extracting of pedestrian re-identification (ReID) features in the video stream includes: performing face detection on the video stream to obtain a face detection result; if the face detection result is that there is a face video frame in the video stream, and it is determined that the image quality of the face video frame is less than a preset threshold, then extracting the ReID features in the face video frame; if the face detection result is that there is a face video frame in the video stream, and it is determined that the image quality of the face video frame is greater than a preset threshold, then extracting the face features in the face video frame, and updating the customer feature library according to the face features; wherein, updating the customer feature library according to the face features includes: determining whether the face features are found in the employee face library; if not, extracting the ReID features of the face video frame, and storing the ReID features in the customer feature library.

5. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, the method according to any one of claims 1 to 3 is performed.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 3 is executed.

Citation Information

Patent Citations

  • A method for synergistically training a face recognition network and a pedestrian re-recognition network

    CN109190475A

  • Passenger flow statistics method and device, storage medium and electronic equipment

    CN110874583A

  • Accurate passenger flow statistics system and method based on human face and human shape, and device thereof

    CN112464843A

  • Identity recognition method and device, electronic equipment and computer readable storage medium

    CN113688794A