Duplicate removal person number counting method and device, equipment and storage medium
By detecting face and body images in videos, calculating feature vectors, and performing concatenation and similarity comparison, the inaccurate count of duplicate people caused by occlusion or similar clothing in existing technologies is solved, achieving higher statistical accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU INNOVATION RES INST OF BEIJING UNIV OF AERONAUTICS & ASTRONAUTICS
- Filing Date
- 2023-08-30
- Publication Date
- 2026-06-02
AI Technical Summary
Existing methods for deduplicating the number of people can easily lead to poor accuracy and low precision when people are heavily obscured or dressed similarly.
By extracting a frame from the target video at preset time intervals, detecting face and body images, calculating and concatenating face and body feature vectors, and comparing similarity with a statistical feature library, duplicate individuals can be identified.
It improves the accuracy and precision of deduplication statistics, effectively avoiding misidentification caused by obscuring or similar clothing.
Smart Images

Figure CN117152813B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data and image processing technology, specifically to a method, apparatus, electronic device, and computer-readable storage medium for deduplicating people counting. Background Technology
[0002] Deduplicated headcount counting refers to using computer vision technology to perform AI analysis on video streams and automatically count the number of people entering a certain area within a certain period of time. If a person leaves and then re-enters the area, they are not counted again.
[0003] Existing methods for deduplicating the number of people may count them repeatedly when people are heavily obscured or dressed similarly, resulting in poor accuracy and low precision. Summary of the Invention
[0004] To address the above issues, this application provides a method for deduplicating and counting people, comprising: extracting a frame of target image from a target video at preset time intervals; detecting each face image and the human body image belonging to the same person in the target image; calculating the face feature vector of each face image and the human body feature vector of each human body image; concatenating the face feature vector and the human body feature vector to obtain the feature vector to be counted for each person in the target image, which can count people from multiple dimensions of deduplicated features, effectively improving the accuracy of deduplication statistics; then, obtaining the target similarity between each feature vector to be counted and the feature vectors already counted in the feature library; counting people whose target similarity is less than a preset similarity threshold, which can effectively identify whether the feature vector to be counted has been counted, greatly improving the accuracy of deduplication statistics.
[0005] In a first aspect, embodiments of this application provide a method for deduplicating and counting people, comprising: extracting a frame of target image from a target video at preset time intervals; detecting each face image and a human body image belonging to the same person as the face image in the target image; calculating the face feature vector of each face image and the human body feature vector of each human body image; concatenating the face feature vector and the human body feature vector to obtain a feature vector to be counted for each person in the target image; obtaining the target similarity between each feature vector to be counted and the feature vectors already counted in the feature library; and counting the number of people whose target similarity is less than a preset similarity threshold.
[0006] Secondly, embodiments of this application provide a deduplication headcount counting device, comprising: a detection module, configured to extract a frame of target image from a target video at preset time intervals, and detect each face image and a human body image belonging to the same person as the face image in the target image; a calculation and splicing module, configured to calculate the face feature vector of each face image and the human body feature vector of each human body image, and splice the face feature vector and the human body feature vector to obtain the target feature vector to be counted for each person in the target image; an acquisition module, configured to acquire the target similarity between each target feature vector to be counted and the target feature vectors already counted in the statistical feature library; and a statistics module, configured to count the number of people whose target similarity is less than a preset similarity threshold.
[0007] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the method described in the first aspect above.
[0008] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect above.
[0009] The technical solutions provided in this application embodiment have at least the following technical effects or advantages:
[0010] This application embodiment extracts a frame of target image from the target video at preset time intervals, detects each face image and the human body image belonging to the same person in the target image, calculates the face feature vector of each face image and the human body feature vector of each human body image, and concatenates the face feature vector and the human body feature vector to obtain the feature vector to be counted for each person in the target image. This can count the number of people from multiple dimensions of deduplicated features, effectively improving the accuracy of deduplication statistics.
[0011] Furthermore, by obtaining the target similarity between each feature vector to be counted and the feature vectors already counted in the feature library, and counting the number of people whose target similarity is less than the preset similarity threshold, it is possible to effectively identify whether the feature vector to be counted has been counted, which greatly improves the accuracy of deduplication.
[0012] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0013] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0014] Figure 1 A flowchart of a deduplication method for counting unique individuals provided in an embodiment of this application is shown;
[0015] Figure 2 This illustration shows a structural schematic diagram of a deduplication headcount counting device provided in an embodiment of this application;
[0016] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0017] Exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.
[0018] Deduplicated headcount counting refers to using computer vision technology to perform AI analysis on video streams and automatically count the number of people entering a certain area within a certain period of time. If a person leaves and then re-enters the area, they are not counted again.
[0019] Existing methods for deduplicating people are prone to misidentification when people are heavily occluded or dressed similarly, resulting in poor accuracy and low precision in the statistical results.
[0020] Based on this, embodiments of this application provide a method for counting duplicate users. The following detailed description of the embodiments of this application is provided in conjunction with the accompanying drawings.
[0021] See Figure 1 The flowchart shown is a method for deduplicating and counting unique individuals. The method specifically includes the following steps:
[0022] Step 101: Extract a frame of target image from the target video at preset time intervals, and detect each face image and the human body image belonging to the same person as the face image in the target image.
[0023] In this embodiment, the preset time interval refers to the time interval set in advance for extracting one frame of the target image from the target video. The preset time interval can be a time interval set by someone skilled in the art according to actual needs, or it can be a time interval obtained by adjusting a set time interval according to actual needs. This embodiment does not impose specific limitations. To clearly illustrate the specific implementation of this application, the preset time interval in this embodiment can be set to 0.33 seconds.
[0024] In one implementation, a frame of the target image can be extracted from the target video every preset time interval, i.e., every 0.33 seconds. Then, a deep learning network for object detection is used to detect each face image and each body image in the target image. Then, based on each face image, a body image belonging to the same person as the face image is found.
[0025] Furthermore, based on each face image, finding the human body image belonging to the same person as the face image can involve obtaining the smallest first rectangular detection box containing the first face image, and obtaining the smallest second rectangular detection box containing each human body image, then obtaining the first coordinates of the first rectangular detection box, and obtaining the second coordinates of each second rectangular detection box, and finally, based on the first coordinates, obtaining the human body image contained in the second rectangular detection box corresponding to the second coordinate closest to the first coordinate, as the human body image belonging to the same person as the first face image.
[0026] Furthermore, obtaining the first coordinate of the first rectangular detection box can involve obtaining the first corner coordinate of the first rectangular detection box and the second corner coordinate of the second corner diagonally opposite the first corner. The midpoint between the x-coordinate of the first corner and the x-coordinate of the second corner is taken as the x-coordinate of the first coordinate, and the midpoint between the y-coordinate of the first corner and the y-coordinate of the second corner is taken as the y-coordinate of the first coordinate. For example, if the first corner coordinate of the first rectangular detection box is (100, 200), and the second corner coordinate of the second corner diagonally opposite the first corner is (200, 300), then the x-coordinate of the first coordinate is... The ordinate of the first coordinate is That is, the first coordinate is (150, 250).
[0027] Furthermore, based on the first coordinate, obtaining the human body image contained in the second rectangular detection box corresponding to the second coordinate closest to the first coordinate can be obtaining the horizontal coordinate of the second coordinate closest to the horizontal coordinate of the first coordinate, and obtaining the human body image corresponding to the vertical coordinate of the first coordinate that is less than or equal to the vertical coordinate of the second coordinate. For example, in the above embodiment, the first coordinate is (150, 250), and there are three second coordinates (155, 258), (157, 255), and (152, 249). The absolute values of the coordinate differences between the abscissa of the first coordinate and the abscissa of each of the second coordinates are obtained. The absolute value of the first coordinate difference is |150-155| = 5, the absolute value of the second coordinate difference is |150-157| = 7, and the absolute value of the third coordinate difference is |150-152| = 2. Moreover, the second coordinates that satisfy the condition that the ordinate of the first coordinate is less than or equal to the ordinate of the second coordinate are (155, 258) and (157, 255). Therefore, the second coordinate closest to the first coordinate (150, 250) is (155, 258). Thus, the human body image corresponding to the second coordinate (155, 258) is the human body image of the same person as the first face image.
[0028] It should be noted that the first face image is any one of the face images.
[0029] When detecting individual face images in a target image, the target detection deep learning network can use the Yolov5_Face detection model for detection; when detecting individual human body images in a target image, the target detection deep learning network can use the Yolov5 detection model for detection; since the Yolov5_Face detection model and the Yolov5 detection model are detection methods commonly used by those skilled in the art, the detection principle will not be repeated in the embodiments of this application.
[0030] By detecting face images and body images in the target image, and then matching the face image with the body image belonging to the same person, it is possible to detect whether they belong to the same person from multiple dimensions of image features, effectively improving the accuracy of detection and the precision of deduplication and counting.
[0031] Step 102: Calculate the facial feature vector for each face image and the human feature vector for each human body image. Concatenate the facial feature vector and the human feature vector to obtain the feature vector to be counted for each person in the target image.
[0032] In this embodiment, a deep learning-based face recognition technology (InsightfaceResNet100) can be used to calculate the face feature vector of each face image, and a full-scale network recognition technology (OSNet) can be used to calculate the human feature vector of each human image. Then, the face feature vector and the human feature vector are concatenated to obtain the feature vector to be statistically analyzed for each person in the target image.
[0033] It should be noted that the dimensions of both the face feature vector and the body feature vector can be set according to actual needs, and the dimensions can also be obtained by adjusting the set dimensions according to actual needs. In this embodiment of the application, the calculated dimensions of the face feature vector and the body feature vector are 512. By concatenating the face feature vector and the body feature vector, the dimension of the feature vector to be statistically analyzed for each person in the target image is 1024.
[0034] Based on the above embodiments, in some modified implementations, before calculating the facial feature vector of each of the facial images and the human feature vector of each of the human body images, facial images whose image size is greater than a preset size threshold can be selected; and / or, facial images whose absolute value of the image angle is less than a preset angle threshold can be selected; and / or, facial images whose image integrity is greater than a preset image integrity threshold can be selected.
[0035] Based on the above embodiments, in some modified embodiments, before filtering out each face image whose image size is greater than a preset size threshold, the height of the target image can be obtained, and based on the height of the target image, the height of the preset size threshold is calculated by formula (1), and the width of the preset size threshold is calculated by formula (2):
[0036] FaceHeightThreshold=Max(100,ImageHeight / 10.8) (1)
[0037] FaceWidthThreshold=FaceHeightThreshold×0.8 (2)
[0038] Where FaceHeightThreshold represents the height of the preset size threshold, FaceWidthThreshold represents the width of the preset size threshold, and ImageHeight represents the height of the target image;
[0039] And / or, the image angles include pitch angle, roll angle and yaw angle. Before filtering out each face image whose absolute value of the image angle is less than a preset angle threshold, the first preset angle threshold for pitch angle and roll angle can be set to 38°, and the second preset angle threshold for yaw angle can be set to 46.5°.
[0040] And / or, before filtering out each face image whose image integrity is greater than the preset image integrity threshold, the image integrity threshold can be set to any value in the range of 0.6 to 1.
[0041] By judging the image size and / or image angle and / or image integrity of each face image, it is possible to effectively filter out different people who are severely occluded or different people who are dressed similarly. This avoids the impact of image size being too small, image angle being too large, or image integrity being severely occluded on deduplication, and significantly improves the accuracy and precision of deduplication statistics.
[0042] Step 103: Obtain the target similarity between each feature vector to be counted and the feature vectors already counted in the feature library.
[0043] In this embodiment, the statistical feature library contains multiple statistical feature vectors, and the dimension of each statistical feature vector is the same as the dimension of the feature vector to be statistically analyzed. In this application, all feature vectors to be statistically analyzed and all statistical feature vectors are 1024-dimensional feature vectors.
[0044] In one implementation, the similarity with each of the counted feature vectors can be calculated using formula (3) based on the face feature vector and body feature vector of the first feature vector to be counted, and the highest similarity is taken as the target similarity. Formula (3) is as follows:
[0045]
[0046] Where, sim k Let α represent the similarity between the first feature vector to be counted and the kth feature vector that has already been counted. F Let α represent the face feature vector in the first feature vector to be counted. P This represents the human feature vector in the first feature vector to be counted. This represents the face feature vector in the k-th statistical feature vector. Let w represent the human feature vector in the kth statistical feature vector, and w represent the weight.
[0047] It should be noted that the first feature vector to be counted is any one of all feature vectors to be counted.
[0048] The weights can be set by those skilled in the art according to actual needs, or they can be obtained by those skilled in the art by adjusting the set weights based on data from the actual scenario. This application does not impose specific limitations on the weights. In this application, the weights can be any value within the range of 0 to 1. For example, in the above embodiment, the weight can be 0.34.
[0049] By calculating the target similarity between each feature vector to be counted and the feature vectors already counted in the feature library, the weakness of using a single deduplication feature for deduplication statistics is avoided. By using multi-dimensional deduplication features of face feature vectors and human feature vectors, and by flexibly setting weights for these multi-dimensional deduplication features, the flexibility and universality of the deduplication statistics method are effectively improved, thereby improving the accuracy and precision of deduplication statistics.
[0050] Step 104: Count the number of people whose target similarity is less than the preset similarity threshold.
[0051] In one implementation, after obtaining the target similarity of each person through the implementation steps 101 to 103, the target similarity is compared with a preset similarity threshold. If the target similarity is less than the preset similarity threshold, it means that the person is different from the personnel information recorded in the statistical feature database, and the number of people counted is incremented by 1. If the target similarity is greater than or equal to the preset similarity threshold, it means that the person is the same person as the personnel information recorded in the statistical feature database, and the number of people counted remains unchanged.
[0052] Based on the above implementation methods, in some modified implementation methods, if the target similarity is less than a preset similarity threshold, the feature vector to be counted corresponding to the target similarity can be obtained as a new counted feature vector, and the new counted feature vector and the newly generated feature number can be saved to the counted feature library; if the target similarity is greater than or equal to the preset similarity threshold, the feature number of the counted feature vector corresponding to the target similarity and the feature vector to be counted corresponding to the target similarity can be obtained as a new counted feature vector, and the new counted feature vector and the feature number can be saved to the counted feature library.
[0053] By updating the statistical feature database, it is possible to effectively screen out whether the person to be counted is the same person as the person already counted, avoid duplicate counting, reduce deduplication errors, and improve the accuracy and precision of deduplication statistics.
[0054] This application embodiment extracts a frame of target image from the target video at preset time intervals, detects each face image and the human body image belonging to the same person in the target image, calculates the face feature vector of each face image and the human body feature vector of each human body image, and concatenates the face feature vector and the human body feature vector to obtain the feature vector to be counted for each person in the target image. This can count the number of people from multiple dimensions of deduplicated features, effectively improving the accuracy of deduplication statistics.
[0055] Furthermore, by obtaining the target similarity between each feature vector to be counted and the feature vectors already counted in the feature library, and counting the number of people whose target similarity is less than the preset similarity threshold, it is possible to effectively identify whether the feature vector to be counted has been counted, which greatly improves the accuracy of deduplication.
[0056] See Figure 2 This application also provides a device for counting duplicate users, which is used to perform the method for counting duplicate users described in the above embodiments. The device includes:
[0057] The detection module 201 is used to extract a frame of target image from the target video at preset time intervals and detect each face image and the human body image belonging to the same person in the target image.
[0058] The calculation and splicing module 202 is used to calculate the facial feature vector of each of the facial images and the human feature vector of each of the human images, and splice the facial feature vector and the human feature vector to obtain the feature vector to be counted for each person in the target image.
[0059] The acquisition module 203 is used to acquire the target similarity between each of the feature vectors to be counted and the feature vectors already counted in the feature library;
[0060] The statistics module 204 is used to count the number of people whose target similarity is less than a preset similarity threshold.
[0061] The deduplication counting device provided in this application embodiment is based on the same inventive concept as the deduplication counting method provided in the above embodiment, and has the same beneficial effects as the method used, operated or implemented therein.
[0062] This application also provides an electronic device corresponding to the deduplication and counting method provided in the foregoing embodiments. Please refer to... Figure 3 This illustrates a schematic diagram of an electronic device provided by some embodiments of this application. For example... Figure 3As shown, the electronic device 30 may include: a processor 300, a memory 301, a bus 302, and a communication interface 303. The processor 300, the communication interface 303, and the memory 301 are connected through the bus 302. The memory 301 stores a computer program that can run on the processor 300. When the processor 300 runs the computer program, it executes the deduplication counting method provided in any of the foregoing embodiments of this application.
[0063] The memory 301 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one physical port 303 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network.
[0064] Bus 302 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The memory 301 is used to store programs. After receiving an execution instruction, the processor 300 executes the program. The deduplication counting method disclosed in any of the foregoing embodiments of this application can be applied to the processor 300, or implemented by the processor 300.
[0065] The processor 300 may be an integrated circuit with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 300 or by instructions in software form. The processor 300 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 301. The processor 300 reads the information in memory 301 and, in conjunction with its hardware, completes the steps of the above method.
[0066] The electronic device provided in this application embodiment and the deduplication and counting method provided in this application embodiment are based on the same inventive concept and have the same beneficial effects as the methods they adopt, operate or implement.
[0067] This application also provides a computer-readable storage medium corresponding to the deduplication headcount counting method provided in the foregoing embodiments, which stores a computer program (i.e., a program product) thereon. When the computer program is run by a processor, it executes the deduplication headcount counting method provided in any of the foregoing embodiments.
[0068] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media, which will not be elaborated here.
[0069] This application also provides a computer program product corresponding to the deduplication headcount counting method provided in the foregoing embodiments, including a computer program that is executed by a processor to implement the deduplication headcount counting method provided in the above embodiments.
[0070] The computer-readable storage medium and computer program product provided in the above embodiments of this application are based on the same inventive concept as the deduplication and counting method provided in the embodiments of this application, and have the same beneficial effects as the methods adopted, run or implemented by the application stored therein.
[0071] It should be noted that:
[0072] The algorithms and displays provided herein are not inherently related to any particular computer, virtual device, or other equipment. Various general-purpose devices can also be used in conjunction with the teachings herein. The required structure for constructing such devices is apparent from the above description. Furthermore, this application is not directed to any particular programming language. It should be understood that the content of this application described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of this application.
[0073] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0074] Similarly, it should be understood that, in order to simplify this application and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of this application, various features of this application are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be construed as reflecting an intention that the claimed application requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of this application.
[0075] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0076] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of this application and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
[0077] The various component embodiments of this application can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the virtual machine creation apparatus according to embodiments of this application. This application can also be implemented as a device or apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such an implementation of this application can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0078] It should be noted that the above embodiments are illustrative of this application and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0079] The above description is merely a preferred embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for deduplicating the number of people, characterized in that, include: At preset time intervals, a frame of target image is extracted from the target video, and each face image and the human body image belonging to the same person in the target image are detected. Calculate the facial feature vector for each face image and the human feature vector for each human body image, and concatenate the facial feature vector and the human feature vector to obtain the feature vector to be counted for each person in the target image. The target similarity between each of the feature vectors to be counted and the feature vectors already counted in the feature library is obtained respectively; A number of people whose target similarity is less than a preset similarity threshold are counted; wherein, detecting human images in the target image that belong to the same person as the face image includes: Detect each human body image in the target image; Obtain the smallest first rectangular detection box containing the first face image, and obtain the smallest second rectangular detection box containing each of the human body images, wherein the first face image is any one of the face images; Obtain the first coordinates of the first rectangular detection box, and obtain the second coordinates of each of the second rectangular detection boxes; Obtain the x-coordinate of the second coordinate that is closest to the x-coordinate of the first coordinate, and obtain the human body image corresponding to the y-coordinate of the first coordinate that is less than or equal to the y-coordinate of the second coordinate, as the human body image belonging to the same person as the first face image.
2. The method for counting duplicate people according to claim 1, characterized in that, Before calculating the facial feature vector for each of the facial images and the human feature vector for each of the human body images, the method further includes: Each face image whose image size is greater than a preset size threshold is selected. And / or, respectively filter out each face image whose absolute value of the image angle is less than a preset angle threshold; And / or, respectively filter out each of the face images whose image integrity is greater than a preset image integrity threshold.
3. The method for counting duplicate people according to claim 2, characterized in that, Before selecting each face image whose image size is greater than a preset size threshold, the method further includes: The height of the target image is obtained, and based on the height of the target image, the height of the preset size threshold is calculated using formula (1), and the width of the preset size threshold is calculated using formula (2): in, This indicates a high preset size threshold. This indicates the width of the preset size threshold. Indicates the height of the target image; And / or, the image angles include pitch angle, roll angle, and yaw angle. Before selecting each face image whose absolute value of the image angle is less than a preset angle threshold, the method further includes: The first preset angle threshold for the pitch angle or roll angle is set to 38°, and the second preset angle threshold for the yaw angle is set to 46.5°. And / or, before selecting each face image whose image integrity is greater than a preset image integrity threshold, the method further includes: Set the image integrity threshold to any value within the range of 0.6 to 1.
4. The method for counting duplicate people according to claim 1, characterized in that, The statistical feature library contains multiple statistical feature vectors. The step of obtaining the target similarity between each of the feature vectors to be statistically analyzed and the statistical feature vectors in the statistical feature library includes: Based on the face feature vector and body feature vector of the first feature vector to be counted, the similarity with each of the counted feature vectors is calculated by formula (3), wherein the first feature vector to be counted is any one of all the feature vectors to be counted; The highest similarity is taken as the target similarity. in, This represents the similarity between the first feature vector to be counted and the kth feature vector that has already been counted. This represents the face feature vector in the first feature vector to be counted. This represents the human feature vector in the first feature vector to be counted. This represents the face feature vector in the k-th statistical feature vector. This represents the human feature vector in the k-th statistically analyzed feature vector. Indicates the weight.
5. The method for counting duplicate people according to claim 4, characterized in that, Also includes: If the target similarity is less than the preset similarity threshold, then the feature vector to be counted corresponding to the target similarity is obtained as a new counted feature vector, and the new counted feature vector and the newly generated feature number are saved to the counted feature library; If the target similarity is greater than or equal to the preset similarity threshold, then the feature number of the statistical feature vector corresponding to the target similarity is obtained, and the feature vector to be statistically analyzed corresponding to the target similarity is obtained as a new statistical feature vector. The new statistical feature vector and the feature number are saved to the statistical feature library.
6. A device for deduplicating the number of people, characterized in that, include: The detection module is used to extract a frame of target image from the target video at preset time intervals and detect each face image and the human body image belonging to the same person in the target image. The calculation and stitching module is used to calculate the facial feature vector of each face image and the human feature vector of each human body image, and stitch the facial feature vector and the human feature vector together to obtain the feature vector to be counted for each person in the target image. The acquisition module is used to acquire the target similarity between each of the feature vectors to be counted and the feature vectors already counted in the feature library; The statistics module is used to count the number of people whose target similarity is less than a preset similarity threshold; The detection module is used to detect each human body image in the target image; obtain a minimum first rectangular detection box containing a first face image, and obtain a minimum second rectangular detection box containing each of the human body images, wherein the first face image is any one of the face images; obtain the first coordinate of the first rectangular detection box, and obtain the second coordinate of each of the second rectangular detection boxes; obtain the abscissa of the second coordinate that is closest to the abscissa of the first coordinate, and obtain the human body image corresponding to the ordinate of the first coordinate that is less than or equal to the ordinate of the second coordinate, as the human body image belonging to the same person as the first face image.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method described in any one of claims 1-5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-5.