A face detection and tracking method and device

Face detection and tracking are performed simultaneously through the first neural network, and the correspondence between the feature set and the image is used to solve the problem of low efficiency of face detection and tracking in the existing technology, and achieve efficient face detection and tracking, and Improved the accuracy of people flow statistics.

CN112767436BActive Publication Date: 2024-10-01SHENZHEN INTELLIFUSION TECHNOLOGIES CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN201911001834.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-10-21
Publication Date
2024-10-01
Estimated Expiration
2039-10-21

AI Technical Summary

Technical Problem

In the existing technology, face detection and tracking need to be divided into two stages, resulting in numerous processing procedures and reducing the efficiency of face detection and tracking.

Method used

A face detection and tracking method is adopted to simultaneously detect and track faces through the first neural network, using the correspondence between feature sets and images to achieve the determination of face positions and identification allocation, avoiding staged processing and improving efficiency.

Benefits of technology

It realizes parallel processing of face detection and tracking, improves efficiency, and counts people flow through identification, which enhances the accuracy of people flow statistics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112767436B_ABST
    Figure CN112767436B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a face detection and tracking method and device, the method comprising: acquiring a video stream including M frames of images; determining the position of a first face in the first image and the corresponding relationship between the position of the first face in the first image and the position of the first face in the second image according to a first neural network, a first image and a feature set, the first image is any image in the M frames of images, the first face is any face among the faces included in the first image, the feature set is a set of features of N frames of images, the N frames of images are the first N frames of images adjacent to the first image in the video stream, and the second image is any image among the images in which a face corresponding to the first face exists in the N frames of images; assigning an identifier to the first face according to the position of the first face in the first image and the corresponding relationship; marking a face frame and an identifier for the first face in the first image according to the position of the first face in the first image and the identifier of the first face, so as to improve the efficiency of face detection and tracking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method and device for face detection and tracking. Background Art

[0002] With the continuous development of computer technology, neural networks are increasingly being used, such as face detection and face tracking. At present, when using neural networks to detect and track faces, it is necessary to first use the neural network to detect the face to obtain an image including a face frame, and then use the neural network to track the image including the face frame. In the above method, since face detection and face tracking need to be divided into two stages, there are many processing processes, which reduces the efficiency of face detection and tracking. Summary of the invention

[0003] The embodiment of the present invention provides a face detection and tracking method and device, which are used to improve the efficiency of face detection and tracking.

[0004] A first aspect provides a face detection and tracking method, comprising:

[0005] Acquire a video stream, wherein the video stream includes M frames of images, where M is an integer greater than 1;

[0006] Determine, according to a first neural network, a first image, and a feature set, a position of a first face in the first image, and a corresponding relationship between the position of the first face in the first image and the position of the first face in the second image, wherein the first image is any image in the M frames of images, the first face is any face in the faces included in the first image, the feature set is a set of features of N frames of images, the N frames of images are first N frames of images adjacent to the first image in the video stream, the second image is any image in the N frames of images in which a face corresponding to the first face exists, N is an integer greater than or equal to 0, and M is greater than N;

[0007] assigning an identifier to the first face according to the position of the first face in the first image and the corresponding relationship;

[0008] A face frame and an identifier are marked for the first face in the first image according to the position of the first face in the first image and the identifier of the first face.

[0009] The first neural network performs face detection on the first image and can use the feature set and the first image to track the face in the first image. It can be seen that face detection and face tracking are processed together and do not need to be performed in two stages. Therefore, the efficiency of face detection and tracking can be improved.

[0010] In one embodiment, determining the position of the first face in the first image and the correspondence between the position of the first face in the first image and the position of the first face in the second image according to the first neural network, the first image and the feature set includes:

[0011] Inputting the first image and the feature set into a first neural network to obtain facial features of a first face, a position of the first face in the first image, and a correspondence between the position of the first face in the first image and the position of the first face in the second image;

[0012] The method further comprises:

[0013] The feature set is updated according to facial features of the first face and a position of the first face in the first image.

