Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a portrait recognition method according to an embodiment of the present invention, where the present embodiment is applicable to a situation of portrait recognition in a multi-application scenario, and the method may be executed by a portrait recognition apparatus according to an embodiment of the present invention, and the apparatus may be implemented in a software and/or hardware manner. Referring to fig. 1, the method for identifying a person provided in this embodiment includes:
step 110, acquiring data information of target portrait data; wherein the data information comprises portrait information and location information.
The target portrait data is obtained by processing all acquired portrait data according to a preset algorithm.
The portrait information of the target portrait data is information related to the portrait in the target portrait data, for example, a portrait image.
The position information of the target portrait data is position information obtained when the target portrait data is obtained, and may be determined according to a scene where a data acquisition device of the target portrait data is located. The physical area may be a specific website, a branch, a building, etc., and the organization information may be a preset number corresponding to an organization, etc., which is not limited in this embodiment.
In this embodiment, optionally, before acquiring the data information of the target portrait data, the method further includes:
acquiring portrait data to be processed, and performing preset image processing on the portrait data to be processed to obtain target portrait data; wherein the preset image processing includes at least one of image deduplication processing and image screening processing.
The acquisition of the portrait data to be processed can be shooting videos through data acquisition equipment, and the portrait data in the video stream is extracted to serve as the portrait data to be processed. The image deduplication processing can be to judge the quality score of the portrait data of the same object, optimize deduplication, and use the portrait data with the highest quality as the target portrait data of the object, so that the subsequent repeated processing of multiple portrait data of the same object is avoided, the computing resources are wasted, and the accuracy of subsequent portrait identification is improved by obtaining the portrait data with the best quality.
The image screening processing can be a preset white list, the portrait data in the white list is filtered, the filtered target portrait data is obtained, the white list can contain hall service personnel, internal staff, unscheduled visitor personnel and the like, and the embodiment does not limit the situation, so that the consumption of computing resources is avoided.
Step 120, determining a first target person database from at least one candidate person database according to the portrait information and/or the location information, and determining a database comparison order of the first target person database.
The first target person database is determined from at least one candidate person database according to the person image information and/or the location information, where the person database may store the person image characteristics, which is not limited in this embodiment. The first target human database may be a human database conforming to a current human image data acquisition scene, and for example, if the position information is a position of a bank at the time of human image data acquisition, it may be determined that the first target human database is a human database corresponding to a position a. And if the portrait information is the portrait image quality score, determining the portrait information as a first target portrait database according to a portrait database corresponding to the image quality score.
The first target human database is determined according to the position information and the human image information, the human databases corresponding to the position information and the human image information can be directly used as the first target human database, the human databases corresponding to the position information and the human image information can be ranked according to preset weights of the position information and the human image information, the human database which is ranked in front is used as the first target human database, and the first target human database is not limited by the embodiment.
The database comparison order of the first target human database is determined according to the portrait information and/or the position information, whether a specific database comparison order is preset at the position or not can be determined according to the position information, if yes, the specific comparison order is used as the database comparison order, and if not, the preset comparison order is used as the database comparison order.
For example, the preset comparison order may be the order of comparing according to the data size of the first target human database, according to the administrative level size of the database, and the like, which is not limited in this embodiment; the specific comparison sequence may be a comparison sequence different from a preset comparison sequence, for example, the preset sequence is a human database of a city area to be compared first, and then a human database of a website is compared, and the specific comparison sequence may be a human database of a website to be compared first, and then a human database of a city area to be compared, so that different comparison sequences are set according to different application scenarios.
And step 130, determining a portrait recognition result according to the portrait information, the first target portrait database and the database comparison sequence.
According to the database comparison sequence, the first target human database is sequentially compared with the human image information, and a corresponding human image recognition result can be obtained, wherein the human image recognition result can be one of no matching object, one matching object and a plurality of matching objects, and the embodiment does not limit the result.
The comparison mode can be that the portrait characteristic value in the portrait information is extracted and searched in the first target portrait database, whether the first target portrait database has the portrait characteristics meeting the condition that the similarity exceeds a preset threshold value or not is determined, and if the first target portrait database has the portrait characteristics, the information corresponding to the portrait characteristics is used as the portrait recognition result.
Optionally, after the portrait recognition result is determined to be recognized, subsequent portrait recognition result pushing and business process processing are performed according to a preset business rule, for example, when the portrait recognition result is successful, the recognized portrait related information is pushed to a specified platform, and the portrait related information may be a portrait image, corresponding identity information, and the like, which is not limited in this embodiment.
According to the technical scheme provided by the embodiment, data information of target portrait data is acquired; wherein the data information comprises portrait information and location information; determining a first target human database from at least one candidate human database according to the portrait information and/or the location information, and determining a database comparison order of the first target human database; and determining a portrait recognition result according to the portrait information, the first target portrait database and the database comparison sequence. When multiple scenes and/or a large number of users to be identified appear, a database to be compared and a database comparison sequence can be determined according to portrait information and/or position information, and therefore the range to be compared and identified is divided. The method has the advantages that the situation that each scene only corresponds to the respective fixed human database is avoided, when the human databases used in different application scenes are overlapped, human database resources are wasted, meanwhile, the respective associated human databases are determined for the different application scenes, and the efficiency, the universality and the accuracy of follow-up human image recognition are improved.
Example two
Fig. 2 is a flowchart of a portrait session identification method according to a second embodiment of the present invention, and the technical solution is supplementary explained for a process of determining a portrait session identification result according to the portrait session information, the first target portrait database, and the database comparison order. Compared with the scheme, the scheme is specifically optimized in that the step of determining the portrait recognition result according to the portrait information, the first target portrait database and the database comparison sequence comprises the following steps:
determining a current human database from the first target human database according to the database comparison sequence, and comparing the human image information with the current human database to obtain at least one current human image comparison result;
judging whether the current portrait comparison result meeting a preset first threshold exists or not;
if not, determining a new current human image database from the first target human image database according to the database comparison sequence, and comparing the human image information with the new current human image database to obtain a new current human image comparison result;
and determining the portrait recognition result according to the new current portrait comparison result. Specifically, the flowchart of the portrait recognition method is shown in fig. 2:
step 210, acquiring data information of target portrait data; wherein the data information comprises portrait information and location information.
Step 220, determining a first target person database from at least one candidate person database according to the portrait information and/or the location information, and determining a database comparison order of the first target person database.
Step 230, determining a current human database from the first target human database according to the database comparison sequence, and comparing the human image information with the current human database to obtain at least one current human image comparison result.
And determining a current human database from the first target human database according to the database comparison sequence, wherein the current human database is a human database currently subjected to comparison operation. Illustratively, the database comparison order is database C, database D, and database A. Then database C is the current human database at the beginning of the compare operation.
And comparing the portrait information with the current portrait database to obtain at least one current portrait comparison result, wherein the current portrait comparison result can be a result of comparing each portrait characteristic value in the portrait information with all characteristic values in the current portrait database.
And 240, judging whether the current portrait comparison result meeting a preset first threshold exists.
And judging whether each current portrait comparison result meets a preset first threshold value, if so, indicating that the current portrait identification result is successful, and obtaining a corresponding matching object. The preset first threshold is a contrast threshold corresponding to the current human database.
All successful current portrait recognition results can be used as final portrait recognition results, which is not limited in this embodiment.
And 250, if not, determining a new current human database from the first target human database according to the database comparison sequence, and comparing the human image information with the new current human database to obtain a new current human image comparison result.
If not, the fact that no matched portrait feature data exists in the current portrait database is indicated, and the next portrait database in the database comparison sequence is determined to serve as the new current portrait database.
And comparing the portrait information with the new current portrait database according to the mode to obtain a new current portrait comparison result.
And step 260, determining the portrait recognition result according to the new current portrait comparison result.
And if the new current portrait comparison results are all failed, continuously determining a next human database of the new current human database according to the database comparison sequence, performing corresponding comparison operation, and circulating the steps until the comparison of all the databases in the first target human database is finished. According to the actual comparison condition, the new current portrait comparison result which is successfully compared can be used as the portrait recognition result, or the new current portrait comparison results which are all unsuccessfully compared can be used as the portrait recognition result.
In this embodiment, optionally, the determining the portrait recognition result according to the new current portrait comparison result includes:
judging whether all the new current portrait comparison results meet a preset second threshold corresponding to each new current portrait comparison result;
if the first target human database is not satisfied, determining a second target human database except the first target human database from the candidate human database according to a preset sequence among human databases;
and determining the portrait recognition result according to the portrait information and the second target portrait database.
And judging whether all the new current portrait comparison results meet preset second threshold values corresponding to the new current portrait comparison results, wherein the preset second threshold values of the new current portrait comparison results are determined according to the human database corresponding to the new current portrait comparison results. And determining a proper contrast threshold according to the attributes of different human database, and improving the accuracy of subsequent human image recognition.
And if all the comparison results do not meet the respective threshold values, the comparison results of the first target human database are all failed. At this time, a second target human database except the first target human database is determined from the candidate human database according to the preset sequence between the human databases, illustratively, the first target human database is a website-level human image feature library and a branch-level human image feature library, and then the second target human database may be a full-line-level human image feature library, that is, the preset sequence may be a rank sequence between human databases, and this embodiment does not limit this. Therefore, when the face recognition result corresponding to the first target face database is failure, comparison operation can be further performed, the comparison range is expanded, and accuracy of face recognition is improved.
In this embodiment, optionally, after determining whether the current portrait comparison result meeting the preset first threshold exists, the method further includes:
if yes, determining result sorting of the current portrait comparison result;
determining a target portrait comparison result from the current portrait comparison results according to the result sorting;
judging whether the target portrait comparison result meeting a preset identification threshold exists or not;
and if so, determining the target portrait comparison result as the portrait identification result.
If there are a plurality of current portrait comparison results meeting the preset first threshold, determining the result ranking of the current portrait comparison results, where the determination mode may be ranking from high to low according to the similarity degree, and this embodiment does not limit this. The current portrait comparison result with the highest ranking rank may be used as the target portrait comparison result, which is not limited in this embodiment.
And comparing the target portrait comparison result with a preset identification threshold, and determining the target portrait comparison result as a portrait identification result if the target portrait comparison result is greater than or equal to the preset identification threshold. And judging whether the most similar portrait comparison result meets the portrait identification requirement or not, and avoiding a plurality of identification results, thereby improving the accuracy of portrait identification.
The embodiment of the invention judges whether the current portrait comparison result meeting a preset first threshold exists or not; if not, determining a new current human image database from the first target human image database according to the database comparison sequence, and comparing the human image information with the new current human image database to obtain a new current human image comparison result; and determining a portrait recognition result according to the new current portrait comparison result, namely, continuing to perform comparison operation according to the database comparison sequence when the portrait comparison is unsuccessful, thereby improving the portrait recognition efficiency.
EXAMPLE III
In order to make it more clear to those skilled in the art to understand the present invention, the present application further provides a portrait recognition system, fig. 3 is a schematic structural diagram of a portrait recognition system provided in a third embodiment of the present invention, as shown in fig. 3:
wherein, leading software and hardware integration module of image acquisition: the module is respectively arranged in a network point, a branch business hall and each office building according to different levels and is used for receiving RTSP video streams transmitted by the portrait acquisition equipment, and filtering and outputting portrait encrypted data by the terminal.
Wherein, the leading software and hardware integration module of image acquisition includes:
the video stream processing module: the method has the functions of processing the video stream and extracting the portrait, can position the portrait in the video stream, judges the portrait quality score, optimizes the duplication removal and outputs the portrait data with the highest quality.
The device management and encryption module: the event platform management module is used for pre-filtering the white list portrait photos pre-embedded by the event platform management module, the white list comprises hall service personnel, internal working personnel and unscheduled visitor personnel, and outputting portrait encrypted data
The event platform front module: the system is used for realizing bidirectional communication and data interaction among the modules.
Wherein, the event platform front module includes:
the preposed data receiving module: the image acquisition device is used for receiving encrypted portrait data on the image acquisition front software and hardware integrated module.
The preposed data pushing module: the system is used for forming a SOAP message according to the position information such as the physical area where the image acquisition equipment is located in the image acquisition front-end software and hardware integrated module, the mechanism information and the like, and sending the SOAP message to the event platform core module.
The event platform management module: the system is used for monitoring and maintaining the running state and the application version of the image acquisition preposed software and hardware integrated module through an equipment management interface and a data synchronization function deployed on the module.
Wherein, the event platform management module includes:
the device management and data synchronization module: the system is used for issuing the white list data in batches through TCP communication with the image acquisition prepositive software and hardware integrated module.
An equipment monitoring module: the method is used for monitoring and maintaining the running state and the application version of the image acquisition front-mounted software and hardware integrated module.
N portrait comparison service module: the method is used for storing mass portrait characteristic values and decrypting portrait encrypted data.
Wherein, the portrait comparison service module includes:
portrait feature library management module: the portrait characteristic library is composed of a large number of portrait characteristics which are stored in the module in a multi-level mode according to actual physical areas and scene logic rules.
1: n people image comparison module: the module decrypts the sent portrait data, extracts characteristic values and searches in a characteristic library, and screens and judges whether the portrait data is accurately identified according to a set threshold value.
An event platform core module: the system is used for comprehensively analyzing and forming a first target human database and database comparison sequence according to the physical region classification of the human database, business logic rules and the like, interacting with the human image comparison service module to obtain a recognition result, and finishing subsequent data pushing.
Wherein, the event platform core module includes:
multi-scenario application and accurate identification module (not shown in the figure): the module adopts a micro-service architecture, a front-end module of a docking event platform and a face recognition comparison service module, and has the functions of physical area positioning, scene information division, multi-scene sharing, potential face library generation, white list filtering and timing duplicate removal, recognition result pushing and the like. The method has the main functions of generating a potential portrait feature library and a comparison priority sequence according to an actual physical region and a scene rule, reducing the functions to be compared, improving the recognition quality of the multi-scene portrait and distinguishing the comparison priority and the comparison range of different scenes.
By establishing the event platform core module, when a large number of multi-scene clients appear, a specific priority and a comparison rule can be formed according to the actual physical area and scene characteristics, the range to be compared and identified is divided, and an identification range analysis model is constructed. The accuracy of multi-scene recognition is improved by inputting the rule model, and 1: the limitation of the N technical application scheme promotes the intelligent level in the field of banking and internal management scenes, and reduces the labor cost and the management cost.
Example four
Fig. 4 is a schematic structural diagram of a portrait recognition apparatus according to a fourth embodiment of the present invention. The device can be realized by hardware and/or software, can execute the portrait recognition method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. As shown in fig. 4, the apparatus includes:
a data information obtaining module 410, configured to obtain data information of the target portrait data; wherein the data information comprises portrait information and location information;
a database order determining module 420, configured to determine a first target person database from at least one candidate person database according to the portrait information and/or the location information, and determine a database comparison order of the first target person database;
and the portrait recognition result determining module 430 is configured to determine a portrait recognition result according to the portrait information, the first target portrait database, and the database comparison sequence.
According to the technical scheme provided by the embodiment, data information of target portrait data is acquired; wherein the data information comprises portrait information and location information; determining a first target human database from at least one candidate human database according to the portrait information and/or the location information, and determining a database comparison order of the first target human database; and determining a portrait recognition result according to the portrait information, the first target portrait database and the database comparison sequence. When multiple scenes and/or a large number of users to be identified appear, a database to be compared and a database comparison sequence can be determined according to portrait information and/or position information, and therefore the range to be compared and identified is divided. The method has the advantages that each scene only corresponds to the respective fixed human database, when the human databases used in different application scenes are overlapped, human database resources are wasted, meanwhile, the respective associated human databases are determined for the different application scenes, and the efficiency and the accuracy of subsequent human image recognition are improved.
On the basis of the above technical solutions, optionally, the portrait recognition result determining module includes:
a current portrait comparison result obtaining unit, configured to determine a current portrait database from the first target portrait database according to the database comparison sequence, compare the portrait information with the current portrait database, and obtain at least one current portrait comparison result;
the current portrait comparison result judging unit is used for judging whether the current portrait comparison result meeting a preset first threshold exists or not;
a new current portrait comparison result obtaining unit, configured to determine a new current portrait database from the first target portrait database according to the database comparison sequence if the current portrait comparison result determination unit determines that the current portrait comparison result is negative, compare the portrait information with the new current portrait database, and obtain a new current portrait comparison result;
and the first portrait recognition result determining unit is used for determining the portrait recognition result according to the new current portrait comparison result.
On the basis of the foregoing technical solutions, optionally, the first person recognition result determining unit includes:
a new current portrait comparison result judgment subunit, configured to judge whether all the new current portrait comparison results satisfy preset second thresholds corresponding to the new current portrait comparison results;
a second target human database determining subunit, configured to determine, if the new current human image comparison result judgment subunit judges that none of the candidate human databases is satisfied, a second target human database other than the first target human database from the candidate human database according to a preset sequence between human databases;
and the portrait recognition result determining subunit is used for determining the portrait recognition result according to the portrait information and the second target portrait database.
On the basis of the above technical solutions, optionally, the apparatus further includes:
the result ordering determining unit is used for determining the result ordering of the current portrait comparison result after the new current portrait comparison result judging subunit;
the target portrait comparison result determining unit is used for determining a target portrait comparison result from the current portrait comparison results according to the result sorting;
the target portrait comparison result judging unit is used for judging whether the target portrait comparison result meeting a preset identification threshold exists or not;
and the second portrait identification result determining unit is used for determining the target portrait comparison result as the portrait identification result if the target portrait comparison result judging unit judges that the target portrait comparison result is positive.
On the basis of the above technical solutions, optionally, the apparatus further includes:
the data image processing module is used for acquiring portrait data to be processed before the data information acquisition module and carrying out preset image processing on the portrait data to be processed to obtain the target portrait data; wherein the preset image processing includes at least one of image deduplication processing and image screening processing.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention, as shown in fig. 5, the electronic device includes a processor 50, a memory 51, an input device 52, and an output device 53; the number of the processors 50 in the electronic device may be one or more, and one processor 50 is taken as an example in fig. 5; the processor 50, the memory 51, the input device 52 and the output device 53 in the electronic apparatus may be connected by a bus or other means, and the bus connection is exemplified in fig. 5.
The memory 51 is used as a computer-readable storage medium for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the portrait recognition method in the embodiment of the present invention. The processor 50 executes various functional applications and data processing of the electronic device by executing software programs, instructions and modules stored in the memory 51, that is, implements the above-described portrait recognition method.
The memory 51 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 51 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 51 may further include memory located remotely from the processor 50, which may be connected to the electronic device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
EXAMPLE six
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method for face recognition, the method including:
acquiring data information of target portrait data; wherein the data information comprises portrait information and location information;
determining a first target human database from at least one candidate human database according to the portrait information and/or the location information, and determining a database comparison order of the first target human database;
and determining a portrait recognition result according to the portrait information, the first target portrait database and the database comparison sequence.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the operations of the method described above, and may also perform related operations in the portrait recognition method provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the portrait recognition apparatus, the included units and modules are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.