Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which are derived by a person skilled in the art based on the embodiments of the application, fall within the scope of protection of the application.
The embodiment of the application provides a character file identification method, a device, equipment and a medium, wherein an image acquired by image acquisition equipment is received, the image is input into a pre-trained classification model, a first target step length of a target character in the image and a first target type identifier corresponding to gait are determined, candidate character files matched with the first target step length and the first target type identifier are searched in a database according to the step length and the type identifier corresponding to each character file recorded in the database, and if a standard image with similarity larger than a set similarity threshold exists in the candidate character files, the character file with the similarity larger than the set similarity threshold is output. In the embodiment of the application, the first target step length and the first target type identifier corresponding to the gait of the target person in the image acquired by the image acquisition equipment are acquired, candidate person files matched with the first target step length and the first target type identifier are searched in the database, and the walking habit of each person is used as the screening condition of the person file identification in the embodiment of the application, so that the comparison range of the image is reduced, and the efficiency of the person file identification is improved.
Example 1:
Fig. 1 is a schematic diagram of a character file identification process according to an embodiment of the present application, where the process specifically includes the following steps:
S101, receiving an image acquired by image acquisition equipment, inputting the image into a pre-trained classification model, and determining a first target step length of a target person in the image and a first target type identifier corresponding to gait.
The character file identification process provided by the embodiment of the application is applied to electronic equipment, and the electronic equipment can be a server, a PC and other equipment.
When an image acquired by the image acquisition equipment is received, in order to determine a character file to which a target character in the image belongs, a pre-trained classification model can be adopted to identify the target character in the image, the classification model is pre-trained, the step length and gait of the character in the image can be identified, and information such as the orientation and action of the character in the image can be identified. And inputting the image into a pre-trained classification model, and determining a first target step length of a target person in the image and a first target type identifier corresponding to gait.
S102, searching candidate character files matched with the first target step length and/or the first target type identification in the database according to the step length corresponding to each character file and the type identification corresponding to gait recorded in the database.
In order to determine the character profile to which the target character in the image belongs, after determining the first target step length and the first target type corresponding to the gait of the target character in the image based on the classification model which is completed through pre-training, candidate character profiles matched with the first target step length and/or the first target type identification of the target character can be searched in a database.
The database stores a character file of each character, the character file contains the identity information of the character and the captured image set of the character, and can also store other information of the character, specifically including the step length of the character and the type identifier corresponding to the gait, and the other information can also contain the information such as the step speed of the character and the identifier corresponding to the gesture of the character, and can be called as implicit attribute information for convenience of description.
According to the step length corresponding to each character file recorded in the database and the type identifier corresponding to the gait, candidate character files matched with the first target step length and/or the first target type identifier can be searched in the database.
If the first target step length is consistent with the step length corresponding to a certain character file recorded in the database in the searching process, or the difference value of the step length corresponding to the first target step length and the step length corresponding to the certain character file is smaller than a preset step length threshold, the step length corresponding to the character file can be considered to be matched with the first target step length, and the character file can be determined to be a candidate character file of the target character.
If the first target type identifier is consistent with the type identifier corresponding to the gait contained in the other information of the certain character file recorded in the database in the searching process, the type identifier corresponding to the gait contained in the other information of the character file can be considered to be matched with the first target type identifier, and the character file can be determined to be a candidate character file of the target character.
In order to improve the efficiency and accuracy of character file identification, it is preferable that if the first target step length and the first target type are both matched with a character file recorded in the database, the character file is determined as a candidate file of the target character.
And S103, outputting a character file to which the standard image with the similarity larger than the set similarity threshold belongs if the standard image with the similarity larger than the set similarity threshold exists in the candidate character file.
After determining the candidate character files corresponding to the target characters, in order to accurately identify the character files of the target characters, for each determined candidate character file, a standard image stored in the candidate character file may be acquired, and based on a human image identification technology, whether the similarity between the standard image and the image collected by the image collection device is greater than a set similarity threshold value is determined, if the similarity between the standard image and the image collected by the image collection device is greater than the set similarity threshold value, the character corresponding to the character file to which the standard image belongs may be considered as the target character, that is, the character file to which the standard image belongs may be considered as the character file of the target character, and the character file may be output.
In the embodiment of the application, the first target step length and the first target type identifier corresponding to the gait of the target person in the image acquired by the image acquisition equipment are acquired, candidate person files matched with the first target step length and the first target type identifier are searched in the database, and the walking habit of each person is used as the screening condition of the person file identification in the embodiment of the application, so that the comparison range of the image is reduced, and the efficiency of the person file identification is improved.
Example 2:
In order to improve the efficiency of identifying the person profile, in the embodiment of the present application, if there is a comparison image with a similarity greater than a set similarity threshold in the candidate person profile, before outputting a person profile to which the comparison image with the similarity greater than the set similarity threshold belongs, the method includes:
acquiring the time and place of the captured image;
Inputting the snapped places into a pre-trained space-time diagram modeling model, and obtaining target place identifiers output by the space-time diagram modeling model;
acquiring a time identifier corresponding to a preset time range corresponding to the target place identifier, and determining a target time identifier corresponding to a time range to which the snapped time belongs according to the snapped time and the time identifier;
And searching candidate character files matched with the target time identification and the target place identification in the database according to the time identification and the place identification corresponding to each character file recorded in the database.
Because the implicit attribute information of the same target person at the same time and the same place usually has similarity or consistency, on the office work, the facing direction, the step length, the pace and the gait of a certain target person are usually more consistent, so that the range of the identification of the portrait file can be further narrowed before the similarity comparison is carried out in order to improve the efficiency of the identification of the portrait file.
In the embodiment of the application, the acquired time and place of the captured image acquired by the image acquisition device can be specific time or a mark corresponding to the captured time, and the captured place can be longitude and latitude information of the installed position of the image acquisition device or a road section name of the installed position of the image acquisition device.
After the time and place of the captured image are obtained, the captured place can be input into a pre-trained blank map modeling (GRAPHWAVENET) model, and a target place identifier corresponding to the input captured place is determined by adopting the blank map modeling model.
In the embodiment of the application, the space-time diagram modeling model is a pre-trained non-supervision model, the model can accurately capture the hidden space dependence in the input data, the captured position of the image is input into the pre-trained space-time diagram modeling model, and the space-time diagram modeling model can output the target position identification of the captured position of the image.
When the snapped location is input into the space-time diagram modeling model, the space-time diagram modeling model can extract the association relation between the snapped location and each other location according to the association relation between the pre-trained location and the location, and determine the location identifier corresponding to the location with the association relation larger than the preset distance threshold as the target location identifier of the snapped location. The association relationship can be a straight line distance between the image acquisition equipment and the image acquisition equipment, or a walking distance of a road between the image acquisition equipment and the image acquisition equipment. The training process of the specific space-time diagram modeling model is the prior art and is not described herein.
After determining the target location identifier corresponding to the snapped location, the range of character profile identification may be further determined according to the time of the snap. In the embodiment of the application, the time division rule corresponding to the target location can be obtained according to the target location identifier, and the time division rule predefines the time identifiers corresponding to different time ranges. According to the time of the snapshot and the time identifier corresponding to the target place identifier and not the time identifier corresponding to the time range, the target time identifier corresponding to the time range to which the time of the snapshot belongs can be determined.
In the embodiment of the application, the preset time ranges are preset, and as the time of a day is fixed, the day can be divided according to the preset time ranges, and the time periods corresponding to each time range are marked, when the day is divided according to the preset time ranges, the time ranges can be divided according to equal time lengths, and the time ranges can be divided according to the quantity of people flow in different time periods. The system can also divide different road sections according to the amount of people flow in different time sections according to different time lengths. According to the time of the image being captured and the time identifier corresponding to the preset time range, the target time identifier corresponding to the time range to which the captured time belongs can be determined.
Preferably, in the embodiment of the present application, the preset time range is adjusted according to the tide law of the character activity, which can be understood as a time range preset with a plurality of different time lengths. For example, if the traffic volume is large in the early and late peak hours and the traffic is very likely to be jammed in some road segments, and the number of people passing in a unit time is smaller than that in other time segments, then the time range may be set to α 1 in the early and late peak hours for the road segments that are likely to be jammed, and the non-early and late peak hours may set the time range to α 2, where α 1>α2. For example, for 24 hours a day of road segment 1, the 00:00:00 to 06:59:59 time period has less people traffic, the time range within the time period may be set to 30 minutes, then the time identifications of 00:00 to 00:29:59 are 1, the time identifications of 00:30:00 to 00:59:59 are 2, and the time identifications of 01:00:00 to 01:29:59 are 3. The time period from 07:00:00 to 08:59:59 is that the people flow rate is high in the early peak, the phenomenon of congestion is easy to occur, and the time range in the time period can be set to be 40 minutes. The setting of the time range and the setting of the time mark can be preset according to the requirement of the actual portrait file identification, and are not described herein.
In addition, for example, the time when the image is captured may be 07:00:00, the time identifier corresponding to the time range to which 07:00:00 belongs is 5, the time identifier corresponding to the time range to which 06:59:00 belongs is 4, and determining the target time identifier corresponding to the captured time only with the time range to which 07:00:00 belongs may reduce the accuracy of character file identification. Therefore, in order to improve accuracy of portrait file identification, in the embodiment of the present application, a time threshold β minutes may be preset, and a target time identifier corresponding to the snapped time may be determined according to a time range to which β minutes belong before and after the snapped time.
After determining the target location identifier corresponding to the snapped location and determining the target time identifier corresponding to the snapped time according to the time division rule corresponding to the target location, the target location identifier and the target time identifier may be determined as the time-space domain identifier of the snapped image, for example, the target location identifier is 55, the target time identifier is 100, and the time-space domain identifier of the snapped image may be represented as (55,100), where the first numeral "55" represents the target location identifier corresponding to the snapped location and the second numeral "100" represents the target time identifier corresponding to the snapped time.
After the time-space domain identifier of the captured image is determined, the comparison range of the character files can be further reduced according to the target time identifier and the target place identifier contained in the time-space domain identifier.
Each character file in the database not only contains the identity information, the portrait snapshot image set and the implicit attribute information of the character corresponding to the character file, but also contains the time-space domain identifier of the snapshot image, and the time-space domain identifier of the snapshot image can be called as time-space domain information for convenience in description. Because the same person can be captured for multiple times, the time and place of each captured image are different, so that multiple groups of time marks and place marks can exist in the time-space domain information of the person file, namely multiple time-space domain marks exist.
According to the obtained target time identifier and the target place identifier, candidate character files matched with the target time identifier and the target place identifier can be searched in a database. Because different target place identifiers correspond to different time division rules, when matching the target time identifiers and the target place identifiers, the matching can be considered to be successful only when the target time identifiers and the target place identifiers are completely consistent with a group of time identifiers and place identifiers. For example, the time-space domain information of a person file in the database contains a plurality of time-space domain identifiers (51,66), (51,88) and (2, 88), and the time-space domain identifier is determined to be (51,88) according to the object time identifier and the object place identifier of the captured image, so that the person file can be determined to be a candidate person file.
In order to improve accuracy of identification of a person profile, in the above embodiments, before outputting a person profile to which a comparison image having a similarity greater than a set similarity threshold belongs if the candidate person profile has a comparison image having a similarity greater than the set similarity threshold, the method includes:
Acquiring a target identifier corresponding to the target orientation and the gesture of the target person output by the pre-trained classification model;
if it is determined that the target identification corresponding to the target orientation and posture of the target person coincides with the identification corresponding to the orientation and posture included in the other information of a certain person profile recorded in the database, the person profile may be determined as a candidate person profile of the target person.
Because the other information of the character file not only comprises the step length and the type identifier corresponding to the gait of the character corresponding to the character file, but also comprises the information such as the step speed and the identifier corresponding to the portrait posture of the character, in the embodiment of the application, based on the classification model which is trained in advance, the step length and the type identifier corresponding to the gait can be determined, and the information such as the target orientation and the target identifier corresponding to the gesture of the target character in the image can be determined. After the target identification corresponding to the target direction and the gesture of the target person is determined, the candidate person file matched with the target direction and the target identification can be searched in the database according to the target identification corresponding to the target direction and the gesture.
Specifically, in the process of searching the candidate character file in the database, if it is determined that the target identifier corresponding to the target orientation and posture of the target character is identical to the identifier corresponding to the orientation and posture included in other information of a certain character file recorded in the database, the character file may be determined as the candidate character file of the target character.
The process of identifying a person file according to the embodiment of the present application will be described with reference to a specific embodiment, and fig. 2 shows an intention of the person file identifying process according to the embodiment of the present application, where the process specifically includes the following steps:
s201, receiving the image acquired by the image acquisition device, and executing S202 and S203 respectively.
S202, acquiring the time and place of the captured image, determining a target time identifier corresponding to the time range of the captured image and a target place identifier corresponding to the captured place, searching a candidate character file matched with the target time identifier and the target place identifier in a database, and executing S204.
And S203, inputting the received image into a pre-trained classification model, determining a first target step length and a first target type identifier corresponding to gait of a target person in the image, searching a candidate person file matched with the first target step length and the first target type identifier in a database, and executing S204.
S204, if the candidate character file contains the comparison image with the similarity larger than the set similarity threshold value, outputting the character file with the comparison image with the similarity larger than the set similarity threshold value.
Example 3:
in order to further improve the efficiency of identifying the person profile, in the above embodiments, after determining the candidate person profile corresponding to the target person, before outputting the person profile to which the comparison image with the similarity greater than the set similarity threshold belongs, the method includes:
For each candidate character file, determining the total number of successful matching times of the candidate character file according to the number of matching of the candidate character file with each piece of information in the first target step length, the first target type identifier, the target time identifier and the target place identifier;
and sorting each candidate character file according to the total successful matching times of each candidate character file, and carrying out subsequent operation on the sorted candidate character files.
Although the candidate character files corresponding to the target characters are determined according to the first target step length, the first target type identifier, the target time identifier and the target place identifier, the identification range of the character files is reduced to a certain extent, a large amount of captured information exists in each character file due to data information accumulated in the database, and the number of candidate character files determined according to the first target step length, the first target type identifier, the target time identifier and the target place identifier is relatively large. Therefore, in order to further improve the efficiency of character file identification, each candidate character file can be ranked, and the images are adopted to match with the standard images in each candidate character file in the ranking result in sequence.
Specifically, in the embodiment of the present application, the total number of successful matches of the candidate character file is determined according to the number of matches of the candidate character file with the information such as the first target step length, the first target type identifier, the target time identifier, the target location identifier, and the like. The more the total number of successful matches, the greater the likelihood that the person corresponding to the candidate person profile is the target person. Therefore, the candidate character files with more total times of successful matching can be used as candidate character files to be compared with each other in priority, and image similarity comparison operation is performed on the candidate character files after sequencing according to the sequencing order.
For example, 3 candidate character profiles for the target character are found in the database, and these 3 candidate character profiles may be referred to as candidate character profile 1, candidate character profile 2, and candidate character profile 3 for convenience of description. The total number of successful matches of the candidate character file 1 is 1, the total number of successful matches of the candidate character file 2 with the first target step, the first target type, the first target time identifier and the first target location identifier is 3, the total number of successful matches of the candidate character file 2 with the first target step, the first target time identifier and the first target location identifier is 2, and the total number of successful matches of the candidate character file 3 with the first target step, the first target time identifier and the first target location identifier is 2. And sorting each candidate character file according to the total number of successful matching times of each candidate character file, wherein the sorted candidate character files are the candidate character file 2, the candidate character file 3 and the candidate character file 1 in sequence, and the probability that the character corresponding to the candidate character file 2 is a target character is higher as the number of successful matching times of the candidate character file 2 is the greatest, and in the subsequent character file identification process, the collected images are adopted to be matched with the standard images in each sorted candidate character file in sequence.
Example 4:
in order to further improve the efficiency of identifying the person profile, in the above embodiments, after determining the candidate person profile corresponding to the target person, before outputting the person profile to which the comparison image with the similarity greater than the set similarity threshold belongs, the method includes:
Determining a second target type identifier corresponding to a second target step length and gait of the pedestrian in the image based on the pre-trained classification model;
searching candidate person files of the same person matched with the second target step length and the second target type identifier of the same person in the database according to the step length and the type identifier corresponding to each person file recorded in the database;
and acquiring the same candidate character files in the candidate character files corresponding to the target characters and the candidate character files corresponding to the same person, and performing subsequent operations on the same candidate character files.
Because the image acquisition device generally performs global shooting when performing image acquisition, the acquired image contains a plurality of people, in the embodiment of the application, after the candidate person files of the target person are determined, the same person as the target person contained in the acquired image can be determined before the similarity comparison operation is performed. The process of determining the same person is the prior art and will not be described in detail herein.
And determining a second target type identifier corresponding to a second target step length and gait of the same person contained in the image based on the classification model which is trained in advance, and searching a candidate person file of the same person, which is matched with the second target step length and the second target type identifier, in a database. Determining the type identifier corresponding to the step size and the gait, and determining the candidate character profile based on the type identifier corresponding to the step size and the gait are described in the other embodiments above, and will not be described herein.
Since the fellow person and the target person generally have the same track, the fellow person candidate profile determined from the captured image generally exists for the same person profile as in the fellow person candidate profile. Therefore, after the candidate person profiles of the same person are determined, the same candidate person profile as the candidate person profile of the same person in the candidate person profile of the same person can be obtained, the possibility of the person profile of the same person being the target person in the same candidate person profile is higher, and the subsequent image similarity comparison operation can be performed first for the same candidate person profile.
Example 5:
In order to further improve the efficiency of character archive recognition, in the above embodiments, the training process for generating the countermeasure model including the classification model includes:
Inputting the sample image into a classification model in an original generated countermeasure model, acquiring a step length and a type identifier corresponding to gait output by the classification model, and determining the identification tag of the sample image according to the step length and the type identifier corresponding to gait by other sub-models of the original generated countermeasure model;
And determining a loss value corresponding to the sample image according to the identification label of the sample image and the target label of the sample image, and adjusting parameters of the original classification model and other sub-models of the original generated countermeasure model according to the loss value.
In order to realize training of the generated countermeasure model including the classification model, in the embodiment of the application, a sample set is preconfigured, the sample set includes a plurality of sample images, the sample images in the sample set cover images under different time periods, different places, different angles, different heights and different light conditions, and the sample images comprise characters with different numbers, different sexes, different heights and different ages.
In order to facilitate training of the generated countermeasure model including the classification model, the sample set further stores, for each sample image, a target label of the sample image, and the specific target label may be used to identify identity information of a target person in the sample image, such as an identification card number.
Specifically, the generated countermeasure model includes a classification model and other sub-models, when the generated countermeasure model is trained, for each sample image in the sample set, the sample image may be input into an original classification model in the original generated countermeasure model, and the original classification model may output, through processing of the sample image, a type identifier corresponding to a step size and gait of a target person in the sample image. After the original classification model outputs the step length of the target person and the type identifier corresponding to the gait in the sample image, other sub-models which originally generate the countermeasure model can determine and output the identification tag of the sample image according to the step length of the target person and the identifier corresponding to the gait in the sample image.
In the embodiment of the application, in order to complete training of the generated countermeasure model including the classification model, after the identification tag determined by the original generated countermeasure model is obtained, a loss value corresponding to the sample image may be determined according to the identification tag and the target tag of the sample image, and other sub-model parameters of the original classification model and the original generated countermeasure model may be adjusted according to the loss value.
Because the target label corresponding to the sample image input to the original classification model is known, the loss value corresponding to the sample image can be determined according to the target label corresponding to the sample image and the identification label determined by other sub-models of the original generated countermeasure model, and other sub-model parameters of the original classification model and the original generated countermeasure model can be adjusted according to the determined loss value corresponding to the sample image.
In the embodiment of the application, a convergence condition is preset, and the convergence condition may be that the number of times that the identification label of the determined sample image is consistent with the target label corresponding to the sample image is greater than a set number, or that the number of iterations of training the initial generation of the countermeasure model reaches a set maximum number of iterations, or the like.
Specifically, for each sample image in the sample set, the sample image is input to a classification model in the originally generated countermeasure model, the classification model in the originally generated countermeasure model is firstly input to the encoder, and the feature vector corresponding to the sample image is determined. The encoder is based on a convolutional neural network to determine feature vectors corresponding to sample images, and a common encoder based on the convolutional neural network comprises 4 convolutional layers, wherein each layer uses convolution kernels with different sizes and different filter numbers to extract local and global feature vectors in the sample images, and after the feature vectors output by each layer are obtained, the feature vectors output by different convolutional layers can be integrated by using an activation function such as a linear rectification function (RECTIFIED LINEAR Unit, RELU) and the like, so that a first feature vector corresponding to the sample image is determined.
After determining a first feature vector corresponding to the sample image, the encoder inputs the feature vector into the view angle converter, and determines a second feature vector corresponding to the sample image after conversion.
In order to extract implicit attribute information of a target person in a sample image, a first feature vector of the sample image output by an encoder may be mapped from a low-dimensional manifold to a high-dimensional space using manifold learning theory, and it may be assumed that an input feature vector is located on a low-dimensional manifold, and a sample image moving along the manifold may implement conversion of a viewing angle. Specifically, the conversion process from view a to view b can be expressed by the following formula: Where z a represents the feature vector of the portrait at view angle a, z b represents the feature vector of the portrait at view angle b, and wi represents the conversion vector from view angle i-1 to view angle i. The specific conversion process can be accomplished through a fully connected layer without bias to reduce the error accumulated by the reconstructed view needed to convert the view angle. The weight of the fully connected layer may be represented as w= [ W 1,w2,……,wnb ], where nb is an identification of angles, each angle corresponds to a weight, W 1 is the weight of view 1, W 2 is the weight of view 2, and W nb is the weight of view nb. The conversion process from view a to view b is represented by a vector e ab=[eab 1,eab 2,……,eab nb, and e ab i ranges in {0,1 }. From the above expression, the expression of the viewing angle converter conversion process can be expressed as z b=za+Weab.
After the view angle converter determines the second feature vector corresponding to the sample image after conversion, the second feature vector corresponding to the sample image after conversion is input into a pre-trained generator, and the predicted image feature vector corresponding to the sample image is determined. The generator is used for generating a false image which is difficult to distinguish from a real image and is formed by a plurality of deconvolution layers, and the generator determines the characteristic vector of the predicted image corresponding to the sample image as the prior art, and is not repeated here.
After the generator determines the feature vector of the predicted image, the feature vector of the predicted image and the second feature vector determined by the view angle converter are input into a discriminant which is trained in advance, the discriminant mainly comprises a plurality of convolution layers, and the discriminant can judge the authenticity of the feature vector of the predicted image generated by the generator and whether the domain of the predicted image generated by the generator is a designated angle domain and a designated state domain. If the discriminator determines that the predicted image feature vector is the feature vector determined by the view angle converter, the second feature vector is input into a classifier which originally generates an countermeasure model, and the classifier determines the step length of the sample image and the type identifier corresponding to the gait.
The training-completed generated countermeasure model is sufficient to distinguish the sample image from the predicted image, and different weights are generally assigned to each pixel point of the captured image in the distinguishing process, so that the implicit attribute of the sample image can be reflected.
The process for training the generated countermeasure model including the classification model according to the embodiment of the present application is described below with reference to a specific embodiment, and fig. 3 is a schematic diagram of the process for training the generated countermeasure model including the classification model according to the embodiment of the present application, where the process specifically includes the following steps:
s301, for each sample image in the sample set, the sample image is input into the encoder of the original classification model. Wherein the classification model is part of the generated challenge model.
S302, an encoder of the original classification model determines a first feature vector corresponding to the sample image.
S303, determining a second feature vector corresponding to the converted sample image by the view angle converter of the original classification model according to the first feature vector corresponding to the sample image and a preset algorithm.
And S304, determining a predicted image feature vector corresponding to the sample image according to the second feature vector corresponding to the converted sample image by the generator of the original classification model.
And S305, determining whether the predicted image feature vector is a second feature vector or not according to the predicted image feature vector and the second feature vector corresponding to the sample image after the view angle conversion by the discriminator of the original classification model, if so, executing S306, and if not, executing S304.
S306, outputting the step length of the target person in the sample image and the type identifier corresponding to the gait by the classifier of the original classification model according to the second feature vector corresponding to the sample image after the view angle conversion.
S307, other sub-models which originally generate the countermeasure model determine the identification label of the sample image according to the step length and the type identification corresponding to the gait.
And S308, determining a loss value corresponding to the sample image according to the identification label of the sample image and the target label of the sample image, and adjusting the original classification model and other sub-model parameters of the original generated countermeasure model according to the loss value.
Example 6:
Fig. 4 is a schematic structural diagram of a portrait focus device according to an embodiment of the present application, as shown in fig. 4, where the device includes:
The determining module 401 is configured to receive an image acquired by an image acquisition device, input the image into a classification model that is trained in advance, and determine a first target step length of a target person in the image and a first target type identifier corresponding to gait;
A searching module 402, configured to search, in the database, a candidate person profile matching the first target step size and/or the first target type identifier according to a step size corresponding to each person profile recorded in the database and a type identifier corresponding to gait;
And the identifying module 403 is configured to output a person profile to which the standard image with the similarity greater than the set similarity threshold belongs if the standard image with the similarity greater than the set similarity threshold exists in the candidate person profile.
In a possible implementation manner, the determining module 401 is further configured to obtain a time and a place of the captured image, input the captured place into a pre-trained space-time diagram modeling model, obtain a target place identifier output by the space-time diagram modeling model, and determine a target time identifier corresponding to a time range to which the captured time belongs according to the captured time and the target place identifier;
the searching module 402 is further configured to search the database for candidate person files matching the target time identifier and the target location identifier according to the time identifier and the location identifier corresponding to each person file recorded in the database.
In a possible implementation manner, the determining module 401 is further configured to obtain a target identifier corresponding to a target orientation and a gesture of the target person output by the pre-trained classification model;
The searching module 402 is configured to determine the character profile as a candidate character profile of the target character if it is determined that the target identifier corresponding to the target orientation and posture of the target character matches the identifier corresponding to the orientation and posture included in other information of the certain character profile recorded in the database.
In a possible implementation manner, the identifying module 403 is further configured to determine, for each candidate person profile, a total number of successful matches of the candidate person profile according to the number of matches of the candidate person profile with each of the first target step size, the first target type identifier, the target time identifier, and the target location identifier, sort each candidate person profile according to the total number of successful matches of each candidate person profile, and perform a subsequent operation on the sorted candidate person profiles.
In one possible embodiment, the apparatus further comprises:
The training module 404 is configured to, for each sample image in the sample set, determine a target tag for each sample image, where the target tag is used to identify identity information of a target person included in the sample image, input the sample image into a classification model in an originally generated countermeasure model, obtain a step length and a type identifier corresponding to a gait output by the classification model, determine an identification tag of the sample image according to the step length and the type identifier corresponding to the gait by using other sub-models in the originally generated countermeasure model, determine a loss value corresponding to the sample image according to the identification tag of the sample image and the target tag of the sample image, and adjust parameters of the original classification model and other sub-models in the originally generated countermeasure model according to the loss value.
Example 7:
Fig. 5 is a schematic structural diagram of an electronic device according to the present application, and on the basis of the foregoing embodiments, the present application further provides an electronic device, as shown in fig. 5, including a processor 501, a communication interface 502, a memory 503, and a communication bus 504, where the processor 501, the communication interface 502, and the memory 503 complete communication with each other through the communication bus 504;
the memory 503 has stored therein a computer program which, when executed by the processor 501, causes the processor 501 to perform the steps of:
receiving an image acquired by image acquisition equipment, inputting the image into a pre-trained classification model, and determining a first target step length of a target person in the image and a first target type identifier corresponding to gait;
searching candidate character files matched with the first target step length and/or the first target type identification in the database according to the step length corresponding to each character file recorded in the database and the type identification corresponding to the gait;
And if the candidate character file contains the standard image with the similarity larger than the set similarity threshold value, outputting the character file to which the standard image with the similarity larger than the set similarity threshold value belongs.
In one possible implementation manner, before outputting the character profile to which the comparison image with the similarity greater than the set similarity threshold belongs if the comparison image with the similarity greater than the set similarity threshold exists in the candidate character profile, the method includes:
acquiring the time and place of the captured image;
Inputting the snapped places into a pre-trained space-time diagram modeling model, and obtaining target place identifiers output by the space-time diagram modeling model;
Determining a target time identifier corresponding to the time range to which the snapped time belongs according to the snapped time and the target information of each time range corresponding to the target place identifier;
And searching candidate character files matched with the target time identification and the target place identification in the database according to the time identification and the place identification corresponding to each character file recorded in the database.
In one possible implementation manner, before outputting the character profile to which the comparison image with the similarity greater than the set similarity threshold belongs if the comparison image with the similarity greater than the set similarity threshold exists in the candidate character profile, the method includes:
Acquiring a target identifier corresponding to the target orientation and the gesture of the target person output by the pre-trained classification model;
if it is determined that the target identification corresponding to the target orientation and posture of the target person coincides with the identification corresponding to the orientation and posture included in the other information of a certain person profile recorded in the database, the person profile may be determined as a candidate person profile of the target person.
In one possible implementation manner, after determining the candidate character file corresponding to the target character, before outputting the character file to which the comparison image with the similarity greater than the set similarity threshold belongs, the method includes:
For each candidate character file, determining the total number of successful matching times of the candidate character file according to the number of matching of the candidate character file with each piece of information in the first target step length, the first target type identifier, the target time identifier and the target place identifier;
and sorting each candidate character file according to the total successful matching times of each candidate character file, and carrying out subsequent operation on the sorted candidate character files.
In one possible implementation manner, after determining the candidate character file corresponding to the target character, before outputting the character file to which the comparison image with the similarity greater than the set similarity threshold belongs, the method includes:
Determining a second target type identifier corresponding to a second target step length and gait of the pedestrian in the image based on the pre-trained classification model;
searching candidate person files of the same person matched with the second target step length and the second target type identifier of the same person in the database according to the step length and the type identifier corresponding to each person file recorded in the database;
and acquiring the same candidate character files in the candidate character files corresponding to the target characters and the candidate character files corresponding to the same person, and performing subsequent operations on the same candidate character files.
In one possible implementation, training the process of generating the challenge model including the classification model includes:
Inputting the sample image into a classification model in an original generated countermeasure model, acquiring a step length and a type identifier corresponding to gait output by the classification model, and determining the identification tag of the sample image according to the step length and the type identifier corresponding to gait by other sub-models of the original generated countermeasure model;
And determining a loss value corresponding to the sample image according to the identification label of the sample image and the target label of the sample image, and adjusting the original classification model and other sub-model parameters of the original generated countermeasure model according to the loss value.
Since the principle of the electronic device for solving the problem is similar to that of the character file identification method, the implementation of the electronic device can be referred to the above embodiment, and the repetition is not repeated.
The communication bus mentioned above for the electronic device may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus. The communication interface 502 is used for communication between the electronic device and other devices described above. The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor. The processor may be a general-purpose processor including a central Processing unit (cpu), a network processor (Network Processor, NP), etc., or may be a digital instruction processor (DIGITAL SIGNAL Processing, DSP), an application specific integrated circuit (asic), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
Example 8:
On the basis of the above embodiments, the present application also provides a computer readable storage medium having stored therein a computer program executable by a processor, which when run on the processor, causes the processor to perform the steps of:
receiving an image acquired by image acquisition equipment, inputting the image into a pre-trained classification model, and determining a first target step length of a target person in the image and a first target type identifier corresponding to gait;
searching candidate character files matched with the first target step length and/or the first target type identification in the database according to the step length corresponding to each character file recorded in the database and the type identification corresponding to the gait;
And if the candidate character file contains the standard image with the similarity larger than the set similarity threshold value, outputting the character file to which the standard image with the similarity larger than the set similarity threshold value belongs.
In one possible implementation manner, before outputting the character profile to which the comparison image with the similarity greater than the set similarity threshold belongs if the comparison image with the similarity greater than the set similarity threshold exists in the candidate character profile, the method includes:
acquiring the time and place of the captured image;
Inputting the snapped places into a pre-trained space-time diagram modeling model, and obtaining target place identifiers output by the space-time diagram modeling model;
Determining a target time identifier corresponding to the time range to which the snapped time belongs according to the snapped time and the target information of each time range corresponding to the target place identifier;
And searching candidate character files matched with the target time identification and the target place identification in the database according to the time identification and the place identification corresponding to each character file recorded in the database.
In one possible implementation manner, before outputting the character profile to which the comparison image with the similarity greater than the set similarity threshold belongs if the comparison image with the similarity greater than the set similarity threshold exists in the candidate character profile, the method includes:
Acquiring a target identifier corresponding to the target orientation and the gesture of the target person output by the pre-trained classification model;
if it is determined that the target identification corresponding to the target orientation and posture of the target person coincides with the identification corresponding to the orientation and posture included in the other information of a certain person profile recorded in the database, the person profile may be determined as a candidate person profile of the target person.
In one possible implementation manner, after determining the candidate character file corresponding to the target character, before outputting the character file to which the comparison image with the similarity greater than the set similarity threshold belongs, the method includes:
For each candidate character file, determining the total number of successful matching times of the candidate character file according to the number of matching of the candidate character file with each piece of information in the first target step length, the first target type identifier, the target time identifier and the target place identifier;
and sorting each candidate character file according to the total successful matching times of each candidate character file, and carrying out subsequent operation on the sorted candidate character files.
In one possible implementation manner, after determining the candidate character file corresponding to the target character, before outputting the character file to which the comparison image with the similarity greater than the set similarity threshold belongs, the method includes:
Determining a second target type identifier corresponding to a second target step length and gait of the pedestrian in the image based on the pre-trained classification model;
searching candidate person files of the same person matched with the second target step length and the second target type identifier of the same person in the database according to the step length and the type identifier corresponding to each person file recorded in the database;
and acquiring the same candidate character files in the candidate character files corresponding to the target characters and the candidate character files corresponding to the same person, and performing subsequent operations on the same candidate character files.
In one possible implementation, training the process of generating the challenge model including the classification model includes:
Inputting the sample image into a classification model in an original generated countermeasure model, acquiring a step length and a type identifier corresponding to gait output by the classification model, and determining the identification tag of the sample image according to the step length and the type identifier corresponding to gait by other sub-models of the original generated countermeasure model;
And determining a loss value corresponding to the sample image according to the identification label of the sample image and the target label of the sample image, and adjusting the original classification model and other sub-model parameters of the original generated countermeasure model according to the loss value.
Since the principle of solving the problem with the computer readable medium provided above is similar to that of character file identification, the steps implemented after the processor executes the computer program in the computer readable medium can be referred to the above embodiment, and the repetition is omitted.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
For system/device embodiments, the description is relatively simple as it is substantially similar to method embodiments, with reference to the description of method embodiments in part.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.