[0014] The first neural network can not only detect the face to obtain the position of the face, but also extract the facial features of the face, so that the face can be tracked according to the facial features to obtain the corresponding relationship with the position of the face in other frames. In addition, based on the large correlation between the frames of the video stream, the features of the previous frame or frames output by the first neural network can be used as input and input into the first neural network together with the next frame. Since the input of the first neural network has the information of the previous frame, the correlation between the next frame and the previous frame can be determined to achieve tracking of the same face.

[0015] In one embodiment, updating the feature set according to the facial features of the first face and the position of the first face in the first image includes:

[0016] Using a second neural network to upsample and reduce the dimension of the facial features of the first face and the position of the first face in the first image;

[0017] The feature set is updated according to the processed facial features of the first face, the position of the first face in the first image, and the sequence number of the first image in the video stream.

[0018] Since there are differences in dimensions etc. between the features output by the first neural network and the directly extracted facial features, before the features in the feature set are input into the first neural network, the features must be processed first to ensure consistency with the features of the original image.

[0019] In one embodiment, assigning an identifier to the first face according to the position of the first face in the first image and the corresponding relationship includes:

[0020] In a case where the first human face has the corresponding relationship, determining the identifier of the first human face in the second image as the identifier of the first human face;

[0021] In the case that the first face does not have the corresponding relationship, a first identifier is assigned to the first face, where the first identifier is an identifier different from the assigned identifiers.

[0022] When assigning identifiers to faces, for an existing face, the original identifier can be assigned to it, and for a newly appeared face, a new identifier can be assigned, thereby avoiding assigning multiple identifiers to the same face.

[0023] In one embodiment, the method further comprises:

[0024] extracting the logo in the annotated first image;

[0025] The flow of people is counted according to the identification.

[0026] The flow of people can be counted by identifying the faces marked in the image.

[0027] In one embodiment, the method further comprises:

[0028] Extracting a face frame in the annotated first image;

[0029] The counting of the flow of people according to the identifier comprises:

[0030] Determine the movement trajectory of the person based on the extracted identifier and face frame;

[0031] The flow of people in different directions is counted according to the movement trajectory.

[0032] The face frames and logos of the faces marked in the image can be used to count the flow of people in different directions, which can improve the accuracy of the flow of people statistics.

[0033] The second aspect provides a face detection and tracking device, comprising a unit for executing the face detection and tracking method provided by the first aspect or any embodiment of the first aspect.

[0034] The third aspect provides a face detection and tracking device, comprising a processor and a memory, wherein the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to call the program instructions to execute the face detection and tracking method provided by the first aspect or any embodiment of the first aspect.

[0035] A fourth aspect provides a readable storage medium, wherein the readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the face detection and tracking method provided by the first aspect or any embodiment of the first aspect.

[0036] The fifth aspect provides an application program, which is used to execute the face detection and tracking method provided by the first aspect or any embodiment of the first aspect during runtime. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are 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.

[0038] Figure 1 It is a flowchart of a face detection and tracking method provided by an embodiment of the present invention;

[0039] Figure 2 It is a flowchart of another face detection and tracking method provided by an embodiment of the present invention;

[0040] Figure 3 It is a structural schematic diagram of a face detection and tracking device provided by an embodiment of the present invention;

[0041] Figure 4 is a structural schematic diagram of another face detection and tracking device provided by an embodiment of the present invention;

[0042] Figure 5 The present invention provides a schematic diagram of face detection and tracking. DETAILED DESCRIPTION

[0043] 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 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 creative work are within the scope of protection of the present invention.

[0044] The embodiments of the present invention provide a face detection and tracking method and device, which can improve the efficiency of face detection and tracking.

[0045] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of a face detection and tracking method provided by an embodiment of the present invention. Figure 1 Some steps in the flowchart shown can be split into several steps. Figure 1 As shown, the face detection and tracking method may include the following steps.

[0046] 101. Obtain a video stream including M frames of images.

[0047] When face detection and tracking is required for a video stream, a video stream is obtained. The video stream includes M frames of images, where M is an integer greater than 1. The video stream may be a locally stored video stream, a video stream obtained from a network or a server, or a video stream collected by a collection device. The video stream may be all video streams that need to be detected and tracked, or may be part of the video streams that need to be detected and tracked.

[0048] 102. Determine, based on the first neural network, the first image, and the feature set, a position of the first face in the first image, and a correspondence between the position of the first face in the first image and the position of the first face in the second image.

