[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

WO2022247091A1 - 人群定位方法及装置、电子设备和存储介质 - Google Patents

人群定位方法及装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2022247091A1
WO2022247091A1 PCT/CN2021/121767 CN2021121767W WO2022247091A1 WO 2022247091 A1 WO2022247091 A1 WO 2022247091A1 CN 2021121767 W CN2021121767 W CN 2021121767W WO 2022247091 A1 WO2022247091 A1 WO 2022247091A1
Authority
WO
WIPO (PCT)
Prior art keywords
crowd
target
map
feature
positioning
Prior art date
Application number
PCT/CN2021/121767
Other languages
English (en)
French (fr)
Inventor
杨昆霖
李昊鹏
侯军
伊帅
Original Assignee
上海商汤智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海商汤智能科技有限公司 filed Critical 上海商汤智能科技有限公司
Publication of WO2022247091A1 publication Critical patent/WO2022247091A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • G06V20/53Recognition of crowd images, e.g. recognition of crowd congestion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/41Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/46Extracting features or characteristics from the video content, e.g. video fingerprints, representative shots or key frames

Definitions

  • the present disclosure relates to the field of computer technology, and in particular to a crowd positioning method and device, electronic equipment, and a storage medium.
  • Crowd analysis is of great significance to public safety and urban planning.
  • Common crowd analysis tasks include crowd counting, crowd behavior analysis, crowd positioning, etc.
  • crowd positioning is the basis of other crowd analysis tasks.
  • Crowd positioning refers to estimating the position of the human body included in the image or video through computer vision algorithms, and determining the coordinates of the human body included in the image or video, so as to provide data basis for subsequent crowd analysis tasks such as crowd counting and group behavior analysis.
  • the accuracy of crowd positioning directly affects the accuracy of crowd counting and the results of crowd behavior analysis. Therefore, there is an urgent need for a crowd location method with high accuracy.
  • the disclosure proposes a crowd positioning method and device, electronic equipment, and a storage medium technical solution.
  • a method for crowd positioning including: performing feature extraction on at least two frames of crowd images obtained from crowd video clips to obtain at least two first feature maps; determining the target first feature map The feature neighborhood corresponding to the target pixel point in the at least two first feature maps, wherein the target first feature map is the first feature map corresponding to the target crowd image in the at least two frames of crowd images ; Based on the feature neighborhood corresponding to the target pixel point, the at least two first feature maps are fused to obtain a second feature map corresponding to the target crowd image; crowd positioning is performed according to the second feature map, A target positioning map corresponding to the target group image is obtained, wherein the target positioning map is used to indicate the positions of human bodies included in the target group image.
  • a crowd positioning device including: a feature extraction module, configured to perform feature extraction on at least two frames of crowd images obtained from crowd video clips, to obtain at least two first feature maps; A feature neighborhood determination module, configured to determine a feature neighborhood corresponding to a target pixel in the target first feature map in the at least two first feature maps, wherein the target first feature map is the same as the at least two The first feature map corresponding to the target crowd image in the frame crowd image; the feature fusion module is used to fuse the at least two first feature maps based on the feature neighborhood corresponding to the target pixel to obtain the target A second feature map corresponding to the crowd image; a crowd positioning module, configured to perform crowd positioning according to the second feature map, and obtain a target positioning map corresponding to the target crowd image, wherein the target positioning map is used to indicate the The location of the human body included in the target population image.
  • an electronic device including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the above-mentioned method.
  • a computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented.
  • a computer program product including computer readable codes, or a non-volatile computer readable storage medium bearing computer readable codes, when the computer readable codes are stored in an electronic device
  • the processor in the electronic device is used to implement the above method.
  • feature extraction is performed on at least two frames of crowd images obtained from crowd video clips to obtain at least two first feature maps;
  • the corresponding feature neighborhood in the figure wherein the target first feature map is the first feature map corresponding to the target crowd image in at least two frames of crowd images; based on the feature neighborhood corresponding to the target pixel point, for at least two first feature maps
  • the images are fused to obtain the second feature map corresponding to the image of the target crowd; the crowd positioning is performed according to the second feature map to obtain the target positioning map corresponding to the target crowd image, wherein the target positioning map is used to indicate the location of the human body included in the target crowd image Location.
  • the fused second feature map can reflect the spatio-temporal relationship between different frames of crowd images, so that after using the second feature map for crowd positioning, a target positioning map with high accuracy corresponding to the target crowd image can be obtained , thus effectively improving the accuracy of crowd positioning.
  • FIG. 1 shows a flow chart of a crowd positioning method according to an embodiment of the present disclosure
  • Fig. 2 shows a schematic diagram of feature fusion according to an embodiment of the present disclosure
  • Fig. 3 shows a schematic diagram of a crowd positioning neural network according to an embodiment of the present disclosure
  • Fig. 4 shows a block diagram of a crowd locating device according to an embodiment of the present disclosure
  • Fig. 5 shows a block diagram of an electronic device according to an embodiment of the present disclosure
  • Fig. 6 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • Fig. 1 shows a flow chart of a crowd locating method according to an embodiment of the present disclosure.
  • the crowd positioning method can be performed by electronic devices such as terminal equipment or servers, and the terminal equipment can be user equipment (User Equipment, UE), mobile equipment, user terminal, cellular phone, cordless phone, personal digital assistant (Personal Digital Assistant, PDA) , handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc.
  • the crowd positioning method can be realized by calling computer-readable instructions stored in a memory by a processor.
  • the crowd locating method can be executed by a server.
  • the crowd positioning method may include:
  • step S11 feature extraction is performed on at least two frames of crowd images obtained from crowd video clips respectively, to obtain at least two first feature maps.
  • the crowd video segment here is a video segment including multiple frames of crowd images, which can be a dense crowd within a certain spatial range (for example, a square, a shopping mall, a subway station, a tourist attraction, etc.) It may be obtained after video collection, or may be obtained by other means, which is not specifically limited in the present disclosure.
  • a certain spatial range for example, a square, a shopping mall, a subway station, a tourist attraction, etc.
  • the image acquisition device collects videos of dense crowds, and after obtaining the original crowd video, when the frame rate of the original crowd video is high, the difference between adjacent frames of crowd images in the original crowd video is small,
  • the frame rate downsampling of the original crowd video with a higher frame rate can be performed to obtain the crowd video clips with a frame rate lower than the threshold, so that the adjacent frames in the crowd video clips
  • the difference between crowd images is large, so that the spatio-temporal relationship between different frames of crowd images in crowd video clips can be better utilized to achieve crowd positioning with better accuracy.
  • a crowd video clip has a frame rate of 5 frames per second.
  • the crowd image of the crowd video segment may include other background parts in addition to the dense crowd, in order to better perform crowd positioning , the crowd image can be cropped to retain the dense crowd included in the crowd image.
  • the cropped crowd images need to have the same scale to ensure that subsequent image processing operations such as feature extraction and feature fusion can be implemented on the crowd images.
  • the crowd video segment includes multiple frames of crowd images, and at least two frames of crowd images are obtained from the crowd video segment for feature extraction, wherein the number of frames of the crowd image obtained from the crowd video segment for feature extraction can be determined according to the actual situation, for example , 2 frames, 3 frames, 5 frames, 7 frames, etc., which are not specifically limited in the present disclosure.
  • Feature extraction is performed on at least two frames of crowd images, specifically, feature extraction may be performed on at least two frames of crowd images through a feature extraction module in a convolutional neural network to obtain at least two first feature maps.
  • the feature extraction process will be described in detail later in combination with possible implementations of the present disclosure, and will not be repeated here.
  • step S12 determine the feature neighborhood corresponding to the target pixel point in the target first feature map in at least two first feature maps, wherein the target first feature map corresponds to the target crowd image in at least two frames of crowd images The first feature map of .
  • the target crowd image here is a certain frame of at least two frames of crowd images acquired from crowd video clips.
  • it may be the first frame crowd image in at least two frames of crowd images; it may be the last frame crowd image in at least two frames of crowd images; it may be an odd-numbered frame crowd image greater than or equal to 3 frames obtained from the crowd video clip
  • the target crowd image may be the middle frame crowd image among the odd-numbered crowd images greater than or equal to 3 frames; it may also be any one frame crowd image among at least two frames of crowd images, which is not specifically limited in the present disclosure.
  • the first feature map corresponding to the target crowd image is determined as the target first feature map.
  • three frames of crowd images I 1 , I 2 , and I 3 are obtained from crowd video clips, feature extraction is performed on the three frames of crowd images respectively, and three first feature maps are obtained: the first feature map corresponding to crowd image I 1 X 1 , the first feature map X 2 corresponding to the crowd image I 2 , and the first feature map X 3 corresponding to the crowd image I 3 .
  • the first feature map X 2 is the target first feature map.
  • the feature neighborhood corresponding to the target pixel point is determined in the first feature map X1 , the first feature map X2 and the first feature map X3 respectively .
  • the specific process of determining the feature neighborhood corresponding to the target pixel will be described in detail later in combination with possible implementations of the present disclosure, and details will not be repeated here.
  • step S13 based on the feature neighborhood corresponding to the target pixel point, at least two first feature maps are fused to obtain a second feature map corresponding to the target crowd image.
  • At least two first feature maps are fused in the feature neighborhood of at least two first feature maps, so that in the feature fusion process, both
  • the spatial information in the image of the target group can be used, and the time sequence information between different frames of the image of the group can be used to obtain a second feature map corresponding to the image of the target group with more robust semantic features.
  • the feature fusion process will be described in detail later in combination with possible implementations of the present disclosure, and will not be repeated here.
  • step S14 crowd positioning is performed according to the second feature map to obtain a target positioning map corresponding to the target crowd image, wherein the target positioning map is used to indicate the position of the human body included in the target crowd image.
  • the second feature map obtained after feature fusion can reflect the spatio-temporal relationship between different frames of crowd images
  • a target positioning map with high accuracy corresponding to the target crowd image can be obtained .
  • the crowd locating process will be described in detail later in combination with possible implementations of the present disclosure, and will not be repeated here.
  • feature extraction is performed on at least two frames of crowd images obtained from crowd video clips to obtain at least two first feature maps;
  • the corresponding feature neighborhood in the feature map wherein the target first feature map is the first feature map corresponding to the target crowd image in at least two frames of crowd images; based on the feature neighborhood corresponding to the target pixel point, for at least two second A feature map is fused to obtain a second feature map corresponding to the target group image; crowd positioning is performed according to the second feature map to obtain a target positioning map corresponding to the target group image, wherein the target positioning map is used to indicate the target group image. position of the human body.
  • crowd positioning of target crowd images by using crowd video clips can mine the timing information in the crowd video clips, so that the accuracy of crowd positioning can be improved.
  • the corresponding first feature map of the adjacent frame image The feature neighborhood of the crowd video clip can capture the long-distance correlation between pixels in different frames of the crowd image, so that the fusion of at least two first feature maps can mine more sufficient and robust feature information.
  • a target positioning map with high accuracy corresponding to the target crowd image can be obtained, thus effectively Improve the accuracy of crowd positioning.
  • the feature extraction module in the convolutional neural network may be used to perform feature extraction on at least two frames of crowd images obtained from crowd video clips, to obtain at least two first feature maps.
  • the feature extraction module in the convolutional neural network can be obtained by training the convolutional layer in the deep convolutional neural network (for example, VGG- The first 13 convolutional layers of the 16 network) constitute.
  • three frames of crowd images I 1 , I 2 and I 3 are obtained from a crowd video clip.
  • the size of each first feature map is reduced to 1/8 of the crowd image of the corresponding frame, and the number of channels is 512.
  • the feature extraction module being composed of the first 13 convolutional layers of the above-mentioned VGG-16 network, it can also be set to other network structures according to actual conditions, which is not specifically limited in this disclosure.
  • the size and number of channels of at least two first feature maps obtained after feature extraction of at least two frames of crowd images obtained from crowd video clips may be different, and this disclosure does not Be specific.
  • determining the feature neighborhood corresponding to the target pixel in at least two first feature maps in the target first feature map includes: according to the coordinates of the target pixel in the target first feature map, and a preset standard deviation, determining a two-dimensional Gaussian distribution corresponding to the target pixel; and determining corresponding feature neighborhoods in at least two first feature maps according to the two-dimensional Gaussian distribution corresponding to the target pixel.
  • the two-dimensional Gaussian distribution corresponding to the target pixel point determine the corresponding feature neighborhood in at least two first feature maps, so that the feature neighborhood can capture pixels in different first feature maps
  • the local and long-distance correlation of points can effectively reflect the spatio-temporal relationship between different frames of crowd images.
  • the first feature map X 2 is the first feature map of the target as an example, for any target pixel in the target first feature map X 2 (x, y), according to the coordinates of the target pixel (x, y) and the preset standard deviation ⁇ 2 , generate a two-dimensional Gaussian distribution N((x, y), ⁇ 2 , I 2 ), where, I 2 is the second-order identity matrix.
  • the specific value of the preset standard deviation ⁇ 2 can be determined according to the actual situation, which is not specifically limited in the present disclosure.
  • the Gaussian two-dimensional distribution N((x, y), ⁇ 2 , I 2 ) corresponding to the target pixel point (x, y) After determining the two-dimensional Gaussian distribution N((x, y), ⁇ 2 , I 2 ) corresponding to the target pixel point (x, y), through the Gaussian two-dimensional distribution N((x, y), ⁇ 2 , I 2 ) for sampling, respectively determine a set of integer sampling coordinates for the first feature map X 1 , X 2 and X 3 where P is the number of sampling coordinates included in each set of sampling coordinates.
  • the specific value of P can be determined according to the actual situation, which is not specifically limited in the present disclosure.
  • the manner of sampling the two-dimensional Gaussian distribution may be random sampling, or other sampling manners, which are not specifically limited in the present disclosure.
  • the above sampling coordinates determined for the first feature map X 1 , X 2 and X 3 The feature neighborhoods of the target pixel point (x, y) in the first feature map X 1 , X 2 and X 3 in the target first feature map X 2 are constructed respectively.
  • the feature neighborhoods of the target pixel points in the target first feature map X2 in the first feature maps X1 , X2 and X3 can be obtained.
  • At least two first feature maps are fused to obtain the second feature map corresponding to the target group image, including: based on the target pixel point in at least two A feature neighborhood corresponding to the first feature map, respectively determine the sampling pixel points corresponding to the target pixel point in at least two first feature maps; according to the target pixel point and the sampling pixel point corresponding to the target pixel point, for at least two
  • the first feature map is fused to obtain a second feature map, wherein the second feature map has the same size as the target first feature map.
  • the Gaussian neighborhood attention module in the convolutional neural network can be used to implement a Gaussian neighborhood attention mechanism based on the feature neighborhoods corresponding to the target pixel in at least two first feature maps, for at least The two first feature maps are fused to obtain a second feature map corresponding to the image of the target group.
  • the Gaussian neighborhood attention module includes three inputs: query map, key map and value map.
  • the query graph can be the target first feature graph corresponding to the image of the target group
  • the key graph and value graph are multiple pairs of key graph value graph pairs formed according to the first feature graph, wherein the same key graph value graph pair
  • the key and value maps in are the same first feature map.
  • the query graph can be expressed as Q ⁇ R h ⁇ w ⁇ c , and the key-value graph pair can be expressed as Among them, K represents the key map, V represents the value map, and n is the number of key map value map pairs. The value of n is the same as the number of at least two first feature maps.
  • the feature neighborhood corresponding to the target pixel in the first feature map of the target is determined based on the two-dimensional Gaussian distribution of the target pixel, therefore, in the subsequent feature fusion process, only the attention mechanism can be used It is limited in the Gaussian neighborhood of the first feature map of the target, so that the redundant components in the global attention mechanism can be removed, so that the efficiency of feature fusion can be improved and the calculation consumption can be reduced.
  • the first feature map X 2 is the target first feature map.
  • any target pixel point (x, y) in the query graph Q is the feature neighborhood corresponding to the target pixel (x, y) in the key-value map pair (K 1 , V 1 ), is the feature neighborhood corresponding to the target pixel (x, y) in the key-value map pair (K 2 , V 2 ), is the feature neighborhood corresponding to the target pixel (x, y) in the key-value map pair (K 3 , V 3 ).
  • At least two first feature map pairs are fused to obtain the second feature map, including: the target pixel and the target pixel
  • the dot product between the sampling pixels corresponding to the point is normalized to obtain the weight of the sampling pixel corresponding to the target pixel; according to the weight of the sampling pixel corresponding to the target pixel, the sampling pixel corresponding to the target pixel Weighted summation is performed to obtain the second feature map.
  • the Gaussian attention ATTENTION (x, y) corresponding to the pixel point (x, y) in the second feature map is determined:
  • the sampling pixel corresponding to the target pixel (x, y) in the value map V i softmax( ) is a normalization function, using the softmax( ) normalization function, for Q x, y and The dot product between is normalized to determine the corresponding sampling pixel of the target pixel (x, y) in the key map K i the weight of.
  • the weight of the sampled pixel in the value map V i Weighted summation is performed to obtain the Gaussian attention ATTENTION (x, y) corresponding to the pixel point (x, y) in the second feature map.
  • Fig. 2 shows a schematic diagram of feature fusion according to an embodiment of the present disclosure.
  • the target pixel in the query map Q the first feature map of the target
  • the key map value map pair ⁇ (K i , V i ) ⁇
  • the target pixel The dot product between the point and the corresponding sampling pixel in the key map is normalized to obtain the weight of the corresponding sampling pixel in the key map, and then according to the weight of the corresponding sampling pixel in the key map, the value map
  • the corresponding sampling pixels are weighted and summed to obtain the Gaussian attention of the target pixel in the second feature map.
  • the Gaussian attention corresponding to the pixels in the second feature map Z corresponding to the target crowd image I2 can be obtained, based on the pixels in the second feature map Z
  • a second feature map Z with the same size as the target first feature map X 2 corresponding to the target crowd image I 2 can be obtained.
  • the second feature map Z is the feature map obtained after feature enhancement based on the Gaussian neighborhood attention mechanism.
  • the second feature map Z and the target first feature map X 2 corresponding to the target group image I 2 have the same size, and the second feature map Diagram Z can reflect the spatio-temporal relationship between the target crowd image I 2 and other non-target crowd images I 1 and I 3 .
  • performing crowd positioning according to the second feature map to obtain a target positioning map corresponding to the target crowd image includes: performing crowd positioning according to the second feature map to obtain a first positioning probability map, wherein the first The positioning probability map is used to indicate the probability that the target pixel in the image of the target group is a human body; according to the probability threshold, image processing is performed on the first positioning probability map to obtain the target positioning map.
  • the first positioning probability map with higher accuracy corresponding to the image of the target group can be obtained by using the second feature map for crowd positioning , however, since the first location probability map is only used to indicate the probability that the pixel in the image of the target group is a human body, therefore, image processing is performed on the first location probability map through a preset probability threshold, thereby effectively obtaining An object localization map of the positions of the human bodies included in the crowd image.
  • performing group positioning according to the second feature map to obtain the first location probability map includes: performing convolution processing on the second feature map to obtain a third feature map; converting the third feature map to Perform convolution processing to obtain a fourth feature map, wherein the fourth feature map has the same size as the target group image; perform convolution processing on the fourth feature map to obtain a first positioning probability map.
  • the third feature map is obtained.
  • the third feature map is transposed and convolved.
  • the fourth feature map having the same size as the image of the target group, and then perform convolution processing on the fourth feature map, the first positioning probability for indicating the probability that the target pixel in the image of the target group is a human body can be effectively obtained picture.
  • the first location probability map has the same size as the target group image. Still taking the target group image I 2 as an example, in the case of the target group image I 2 ⁇ R H ⁇ W ⁇ 3 , H and W are the height and width of the target group image respectively, and the number of channels of the target group image is 3( For example, RGB three-channel), at this time, the first positioning probability map can be recorded as in, Used to indicate the probability that I 2 (x) is a human body, x is the target crowd image I 2 and the first positioning probability map The coordinates of the target pixel points with the same relative position in .
  • the location prediction module in the convolutional neural network may be used to perform crowd location on the second feature map to obtain the first location probability map.
  • the location prediction module in the convolutional neural network may include a convolutional layer for performing convolution processing, and a transposed convolutional layer for performing transposed convolution processing.
  • the specific structure of the positioning prediction module can be set according to the actual situation (for example, the number of convolutional layers, and the arrangement of each layer, etc.), which is not specifically limited in the present disclosure.
  • the second feature map Z is input into the location prediction module in the convolutional neural network, and the process of the location prediction module performing group positioning on the second feature map Z can be specifically described As follows: use three convolutional layers (the size of the convolution kernel is 3, the hole rate is 2, and the number of channels is 512) to perform convolution processing on the second feature map Z to achieve further feature extraction and obtain the third feature map ; Then use three transposed convolutional layers (the convolution kernel size is 4, the step size is 2, and the number of channels is 256, 128, 64 respectively), and a convolutional layer connected after each transposed convolutional layer ( The size of the convolution kernel is 3, the hole ratio is 2, and the number of channels is 256, 128, and 64 respectively).
  • the feature is transformed into the size of the target group image, and the same as The fourth feature map with the same size as the target group image, and finally use a 1 ⁇ 1 convolutional layer to convolve the fourth feature map, convert the number of channels of the feature to 1, and finally output the first positioning probability map
  • the first positioning probability map is only used to indicate the probability that the target pixel in the image of the target group is a human body
  • image processing is performed on the first positioning probability map through a preset probability threshold, so that the image used to indicate the target group can be effectively obtained.
  • Included in the object localization map is the position of the human body.
  • the specific value of the probability threshold can be determined according to the actual situation, which is not specifically limited in the present disclosure.
  • image processing is performed on the first positioning probability map according to the probability threshold to obtain the target positioning map, including: performing an average pooling operation on the first positioning probability map to obtain a mean pooling map; Perform the maximum pooling operation on the pooled graph to obtain the maximum pooled graph; obtain the second positioning probability graph according to the mean pooling graph and the maximum pooling graph; perform threshold segmentation on the second positioning probability graph according to the probability threshold to obtain target positioning picture.
  • An average pooling operation is performed on the first positioning probability map to obtain a mean pooling map, and a maximum pooling operation is performed on the mean pooling map to obtain a maximum pooling map, thereby effectively suppressing image noise.
  • Specific values of sizes and step sizes of the first pooling kernel and the second pooling kernel can be set according to actual conditions, which are not specifically limited in the present disclosure.
  • Peak screening is performed on the average pooling map and the maximum pooling, so that a second positioning probability map with higher accuracy can be obtained.
  • the pixel values of the pixels in the mean pooling map and the maximum pooling map are used to indicate the probability that the corresponding target pixel in the image of the target crowd is a human body. Compare the mean pooling map and the maximum pooling map pixel by pixel. For the pixels with the same relative position in the mean pooling map and the maximum pooling map, if the pixel values have the same probability value, the second positioning probability map The pixel value of the pixel with the same relative position in the image is determined as the value of the probability; for the pixel with the same relative position in the mean pooling map and the maximum pooling map, if the pixel value has different probability values, the second positioning probability The pixel values of the pixel points with the same relative position in the figure are determined to be 0.
  • the pixel value of the pixel point (i, j) (the pixel point at the i-th row and j-th column) in the mean pooling map is 0.7
  • the pixel value of the pixel point (i, j) in the maximum pooling map is In the case of 0.7
  • the pixel value of the pixel point (i, j) in the second positioning probability map is determined to be 0.7.
  • the pixel in the second positioning probability map is determined to be 0.
  • threshold segmentation is performed on the second positioning probability map through the preset probability threshold, so that the final required target positioning map can be obtained, and the position of the human body included in the target crowd image can be effectively determined.
  • the probability value corresponding to each pixel in the second positioning probability map is compared with the probability threshold, and when the pixel value of a certain pixel is greater than or equal to the probability threshold, the relative position in the target positioning map is The pixel value of the same pixel is determined as 1; when the pixel value of a certain pixel is smaller than the probability threshold, the pixel value of the pixel with the same relative position in the target positioning map is determined as 0.
  • the target positioning map and the target group image have the same size, and the position of a pixel with a pixel value of 1 in the target positioning map is used to indicate the position of the human body included in the target group image.
  • the position of the target pixel point (i, j) in the target positioning map corresponds to the human body; in the target positioning map, the pixel point (i, j) When the pixel value of j) is 0, the position of the target pixel point (i, j) in the target crowd image corresponds to the part other than the head of the human body.
  • the position of the human body included in the target crowd image can be determined, the crowd positioning can be realized, and data basis can be provided for other crowd analysis tasks (for example, crowd counting, crowd behavior analysis, etc.).
  • the number of human bodies included in the image of the target group can be obtained by counting the number of pixels with a pixel value of 1 in the target location map, so as to realize crowd counting in the image of the target group.
  • the behavior track of the human body included in the target group image can be obtained, and the crowd behavior analysis of the target group image can be realized
  • the crowd positioning method is implemented through a crowd positioning neural network
  • the training samples of the crowd positioning neural network include crowd sample video clips and real location maps corresponding to target crowd sample images in the crowd sample video clips; crowd positioning
  • the neural network training method is as follows: according to the crowd sample video clips, through the crowd positioning neural network, determine the predicted positioning probability map corresponding to the target crowd sample image, wherein the predicted positioning probability map is used to indicate that the pixel points in the target crowd sample image are human body Probability; based on the predicted location probability map and the real location map, determine the location loss; based on the location loss, optimize the crowd location neural network.
  • the crowd positioning neural network can be pre-trained based on the above crowd positioning method, and then in practical applications, the identification and positioning of crowd images can be quickly and effectively realized through the crowd positioning neural network.
  • a training sample for performing network training on the crowd positioning neural network is constructed in advance, wherein the training sample includes a crowd sample video segment and a real positioning map corresponding to a target crowd sample image in the crowd sample video segment.
  • the crowd sample video segment here is a video segment that includes multiple frames of crowd sample images, which can be captured by an image acquisition device within a certain spatial range (for example, a place with a large flow of people such as a square, a shopping mall, a subway station, a tourist attraction, etc.)
  • the video collected by dense crowds may also be obtained by other means, which is not specifically limited in this disclosure.
  • the crowd positioning method further includes: acquiring the original crowd sample video; performing frame rate down-sampling on the original crowd sample video to obtain the crowd sample video segment, wherein the frame rate of the crowd sample video segment is less than a threshold .
  • the image acquisition equipment collects the video of the dense crowd, and after the original crowd sample video is obtained, when the frame rate of the original crowd sample video is high, the difference between the adjacent frame crowd sample images in the original crowd sample video is small.
  • the frame rate downsampling of the original crowd sample video with a higher frame rate can be performed to obtain crowd sample video clips with a frame rate lower than the threshold, so that the crowd sample video clips
  • the difference between adjacent frames of crowd sample images is relatively large, so that the temporal and spatial relationship between different frames of crowd sample images in the crowd sample video segment can be better utilized to train the crowd localization neural network.
  • the frame rate of the crowd sample video segment is 5 frames per second.
  • the crowd sample image of the crowd sample video segment may include other background parts in addition to the dense crowd, in order to better locate the neural network of the crowd
  • the network is trained to crop the crowd sample image and retain the dense crowd included in the crowd sample image.
  • the cropped crowd sample images need to have the same scale to ensure that subsequent image processing operations such as feature extraction and feature fusion can be implemented on the crowd sample images.
  • the crowd sample video segment includes multiple frames of crowd sample images, and at least two frames of crowd sample images are obtained from the crowd sample video segment for feature extraction, wherein the specific number of at least two frames of crowd sample images for feature extraction can be determined according to actual conditions, For example, 2 frames, 3 frames, 5 frames, 7 frames, etc., which are not specifically limited in the present disclosure.
  • the target crowd sample image can be the first frame crowd sample image in at least two frames of crowd sample images; it can be the last frame crowd sample image in at least two frames of crowd sample images; Or in the case of an odd-numbered frame crowd sample image equal to 3 frames, the target crowd sample image can be an intermediate frame crowd sample image in an odd-numbered frame crowd sample image greater than or equal to 3 frames; it can also be at least two frames of a crowd sample image Any frame of crowd sample image, which is not specifically limited in the present disclosure.
  • the real positioning map and the sample image of the target group have the same size, the pixel value of the pixel point in the real positioning map is 0 or 1, and the position of the pixel point with a pixel value of 1 is used to indicate the position of the human body included in the sample image of the target group ;
  • the position of the pixel with a pixel value of 0 is used to indicate other positions than the human body included in the sample image of the target group.
  • the relationship between the real positioning map and the sample image of the target group is similar to the relationship between the above target positioning map and the image of the target group, and will not be repeated here.
  • the crowd positioning method further includes: determining a labeling result corresponding to the sample image of the target crowd, wherein the labeling result includes the coordinates of the human body in the sample image of the target crowd; and determining a real positioning map according to the labeling result.
  • the real positioning map corresponding to the sample images of the target population can be effectively determined according to the labeling results, and then the neural network for crowd positioning can be effectively constructed according to the sample images of the target population and the real positioning map Training samples for network training.
  • the target crowd sample image is I 2 ′ ⁇ R H ⁇ W ⁇ 3
  • H and W are the height and width of the target crowd sample image I 2 ′ respectively
  • the number of channels of the target crowd sample image is 3.
  • a i is the coordinates of the i-th person in the target crowd sample image I 2 ′
  • m is the number of human bodies included in the target crowd sample image I 2 ′.
  • y is the coordinates of the pixels in the sample image I 2 ′ of the target group and the relative position in the real positioning map Y
  • K [0,1,0; 1,1,1;0,1,0] is the convolution kernel
  • ⁇ ( ) is the convolution result graph
  • ⁇ ( ) is a multivariate delta function, and its specific form can be shown in the following formula (3),
  • the above-mentioned training samples use the above-mentioned training samples to carry out network training on the crowd positioning neural network.
  • the crowd positioning neural network it is determined that the target crowd sample image included in the training sample corresponds to the pixels in the target crowd sample image.
  • the dots are the predicted localization probability maps of the probabilities of the human body.
  • the crowd positioning neural network is used to determine the predicted positioning probability map corresponding to the target crowd sample image, including: respectively at least two frames of crowd samples obtained from the crowd sample video clips Perform feature extraction on the image to obtain at least two fifth feature maps; determine the feature neighborhoods corresponding to the pixels in the target fifth feature map in the at least two fifth feature maps, wherein the target fifth feature map is a sample image of the target population The corresponding fifth feature map; based on the feature neighborhood corresponding to the pixel point, at least two fifth feature maps are fused to obtain the sixth feature map corresponding to the sample image of the target group; crowd positioning is performed according to the sixth feature map, and prediction is obtained Location probability map.
  • the crowd location neural network includes a feature extraction module, and at least two fifth feature maps can be obtained after the feature extraction module performs feature extraction on at least two crowd sample images obtained from crowd sample video clips.
  • three frames of crowd sample images: I′ 1 , I′ 2 and I′ 3 are acquired from the crowd sample video segment, wherein the crowd sample image I′ 2 is a target crowd sample image.
  • the network structure of the feature extraction module in the crowd positioning neural network is similar to the network structure of the feature extraction module in the above-mentioned convolutional neural network.
  • the feature extraction process of the feature extraction module in the product neural network is similar to the feature extraction process of at least two frames of crowd sample images, and will not be repeated here.
  • the crowd positioning neural network includes a Gaussian neighborhood attention module. Based on the Gaussian neighborhood attention module, it is possible to determine the feature neighborhood corresponding to the pixel in the fifth feature map of the target in at least two fifth feature maps, and based on the pixel point In the corresponding feature neighborhoods of the at least two fifth feature maps, at least two fifth feature maps are fused to obtain a sixth feature map Z' corresponding to the target population sample image I'2 .
  • the network structure of the Gaussian neighborhood attention module in the crowd positioning neural network is similar to the network structure of the Gaussian neighborhood attention module in the above-mentioned convolutional neural network.
  • the process of feature fusion of the Gaussian neighborhood attention module in the crowd positioning neural network It is similar to the feature fusion process of the Gaussian neighborhood attention module in the above-mentioned convolutional neural network, and will not be repeated here.
  • the crowd positioning neural network also includes a positioning prediction module.
  • the sixth feature map is used to perform crowd positioning on the sixth feature map, and a predicted positioning probability map indicating the probability that the pixel in the sample image of the target crowd is a human body can be obtained. Still taking the above-mentioned sixth feature map Z′ as an example, use the location prediction module in the crowd location neural network to perform crowd location on the sixth feature map Z′, and obtain the predicted location probability map
  • the network structure of the location prediction module in the crowd location neural network is similar to the network structure of the location prediction module in the above-mentioned convolutional neural network.
  • the crowd positioning process of the positioning prediction module in the network to the second feature map is similar, and will not be repeated here.
  • the predicted location probability map is used to indicate the probability that the pixel in the sample image of the target group is a human body
  • the real location map is used to indicate the position of the human body included in the sample image of the target group
  • the crowd localization neural network After the crowd localization neural network obtains the predicted localization probability map corresponding to the sample image of the target crowd, according to the difference between the predicted localization probability map and the real localization map, the localization loss of the crowd localization neural network can be determined.
  • determining the positioning loss based on the predicted positioning probability map and the real positioning map includes: according to the predicted positioning probability map, the real positioning map and the positive sample weight, using the cross entropy loss function to determine the positioning loss, where , the positive sample weight is the weight corresponding to the pixel point used to indicate the position of the human body in the real positioning map.
  • the predicted localization probability map and the real positioning map Y, the positioning loss L can be determined by the cross-entropy loss function shown in the following formula (4):
  • H and W are the predicted positioning probability map respectively and the height and width of the real positioning map Y
  • y is the predicted positioning probability map
  • is the positive sample weight.
  • the pixel at the position of the human body can be considered as a positive sample, and other pixels are considered as negative samples, because the proportion of the background part in the sample image of the target population may be much larger than that of the human body, that is, The number of negative samples is far greater than the number of positive samples.
  • the network parameters corresponding to the crowd positioning neural network can be adjusted according to the positioning loss to realize the optimization of the crowd positioning network, and iterative training is carried out with the above network training method until the iterative training meets the preset training conditions, and finally Obtain the trained crowd localization neural network.
  • the method of descending with the gradient is used to adjust the network parameters.
  • the network parameter during the i-th iterative training is ⁇ i
  • the localization loss determined after using the network parameter ⁇ i for network training is L
  • the network parameter ⁇ i+1 during the i+1-th iterative training can be obtained by the following The above formula (6) determines:
  • is the network learning rate.
  • the preset training condition may be network convergence. For example, if the above network training method is used for iterative training until the network parameters no longer change, it can be considered that the network has reached convergence, and the trained crowd positioning neural network can be determined.
  • the preset training condition may be an iteration threshold.
  • the above-mentioned network training method is used for iterative training until the number of iterations reaches the iteration threshold, and the trained crowd positioning neural network is determined.
  • the preset training condition may be a positioning threshold.
  • the above network training method is used for iterative training until the positioning accuracy rate corresponding to the network is greater than the positioning threshold, and the trained crowd positioning neural network is determined.
  • the preset training condition can also be set to other training conditions according to actual conditions, which is not specifically limited in the present disclosure.
  • Fig. 3 shows a schematic diagram of a neural network for crowd positioning according to an embodiment of the present disclosure.
  • the crowd location neural network 30 includes a feature extraction module 31 , a Gaussian neighborhood attention module 32 and a location prediction module 33 .
  • At least two frames of crowd images obtained from crowd video clips that need to be crowd positioned are input into the crowd localization neural network 30, and the feature extraction module 31 performs feature extraction on at least two frames of crowd images to obtain at least two first frames of crowd images.
  • a feature map; Gaussian neighborhood attention 32 is based on the Gaussian neighborhood attention mechanism, determining the target first feature map corresponding to the target crowd image, the target pixel points in at least two feature neighborhoods corresponding to the first feature map, and Based on the feature neighborhood corresponding to the target pixel point, at least two first feature maps are fused to obtain a second feature map corresponding to the target crowd image; the positioning prediction module 33 performs crowd positioning on the second feature map to obtain An object localization map of the positions of the human bodies included in the crowd image.
  • the specific processing procedures of the feature extraction module 31 , the Gaussian neighborhood attention 32 and the location prediction module 33 are similar to those described above, and will not be repeated here.
  • the crowd positioning neural network is used to perform feature fusion based on the Gaussian neighborhood attention mechanism during the crowd positioning process, so that the fused feature map can reflect the difference between the target crowd image and other non-target frame crowd images.
  • the spatio-temporal relationship between them so that after using the fused feature map for crowd positioning, a target positioning map with high accuracy corresponding to the target crowd image can be obtained, thereby effectively improving the accuracy of crowd positioning.
  • the present disclosure also provides crowd locating devices, electronic equipment, computer-readable storage media, and program products, all of which can be used to implement any crowd locating method provided in the present disclosure, and refer to corresponding technical solutions and descriptions in the method section. record, no more details.
  • Fig. 4 shows a block diagram of a crowd locating device according to an embodiment of the present disclosure.
  • the device 40 includes: a feature extraction module 41, which is used to perform feature extraction on at least two frames of crowd images obtained from the crowd video clips, respectively, to obtain at least two first feature maps; a feature neighborhood determination module 42 , used to determine the feature neighborhood corresponding to the target pixel point in the target first feature map in at least two first feature maps, wherein the target first feature map is the first target crowd image corresponding to the target crowd image in at least two frames of crowd images A feature map; the feature fusion module 43 is used to fuse at least two first feature maps based on the feature neighborhood corresponding to the target pixel point to obtain a second feature map corresponding to the target crowd image; the crowd positioning module 44 is used for Perform crowd positioning according to the second feature map to obtain a target positioning map corresponding to the target crowd image, wherein the target positioning map is used to indicate the position of the human body included in the target crowd image.
  • a feature extraction module 41 which is used to perform
  • the feature neighborhood determination module 42 is specifically configured to: determine the two-dimensional Gaussian distribution corresponding to the target pixel point according to the coordinates of the target pixel point in the target first feature map and the preset standard deviation ; According to the two-dimensional Gaussian distribution corresponding to the target pixel, determine corresponding feature neighborhoods in at least two first feature maps.
  • the feature fusion module 43 includes: a first determining submodule, configured to, based on the feature neighborhood corresponding to the target pixel point in the at least two first feature maps, in the at least two first feature maps In the figure, the sampling pixels corresponding to the target pixel are respectively determined; the second determination sub-module is used to fuse at least two first feature maps according to the target pixel and the sampling pixel corresponding to the target pixel to obtain the first Two feature maps, where the second feature map has the same size as the target first feature map.
  • the second determining submodule is specifically configured to: perform normalization processing on the dot product between the target pixel and the sampling pixel corresponding to the target pixel, to obtain the sampling pixel corresponding to the target pixel The weight of the pixel point; according to the weight of the sampling pixel point corresponding to the target pixel point, the weighted summation is performed on the sampling pixel point corresponding to the target pixel point to obtain the second feature map.
  • the crowd positioning module 44 includes: a crowd positioning submodule, configured to perform crowd positioning according to the second feature map to obtain a first positioning probability map, wherein the first positioning probability map is used to indicate the target The probability that the target pixel in the crowd image is a human body; the third determination sub-module is used to perform image processing on the first positioning probability map according to the probability threshold to obtain the target positioning map.
  • the crowd positioning submodule is specifically used to: perform convolution processing on the second feature map to obtain a third feature map; perform transposed convolution processing on the third feature map to obtain a fourth feature map , wherein the fourth feature map and the image of the target group have the same size; the fourth feature map is convoluted to obtain the first positioning probability map.
  • the third determination submodule is specifically used to: perform an average pooling operation on the first positioning probability map to obtain a mean pooling map; perform a maximum pooling operation on the mean pooling map to obtain the maximum A pooling map; according to the average pooling map and the maximum pooling map, a second positioning probability map is obtained; according to the probability threshold, threshold segmentation is performed on the second positioning probability map to obtain a target positioning map.
  • the device 40 realizes the crowd positioning method through the crowd positioning neural network, and the training samples of the crowd positioning neural network include the crowd sample video clip and the real positioning map corresponding to the target crowd sample image in the crowd sample video clip;
  • the device 40 also includes: a network training module, including: a prediction sub-module, which is used to determine the predicted positioning probability map corresponding to the target crowd sample image through the crowd positioning neural network according to the crowd sample video clip, wherein the predicted positioning probability map is used to indicate The probability that the pixel in the sample image of the target crowd is a human body; the fourth determination sub-module is used to determine the positioning loss based on the predicted positioning probability map and the real positioning map; the optimization sub-module is used to optimize the crowd positioning neural network based on the positioning loss.
  • a network training module including: a prediction sub-module, which is used to determine the predicted positioning probability map corresponding to the target crowd sample image through the crowd positioning neural network according to the crowd sample video clip, wherein the predicted positioning probability map is used to indicate The probability that the
  • the prediction submodule is specifically configured to: respectively perform feature extraction on at least two frames of crowd sample images obtained from crowd sample video clips to obtain at least two fifth feature maps; determine the target fifth Feature neighborhoods corresponding to pixels in the feature map in at least two fifth feature maps, wherein the target fifth feature map is the fifth feature map corresponding to the sample image of the target population; based on the pixels in at least two fifth feature maps In the corresponding feature neighborhood, at least two fifth feature maps are fused to obtain a sixth feature map corresponding to the target crowd sample image; crowd positioning is performed according to the sixth feature map to obtain a predicted positioning probability map.
  • the fourth determining submodule is specifically configured to: determine the positioning loss by using the cross-entropy loss function according to the predicted positioning probability map, the real positioning map, and the positive sample weight, wherein the positive sample weight is the real The weight corresponding to the pixel point used to indicate the position of the human body in the positioning map.
  • the device 40 also includes: an acquisition submodule, configured to acquire the original crowd sample video; a downsampling submodule, configured to perform frame rate down-sampling on the original crowd sample video, to obtain crowd sample video clips , wherein the frame rate of the crowd sample video segment is less than a threshold.
  • the device 40 further includes: a fifth determining submodule, configured to determine the labeling result corresponding to the sample image of the target group, wherein the labeling result includes the coordinates of the human body in the sample image of the target group;
  • the determination sub-module is used to determine the real positioning map according to the labeling result.
  • the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the methods described in the method embodiments above, and its specific implementation can refer to the description of the method embodiments above. For brevity, here No longer.
  • Embodiments of the present disclosure also provide a computer-readable storage medium, on which computer program instructions are stored, and the above-mentioned method is implemented when the computer program instructions are executed by a processor.
  • the computer readable storage medium may be a volatile computer readable storage medium or a nonvolatile computer readable storage medium.
  • An embodiment of the present disclosure also proposes an electronic device, including: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to invoke the instructions stored in the memory to execute the above method.
  • An embodiment of the present disclosure also provides a computer program product, including computer readable codes.
  • the processor in the device executes the method for realizing the crowd positioning method provided in any of the above embodiments. instruction.
  • An embodiment of the present disclosure also provides another computer program product, which is used for storing computer-readable instructions, and when the instructions are executed, the computer executes the operations of the crowd locating method provided in any of the above-mentioned embodiments.
  • Electronic devices may be provided as terminals, servers, or other forms of devices.
  • Fig. 5 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • the electronic device 800 may be a terminal such as a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, or a personal digital assistant.
  • electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814 , and the communication component 816.
  • the processing component 802 generally controls the overall operations of the electronic device 800, such as those associated with display, telephone calls, data communications, camera operations, and recording operations.
  • the processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802 .
  • the memory 804 is configured to store various types of data to support operations at the electronic device 800 . Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like.
  • the memory 804 can be implemented by any type of volatile or non-volatile storage device or their combination, 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 Memory, Flash Memory, Magnetic or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic or Optical Disk Magnetic Disk
  • the power supply component 806 provides power to various components of the electronic device 800 .
  • Power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 800 .
  • the multimedia component 808 includes a screen providing an output interface between the electronic device 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or slide action, but also detect duration and pressure associated with the touch or slide operation.
  • the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.
  • the audio component 810 is configured to output and/or input audio signals.
  • the audio component 810 includes a microphone (MIC), which is configured to receive external audio signals when the electronic device 800 is in operation modes, such as call mode, recording mode and voice recognition mode. Received audio signals may be further stored in memory 804 or sent via communication component 816 .
  • the audio component 810 also includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.
  • Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of electronic device 800 .
  • the sensor component 814 can detect the open/closed state of the electronic device 800, the relative positioning of components, such as the display and the keypad of the electronic device 800, the sensor component 814 can also detect the electronic device 800 or a Changes in position of components, presence or absence of user contact with electronic device 800 , electronic device 800 orientation or acceleration/deceleration and temperature changes in electronic device 800 .
  • Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact.
  • Sensor assembly 814 may also include an optical sensor, such as a complementary metal-oxide-semiconductor (CMOS) or charge-coupled device (CCD) image sensor, for use in imaging applications.
  • CMOS complementary metal-oxide-semiconductor
  • CCD charge-coupled device
  • the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
  • the communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices.
  • the electronic device 800 can access a wireless network based on a communication standard, such as a wireless network (WiFi), a second generation mobile communication technology (2G) or a third generation mobile communication technology (3G), or a combination thereof.
  • the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID Radio Frequency Identification
  • IrDA Infrared Data Association
  • UWB Ultra Wide Band
  • Bluetooth Bluetooth
  • electronic device 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A programmable gate array
  • controller microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
  • a non-volatile computer-readable storage medium such as the memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to implement the above method.
  • Fig. 6 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • the electronic device 1900 may be provided as a server.
  • electronic device 1900 includes processing component 1922 , which further includes one or more processors, and a memory resource represented by memory 1932 for storing instructions executable by processing component 1922 , such as application programs.
  • the application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions.
  • the processing component 1922 is configured to execute instructions to perform the above method.
  • Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input-output (I/O) interface 1958 .
  • the electronic device 1900 can operate based on the operating system stored in the memory 1932, such as the Microsoft server operating system (Windows Server TM ), the graphical user interface-based operating system (Mac OS X TM ) introduced by Apple Inc., and the multi-user and multi-process computer operating system (Unix TM ), a free and open source Unix-like operating system (Linux TM ), an open source Unix-like operating system (FreeBSD TM ), or the like.
  • Microsoft server operating system Windows Server TM
  • Mac OS X TM graphical user interface-based operating system
  • Unix TM multi-user and multi-process computer operating system
  • Linux TM free and open source Unix-like operating system
  • FreeBSD TM open source Unix-like operating system
  • a non-transitory computer-readable storage medium such as the memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to implement the above method.
  • the present disclosure can be a system, method and/or computer program product.
  • a computer program product may include a computer readable storage medium having computer readable program instructions thereon for causing a processor to implement various aspects of the present disclosure.
  • a computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device.
  • a computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Computer-readable storage media include: portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory), static random access memory (SRAM), compact disc read only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanically encoded device, such as a printer with instructions stored thereon A hole card or a raised structure in a groove, and any suitable combination of the above.
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • flash memory static random access memory
  • SRAM static random access memory
  • CD-ROM compact disc read only memory
  • DVD digital versatile disc
  • memory stick floppy disk
  • mechanically encoded device such as a printer with instructions stored thereon
  • a hole card or a raised structure in a groove and any suitable combination of the above.
  • computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals.
  • Computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
  • a network adapter card or a network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
  • Computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or Source or object code written in any combination, including object-oriented programming languages - such as Smalltalk, C++, etc., and conventional procedural programming languages - such as the "C" language or similar programming languages.
  • Computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement.
  • the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as via the Internet using an Internet service provider). connect).
  • LAN local area network
  • WAN wide area network
  • an electronic circuit such as a programmable logic circuit, field programmable gate array (FPGA), or programmable logic array (PLA)
  • FPGA field programmable gate array
  • PDA programmable logic array
  • These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine such that when executed by the processor of the computer or other programmable data processing apparatus , producing an apparatus for realizing the functions/actions specified in one or more blocks in the flowchart and/or block diagram.
  • These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause computers, programmable data processing devices and/or other devices to work in a specific way, so that the computer-readable medium storing instructions includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks in flowcharts and/or block diagrams.
  • each block in a flowchart or block diagram may represent a module, a portion of a program segment, or an instruction that includes one or more Executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified function or action , or may be implemented by a combination of dedicated hardware and computer instructions.
  • the computer program product can be specifically realized by means of hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) etc. Wait.
  • a software development kit Software Development Kit, SDK

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computational Linguistics (AREA)
  • Image Analysis (AREA)

