Disclosure of Invention
Technical problem to be solved
Aiming at the defects of the prior art, the invention provides a distributed rapid pedestrian re-identification system, which solves the technical problem of low efficiency of pedestrian re-identification.
(II) technical scheme
In order to achieve the purpose, the invention is realized by the following technical scheme:
a distributed rapid pedestrian re-identification system, comprising: the device comprises a video storage device, an edge calculation device, an external storage device, a camera and a terminal computer;
the video storage device is connected with the camera and used for receiving an original video acquired by the camera;
the edge calculation device is connected with the camera and used for receiving the original video record and acquiring the position of a pedestrian in a frame picture and the characteristic vector of the pedestrian in the frame picture;
the external storage device is connected with the edge calculation device and is used for receiving single file information which is sent by the edge calculation device and consists of the position of the pedestrian in a frame picture, the feature vector of the pedestrian in the frame picture, the time information of the frame picture and the camera number of the source of the frame picture;
and the terminal computer is used for calling file information in the external storage device and the original video in the video storage device through the edge computing device to realize the re-identification of the target pedestrian.
Preferably, the distributed rapid pedestrian re-identification system further comprises a transmission device, and the terminal computer is connected with the edge calculation device through the transmission device.
Preferably, the terminal computer is specifically configured to call the file information and the original video record according to the target pedestrian feature vector and a target time range to be queried, so as to realize target pedestrian re-identification.
Preferably, the edge calculation means comprises a pedestrian detection sub-means and a pedestrian identification sub-means connected to each other;
the pedestrian detection sub-device is used for receiving the original video record and acquiring the position of the pedestrian in a frame picture; the pedestrian re-identification sub-device is used for receiving the position information of the pedestrian in the frame picture and acquiring the feature vector of the pedestrian in the frame picture.
Preferably, the distributed rapid pedestrian re-identification system further comprises a data merging device, and the data merging device is arranged between the terminal computer and the plurality of transmission devices.
Preferably, the data merging device includes several stages, and the data merging device at the next stage is used for integrating the data transmitted by the data merging device at the previous stage.
Preferably, the pedestrian detection sub-device carries a pedestrian detection model, and the pedestrian detection model comprises a YOLOV3 model or a YOLOV4 model; the pedestrian identification sub-device carries a pedestrian re-identification model.
Preferably, the external storage device includes a usb disk, a solid state disk, or a removable disk.
(III) advantageous effects
The invention provides a distributed rapid pedestrian re-identification system. Compared with the prior art, the method has the following beneficial effects:
the edge calculating device is connected with the camera and used for receiving the original video and acquiring the position of a pedestrian in a frame picture and the characteristic vector of the pedestrian in the frame picture; the external storage device is connected with the edge calculation device and is used for receiving single file information which is sent by the edge calculation device and consists of the position of the pedestrian in the frame picture, the feature vector of the pedestrian in the frame picture, the time information of the frame picture and the camera number of the source of the frame picture; and the terminal computer is used for calling file information in the external storage device and the original video in the video storage device through the edge computing device so as to realize the re-identification of the target pedestrian at any time. Because the edge computing devices in the whole set of system correspond to the cameras one to one, the pedestrian characteristics of frame pictures in the video stream received in real time are extracted in a distributed mode, the target pedestrians are searched from the video videos shot by the cameras, and the pedestrian re-identification work is efficiently and quickly realized.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are clearly and completely described, and it is obvious that the described embodiments are a part of the embodiments of the present invention, but not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the application solves the technical problem of low efficiency of pedestrian re-identification by providing the distributed rapid pedestrian re-identification system.
In order to solve the technical problems, the general idea of the embodiment of the application is as follows:
the edge calculating device in the embodiment of the invention is connected with the camera and used for receiving the original video recording and acquiring the position of a pedestrian in a frame picture and the characteristic vector of the pedestrian in the frame picture; the external storage device is connected with the edge calculation device and is used for receiving single file information which is sent by the edge calculation device and consists of the position of the pedestrian in the frame picture, the feature vector of the pedestrian in the frame picture, the time information of the frame picture and the camera number of the source of the frame picture; and the terminal computer is used for calling file information in the external storage device and the original video in the video storage device through the edge computing device so as to realize the re-identification of the target pedestrian at any time. Because the edge computing devices in the whole set of system correspond to the cameras one to one, the pedestrian characteristics of frame pictures in the video stream received in real time are extracted in a distributed mode, the target pedestrians are searched from the video videos shot by the cameras, and the pedestrian re-identification work is efficiently and quickly realized.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Example 1:
as shown in fig. 1 to 3, an embodiment of the present invention provides a distributed rapid pedestrian re-identification system, including: the device comprises a video recording storage device, an edge calculation device, an external storage device, a camera, a transmission device and a terminal computer.
The video storage device is connected with the camera and used for receiving the original video acquired by the camera.
The edge calculation device is connected with the camera and used for receiving the original video record and acquiring the position of the pedestrian in the frame picture and the characteristic vector of the pedestrian in the frame picture.
As shown in fig. 4, the edge calculation means includes a pedestrian detection sub-means and a pedestrian recognition sub-means connected to each other; the pedestrian detection sub-device is used for receiving the original video record and acquiring the position of the pedestrian in a frame picture; the pedestrian re-identification sub-device is used for receiving the position information of the pedestrian in the frame picture and acquiring the feature vector of the pedestrian in the frame picture.
The pedestrian detection sub-device carries a pedestrian detection model, and the pedestrian detection model comprises a Yolov3 model or a Yolov4 model; the pedestrian identification sub-device carries a pedestrian re-identification model.
The external storage device is connected with the edge calculation device and is used for receiving single file information which is sent by the edge calculation device and consists of the position of the pedestrian in the frame picture, the feature vector of the pedestrian in the frame picture, the time information of the frame picture and the camera number of the source of the frame picture.
The external storage device comprises a U disk, a solid state disk or a mobile hard disk.
The terminal computer is connected with the edge computing device through the transmission device; the device is used for calling file information in the external storage device and an original video in the video storage device through the edge computing device to realize target pedestrian re-identification.
Specifically, the terminal computer is specifically configured to call the file information and the original video record according to the target pedestrian feature vector and a target time range to be queried, so as to realize target pedestrian re-identification.
As shown in fig. 2, the distributed rapid pedestrian re-identification system according to the embodiment of the present invention further includes a data merging device, where the data merging device is disposed between the terminal computer and the plurality of transmission devices.
As shown in fig. 3, the data merging device includes several stages, and the data merging device at the next stage is used for integrating the data transmitted by the data merging device at the previous stage.
The working principle of the distributed rapid pedestrian re-identification system provided by the embodiment of the invention is as follows:
an edge computing device is deployed and installed in each camera of a city or each place with pedestrian re-identification requirements, a pre-trained pedestrian detection and pedestrian re-identification model is carried on the edge computing device, the device is provided with a pluggable storage interface, and the device can be connected with a U disk, a solid state disk, a mobile hard disk and the like, and is a large-capacity storage device.
And determining the optimal capacity of the external storage equipment according to the time length of the original video of the camera which can be stored. The edge computing device needs to be connected to a video access port of the camera, that is, video data captured by the camera needs to be transmitted to the original video recording storage device and also needs to be transmitted to the edge device.
The purpose of the edge calculation device is as follows: continuously detecting each frame of picture in a video stream, firstly calculating the pedestrian in the video frame through a pedestrian re-identification model carried in the video stream, wherein the pedestrian detection model can use a YOLOV3 model or a YOLOV4 model, then sending the separated pedestrian into the carried pedestrian re-identification model, and calculating the feature vector of the pedestrian. Therefore, the position of a pedestrian and the number of the pedestrian are obtained, and the time when the frame of picture appears and the current number of the camera are difficult to obtain due to the real-time input of the camera video. The four are packaged into a file to be stored in an external storage device of the edge computing device for later inquiry.
The file contains these four items of information: the position of the pedestrian in the frame picture, the feature vector of the pedestrian in the frame picture, the time information of the frame picture and the camera number of the source of the frame picture. It can be easily found that the position of a pedestrian in the video recording can be accurately determined through the four items of information. And because the four items of information are simple digital information, the occupied storage space is very small, each tone of information only needs a space of a few or dozens of KB approximately, and a slightly larger storage medium can completely meet the requirement of pedestrian information recording of one month or even up to a month.
Of course, for some industrial cameras, if 70 frames of data are acquired in 1 second, the calculation load of the edge calculation device is large. However, for scenes in a city, it takes at least 1 to 2 seconds even if a pedestrian runs out of the camera screen. Therefore, it is not necessary to store every frame of picture collected in the camera at all, and the invention is set to collect 5-10 frames of pictures within 1 second. If 5 frames are acquired in one second, namely 1 frame is acquired in 0.2 second; if 10 frames are acquired in 1 second, 1 frame is acquired in 0.1 second. Therefore, the calculation amount of the edge calculation device is greatly reduced, and a common edge calculation device can also complete corresponding tasks.
The edge computing device stores the pedestrians detected in the monitoring picture at any moment in the storage device. If the pedestrian re-identification is needed, the pedestrian re-identification can be quickly completed only by comparing the pedestrian information stored in each edge device. Since each edge device is networked, it can be connected to the central network, i.e. the terminal computer, by wireless or wired transmission means.
Therefore, when a user needs to inquire a pedestrian in a certain time period, only one pedestrian needs to be inquired at the time, and a common computer (host) can complete the feature extraction of the pedestrian. And the user uses the terminal computer to send the feature vector of the target pedestrian and the target time range to be inquired to each edge device through the network. At this time, each edge device receives the instruction, reads data in the external storage device, screens out pedestrian features within the target time range, and calculates the distances between all pedestrian features and the target pedestrian features in the edge calculation device by calculating the Euclidean distance or some other distances so as to judge whether the pedestrian features are the same pedestrian. And if the pedestrian is the same, sending the file information corresponding to the pedestrian and the original video back to the terminal computer for summarizing.
Because the external storage device stores the file information, the edge computing device can search the pedestrian picture from the video storage device through the file information. After receiving the information of each edge computing device, the terminal computer sequences all the information through the time of each piece of information, and then matches the position information and the time information in the information with the original video, thereby efficiently, quickly and real-timely realizing the re-identification of the pedestrian.
Particularly, when the number of the cameras is very large, if each edge computing device summarizes the information and directly feeds the information back to the terminal computer for sequencing and integration, the processing pressure of the whole system is still high, and the efficiency cannot be guaranteed.
Correspondingly, the embodiment of the invention also provides a data merging device, and the data merging device is arranged between the terminal computer and the plurality of transmission devices. The data merging device is used for integrating the results of calculation and inquiry of a certain number of edge calculation devices or an edge calculation device in a block of area, sorting the inquiry results according to time sequence, and then continuously sending the integrated information to the upper level.
If the area is very large, as shown in fig. 3, a multi-stage data merging device may be added, that is, the previous stage of the data merging device is also the data merging device, and each stage of the data merging device is used to sequentially integrate the data sent by the next stage of the data merging device according to time and send the integrated data back to the previous stage. And finally, sending all integrated information back to the terminal computer, wherein the terminal computer directly searches for a target in the original video through pedestrian information which is arranged in sequence from front to back according to time.
Through the above process, the distributed rapid pedestrian re-identification system provided by the embodiment of the invention further comprises a data merging device to realize rapid, real-time and high-response-speed pedestrian re-identification retrieval function.
In summary, compared with the prior art, the method has the following beneficial effects:
1. the edge calculating device in the embodiment of the invention is connected with the camera and used for receiving the original video recording and acquiring the position of a pedestrian in a frame picture and the characteristic vector of the pedestrian in the frame picture; the external storage device is connected with the edge calculation device and is used for receiving single file information which is sent by the edge calculation device and consists of the position of the pedestrian in the frame picture, the feature vector of the pedestrian in the frame picture, the time information of the frame picture and the camera number of the source of the frame picture; and the terminal computer is used for calling file information in the external storage device and the original video in the video storage device through the edge computing device so as to realize the re-identification of the target pedestrian at any time. Because the edge computing devices in the whole set of system correspond to the cameras one to one, the pedestrian characteristics of frame pictures in the video stream received in real time are extracted in a distributed mode, the target pedestrians are searched from the video videos shot by the cameras, and the pedestrian re-identification work is efficiently and quickly realized.
2. The embodiment of the invention also provides a multi-stage data merging device, and the data merging device is arranged between the terminal computer and the plurality of transmission devices. The data merging device has the functions of integrating the results of calculation and query of a certain number of edge calculation devices or one region, sorting the query results according to time, and then continuously sending the integrated information to the upper stage, so that the finishing efficiency of pedestrian re-identification is further improved.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.