[0049] After obtaining the video stream, the position of the first face in the first image and the corresponding relationship between the position of the first face in the first image and the position of the first face in the second image can be determined according to the first neural network, the first image and the feature set. The corresponding relationship between the position of the first face in the first image and the position in the second image, that is, the faces corresponding to the first position and the second position are the faces of the same person, that is, the positions corresponding to the same face in the two images are linked, so that the face with the assigned identifier can be assigned the identifier to the face of the person appearing in the subsequent image according to this connection, without the need to reassign the identifier as a newly appearing face, and different identifiers can be avoided for the faces of the same person in different images. The first position is the position of the first face in the first image, and the second position is the position of the first face in the second image. The first image and the feature set can be input into the first neural network to obtain the facial features of the first face, the position of the first face in the first image, and the corresponding relationship between the position of the first face in the first image and the position of the first face in the second image. The first image is any image in the M frames of images, the first face is any face in the faces included in the first image, the feature set is a set of features of the N frames of images, the N frames of images are the first N frames of images adjacent to the first image in the video stream, the second image is any image in the N frames of images in which the first face corresponds to the face, N is an integer greater than or equal to 0, and M is greater than N. For example, the first image is the tenth frame of the video stream, the N frames of images can be the first to ninth frames of the video stream, or the second to ninth frames of the video stream, or the third to ninth frames of the video stream, or the fourth to ninth frames of the video stream, or the fifth to ninth frames of the video stream, or the sixth to ninth frames of the video stream, or the seventh to ninth frames of the video stream, or the eighth to ninth frames of the video stream, or the ninth frame of the video stream. In the case where there is no image before the first image, N is 0, and in the case where there is an image before the first image, N is an integer greater than or equal to 1. The second image is any image in the N-frame images in which there is a face corresponding to the first face, that is, the second image has a face of the same person as in the first image, that is, the second image is any image in the N-frame images that has a face corresponding to the same person as in the first image. The second image can be the first frame image in the N-frame images, or the Nth frame image in the N-frame images, or any other frame image in the N-frame images. The first neural network can be a mobile Internet (MobileNet) network, or a residual network (ResNet), or other neural networks with equivalent functions.

[0050] 103. Assign a label to the first face according to the position of the first face in the first image and the corresponding relationship.

[0051] After determining the position of the first face in the first image and the corresponding relationship between the position of the first face in the first image and the position of the first face in the second image according to the first neural network, the first image and the feature set, an identifier can be assigned to the first face according to the position of the first face in the first image and the corresponding relationship. In the case where there is a corresponding relationship between the first face, the identifier of the first face in the second image is determined as the identifier of the first face, that is, in the case where the first face is not a new face, since the identifier has been assigned to the first face before, the identifier previously assigned to the first face can be directly assigned to the first face. In the case where there is no corresponding relationship between the first face, that is, in the case where the first face is a new face, since the identifier has not been assigned to the first face before, a first identifier can be assigned to the first face, and the first identifier is an identifier different from the identifier that has been assigned. The corresponding relationship between the position of the first face in the first image and the position of the first face in the second image indicates that the faces at the corresponding positions in the two frames of images are the faces of the same person.

[0052] 104. Label a face frame and an identifier for the first face in the first image according to the position of the first face in the first image and the identifier of the first face.

[0053] After assigning an identifier to the first face according to the position of the first face in the first image and the corresponding relationship, a face frame and an identifier can be annotated for the first face in the first image according to the position of the first face in the first image and the identifier of the first face, that is, a face frame and an identifier are annotated for each face in the first image.

[0054] exist Figure 1 In the described face detection and tracking method, the first neural network performs face detection on the first image, and can use the feature set and the first image to track the face in the first image. It can be seen that face detection and face tracking are processed together and do not need to be performed in two stages. Therefore, the efficiency of face detection and tracking can be improved.

[0055] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of another face detection and tracking method provided by an embodiment of the present invention. Figure 2 Some steps in the flowchart shown can be split into several steps. Figure 2 As shown, the face detection and tracking method may include the following steps.

[0056] 201. Obtain a video stream including M frames of images.