Abstract

一种人群定位方法及装置、电子设备和存储介质,所述方法包括:分别对从人群视频片段中获取的至少两帧人群图像进行特征提取,得到至少两个第一特征图(S11);确定目标第一特征图中目标像素点在至少两个第一特征图中对应的特征邻域,其中,目标第一特征图是与至少两帧人群图像中的目标人群图像对应的第一特征图(S12);基于目标像素点对应的特征邻域,对至少两个第一特征图进行融合,得到目标人群图像对应的第二特征图(S13);根据第二特征图进行人群定位,得到目标人群图像对应的目标定位图,其中,目标定位图用于指示目标人群图像中包括的人体的位置(S14)。

Description

人群定位方法及装置、电子设备和存储介质
本申请要求2021年05月26日提交、申请号为202110579974.X,发明名称为“人群定位方法及装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开涉及计算机技术领域,尤其涉及一种人群定位方法及装置、电子设备和存储介质。
背景技术
随着人口的增长、城市化进程的加速,人群大量聚集的行为越来越多,且规模越来越大。人群分析对于公共安全、城市规划有着重要意义。常见的人群分析任务包括人群计数、群体行为解析、人群定位等,其中,人群定位是其它人群分析任务的基础。人群定位指的是,通过计算机视觉算法对图像或视频中包括的人体的位置进行估计,确定图像或视频中包括的人体的坐标,以为后续人群计数和群体行为解析等人群分析任务提供数据依据。人群定位的准确率直接影响人群计数的精度和人群行为解析的结果。因此,亟需一种准确率较高的人群定位方法。
发明内容
本公开提出了一种人群定位方法及装置、电子设备和存储介质技术方案。
根据本公开的一方面,提供了一种人群定位方法,包括:分别对从人群视频片段中获取的至少两帧人群图像进行特征提取,得到至少两个第一特征图;确定目标第一特征图中目标像素点在所述至少两个第一特征图中对应的特征邻域,其中,所述目标第一特征图是与所述至少两帧人群图像中的目标人群图像对应的第一特征图;基于目标像素点对应的所述特征邻域,对所述至少两个第一特征图进行融合,得到所述目标人群图像对应的第二特征图;根据所述第二特征图进行人群定位,得到所述目标人群图像对应的目标定位图,其中,所述目标定位图用于指示所述目标人群图像中包括的人体的位置。
根据本公开的一方面,提供了一种人群定位装置,包括:特征提取模块,用于分别对从人群视频片段中获取的至少两帧人群图像进行特征提取,得到至少两个第一特征图;特征邻域确定模块,用于确定目标第一特征图中目标像素点在所述至少两个第一特征图中对应的特征邻域,其中,所述目标第一特征图是与所述至少两帧人群图像中的目标人群图像对应的第一特征图;特征融合模块,用于基于目标像素点对应的所述特征邻域,对所述至少两个第一特征图进行融合,得到所述目标人群图像对应的第二特征图;人群定位模块,用于根据所述第二特征图进行人群定位,得到所述目标人群图像对应的目标定位图,其中,所述目标定位图用于指示所述目标人群图像中包括的人体的位置。
根据本公开的一方面,提供了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。
根据本公开的一方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。
根据本公开的一方面,提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行用于实现上述方法。
在本公开实施例中,分别对从人群视频片段中获取的至少两帧人群图像进行特征提取,得到至少两个第一特征图;确定目标第一特征图中像素点在至少两个第一特征图中对应的特征邻域,其中,目 标第一特征图是至少两帧人群图像中的目标人群图像对应的第一特征图;基于目标像素点对应的特征邻域,对至少两个第一特征图进行融合,得到目标人群图像对应的第二特征图;根据第二特征图进行人群定位,得到目标人群图像对应的目标定位图,其中,目标定位图用于指示目标人群图像中包括的人体的位置。在人群定位过程中,基于人群视频片段中的目标人群图像对应的第一特征图中目标像素点的特征邻域,对人群视频片段中获取的至少两帧人群图像对应的至少两个第一特征图进行融合,融合后的第二特征图可以反映不同帧人群图像之间的时空关系,以使得利用第二特征图进行人群定位后,可以得到目标人群图像对应的准确率较高的目标定位图,从而有效提高了人群定位的准确率。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。
图1示出根据本公开实施例的一种人群定位方法的流程图;
图2示出根据本公开实施例的特征融合的示意图;
图3示出根据本公开实施例的一种人群定位神经网络的示意图;
图4示出根据本公开实施例的一种人群定位装置的框图;
图5示出根据本公开实施例的一种电子设备的框图;
图6示出根据本公开实施例的一种电子设备的框图。
具体实施方式
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。
另外,为了更好地说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。
图1示出根据本公开实施例的一种人群定位方法的流程图。该人群定位方法可以由终端设备或服务器等电子设备执行,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等,该人群定位方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。或者,可通过服务器执行该人群定位方法。如图1所示,该人群定位方法可以包括:
在步骤S11中,分别对从人群视频片段中获取的至少两帧人群图像进行特征提取,得到至少两个第一特征图。
这里的人群视频片段是包括多帧人群图像的视频片段,其可以是图像采集设备对某个空间范围内(例如,广场、商场、地铁站、旅游景点等人流量较大的地点)的密集人群进行视频采集后得到的,也可以是通过其它方式获取得到的,本公开对此不做具体限定。
在一示例中,图像采集设备对密集人群进行视频采集,得到原始人群视频之后,在原始人群视频的帧率较高的情况下,原始人群视频中相邻帧人群图像之间的差异较小,为了更好地利用不同帧人群图像之间的时空关系,可以对帧率较高的原始人群视频进行帧率下采样,得到帧率小于阈值的人群视频片段,以使得人群视频片段中相邻帧人群图像之间的差异较大,从而可以更好地利用人群视频片段中不同帧人群图像之间的时空关系,实现精度更好地人群定位。例如,人群视频片段的帧率为每秒5帧。
在一示例中,在对原始人群视频进行帧率下采样得到人群视频片段后,由于人群视频片段的人群图像中除了包括密集人群之外,可能还包括其它背景部分,为了更好地进行人群定位,可以对人群图像进行裁剪,保留人群图像中包括的密集人群部分。但是,裁剪后的人群图像需要具有相同的尺度,以确保可以对人群图像实现后续的特征提取、特征融合等图像处理操作。
人群视频片段中包括多帧人群图像,从人群视频片段中获取至少两帧人群图像进行特征提取,其中,从人群视频片段中获取的进行特征提取的人群图像的帧数可以根据实际情况确定,例如,2帧、3帧、5帧、7帧等,本公开对此不做具体限定。
对至少两帧人群图像进行特征提取,具体可以是通过卷积神经网络中的特征提取模块,对至少两帧人群图像进行特征提取,得到至少两个第一特征图。后文会结合本公开可能的实现方式对特征提取过程做详细描述,此处不作赘述。
在步骤S12中,确定目标第一特征图中目标像素点在至少两个第一特征图中对应的特征邻域,其中,目标第一特征图是与至少两帧人群图像中的目标人群图像对应的第一特征图。
这里的目标人群图像是从人群视频片段中获取的至少两帧人群图像中的某一帧。例如,可以是至少两帧人群图像中的首帧人群图像;可以是至少两帧人群图像中的尾帧人群图像;在从人群视频片段中获取的是大于或等于3帧的奇数帧人群图像的情况下,目标人群图像可以是大于或等于3帧的奇数帧人群图像中的中间帧人群图像;还可以是至少两帧人群图像中的任意一帧人群图像,本公开对此不做具体限定。
将目标人群图像对应的第一特征图,确定为目标第一特征图。确定目标第一特征图中目标像素点在至少两个第一特征图中对应的特征邻域。例如,从人群视频片段中获取了三帧人群图像I 1、I 2和I 3,分别对三帧人群图像进行特征提取,得到三个第一特征图:人群图像I 1对应的第一特征图X 1、人群图像I 2对应的第一特征图X 2和人群图像I 3对应的第一特征图X 3。其中,在人群图像I 2是目标人群图像的情况下,第一特征图X 2是目标第一特征图。此时,针对目标第一特征图X 2中的目标像素点, 分别在第一特征图X 1、第一特征图X 2和第一特征图X 3中,确定目标像素点对应的特征邻域。后文会结合本公开可能的实现方式对确定目标像素点对应的特征邻域的具体过程做详细描述,此处不作赘述。
在步骤S13中,基于目标像素点对应的特征邻域,对至少两个第一特征图进行融合,得到目标人群图像对应的第二特征图。
相关技术中,利用人群视频片段进行人群定位时,针对从人群视频片段中获取的至少两帧人群图像进行特征提取后得到的至少两个第一特征图,仅进行通道维度的简单融合,无法充分利用人群视频片段中不同帧人群图像之间的时序信息。
本公开实施例中,基于目标第一特征图中目标像素点,在至少两个第一特征图中的特征邻域,对至少两个第一特征图进行融合,使得在特征融合过程中,既可以利用目标人群图像中的空间信息,又可以利用不同帧人群图像之间的时序信息,以得到目标人群图像对应的具有鲁棒性更高的语义特征的第二特征图。后文会结合本公开可能的实现方式对特征融合过程做详细描述,此处不作赘述。
在步骤S14中,根据第二特征图进行人群定位,得到目标人群图像对应的目标定位图,其中,目标定位图用于指示目标人群图像中包括的人体的位置。
由于特征融合后得到的第二特征图,可以反映不同帧人群图像之间的时空关系,从而在利用第二特征图进行人群定位后,可以得到目标人群图像对应的准确率较高的目标定位图。后文会结合本公开可能的实现方式对人群定位过程做详细描述,此处不作赘述。
在本公开实施例中,分别对从人群视频片段中获取的至少两帧人群图像进行特征提取,得到至少两个第一特征图;确定目标第一特征图中目标像素点在至少两个第一特征图中对应的特征邻域,其中,目标第一特征图是与至少两帧人群图像中的目标人群图像对应的第一特征图;基于目标像素点对应的特征邻域,对至少两个第一特征图进行融合,得到目标人群图像对应的第二特征图;根据第二特征图进行人群定位,得到目标人群图像对应的目标定位图,其中,目标定位图用于指示目标人群图像中包括的人体的位置。
相比于相关技术中基于单个人群图像进行人群定位的方式,利用人群视频片段进行目标人群图像的人群定位,可以挖掘人群视频片段中的时序信息,以使得可以提高人群定位精度。
此外,相比于相关技术中对至少两个第一特征图进行通道级别简单融合的方式,在人群定位过程中,基于目标图像的目标像素点,在相邻帧图像的第一特征图中对应的特征邻域,可以捕获人群视频片段的不同帧人群图像中像素之间的长距离关联关系,使得对至少两个第一特征图进行融合,可以挖掘更充分更具有鲁棒性的特征信息,以使得融合后的第二特征图可以反映不同帧人群图像之间的时空关系,进而利用第二特征图进行人群定位后,可以得到目标人群图像对应的准确率较高的目标定位图,从而有效提高了人群定位的准确率。
在一种可能的实现方式中,可以利用卷积神经网络中的特征提取模块,分别对从人群视频片段中获取的至少两帧人群图像进行特征提取,得到至少两个第一特征图。
在一示例中,卷积神经网络中的特征提取模块,可以由在计算机视觉领域的公共图像数据集(例如,ImageNet)上训练得到的深度卷积神经网络中的卷积层(例如,VGG-16网络的前13个卷积层) 构成。
例如,从人群视频片段中获取了三帧人群图像I 1、I 2和I 3。将三帧人群图像I 1、I 2和I 3输入到卷积神经网络中的特征提取模块进行特征提取,可以得到三个第一特征图:人群图像I 1对应的第一特征图X 1、人群图像I 2对应的第一特征图X 2和人群图像I 3对应的第一特征图X 3。其中,每个第一特征图的尺寸缩小为对应帧人群图像的1/8,且通道数是512。
特征提取模块的结构除了可以由上述VGG-16网络的前13个卷积层构成之外,还可以根据实际情况设置为其它网络结构,本公开对此不做具体限定。针对不同网络结构的特征提取模块,对从人群视频片段中获取的至少两帧人群图像进行特征提取之后得到的至少两个第一特征图的尺寸和通道数可以是不同的,本公开对此不做具体限定。
在一种可能的实现方式中,确定目标第一特征图中目标像素点在至少两个第一特征图中对应的特征邻域,包括:根据目标像素点在目标第一特征图中的坐标,以及预设标准差,确定目标像素点对应的二维高斯分布;根据目标像素点对应的二维高斯分布,分别在至少两个第一特征图中确定对应的特征邻域。
基于二维高斯分布的分布特性,根据目标像素点对应的二维高斯分布,在至少两个第一特征图中确定对应的特征邻域,使得该特征邻域可以捕获不同第一特征图中像素点的局部和长距离关联关系,有效反映不同帧人群图像之间的时空关系。
仍以上述三个第一特征图X 1、X 2和X 3,第一特征图X 2是目标第一特征图为例,针对目标第一特征图X 2中任一目标像素点(x,y),根据目标像素点(x,y)的坐标,以及预设标准差γ 2,生成目标像素点(x,y)对应的二维高斯分布N((x,y),γ 2,I 2),其中,I 2是二阶单位方阵。预设标准差γ 2的具体取值可以根据实际情况确定,本公开对此不做具体限定。
在确定目标像素点(x,y)对应的二维高斯分布N((x,y),γ 2,I 2)之后,通过对该高斯二维分布N((x,y),γ 2,I 2)进行采样,分别为第一特征图X 1、X 2和X 3确定一组整数采样坐标
Figure PCTCN2021121767-appb-000001
其中,P是每组采样坐标中包括的采样坐标的数目。P的具体取值可以根据实际情况确定,本公开对此不做具体限定。对二维高斯分布进行采样的方式可以是随机采样,也可以采用其它采样方式,本公开对此不做具体限定。
上述为第一特征图X 1、X 2和X 3确定的采样坐标
Figure PCTCN2021121767-appb-000002
Figure PCTCN2021121767-appb-000003
分别构成目标第一特征图X 2中的目标像素点(x,y)在第一特征图X 1、X 2和X 3中的特征邻域。
采用上述方式遍历目标第一特征图X 2中的目标像素点,可以得到目标第一特征图X 2中的目标 像素点在第一特征图X 1、X 2和X 3中的特征邻域。
在一种可能的实现方式中,基于目标像素点对应的特征邻域,对至少两个第一特征图进行融合,得到目标人群图像对应的第二特征图,包括:基于目标像素点在至少两个第一特征图中对应的特征邻域,在至少两个第一特征图中分别确定目标像素点对应的采样像素点;根据目标像素点以及目标像素点对应的采样像素点,对至少两个第一特征图进行融合,得到第二特征图,其中,第二特征图和目标第一特征图具有相同的尺寸。
在确定目标像素点在至少两个第一特征图中对应的特征邻域之后,可以基于目标像素点对应的特征邻域,快速确定至少两个第一特征图中目标像素点对应的采样像素点,进而根据目标像素点以及目标像素点对应的采样像素点,实现至少两个第一特征图的融合,以有效得到目标人群图像对应的第二特征图。
在一示例中,可以利用卷积神经网络中的高斯邻域注意力模块,实现基于高斯邻域注意力机制,根据目标像素点在至少两个第一特征图中对应的特征邻域,对至少两个第一特征图进行融合,以得到目标人群图像对应的第二特征图。高斯邻域注意力模块包括三个输入:查询图(query map)、键图(key map)和值图(value map)。其中,查询图可以是目标人群图像对应的目标第一特征图,键图和值图是根据第一特征图构成的多个成对存在的键图值图对,其中,同一键图值图对中的键图和值图是相同的第一特征图。查询图可以表示为Q∈R h×w×c,键图值图对可以表示为
Figure PCTCN2021121767-appb-000004
其中,K表示键图,V表示值图,n是键图值图对的数目。n的取值与至少两个第一特征图的数目相同。
由于目标第一特征图中目标像素点在第一特征图中对应的特征邻域,是基于目标像素点的二维高斯分布确定的,因此,在后续特征融合过程中,可以仅将注意力机制限定在目标第一特征图的高斯邻域之中,使得可以去除全局注意力机制中的冗余成分,从而可以提高特征融合效率,降低计算消耗。
仍以上述三个第一特征图X 1、X 2和X 3,第一特征图X 2是目标第一特征图为例。将目标第一特征图X 2确定为查询图Q。根据三个第一特征图X 1、X 2和X 3确定三个键图值图对:(K 1,V 1)=(X 1,X 1)、(K 2,V 2)=(X 2,X 2)和(K 3,V 3)=(X 3,X 3)。
由于上述为第一特征图X 1、X 2和X 3确定的采样像素点坐标
Figure PCTCN2021121767-appb-000005
Figure PCTCN2021121767-appb-000006
分别构成目标第一特征图X 2中的目标像素点(x,y)在第一特征图X 1、X 2和X 3中的特征邻域。因此,针对查询图Q中的任一目标像素点(x,y),
Figure PCTCN2021121767-appb-000007
是目标像素点(x,y)在键图值图对(K 1,V 1)中对应的特征邻域、
Figure PCTCN2021121767-appb-000008
是目标像素点(x,y)在键图值图对(K 2,V 2)中对应的特征邻域、
Figure PCTCN2021121767-appb-000009
是目标像素点(x,y)在键图值图对(K 3,V 3)中对应的特征邻域。
在一种可能的实现方式中,根据目标像素点以及目标像素点对应的采样像素点,对至少两个第一特征图对进行融合,得到第二特征图,包括:对目标像素点与目标像素点对应的采样像素点之间的点 积进行归一化处理,得到目标像素点对应的采样像素点的权重;根据目标像素点对应的采样像素点的权重,对目标像素点对应的采样像素点进行加权求和,得到第二特征图。
针对查询图Q(目标第一特征图)中的目标像素点(x,y),在任一键图值图对{(K i,V i)},根据上述基于二维高斯分布采样得到的键图值图对{(K i,V i)}对应的一组采样坐标点
Figure PCTCN2021121767-appb-000010
确定目标像素点(x,y)在键图K i中对应的采样像素点
Figure PCTCN2021121767-appb-000011
以及确定目标像素点(x,y)在值图V i中对应的采样像素点
Figure PCTCN2021121767-appb-000012
而基于下述公式(1),确定第二特征图中像素点(x,y)对应的高斯注意力ATTENTION(x,y):
Figure PCTCN2021121767-appb-000013
其中,
Figure PCTCN2021121767-appb-000014
Figure PCTCN2021121767-appb-000015
分别是查询图Q中的目标像素点(x,y)、目标像素点(x,y)在键图K i中对应的采样像素点
Figure PCTCN2021121767-appb-000016
以及目标像素点(x,y)在值图V i中对应的采样像素点
Figure PCTCN2021121767-appb-000017
softmax(·)是归一化函数,利用softmax(·)归一化函数,对Q x,y
Figure PCTCN2021121767-appb-000018
之间的点积进行归一化处理,用于确定目标像素点(x,y)在键图K i中对应的采样像素点
Figure PCTCN2021121767-appb-000019
的权重。进而根据键图K i中采样像素点
Figure PCTCN2021121767-appb-000020
的权重,对值图V i中采样像素点
Figure PCTCN2021121767-appb-000021
进行加权求和,以得到第二特征图中像素点(x,y)对应的高斯注意力ATTENTION(x,y)。
图2示出根据本公开实施例的特征融合的示意图。如图2所示,针对查询图Q(目标第一特征图)中的目标像素点,根据目标像素点的二维高斯分布,分别在键图值图对{(K i,V i)}中的键图K i和值图V i(均为第一特征图)中确定目标像素点对应的采样像素点,进而基于上述公式(1),利用softmax(·)归一化函数,对目标像素点和键图中对应的采样像素点之间的点积进行归一化处理,得到键图中对应的采样像素点的权重,进而根据键图中对应的采样像素点的权重,对值图中对应的采样像素点进行加权求和,得到第二特征图中目标像素点的高斯注意力。
基于上述公式(1),遍历查询图Q中的目标像素点,从而可以得到目标人群图像I 2对应的第二特征图Z中像素点对应的高斯注意力,基于第二特征图Z中像素点对应的高斯注意力,可以得到与目标人群图像I 2对应的目标第一特征图X 2具有相同尺寸的第二特征图Z。第二特征图Z是基于高斯邻域注意力机制进行特征增强之后得到的特征图,第二特征图Z和目标人群图像I 2对应的目标第一 特征图X 2具有相同的尺寸,第二特征图Z可以反映目标人群图像I 2与其它非目标人群图像I 1、I 3之间的时空关系。
在一种可能的实现方式中,根据第二特征图进行人群定位,得到目标人群图像对应的目标定位图,包括:根据第二特征图进行人群定位,得到第一定位概率图,其中,第一定位概率图用于指示目标人群图像中目标像素点是人体的概率;根据概率阈值,对第一定位概率图进行图像处理,得到目标定位图。
由于第二特征图可以反映目标人群图像与其它非目标人群图像之间的时空关系,因此,利用第二特征图进行人群定位,可以得到目标人群图像对应的准确率较高的第一定位概率图,但是,由于第一定位概率图仅用于指示目标人群图像中像素点是人体的概率,因此,通过预先设置的概率阈值对第一定位概率图进行图像处理,从而可以有效得到用于指示目标人群图像中包括的人体的位置的目标定位图。
下面结合本公开可能的实现方式对根据第二特征图进行人群定位的过程做详细描述。
在一种可能的实现方式中,根据第二特征图进行人群定位,得到第一定位概率图,包括:对第二特征图进行卷积处理,得到第三特征图;对第三特征图进行转置卷积处理,得到第四特征图,其中,第四特征图和目标人群图像具有相同的尺寸;对第四特征图进行卷积处理,得到第一定位概率图。
通过对第二特征图进行卷积处理,以实现进一步的特征提取,得到第三特征图,为了确定目标人群图像中目标像素点是人体的概率,对第三特征图进行转置卷积处理,以使得可以得到与目标人群图像具有相同尺寸的第四特征图,进而对第四特征图进行卷积处理,可以有效得到用于指示目标人群图像中目标像素点是人体的概率的第一定位概率图。
第一定位概率图与目标人群图像具有相同的尺寸。仍以上述目标人群图像I 2为例,在目标人群图像I 2∈R H×W×3的情况下,H和W分别是目标人群图像的高和宽,目标人群图像的通道数是3(例如,RGB三通道),此时,第一定位概率图可以记作
Figure PCTCN2021121767-appb-000022
其中,
Figure PCTCN2021121767-appb-000023
用于指示I 2(x)是人体的概率,x是目标人群图像I 2和第一定位概率图
Figure PCTCN2021121767-appb-000024
中相对位置相同的目标像素点的坐标。
在一种可能的实现方式中,可以利用卷积神经网络中的定位预测模块,对第二特征图进行人群定位,得到第一定位概率图。
在一示例中,卷积神经网络中的定位预测模块,可以包括用于进行卷积处理的卷积层,以及用于进行转置卷积处理的转置卷积层。定位预测模块的具体结构可以根据实际情况进行设置(例如,卷积层的层数,以及各层级的排布方式等),本公开对此不做具体限定。
在一示例中,仍以上述第二特征图Z为例,将第二特征图Z输入卷积神经网络中的定位预测模块,定位预测模块对第二特征图Z进行人群定位的过程可以具体描述如下:利用三个卷积层(卷积核大小是3,空洞率是2,通道数是512),对第二特征图Z进行卷积处理,以实现进一步地特征提取,得到第三特征图;然后利用三个转置卷积层(卷积核大小是4,步长是2,通道数分别是256、128、64), 以及每个转置卷积层之后连接的一个卷积层(卷积核大小是3,空洞率是2,通道数分别是256、128、64),对第三特征图进行转置卷积处理后,以实现将特征变换为目标人群图像的尺寸,得到与目标人群图像的尺寸相同的第四特征图,最后利用一个1×1卷积层对第四特征图进行卷积处理,将特征的通道数变换为1,最终输出第一定位概率图
Figure PCTCN2021121767-appb-000025
由于第一定位概率图仅用于指示目标人群图像中目标像素点是人体的概率,因此,通过预先设置的概率阈值对第一定位概率图进行图像处理,从而可以有效得到用于指示目标人群图像中包括的人体的位置的目标定位图。概率阈值的具体取值可以根据实际情况确定,本公开对此不做具体限定。
在一种可能的实现方式中,根据概率阈值,对第一定位概率图进行图像处理,得到目标定位图,包括:对第一定位概率图进行平均池化操作,得到均值池化图;对均值池化图进行最大池化操作,得到最大池化图;根据均值池化图和最大池化图,得到第二定位概率图;根据概率阈值,对第二定位概率图进行阈值分割,得到目标定位图。
对第一定位概率图进行平均池化操作,得到均值池化图,以及对均值池化图进行最大池化操作,得到最大池化图,从而可以有效实现对图像噪声的抑制。
在一示例中,首先,利用尺寸是3、步长是1的第一池化核,对第一定位概率图进行平均池化操作,得到均值池化图;然后,利用尺寸是3、步长是1的第二池化核,对均值池化图进行最大池化操作,得到最大池化图。第一池化核和第二池化核的尺寸、步长的具体取值可以根据实际情况进行设置,本公开对此不做具体限定。
对均值池化图和最大池化进行峰值筛选,从而可以得到精度更高的第二定位概率图。
在一示例中,均值池化图和最大池化图中的像素点的像素值,用于指示目标人群图像中对应目标像素点是人体的概率。对均值池化图和最大池化图进行逐像素点对比,针对均值池化图和最大池化图中相对位置相同的像素点,若像素值为相同的概率值,则将第二定位概率图中相对位置相同的像素点的像素值确定为该概率取值;针对均值池化图和最大池化图中相对位置相同的像素点,若像素值为不同的概率值,则将第二定位概率图中相对位置相同的像素点的像素值确定为0。
例如,在均值池化图中像素点(i,j)(第i行、第j列处的像素点)的像素值为0.7,最大池化图中像素点(i,j)的像素值为0.7的情况下,第二定位概率图中像素点(i,j)的像素值确定为0.7。
再例如,在均值池化图中像素点(i,j)的像素值为0.7,最大池化图中像素点(i,j)的像素值为0.5的情况下,第二定位概率图中像素点(i,j)的像素值确定为0。
最终,通过预先设置的概率阈值,对第二定位概率图进行阈值分割,从而可以得到最终需要的目标定位图,进而有效确定目标人群图像中包括的人体的位置。
在一示例中,将第二定位概率图中逐像素点对应的概率取值与概率阈值进行比较,在某一像素点的像素值大于或等于概率阈值的情况下,将目标定位图中相对位置相同的像素点的像素值确定为1;在某一像素点的像素值小于概率阈值的情况下,将目标定位图中相对位置相同的像素点的像素值确定为0。
目标定位图和目标人群图像具有相同的尺寸,目标定位图中像素值为1的像素点的位置,用于指示目标人群图像中包括的人体的位置。例如,在目标定位图中像素点(i,j)的像素值为1的情况下,目标人群图像中目标像素点(i,j)的位置对应人体;在目标定位图中像素点(i,j)的像素值为0的情况下,目标人群图像中目标像素点(i,j)的位置对应人体头部以外的部分。
根据目标定位图,即可以确定目标人群图像中包括的人体的位置,实现人群定位,为其它人群分析任务(例如,人群计数、群体行为解析等)提供数据依据。例如,可以通过统计目标定位图中像素值为1的像素点的个数,得到目标人群图像中包括的人体的数量,实现对目标人群图像的人群计数。再例如,可以通过统计目标定位图中像素值为1的像素点的分布情况,得到目标人群图像中包括的人体的行为轨迹,实现对目标人群图像的人群行为解析
在一种可能的实现方式中,人群定位方法通过人群定位神经网络实现,人群定位神经网络的训练样本包括人群样本视频片段和人群样本视频片段中的目标人群样本图像对应的真实定位图;人群定位神经网络的训练方法如下:根据人群样本视频片段,通过人群定位神经网络,确定目标人群样本图像对应的预测定位概率图,其中,预测定位概率图用于指示目标人群样本图像中像素点是人体的概率;基于预测定位概率图与真实定位图,确定定位损失;基于定位损失,优化人群定位神经网络。
为了快速实现人群定位,可以基于上述人群定位方法预先训练得到人群定位神经网络,进而在实际应用中,通过人群定位神经网络,快速有效地实现对人群图像的认定定位。
预先构建用于对人群定位神经网络进行网络训练的训练样本,其中,训练样本中包括人群样本视频片段和人群样本视频片段中的目标人群样本图像对应的真实定位图。
这里的人群样本视频片段是包括多帧人群样本图像的视频片段,其可以是图像采集设备对某个空间范围内(例如,广场、商场、地铁站、旅游景点等人流量较大的地点)的密集人群进行视频采集后得到的,也可以是通过其它方式获取得到的,本公开对此不做具体限定。
在一种可能的实现方式中,该人群定位方法还包括:获取原始人群样本视频;对原始人群样本视频进行帧率下采样,得到人群样本视频片段,其中,人群样本视频片段的帧率小于阈值。
图像采集设备对密集人群进行视频采集,得到原始人群样本视频之后,在原始人群样本视频的帧率较高的情况下,原始人群样本视频中相邻帧人群样本图像之间的差异较小,为了更好地利用不同帧人群样本图像之间的时空关系,可以对帧率较高的原始人群样本视频进行帧率下采样,得到帧率小于阈值的人群样本视频片段,以使得人群样本视频片段中相邻帧人群样本图像之间的差异较大,从而可以更好地利用人群样本视频片段中不同帧人群样本图像之间的时空关系,对人群定位神经网络进行训练。例如,人群样本视频片段的帧率为每秒5帧。
在对原始人群样本视频进行帧率下采样得到人群样本视频片段后,由于人群样本视频片段的人群样本图像中除了包括密集人群之外,可能还包括其它背景部分,为了更好地对人群定位神经网络进行训练,可以对人群样本图像进行裁剪,保留人群样本图像中包括的密集人群部分。但是,裁剪后的人群样本图像需要具有相同的尺度,以确保可以对人群样本图像实现后续的特征提取、特征融合等图像处理操作。
人群样本视频片段中包括多帧人群样本图像,从人群样本视频片段中获取至少两帧人群样本图像进行特征提取,其中,进行特征提取的至少两帧人群样本图像的具体数目可以根据实际情况确定,例如,2帧、3帧、5帧、7帧等,本公开对此不做具体限定。
在从人群样本视频片段中获取的至少两帧人群样本图像中,任意选取一帧人群样本图像确定为目标人群样本图像。例如,目标人群样本图像,可以是至少两帧人群样本图像中的首帧人群样本图像;可以是至少两帧人群样本图像中的尾帧人群样本图像;在从人群样本视频片段中获取的是大于或等于3帧的奇数帧人群样本图像的情况下,目标人群样本图像可以是大于或等于3帧的奇数帧人群样本图像中的中间帧人群样本图像;还可以是至少两帧人群样本图像中的任意一帧人群样本图像,本公开对此不做具体限定。
真实定位图和目标人群样本图像具有相同的尺寸,真实定位图中像素点的像素值为0或1,像素值为1的像素点的位置,用于指示目标人群样本图像中包括的人体的位置;像素值为0的像素点的位置,用于指示目标人群样本图像中包括的人体以外的其它位置。真实定位图和目标人群样本图像之间的关系,与上述目标定位图和目标人群图像之间的关系类似,此处不再赘述。
在一种可能的实现方式中,该人群定位方法还包括:确定目标人群样本图像对应的标注结果,其中,标注结果包括人体在目标人群样本图像中的坐标;根据标注结果,确定真实定位图。
通过对目标人群样本图像进行人体坐标的标注,以使得可以根据标注结果有效确定目标人群样本图像对应的真实定位图,进而可以根据目标人群样本图像和真实定位图有效构建用于对人群定位神经网络进行网络训练的训练样本。
在一示例中,目标人群样本图像是I 2′∈R H×W×3,H和W分别是目标人群样本图像I 2′的高和宽,目标人群样本图像的通道数是3。对目标人群样本图像I 2′中包括的人体进行标注,得到目标人群样本图像I 2′对应的标注结果
Figure PCTCN2021121767-appb-000026
其中,a i是第i个人体在目标人群样本图像I 2′中的坐标,m是目标人群样本图像I 2′中包括的人体的个数。
在一示例中,可以根据目标人群样本图像I 2′对应的标注结果
Figure PCTCN2021121767-appb-000027
利用下述公式(2),确定目标人群样本图像I 2′对应的真实定位图Y∈R H×W
Figure PCTCN2021121767-appb-000028
其中,
Figure PCTCN2021121767-appb-000029
y是目标人群样本图像I 2′和真实定位图Y中相对位置相同的像素点的坐标,K=[0,1,0;1,1,1;0,1,0]是卷积核,ψ(·)是卷积结果图,δ(·)是多元delta函数,其具体形式可以如下述公式(3)所示,
Figure PCTCN2021121767-appb-000030
根据目标人群样本图像对应的标注结果,除了可以采用上述公式(2)的方式确定真实定位图,还可以采用其它方式确定,本公开对此不做具体限定。
在确定上述训练样本之后,利用上述训练样本对人群定位神经网络进行网络训练,首先,通过人群定位神经网络,确定训练样本中包括的目标人群样本图像对应的,用于指示目标人群样本图像中像素点是人体的概率的预测定位概率图。
在一种可能的实现方式中,根据人群样本视频片段,通过人群定位神经网络,确定目标人群样本图像对应的预测定位概率图,包括:分别对从人群样本视频片段中获取的至少两帧人群样本图像进行特征提取,得到至少两个第五特征图;确定目标第五特征图中像素点在至少两个第五特征图中对应的特征邻域,其中,目标第五特征图是目标人群样本图像对应的第五特征图;基于像素点对应的特征邻域,对至少两个第五特征图进行融合,得到目标人群样本图像对应的第六特征图;根据第六特征图进行人群定位,得到预测定位概率图。
人群定位神经网络中包括特征提取模块,从人群样本视频片段中获取的至少两个人群样本图像经过特征提取模块进行特征提取之后,可以得到至少两个第五特征图。例如,从人群样本视频片段中获取三帧人群样本图像:I′ 1、I′ 2和I′ 3,其中,人群样本图像I′ 2是目标人群样本图像。利用人群定位神经网络中的特征提取模块,对人群样本图像I′ 1、I′ 2和I′ 3进行特征提取,得到三个第五特征图:人群样本图像I′ 1对应的第五特征图X′ 1、人群样本图像I′ 2对应的第五特征图X′ 2和人群样本图像I′ 3对应的第五特征图X′ 3
人群定位神经网络中特征提取模块的网络结构,与上述卷积神经网络中特征提取模块的网络结构类似,人群定位神经网络中特征提取模块对至少两帧人群样本图像的特征提取过程,与上述卷积神经网络中特征提取模块对至少两帧人群样本图像的特征提取过程类似,此处不再赘述。
人群定位神经网络中包括高斯邻域注意力模块,基于高斯邻域注意力模块,可以确定目标第五特征图中像素点在至少两个第五特征图中对应的特征邻域,以及基于像素点在至少两个第五特征图中对应的特征邻域,对至少两个第五特征图进行融合,得到目标人群样本图像I′ 2对应的第六特征图Z′。
人群定位神经网络中高斯邻域注意力模块的网络结构,与上述卷积神经网络中高斯邻域注意力模块的网络结构类似,人群定位神经网络中高斯邻域注意力模块进行特征融合的过程,与上述卷积神经网络中高斯邻域注意力模块进行特征融合的过程类似,此处不再赘述。
人群定位神经网络中还包括定位预测模块,利用定位预测模块对第六特征图进行人群定位,可以得到用于指示目标人群样本图像中像素点是人体的概率的预测定位概率图。仍以上述第六特征图Z′为例,利用人群定位神经网络中的定位预测模块,对第六特征图Z′进行人群定位,得到预测定位概 率图
Figure PCTCN2021121767-appb-000031
人群定位神经网络中定位预测模块的网络结构,与上述卷积神经网络中定位预测模块的网络结构类似,人群定位神经网络中定位预测模块对第六特征图的人群定位过程,与上述卷积神经网络中定位预测模块对第二特征图的人群定位过程类似,此处不再赘述。
由于预测定位概率图用于指示目标人群样本图像中像素点是人体的概率,真实定位图用于指示目标人群样本图像中包括的人体的位置,因此,基于预测定位概率图和真实定位图,可以确定人群神经网络的定位损失,进而基于定位损失,可以调整人群定位神经网络的网络参数,以实现优化人群定位神经网络。
在人群定位神经网络得到目标人群样本图像对应的预测定位概率图之后,根据预测定位概率图和真实定位图之间的差异,可以确定人群定位神经网络的定位损失。
在一种可能的实现方式中,基于预测定位概率图和真实定位图,确定定位损失,包括:根据预测定位概率图、真实定位图以及正样本权重,利用交叉熵损失函数,确定定位损失,其中,正样本权重是真实定位图中用于指示人体所在位置的像素点对应的权重。
在一示例中,根据预测定位概率图
Figure PCTCN2021121767-appb-000032
和真实定位图Y,可以通过下述公式(4)所示的交叉熵损失函数,确定定位损失L:
Figure PCTCN2021121767-appb-000033
其中,H和W分别是预测定位概率图
Figure PCTCN2021121767-appb-000034
和真实定位图Y的高和宽,y是预测定位概率图
Figure PCTCN2021121767-appb-000035
和真实定位图Y中相对位置相同的像素点的坐标,λ是正样本权重。
在目标人群样本图像中,人体所在位置的像素点可以认为是正样本,其它像素点则被认为是负样本,由于目标人群样本图像中背景部分的占比可能远远大于人体的占比,也即负样本的数量远远大于正样本的数量,通过设置正样本权重,从而可以实现训练过程中对正负样本进行平衡。
确定定位损失的方式除了可以采用上述公式(4)所示的交叉熵损失函数以外,还可以通过其它损失函数来确定,本公开对此不做具体限定。
在确定定位损失之后,可以根据定位损失调整人群定位神经网络对应的网络参数,以实现对人群定位网络的优化,并采用与上述网络训练方法进行迭代训练,直至迭代训练符合预设训练条件,最终得到训练后的人群定位神经网络。
在一种可能的实现方式中,根据定位损失,利用随梯度下降方法进行网络参数调整。
例如,第i次迭代训练时的网络参数是θ i,利用网络参数θ i进行网络训练之后确定的定位损失是L,则第i+1次迭代训练时的网络参数θ i+1可以通过下述公式(6)确定:
Figure PCTCN2021121767-appb-000036
其中,
Figure PCTCN2021121767-appb-000037
表示梯度算子符号,γ是网络学习率。网络学习率γ的具体取值可以根据实际情况确定,例如,γ=0.0001,本公开对此不作限定。
在一种可能的实现方式中,预设训练条件可以是网络收敛。例如,采用上述网络训练方法进行迭代训练,直至网络参数不再改变,可以认为网络达到收敛,确定得到训练后的人群定位神经网络。
在一种可能的实现方式中,预设训练条件可以是迭代阈值。例如,采用上述网络训练方法进行迭代训练,直至迭代次数达到迭代阈值,确定得到训练后的人群定位神经网络。
在一种可能的实现方式中,预设训练条件可以是定位阈值。例如,采用上述网络训练方法进行迭代训练,直至网络对应的定位准确率大于定位阈值,确定得到训练后的人群定位神经网络。
预设训练条件除了可以是上述网络收敛、迭代阈值,或定位阈值以外,还可以根据实际情况设置为其它训练条件,本公开对此不做具体限定。
图3示出根据本公开实施例的一种人群定位神经网络的示意图。如图3所示,人群定位神经网络30包括特征提取模块31、高斯邻域注意力模块32和定位预测模块33。
如图3所示,将需要进行人群定位的从人群视频片段中获取的至少两帧人群图像输入人群定位神经网络30,特征提取模块31对至少两帧人群图像进行特征提取,得到至少两个第一特征图;高斯邻域注意力32基于高斯邻域注意力机制,确定目标人群图像对应的目标第一特征图中,目标像素点在至少两个第一特征图中对应的特征邻域,以及基于目标像素点对应的特征邻域,对至少两个第一特征图进行融合,得到目标人群图像对应的第二特征图;定位预测模块33对第二特征图进行人群定位,得到用于指示目标人群图像中包括的人体的位置的目标定位图。特征提取模块31、高斯邻域注意力32和定位预测模块33的具体处理过程与上述相关描述类似,此处不再赘述。
在本公开实施例中,利用人群定位神经网络,在人群定位过程中,基于高斯邻域注意力机制进行特征融合,以使得融合后的特征图可以反映目标人群图像与其它非目标帧人群图像之间的时空关系,以使得利用融合后的特征图进行人群定位后,可以得到目标人群图像对应的准确率较高的目标定位图,从而有效提高了人群定位的准确率。
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。
此外,本公开还提供了人群定位装置、电子设备、计算机可读存储介质、程序产品,上述均可用来实现本公开提供的任一种人群定位方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。
图4示出根据本公开实施例的一种人群定位装置的框图。如图4所示,装置40包括:特征提取模块41,用于分别对从人群视频片段中获取的至少两帧人群图像进行特征提取,得到至少两个第一特征图;特征邻域确定模块42,用于确定目标第一特征图中目标像素点在至少两个第一特征图中对应的特征邻域,其中,目标第一特征图是与至少两帧人群图像中的目标人群图像对应的第一特征图;特征融合模块43,用于基于目标像素点对应的特征邻域,对至少两个第一特征图进行融合,得到目标人群图像对应的第二特征图;人群定位模块44,用于根据第二特征图进行人群定位,得到目标人群图像对应的目 标定位图,其中,目标定位图用于指示目标人群图像中包括的人体的位置。
在一种可能的实现方式中,特征邻域确定模块42,具体用于:根据目标像素点在目标第一特征图中的坐标,以及预设标准差,确定目标像素点对应的二维高斯分布;根据目标像素点对应的二维高斯分布,分别在至少两个第一特征图中确定对应的特征邻域。
在一种可能的实现方式中,特征融合模块43,包括:第一确定子模块,用于基于目标像素点在至少两个第一特征图中对应的特征邻域,在至少两个第一特征图中分别确定目标像素点对应的采样像素点;第二确定子模块,用于根据目标像素点以及目标像素点对应的所述采样像素点,对至少两个第一特征图进行融合,得到第二特征图,其中,第二特征图和目标第一特征图具有相同的尺寸。
在一种可能的实现方式中,第二确定子模块,具体用于:对目标像素点与目标像素点对应的采样像素点之间的点积进行归一化处理,得到目标像素点对应的采样像素点的权重;根据目标像素点对应的采样像素点的权重,对目标像素点对应的采样像素点进行加权求和,得到第二特征图。
在一种可能的实现方式中,人群定位模块44,包括:人群定位子模块,用于根据第二特征图进行人群定位,得到第一定位概率图,其中,第一定位概率图用于指示目标人群图像中目标像素点是人体的概率;第三确定子模块,用于根据概率阈值,对第一定位概率图进行图像处理,得到目标定位图。
在一种可能的实现方式中,人群定位子模块,具体用于:对第二特征图进行卷积处理,得到第三特征图;对第三特征图进行转置卷积处理,得到第四特征图,其中,第四特征图和目标人群图像具有相同的尺寸;对第四特征图进行卷积处理,得到第一定位概率图。
在一种可能的实现方式中,第三确定子模块,具体用于:对第一定位概率图进行平均池化操作,得到均值池化图;对均值池化图进行最大池化操作,得到最大池化图;根据均值池化图和最大池化图,得到第二定位概率图;根据概率阈值,对第二定位概率图进行阈值分割,得到目标定位图。
在一种可能的实现方式中,装置40通过人群定位神经网络实现人群定位方法,人群定位神经网络的训练样本包括人群样本视频片段和人群样本视频片段中的目标人群样本图像对应的真实定位图;装置40还包括:网络训练模块,包括:预测子模块,用于根据人群样本视频片段,通过人群定位神经网络,确定目标人群样本图像对应的预测定位概率图,其中,预测定位概率图用于指示目标人群样本图像中像素点是人体的概率;第四确定子模块,用于基于预测定位概率图与真实定位图,确定定位损失;优化子模块,用于基于定位损失,优化人群定位神经网络。
在一种可能的实现方式中,预测子模块,具体用于:分别对从人群样本视频片段中获取的至少两帧人群样本图像进行特征提取,得到至少两个第五特征图;确定目标第五特征图中像素点在至少两个第五特征图中对应的特征邻域,其中,目标第五特征图是目标人群样本图像对应的第五特征图;基于像素点在至少两个第五特征图中对应的特征邻域,对至少两个第五特征图进行融合,得到目标人群样本图像对应的第六特征图;根据第六特征图进行人群定位,得到预测定位概率图。
在一种可能的实现方式中,第四确定子模块,具体用于:根据预测定位概率图、真实定位图以及正样本权重,利用交叉熵损失函数,确定定位损失,其中,正样本权重是真实定位图中用于指示人体所在位置的像素点对应的权重。
在一种可能的实现方式中,装置40,还包括:获取子模块,用于获取原始人群样本视频;下采样子模块,用于对原始人群样本视频进行帧率下采样,得到人群样本视频片段,其中,人群样本视频片 段的帧率小于阈值。
在一种可能的实现方式中,装置40,还包括:第五确定子模块,用于确定目标人群样本图像对应的标注结果,其中,标注结果包括人体在目标人群样本图像中的坐标;第六确定子模块,用于根据标注结果,确定真实定位图。
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。计算机可读存储介质可以是易失性计算机可读存储介质或非易失性计算机可读存储介质。
本公开实施例还提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,当计算机可读代码在设备上运行时,设备中的处理器执行用于实现如上任一实施例提供的人群定位方法的指令。
本公开实施例还提供了另一种计算机程序产品,用于存储计算机可读指令,指令被执行时使得计算机执行上述任一实施例提供的人群定位方法的操作。
电子设备可以被提供为终端、服务器或其它形态的设备。
图5示出根据本公开实施例的一种电子设备的框图。如图5所示,电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。
参照图5,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑 动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如互补金属氧化物半导体(CMOS)或电荷耦合装置(CCD)图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如无线网络(WiFi),第二代移动通信技术(2G)或第三代移动通信技术(3G),或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。
图6示出根据本公开实施例的一种电子设备的框图。如图6所示,电子设备1900可以被提供为一服务器。参照图6,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设 备1900可以操作基于存储在存储器1932的操作系统,例如微软服务器操作系统(Windows Server TM),苹果公司推出的基于图形用户界面操作系统(Mac OS X TM),多用户多进程的计算机操作系统(Unix TM),自由和开放原代码的类Unix操作系统(Linux TM),开放原代码的类Unix操作系统(FreeBSD TM)或类似。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是(但不限于)电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言-诸如Smalltalk、C++等,以及常规的过程式编程语言-诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络-包括局域网(LAN)或广域网(WAN)-连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理 器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。