[0057] When face detection and tracking is required for a video stream, a video stream is obtained. The video stream includes M frames of images, where M is an integer greater than 1. The video stream may be a locally stored video stream, a video stream obtained from a network or a server, or a video stream collected by a collection device. The video stream may be all video streams that need to be detected and tracked, or may be part of the video streams that need to be detected and tracked.

[0058] 202. Determine, based on the first neural network, the first image, and the feature set, a position of the first face in the first image, and a correspondence between the position of the first face in the first image and the position of the first face in the second image.

[0059] After acquiring the video stream, the position of the first face in the first image and the corresponding relationship between the position of the first face in the first image and the position of the first face in the second image can be determined according to the first neural network, the first image and the feature set. The first image and the feature set can be input into the first neural network to obtain the facial features of the first face, the position of the first face in the first image, and the corresponding relationship between the position of the first face in the first image and the position of the first face in the second image. Among them, the first image is any image in the M-frame images, the first face is any face included in the first image, the feature set is a set of features of the N-frame images, the N-frame images are the first N-frame images adjacent to the first image in the video stream, the second image is any image in the N-frame images where there is a face corresponding to the first face, N is an integer greater than or equal to 0, and M is greater than N. For example, the first image is the tenth frame image in the video stream, and the N frame images can be the first frame image to the ninth frame image in the video stream, or the second frame image to the ninth frame image, or the third frame image to the ninth frame image, or the fourth frame image to the ninth frame image, or the fifth frame image to the ninth frame image, or the sixth frame image to the ninth frame image, or the seventh frame image to the ninth frame image, or the eighth frame image to the ninth frame image, or the ninth frame image. In the case where there is no image before the first image, N is 0, and in the case where there is an image before the first image, N is an integer greater than or equal to 1.

[0060] 203. Update the feature set according to the facial features of the first face and the position of the first face in the first image.

[0061] After inputting the first image and the feature set into the first neural network, obtaining the facial features of the first face, the position of the first face in the first image, and the correspondence between the position of the first face in the first image and the position of the first face in the second image, the feature set can be updated according to the facial features of the first face and the position of the first face in the first image. The facial features of the first face and the position of the first face in the first image can be upsampled and reduced in dimension using the second neural network, and then the feature set can be updated according to the facial features of the first face after processing, the position of the first face in the first image, and the sequence number of the first image in the video stream. The facial features of the first face after processing and the position of the first face in the first image can be directly added to the feature set. In the case of limited cache space, or the setting value needs to store information of a fixed number of frames, if there are many features stored in the feature set, before adding the facial features of the first face after processing and the position of the first face in the first image to the feature set, the information of the face with the longest existence in the feature set can be deleted. The updated feature set can be input into the first neural network together with the next frame of image. The second neural network can be a network composed of convolutional layers. The position of the first face in the second image, that is, the position of the corresponding face in the second image.

[0062] 204. Assign a label to the first face according to the position of the first face in the first image and the corresponding relationship.

[0063] After determining the position of the first face in the first image and the corresponding relationship between the position of the first face in the first image and the position of the first face in the second image according to the first neural network, the first image and the feature set, an identifier can be assigned to the first face according to the position of the first face in the first image and the corresponding relationship. In the case where there is a corresponding relationship between the first face, the identifier of the first face in the second image is determined as the identifier of the first face, that is, in the case where the first face is not a new face, since the identifier has been assigned to the first face before, the identifier previously assigned to the first face can be directly assigned to the first face. In the case where there is no corresponding relationship between the first face, that is, in the case where the first face is a new face, since the identifier has not been assigned to the first face before, a first identifier can be assigned to the first face, and the first identifier is an identifier different from the identifier that has been assigned. The corresponding relationship between the position of the first face in the first image and the position of the first face in the second image indicates that the faces at the corresponding positions in the two frames of images are the faces of the same person.

[0064] 205. Label a face frame and an identifier for the first face in the first image according to the position of the first face in the first image and the identifier of the first face.

[0065] After assigning an identifier to the first face according to the position of the first face in the first image and the corresponding relationship, a face frame and an identifier can be annotated for the first face in the first image according to the position of the first face in the first image and the identifier of the first face, that is, a face frame and an identifier are annotated for each face in the first image.

[0066] 206 . Extract the identifier and the face frame in the annotated first image, determine the movement trajectory of the person according to the extracted identifier and face frame, and count the flow of people in different directions according to the movement trajectory.

[0067] After labeling the first face in the first image with a face frame and an identifier according to the position of the first face in the first image and the identifier of the first face, the identifier in the labeled first image can be extracted, and the flow of people can be counted only by the extracted identifier. The identifier and face frame in the labeled first image can also be extracted, and the movement trajectory of the person can be determined according to the extracted identifier and face frame, and the flow of people in different directions can be counted according to the movement trajectory. Whether the user is leaving or coming in can be determined according to the movement trajectory.

[0068] exist Figure 2 In the described face detection and tracking method, the first neural network performs face detection on the first image, and can use the feature set and the first image to track the face in the first image. It can be seen that face detection and face tracking are processed together and do not need to be performed in two stages. Therefore, the efficiency of face detection and tracking can be improved.

[0069] See also Figure 5 , Figure 5 FIG. 1 is a schematic diagram of face detection and tracking provided by an embodiment of the present invention. Figure 5 As shown, the feature set of the first image and the image before the first image can be input into the first neural network together, and then the output of the first neural network can be divided into two paths, one of which is used to input the feature set so that the updated feature set and the next frame image can be input into the first neural network together, and face recognition and face tracking can be achieved based on the next frame image and the updated feature set, and the other path is used to determine the position and identification of each face in the first image.

[0070] See also Figure 3 , Figure 3 FIG. 1 is a schematic diagram of the structure of a face detection and tracking device provided by an embodiment of the present invention. Figure 3 As shown, the face detection and tracking device may include:

[0071] An acquisition unit 301 is used to acquire a video stream, where the video stream includes M frames of images, where M is an integer greater than 1;

[0072] A determining unit 302 is used to determine a position of a first face in the first image and a corresponding relationship between the position of the first face in the first image and the position of the first face in the second image according to the first neural network, the first image and the feature set, wherein the first image is any image in the M image frames, the first face is any face in the faces included in the first image, the feature set is a set of features of the N image frames, the N image frames are the first N image frames adjacent to the first image in the video stream, the second image is any image in the N image frames where a face corresponding to the first face exists, N is an integer greater than or equal to 0, and M is greater than N;

[0073] An allocating unit 303, configured to allocate an identifier to the first face according to the position and the corresponding relationship of the first face in the first image;

[0074] The labeling unit 304 is used to label the first face in the first image with a face frame and an identifier according to the position of the first face in the first image and the identifier of the first face.

[0075] In one embodiment, the determination unit 302 is specifically configured to input the first image and the feature set into the first neural network to obtain facial features of the first face, the position of the first face in the first image, and the correspondence between the position of the first face in the first image and the position of the first face in the second image;

[0076] The face detection and tracking device may also include:

[0077] The updating unit 305 is used to update the feature set according to the facial features of the first face and the position of the first face in the first image.

[0078] In one embodiment, the updating unit 305 is specifically configured to:

[0079] Using a second neural network, upsampling and dimensionality reduction processing is performed on facial features of the first face and a position of the first face in the first image;

[0080] The feature set is updated according to the processed facial features of the first face, the position of the first face in the first image, and the sequence number of the first image in the video stream.

[0081] In one embodiment, the allocation unit 303 is specifically configured to:

[0082] In the case where there is a corresponding relationship with the first face, determining the identifier of the first face in the second image as the identifier of the first face;

[0083] In the case that there is no corresponding relationship with the first face, a first identifier is assigned to the first face, where the first identifier is an identifier different from the assigned identifiers.

[0084] In one embodiment, the face detection and tracking device may further include:

[0085] An extraction unit 306, configured to extract the logo in the annotated first image;

[0086] The counting unit 307 is used to count the flow of people according to the extracted identifiers.

[0087] In one embodiment, the extraction unit 306 is further configured to extract a face frame in the annotated first image;

[0088] The statistical unit 307 is specifically used for:

[0089] Determine the movement trajectory of the person based on the extracted identifier and face frame;

[0090] Count the flow of people in different directions based on movement trajectories.