Claims (16)

  1. 一种人群定位方法,其特征在于,包括:
    分别对从人群视频片段中获取的至少两帧人群图像进行特征提取,得到至少两个第一特征图;
    确定目标第一特征图中目标像素点在所述至少两个第一特征图中对应的特征邻域,其中,所述目标第一特征图是与所述至少两帧人群图像中的目标人群图像对应的第一特征图;
    基于目标像素点对应的所述特征邻域,对所述至少两个第一特征图进行融合,得到所述目标人群图像对应的第二特征图;
    根据所述第二特征图进行人群定位,得到所述目标人群图像对应的目标定位图,其中,所述目标定位图用于指示所述目标人群图像中包括的人体的位置。
  2. 根据权利要求1所述的方法,其特征在于,所述确定目标第一特征图中目标像素点在所述至少两个第一特征图中对应的特征邻域,包括:
    根据目标像素点在所述目标第一特征图中的坐标,以及预设标准差,确定目标像素点对应的二维高斯分布;
    根据目标像素点对应的所述二维高斯分布,分别在所述至少两个第一特征图中确定对应的所述特征邻域。
  3. 根据权利要求1或2所述的方法,其特征在于,所述基于目标像素点对应的所述特征邻域,对所述至少两个第一特征图进行融合,得到所述目标人群图像对应的第二特征图,包括:
    基于目标像素点在所述至少两个第一特征图中对应的所述特征邻域,在所述至少两个第一特征图中分别确定目标像素点对应的采样像素点;
    根据目标像素点以及目标像素点对应的所述采样像素点,对所述至少两个第一特征图进行融合,得到所述第二特征图,其中,所述第二特征图和所述目标第一特征图具有相同的尺寸。
  4. 根据权利要求3所述的方法,其特征在于,所述根据目标像素点以及目标像素点对应的所述采样像素点,对所述至少两个第一特征图进行融合,得到所述第二特征图,包括:
    对目标像素点与目标像素点对应的所述采样像素点之间的点积进行归一化处理,得到目标像素点对应的所述采样像素点的权重;
    根据目标像素点对应的所述采样像素点的权重,对目标像素点对应的所述采样像素点进行加权求和,得到所述第二特征图。
  5. 根据权利要求1至4中任意一项所述的方法,其特征在于,所述根据所述第二特征图进行人群定位,得到所述目标人群图像对应的目标定位图,包括:
    根据所述第二特征图进行人群定位,得到第一定位概率图,其中,所述第一定位概率图用于指示所述目标人群图像中目标像素点是人体的概率;
    根据概率阈值,对所述第一定位概率图进行图像处理,得到所述目标定位图。
  6. 根据权利要求5所述的方法,其特征在于,所述根据所述第二特征图进行人群定位,得到第一定位概率图,包括:
    对所述第二特征图进行卷积处理,得到第三特征图;
    对所述第三特征图进行转置卷积处理,得到第四特征图,其中,所述第四特征图和所述目标人群图像具有相同的尺寸;
    对所述第四特征图进行卷积处理,得到所述第一定位概率图。
  7. 根据权利要求5或6所述的方法,其特征在于,所述根据概率阈值,对所述第一定位概率图进行图像处理,得到所述目标定位图,包括:
    对所述第一定位概率图进行平均池化操作,得到均值池化图;
    对所述均值池化图进行最大池化操作,得到最大池化图;
    根据所述均值池化图和所述最大池化图,得到第二定位概率图;
    根据所述概率阈值,对所述第二定位概率图进行阈值分割,得到所述目标定位图。
  8. 根据权利要求1至7中任意一项所述的方法,其特征在于,所述人群定位方法通过人群定位神经网络实现,所述人群定位神经网络的训练样本包括人群样本视频片段和所述人群样本视频片段中的目标人群样本图像对应的真实定位图;
    所述人群定位神经网络的训练方法如下:
    根据所述人群样本视频片段,通过所述人群定位神经网络,确定所述目标人群样本图像对应的预测定位概率图,其中,所述预测定位概率图用于指示所述目标人群样本图像中像素点是人体的概率;
    基于所述预测定位概率图与所述真实定位图,确定定位损失;
    基于所述定位损失,优化所述人群定位神经网络。
  9. 根据权利要求8所述的方法,其特征在于,所述根据所述人群样本视频片段,通过所述人群定位神经网络,确定所述目标人群样本图像对应的预测定位概率图,包括:
    分别对从所述人群样本视频片段中获取的至少两帧人群样本图像进行特征提取,得到至少两个第五特征图;
    确定目标第五特征图中像素点在所述至少两个第五特征图中对应的特征邻域,其中,所述目标第五特征图是所述目标人群样本图像对应的第五特征图;
    基于像素点对应的所述特征邻域,对所述至少两个第五特征图进行融合,得到所述目标人群样本图像对应的第六特征图;
    根据所述第六特征图进行人群定位,得到所述预测定位概率图。
  10. 根据权利要求8或9所述的方法,其特征在于,所述基于所述预测定位概率图和所述真实定位图,确定定位损失,包括:
    根据所述预测定位概率图、所述真实定位图以及正样本权重,利用交叉熵损失函数,确定所述定位损失,其中,所述正样本权重是所述真实定位图中用于指示人体所在位置的像素点对应的权重。
  11. 根据权利要求8至10中任意一项所述的方法,其特征在于,所述方法还包括:
    获取原始人群样本视频;
    对所述原始人群样本视频进行帧率下采样,得到所述人群样本视频片段,其中,所述人群样本视频片段的帧率小于阈值。
  12. 根据权利要求8至11中任意一项所述的方法,其特征在于,所述方法还包括:
    确定所述目标人群样本图像对应的标注结果,其中,所述标注结果包括人体在所述目标人群样本图像中的坐标;
    根据所述标注结果,确定所述真实定位图。
  13. 一种人群定位装置,其特征在于,包括:
    特征提取模块,用于分别对从人群视频片段中获取的至少两帧人群图像进行特征提取,得到至少两个第一特征图;
    特征邻域确定模块,用于确定目标第一特征图中目标像素点在所述至少两个第一特征图中对应的特征邻域,其中,所述目标第一特征图是与所述至少两帧人群图像中的目标人群图像对应的第一特征图;
    特征融合模块,用于基于目标像素点对应的所述特征邻域,对所述至少两个第一特征图进行融合,得到所述目标人群图像对应的第二特征图;
    人群定位模块,用于根据所述第二特征图进行人群定位,得到所述目标人群图像对应的目标定位图,其中,所述目标定位图用于指示所述目标人群图像中包括的人体的位置。
  14. 一种电子设备,其特征在于,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器被配置为调用所述存储器存储的指令,以执行权利要求1至12中任意一项所述的方法。
  15. 一种计算机可读存储介质,其上存储有计算机程序指令,其特征在于,所述计算机程序指令被处理器执行时实现权利要求1至12中任意一项所述的方法。
  16. 一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行用于实现权利要求1-12中的任一权利要求所述的方法。