[0091] For a more detailed description of the acquisition unit 301, the determination unit 302, the allocation unit 303, the marking unit 304, the update unit 305, the extraction unit 306 and the statistics unit 307, please refer to the above Figure 1-Figure 2 The relevant description in the illustrated method embodiment is directly obtained and will not be repeated here.

[0092] See also Figure 4 , Figure 4 FIG. 1 is a schematic diagram of the structure of another face detection and tracking device provided by an embodiment of the present invention. Figure 4 As shown, the face detection and tracking device may include a processor 401, a memory 402 and a bus 403. The memory 402 may exist independently or be integrated with the processor 401. The bus 403 transmits information between the above components. Among them:

[0093] A set of program codes is stored in the memory 402, and the processor 401 is used to call the program codes stored in the memory 402 to perform the following operations:

[0094] Get a video stream, the video stream includes M frames of images, where M is an integer greater than 1;

[0095] Determine, according to the first neural network, the first image and the feature set, a position of the first face in the first image, and a corresponding relationship between the position of the first face in the first image and the position of the first face in the second image, wherein the first image is any image in the M-frame images, the first face is any face in the faces included in the first image, the feature set is a set of features of the N-frame images, the N-frame images are the first N-frame images adjacent to the first image in the video stream, the second image is any image in the N-frame images in which a face corresponding to the first face exists, N is an integer greater than or equal to 0, and M is greater than N;

[0096] assigning an identifier to the first face according to the position of the first face in the first image and the corresponding relationship;

[0097] A face frame and an identifier are marked for the first face in the first image according to the position of the first face in the first image and the identifier of the first face.

[0098] In one embodiment, the processor 401 determines the position of the first face in the first image and the corresponding relationship between the position of the first face in the first image and the position of the first face in the second image according to the first neural network, the first image and the feature set, including:

[0099] Inputting the first image and the feature set into a first neural network, obtaining facial features of the first face, the position of the first face in a frame of the image, and a correspondence between the position of the first face in the first image and the position of the first face in the second image;

[0100] The processor 401 is further configured to call the program code stored in the memory 402 to perform the following operations:

[0101] The feature set is updated according to the facial features of the first face and the position of the first face in the first image.

[0102] In one embodiment, the processor 401 updates the feature set according to the facial features of the first face and the position of the first face in the first image, including:

[0103] Using a second neural network, upsampling and dimensionality reduction processing is performed on facial features of the first face and a position of the first face in the first image;

[0104] The feature set is updated according to the processed facial features of the first face, the position of the first face in the first image, and the sequence number of the first image in the video stream.

[0105] In one embodiment, the processor 401 assigns an identifier to the first face according to the position and the corresponding relationship of the first face in the first image, including:

[0106] In the case where there is a corresponding relationship with the first face, determining the identifier of the first face in the second image as the identifier of the first face;

[0107] In the case that there is no corresponding relationship with the first face, a first identifier is assigned to the first face, where the first identifier is an identifier different from the assigned identifiers.

[0108] In one embodiment, the processor 401 is further configured to call the program code stored in the memory 402 to perform the following operations:

[0109] extracting the logo in the annotated first image;

[0110] Count the flow of people based on the extracted identifiers.

[0111] In one embodiment, the processor 401 is further configured to call the program code stored in the memory 402 to perform the following operations:

[0112] Extracting a face frame in the annotated first image;

[0113] Processor 401 counts the flow of people according to the extracted identifier, including:

[0114] Determine the movement trajectory of the person based on the extracted identifier and face frame;

[0115] Count the flow of people in different directions based on movement trajectories.

[0116] Among them, steps 101-104 and steps 201-206 can be executed by the processor 401 and the memory 402 in the face detection and tracking device.

[0117] The acquiring unit 301 , the determining unit 302 , the allocating unit 303 , the labeling unit 304 , the updating unit 305 , the extracting unit 306 and the statistical unit 307 may be implemented by the processor 401 and the memory 402 in the face detection and tracking device.

[0118] The above-mentioned face detection and tracking device can also be used to execute various methods executed in the above-mentioned method embodiments, which will not be described in detail.

[0119] In one embodiment, a readable storage medium is provided, the readable storage medium is used to store an application program, the application program is used to execute at runtime Figure 1 or Figure 2 Face detection and tracking method.

[0120] In one embodiment, an application is provided for executing at runtime Figure 1 or Figure 2 Face detection and tracking method.

[0121] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0122] The embodiments of the present invention are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A face detection and tracking method, characterized in that: include: Acquire a video stream, wherein the video stream includes M frames of images, where M is an integer greater than 1; Determining the position of a first face in the first image and the corresponding relationship between the position of the first face in the first image and the position of the first face in the second image according to a first neural network, the first image and the feature set, comprising: inputting the first image and the feature set into the first neural network to obtain facial features of the first face, the position of the first face in the first image, and the corresponding relationship between the position of the first face in the first image and the position of the first face in the second image, the first image is any image in the M frames of images, the first face is any face among the faces included in the first image, the feature set is a set of features of N frames of images, the N frames of images are the first N frames of images adjacent to the first image in the video stream, the second image is any image among the images in which a face corresponding to the first face exists in the N frames of images, N is an integer greater than or equal to 0, and M is greater than N; updating the feature set according to the facial features of the first face and the position of the first face in the first image, so that the updated feature set and the next frame of image are input into the first neural network; According to the position of the first face in the first image and the corresponding relationship, assigning an identifier to the first face includes: if the first face has the corresponding relationship, determining the identifier of the first face in the second image as the identifier of the first face; if the first face does not have the corresponding relationship, assigning a first identifier to the first face, the first identifier being an identifier different from the assigned identifier; A face frame and an identifier are marked for the first face in the first image according to the position of the first face in the first image and the identifier of the first face.

2. The method according to claim 1, characterized in that The updating of the feature set according to the facial features of the first face and the position of the first face in the first image comprises: Using a second neural network to upsample and reduce the dimension of the facial features of the first face and the position of the first face in the first image; The feature set is updated according to the processed facial features of the first face, the position of the first face in the first image, and the sequence number of the first image in the video stream.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: extracting the logo in the annotated first image; The flow of people is counted according to the identification.

4. The method according to claim 3, characterized in that The method further comprises: Extracting a face frame in the annotated first image; The counting of the flow of people according to the identifier comprises: Determine the movement trajectory of the person based on the extracted identifier and face frame; The flow of people in different directions is counted according to the movement trajectory.

5. A face detection and tracking device, characterized in that: include: An acquisition unit, used for acquiring a video stream, wherein the video stream includes M frames of images, where M is an integer greater than 1; a determining unit, configured to determine, according to a first neural network, a first image, and a feature set, a position of a first face in the first image, and a corresponding relationship between the position of the first face in the first image and the position of the first face in the second image, comprising: inputting the first image and the feature set into the first neural network to obtain facial features of the first face, the position of the first face in the first image, and a corresponding relationship between the position of the first face in the first image and the position of the first face in the second image, wherein the first image is any image in the M frames of images, the first face is any face among the faces included in the first image, the feature set is a set of features of N frames of images, the N frames of images are first N frames of images adjacent to the first image in the video stream, the second image is any image among the images in which a face corresponding to the first face exists in the N frames of images, N is an integer greater than or equal to 0, and M is greater than N; an updating unit, configured to update the feature set according to the facial features of the first face and the position of the first face in the first image, so that the updated feature set and the next frame of image are input into the first neural network; an allocating unit, configured to allocate an identifier to the first face according to the position of the first face in the first image and the corresponding relationship, including: if the first face has the corresponding relationship, determining the identifier of the first face in the second image as the identifier of the first face; if the first face does not have the corresponding relationship, allocating a first identifier to the first face, the first identifier being an identifier different from the already allocated identifier; The labeling unit is used to label the first face in the first image with a face frame and an identifier according to the position of the first face in the first image and the identifier of the first face.

6. A face detection and tracking device, characterized in that: It includes a processor and a memory, the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to call the program instructions to execute the face detection and tracking method according to any one of claims 1 to 4.

7. A storage medium, characterized in that: The storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the processor executes the face detection and tracking method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Video processing method and apparatus

    CN105354543A

  • Tracking method, device and system for face characteristic information

    CN108875480A

  • Face-tracking method and device

    CN109344789A

  • Video processing method and device, medium and electronic device

    CN109543604A

  • Face positioning method and device, terminal equipment and storage medium

    CN109871760A