PCT/CN2021/121767 2021-05-26 2021-09-29 人群定位方法及装置、电子设备和存储介质 WO2022247091A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110579974.XA CN113283343B (zh) 2021-05-26 2021-05-26 人群定位方法及装置、电子设备和存储介质
CN202110579974.X 2021-05-26

Publications (1)

Publication Number Publication Date
WO2022247091A1 true WO2022247091A1 (zh) 2022-12-01

Family

ID=77282097

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/121767 WO2022247091A1 (zh) 2021-05-26 2021-09-29 人群定位方法及装置、电子设备和存储介质

Country Status (2)

Country Link
CN (1) CN113283343B (zh)
WO (1) WO2022247091A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113283343B (zh) * 2021-05-26 2024-10-29 上海商汤智能科技有限公司 人群定位方法及装置、电子设备和存储介质
CN114119640B (zh) * 2022-01-27 2022-04-22 广东皓行科技有限公司 模型训练方法、图像分割方法以及图像分割系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111626171A (zh) * 2020-05-21 2020-09-04 青岛科技大学 基于视频片段注意力机制与交互关系活动图建模的群组行为识别方法
CN112232231A (zh) * 2020-10-20 2021-01-15 城云科技(中国)有限公司 行人属性的识别方法、系统、计算机设备和存储介质
CN112348116A (zh) * 2020-11-30 2021-02-09 长沙理工大学 利用空间上下文的目标检测方法、装置和计算机设备
WO2021057810A1 (zh) * 2019-09-29 2021-04-01 深圳数字生命研究院 数据处理、训练、识别方法、装置和存储介质
CN112767451A (zh) * 2021-02-01 2021-05-07 福州大学 一种基于双流卷积神经网络的人群分布预测方法及其系统
CN113283343A (zh) * 2021-05-26 2021-08-20 上海商汤智能科技有限公司 人群定位方法及装置、电子设备和存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021057810A1 (zh) * 2019-09-29 2021-04-01 深圳数字生命研究院 数据处理、训练、识别方法、装置和存储介质
CN111626171A (zh) * 2020-05-21 2020-09-04 青岛科技大学 基于视频片段注意力机制与交互关系活动图建模的群组行为识别方法
CN112232231A (zh) * 2020-10-20 2021-01-15 城云科技(中国)有限公司 行人属性的识别方法、系统、计算机设备和存储介质
CN112348116A (zh) * 2020-11-30 2021-02-09 长沙理工大学 利用空间上下文的目标检测方法、装置和计算机设备
CN112767451A (zh) * 2021-02-01 2021-05-07 福州大学 一种基于双流卷积神经网络的人群分布预测方法及其系统
CN113283343A (zh) * 2021-05-26 2021-08-20 上海商汤智能科技有限公司 人群定位方法及装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN113283343B (zh) 2024-10-29
CN113283343A (zh) 2021-08-20

Similar Documents

Publication Publication Date Title
TWI766286B (zh) 圖像處理方法及圖像處理裝置、電子設備和電腦可讀儲存媒介
CN109740516B (zh) 一种用户识别方法、装置、电子设备及存储介质
TWI759647B (zh) 影像處理方法、電子設備,和電腦可讀儲存介質
CN112241673B (zh) 视频处理方法及装置、电子设备和存储介质
CN111881956B (zh) 网络训练方法及装置、目标检测方法及装置和电子设备
US20220122292A1 (en) Pose determination method and device, electronic device and storage medium
CN110532956B (zh) 图像处理方法及装置、电子设备和存储介质
JP2022522551A (ja) 画像処理方法及び装置、電子機器並びに記憶媒体
WO2021169136A1 (zh) 图像处理方法及装置、电子设备和存储介质
WO2022247091A1 (zh) 人群定位方法及装置、电子设备和存储介质
US20220383517A1 (en) Method and device for target tracking, and storage medium
CN113326768A (zh) 训练方法、图像特征提取方法、图像识别方法及装置
WO2022141969A1 (zh) 图像分割方法及装置、电子设备、存储介质和程序
CN113139484B (zh) 人群定位方法及装置、电子设备和存储介质
CN113538310A (zh) 图像处理方法及装置、电子设备和存储介质
WO2023142419A1 (zh) 人脸跟踪识别方法、装置、电子设备、介质及程序产品
CN111988622B (zh) 视频预测方法及装置、电子设备和存储介质
WO2023142554A1 (zh) 计数方法及装置、电子设备、存储介质和计算机程序产品
WO2023155350A1 (zh) 一种人群定位方法及装置、电子设备和存储介质
CN113506324B (zh) 图像处理方法及装置、电子设备和存储介质
CN113506325B (zh) 图像处理方法及装置、电子设备和存储介质
CN115035440A (zh) 时序动作提名的生成方法及装置、电子设备和存储介质
CN114842404A (zh) 时序动作提名的生成方法及装置、电子设备和存储介质
CN114359808A (zh) 目标检测方法及装置、电子设备和存储介质
CN113297983A (zh) 人群定位方法及装置、电子设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21942656

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21942656

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 21942656

Country of ref document: EP

Kind code of ref document: A1