CN112464842A - Age display method and device, storage medium and electronic equipment - Google Patents

Age display method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN112464842A
CN112464842A CN202011409809.1A CN202011409809A CN112464842A CN 112464842 A CN112464842 A CN 112464842A CN 202011409809 A CN202011409809 A CN 202011409809A CN 112464842 A CN112464842 A CN 112464842A
Authority
CN
China
Prior art keywords
face
face information
target
information set
age
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011409809.1A
Other languages
Chinese (zh)
Inventor
司苏沛
李骊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing HJIMI Technology Co Ltd
Original Assignee
Beijing HJIMI Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing HJIMI Technology Co Ltd filed Critical Beijing HJIMI Technology Co Ltd
Priority to CN202011409809.1A priority Critical patent/CN112464842A/en
Publication of CN112464842A publication Critical patent/CN112464842A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/178Human faces, e.g. facial parts, sketches or expressions estimating age from face image; using age information for improving recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention provides an age display method and device, a storage medium and electronic equipment, wherein the method comprises the following steps: when a target face image is received, determining face information corresponding to each face object in the target face image; judging whether a target face information set corresponding to the face object exists for each face object in the target face image, and judging whether the face information of the face object meets the storage condition corresponding to the target face information set based on the confidence coefficient of the age identification result of the face object if the target face information set corresponding to the face object exists; if yes, storing the face information into the target face information set; acquiring a target age corresponding to the face object according to an age identification result of each face information stored in the target face information set; and displaying the target age corresponding to each human face object at the corresponding display position. The age can be stably displayed, and the user experience is improved.

Description

Age display method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an age display method and apparatus, a storage medium, and an electronic device.
Background
With the development of scientific technology, the face recognition technology is also developed greatly, and in the current face recognition technology, the age is taken as an important face attribute, so that the face recognition technology has wide application prospects in the fields of human-computer interaction, intelligent commerce, safety monitoring, entertainment and the like. Human face age estimation, an important biometric feature recognition technology, has been a popular research topic in the field of pattern recognition and computer vision.
In some application scenarios, the human face is dynamically identified through the human face model, and the identified age result is displayed in real time, however, due to the inherent defect of the human face detection analysis model, the human face detection analysis model can obtain different age results under different angles, illumination, postures, shelters and fuzzy conditions of the facial picture of the same person, which causes the instable age displayed on the picture.
Disclosure of Invention
The technical problem to be solved by the invention is to provide an age display method, which can stably and accurately display the age and improve the user experience.
The invention also provides an age display device for ensuring the realization and application of the method in practice.
An age display method comprising:
when a target face image is received, determining face information corresponding to each face object in the target face image, wherein the face information of each face object at least comprises an age identification result of the face object and a confidence coefficient of the age identification result;
judging whether a target face information set corresponding to the face object exists for each face object in the target face image, and judging whether the face information of the face object meets the storage condition corresponding to the target face information set based on the confidence coefficient of the age identification result of the face object if the target face information set corresponding to the face object exists; if the face information meets the storage condition, storing the face information into the target face information set so as to complete the updating of the target face information set; acquiring a target age corresponding to the face object according to the age identification result of each piece of face information stored in the updated target face information set;
and displaying the target age corresponding to each human face object at the corresponding display position, wherein each display position is positioned on a display interface of the target human face image.
Optionally, the determining whether the target face information set corresponding to the face object already exists includes:
judging whether a pre-established information set storage area is empty or not;
if the information set storage area is empty, judging that a target face information set corresponding to the face object does not exist;
if the information set storage area is not empty, determining each currently established face information set in the information set storage area, and the Euclidean distance between the center point coordinate of the face object and the center point coordinate of the face object to which each face information in each face information set belongs; judging whether the minimum Euclidean distance in the Euclidean distances is larger than a preset distance threshold value or not; if the minimum Euclidean distance is not greater than the distance threshold, judging that the face information set corresponding to the minimum Euclidean distance is a target face information set corresponding to the face object; and if the distance is larger than the distance threshold, judging that the target face information set corresponding to the face object does not exist.
Optionally, the determining, based on the confidence level in the face information corresponding to the face object, whether the face information of the face object meets the storage condition corresponding to the target face information set includes:
judging whether the number of the face information in the target face information set is greater than or equal to a preset number threshold value or not;
if the number of the face information in the target face information set is greater than or equal to the number threshold, determining whether the confidence of the age identification result of the face object is greater than the minimum confidence of the confidence of each face information in the target face information set, and if the confidence of the age identification result of the face object is greater than the minimum confidence, judging that the face information of the face object meets the storage condition corresponding to the target face information set; if the confidence of the age identification result of the face is not greater than the minimum confidence, judging that the face information corresponding to the face object does not meet the storage condition corresponding to the target face information set;
and if the number of the face information in the target face information set is smaller than the preset number threshold, judging that the face information corresponding to the face object meets the storage condition corresponding to the target face information set.
Optionally, in the above method, if the confidence of the age identification result of the face object is greater than the minimum confidence, the storing the face information into the target face information set to complete updating the target face information set includes:
and replacing and storing the face information of the face object to the face information to which the minimum confidence degree belongs in the target face information set so as to finish updating the target face information set.
The above method, optionally, further includes:
if the target face information set corresponding to the face object does not exist, allocating an object identifier for the face object;
generating a target face information set corresponding to the face object based on the object identification and the face information of the face object;
and acquiring the target age corresponding to the face object according to the age identification result in the target face information set.
Optionally, in the method, the obtaining a target age corresponding to the face object according to an age identification result of each piece of face information stored in the updated target face information set includes:
obtaining a weighting coefficient of each age recognition result in the target face information set according to the confidence degree of the age recognition result of each face information stored in the updated target face information set;
and carrying out weighted average on each age recognition result in the updated target face information set according to the weighting coefficient of each age recognition result in the updated target face information set to obtain the target age corresponding to the face object.
In the above method, optionally, after the storing the face information into the target face information set, the method further includes:
updating the numerical value of a counter corresponding to the target face information set, and detecting the counter;
and if the numerical value of the counter is not updated within a preset time length, deleting the target face information set.
An age display device comprising:
the system comprises a receiving unit, a judging unit and a judging unit, wherein the receiving unit is used for determining face information corresponding to each face object in a target face image when the target face image is received, and the face information of each face object at least comprises an age identification result of the face object and a confidence coefficient of the age identification result;
the execution unit is used for judging whether a target face information set corresponding to the face object exists for each face object in the target face image, and judging whether the face information of the face object meets the storage condition corresponding to the target face information set based on the confidence of the age identification result of the face object if the target face information set corresponding to the face object exists; if the face information meets the storage condition, storing the face information into the target face information set so as to complete the updating of the target face information set; acquiring a target age corresponding to the face object according to the age identification result of each piece of face information stored in the updated target face information set;
and the display unit is used for displaying the target age corresponding to each face object at the corresponding display position, wherein each display position is positioned on the display interface of the target face image.
A storage medium comprising stored instructions, wherein the instructions, when executed, control a device on which the storage medium is located to perform the age display method as described above.
An electronic device comprising a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by the one or more processors to perform the age display method as described above.
Compared with the prior art, the invention has the following advantages:
the invention provides an age display method and device, a storage medium and electronic equipment, wherein the method comprises the following steps: when a target face image is received, determining face information corresponding to each face object in the target face image, wherein the face information of each face object at least comprises an age identification result of the face object and a confidence coefficient of the age identification result; judging whether a target face information set corresponding to the face object exists for each face object in the target face image, and judging whether the face information of the face object meets the storage condition corresponding to the target face information set based on the confidence coefficient of the age identification result of the face object if the target face information set corresponding to the face object exists; if the face information meets the storage condition, storing the face information into the target face information set so as to complete the updating of the target face information set; acquiring a target age corresponding to the face object according to the age identification result of each piece of face information stored in the updated target face information set; and displaying the target age corresponding to each human face object at the corresponding display position, wherein each display position is positioned on a display interface of the target human face image. By applying the age display method provided by the invention, the face information set of each face object in the target face image can be determined, so that the same face is tracked, and the corresponding target age of the face object is determined by utilizing each face information in the face information set, so that the age of the face object can be accurately and stably displayed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart of a method for displaying age according to the present invention;
FIG. 2 is a flowchart of a process for determining whether a target face information set exists according to the present invention;
FIG. 3 is a flowchart of a process for determining whether face information satisfies a storage condition according to the present invention;
FIG. 4 is a flowchart of another method of an age display method according to the present invention;
FIG. 5 is an exemplary diagram of a display interface of a target face image according to the present invention;
fig. 6 is a schematic structural diagram of an age display device according to the present invention;
fig. 7 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The invention is operational with numerous general purpose or special purpose computing device environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multi-processor apparatus, distributed computing environments that include any of the above devices or equipment, and the like.
The embodiment of the invention provides an age display method, which can be applied to various system platforms, wherein an execution main body of the method can be a computer terminal or a processor of various mobile devices, and a flow chart of the method is shown in fig. 1, and the method specifically comprises the following steps:
s101: when a target face image is received, determining face information corresponding to each face object in the target face image, wherein the face information of each face object at least comprises an age identification result of the face object and a confidence coefficient of the age identification result.
In the method provided by the embodiment of the present invention, the target face image may be an aligned image of a face output by a preset face detection model, wherein the aligned image of the face output by the face detection model may be obtained by capturing all image frames or a part of image frames of a video stream and sequentially inputting the captured image frames to the face detection model.
Optionally, the video stream may be a video stream transmitted by a user terminal device, the user terminal device may be a camera, all image frames of the video stream may be retained, or 1 image frame may be extracted every N image frames, where N is a positive integer.
The target face image at least comprises one face object, and each face object is provided with a face rectangular frame marked by the face detection model.
Specifically, the face information of the face object may include an age recognition result of the face object, a confidence of the age recognition result, and a center point coordinate of the face object. The central point coordinate may be a central point coordinate of a face rectangular frame marked by the face detection model, and the central point coordinate may be determined by an upper left corner coordinate and a lower right corner coordinate of the face rectangular frame, or may be determined by the upper right corner coordinate and the lower left corner coordinate.
Optionally, the confidence of the age identification result represents the credibility of the age identification result, and the higher the confidence of the age identification result, the more credible the age identification result is.
One feasible way of determining the face information corresponding to each face object in the target face image is as follows: and preprocessing the target face image, and inputting the preprocessed target face image into a preset face attribute analysis model to obtain face information of a face object in the target face image.
When there are a plurality of face objects in the target face image, the face information of each face object may be sorted according to the confidence of the age recognition result of each face object, and the face information of each face object may be stored in the form of data or a list.
S102: judging whether a target face information set corresponding to the face object exists for each face object in the target face image, and judging whether the face information of the face object meets the storage condition corresponding to the target face information set based on the confidence coefficient of the age identification result of the face object if the target face information set corresponding to the face object exists; if the face information meets the storage condition, storing the face information into the target face information set so as to complete the updating of the target face information set; and acquiring the target age corresponding to the face object according to the updated age identification result of each face information stored in the target face information set.
In the method provided by the embodiment of the invention, whether a target face information set corresponding to the face object exists in a pre-established information set storage area can be judged.
Specifically, the target age of the face object can be obtained by calculating the age recognition result of each piece of face information in the target face information set.
The target face information set can be arranged in a pre-established information set storage area, each face information set in the information set storage area is provided with a counter corresponding to the face information set, and after the face information is stored in the target face information set, the numerical value of the counter corresponding to the target face information set can be updated; after the target age corresponding to each face object is obtained, whether a face information set with the value of the corresponding counter not updated exists in the information set storage area or not can be detected, and if the face information set with the value of the corresponding counter not updated exists, the face information set with the value of the corresponding counter not updated can be deleted.
In a feasible manner, it may be determined whether the confidence of the age identification result of the face object is greater than or equal to a confidence threshold corresponding to the target face information set, if so, it is determined that the face information of the face object satisfies the storage condition corresponding to the target face information set, otherwise, it is determined that the face information of the face object does not satisfy the storage condition corresponding to the target face information set, and the confidence threshold may be set to any value according to a requirement, for example, the confidence may be the minimum confidence in each piece of face information stored in the target face information set.
Optionally, when the number of face information in the target face information set is greater than or equal to the number threshold, based on the confidence of the age identification result of the face object, it is determined whether the face information of the face object meets the storage condition corresponding to the target face information set.
S103: and displaying the target age corresponding to each human face object at the corresponding display position, wherein each display position is positioned on a display interface of the target human face image.
In the method provided by the embodiment of the invention, each face object has a corresponding display position, and the target age of the face object can be displayed at the display position.
The display position can be determined according to the coordinates of the center point of the face object or any point coordinates on the rectangular frame of the face object.
The age display method provided by the embodiment of the invention comprises the following steps: when a target face image is received, determining face information corresponding to each face object in the target face image, wherein the face information of each face object at least comprises an age identification result of the face object and a confidence coefficient of the age identification result; judging whether a target face information set corresponding to the face object exists for each face object in the target face image, and judging whether the face information of the face object meets the storage condition corresponding to the target face information set based on the confidence coefficient of the age identification result of the face object if the target face information set corresponding to the face object exists; if the face information meets the storage condition, storing the face information into a target face information set so as to complete the updating of the target face information set; acquiring a target age corresponding to the face object according to the age identification result of each face information stored in the updated target face information set; and displaying the target age corresponding to each face object at the corresponding display position, wherein each display position is positioned on the display interface of the target face image. By applying the method provided by the embodiment of the invention, the same face object can be tracked, and the target age of the face object can be determined by applying a large amount of high-confidence face information of the same face object, so that the age can be stably displayed, and the user experience is improved.
In the method provided in the embodiment of the present invention, based on the implementation process, specifically, a feasible manner of determining whether a target face information set corresponding to the face object already exists may include:
judging whether a pre-established information set storage area is empty or not, if not, determining each currently established information set in the information set storage area and a feature difference value between a feature value of the face object and a feature value of the face object to which each face information in each face information set belongs; judging whether the minimum feature difference value in all the feature difference values is larger than a preset difference threshold value or not; if the difference value is not greater than the difference threshold value, the face information set corresponding to the minimum feature difference value is judged to be the target face information set corresponding to the face object.
The feature difference value can be obtained by calculating a pixel point comparison algorithm, a mean hash algorithm, a perceptual hash algorithm, a feature energy matching algorithm, a Structural SIMilarity algorithm (SSIM), a deep learning face SIMilarity comparison algorithm or a euclidean distance algorithm.
In the method provided in the embodiment of the present invention, based on the implementation process, specifically, the process of determining whether the target face information set corresponding to the face object already exists may include, as shown in fig. 2:
s201: judging whether a pre-established information set storage area is empty or not; if so, go to S202, otherwise, go to S203.
In the method provided by the embodiment of the invention, the information set storage area is used for storing face information sets, each face information set is provided with an object identifier, and the object identifiers of the face information sets are different.
S202: and judging that the target face information set corresponding to the face object does not exist.
S203: and determining each currently established face information set in the information set storage region, and the Euclidean distance between the center point coordinate of the face object and the center point coordinate of the face object to which each face information in each face information set belongs.
In the method provided by the embodiment of the present invention, the coordinates of the center point of the current face object may be (cx1, cy1), the center point of the face object to which the face information in the face information set belongs may be (cx2, cy2), and the euclidean distance between the two may be:
Figure BDA0002818271000000091
s204: judging whether the minimum Euclidean distance in the Euclidean distances is larger than a preset distance threshold value or not; if not, S205 is executed, and if yes, S202 is executed.
The distance threshold value can be set according to scene requirements.
S205: and judging the face information set corresponding to the minimum Euclidean distance as a target face information set corresponding to the face object.
In the method provided by the embodiment of the present invention, when the minimum euclidean distance is not greater than the distance threshold, it is described that the two face objects corresponding to the minimum euclidean distance are the same face, that is, the face information set corresponding to the minimum euclidean distance is the target face information set corresponding to the current face object.
In the method provided in the embodiment of the present invention, based on the implementation process, specifically, the process of determining whether the face information of the face object meets the storage condition corresponding to the target face information set based on the confidence level in the face information corresponding to the face object may include, as shown in fig. 3:
s301: judging whether the number of the face information in the target face information set is greater than or equal to a preset number threshold value or not; if yes, executing S302; if not, go to S303.
In the method provided by the embodiment of the present invention, the number threshold may be any value, for example, 30, and the number threshold may be set according to a scene requirement.
S302: judging whether the confidence coefficient of the age identification result of the face object is greater than the minimum confidence coefficient of the confidence coefficients of the face information of the target face information set; if so, go to step S303, otherwise, go to step S304.
In the method provided by the embodiment of the invention, the minimum confidence coefficient is determined from the confidence coefficients of all face information in the target face information set.
The confidence of the age recognition result of the face object may be compared with the minimum confidence, so as to determine whether the confidence of the age recognition result of the face object is greater than the minimum confidence of the confidence of each piece of face information in the target face information set.
S303: and judging that the face information of the face object meets the storage condition corresponding to the target face information set.
S304: and judging that the face information corresponding to the face object does not meet the storage condition corresponding to the target face information set.
By applying the method provided by the embodiment of the invention, the face information with high confidence coefficient can be reserved in the face information set, so that the accuracy of the target age of the face object can be ensured.
In the method provided in the embodiment of the present invention, based on the foregoing implementation process, specifically, if the confidence of the age identification result of the face object is greater than the minimum confidence, the storing the face information into the target face information set to complete the updating of the target face information set includes:
and replacing and storing the face information of the face object to the face information to which the minimum confidence degree belongs in the target face information set so as to finish updating the target face information set.
In the method provided by the embodiment of the invention, the face information of the face object can be deleted from the face information belonging to the minimum confidence coefficient in the target face information set, and the face information of the face object is stored in the target face information set, so that the target face information set is updated.
By applying the method provided by the embodiment of the invention, the age identification result with high confidence can be kept, so that the accuracy of the target age can be guaranteed.
In the method provided in the embodiment of the present invention, based on the implementation process, specifically, the method further includes:
if the target face information set corresponding to the face object does not exist, allocating an object identifier for the face object;
generating a target face information set corresponding to the face object based on the object identification and the face information of the face object;
and acquiring the target age corresponding to the face object according to the age identification result in the target face information set.
In the method provided by the embodiment of the present invention, the target face information set may be in the form of a key value pair, where the value of the object identifier is a key, the face information of the face object is a value, the value in the key value pair may include at least one piece of face information, the value in the key value pair may be a list, and the face information in the list may be sorted according to the confidence level included in the face information.
Specifically, in the process of generating a target face information set corresponding to the face object based on the object identifier and the face information of the face object, a counter corresponding to the face object may be created and stored in the target face information set, and the counter may be used to update the value of the counter when each piece of face information is stored in the target face information set.
Alternatively, the object identifier may be any value other than the object identifier of the existing face information set.
The process of obtaining the target age corresponding to the face object according to the age identification result in the target face information set may be the same as the process of obtaining the target age corresponding to the face object related in S102.
By applying the method provided by the embodiment of the invention, the face information set can be created for the face object, so that the same face in the video stream can be tracked.
In the method provided in the embodiment of the present invention, based on the above implementation process, a feasible way of obtaining the target age corresponding to the face object according to the age recognition result of each piece of face information stored in the updated target face information set specifically includes:
and obtaining a weighting coefficient of each age recognition result in the target face information set according to the updated confidence coefficient of the age recognition result of each face information stored in the target face information set.
And carrying out weighted average on each age recognition result in the updated target face information set according to the weighting coefficient of each age recognition result in the updated target face information set to obtain the target age corresponding to the face object.
In the method provided by the embodiment of the present invention, the weighted average is performed on each age recognition result in the updated target face information set, and a manner of obtaining the target age corresponding to the face object is as follows:
Figure BDA0002818271000000121
the mean _ age is a target age, the confidence is a weighting coefficient, the weighting coefficient may be a confidence, age is an age recognition result, and n is the number of face information in the target face information set.
In the method provided in the embodiment of the present invention, based on the above implementation process, specifically, another feasible way of obtaining the target age corresponding to the face object according to the age recognition result of each piece of face information stored in the updated target face information set specifically includes:
calculating each age recognition result in the updated target face information set to obtain an age average value of each age recognition result in the target face information set;
and taking the age average value as the target age corresponding to the human face object.
In the method provided by the embodiment of the invention, the average value of the age recognition results in the face information set can be calculated, and the average value is used as the target age corresponding to the face object.
In the method provided in the embodiment of the present invention, based on the above implementation process, optionally after the face information is stored in the target face information set, a feasible manner is as follows:
updating the numerical value of a counter corresponding to the target face information set, and detecting the counter;
and if the numerical value of the counter is not updated within a preset time length, deleting the target face information set.
In another feasible mode, the value of the counter corresponding to the target face information set is updated, after the target age of each face object is obtained, whether the face information set with the updated value of the counter exists in the information set storage area is detected, and if the face information set with the updated value of the counter exists, the face information set with the updated value of the counter can be deleted.
The counter may be updated in a manner that when a new face information is stored in the corresponding face information set, the counter is incremented by a preset value, for example, the counter may be incremented by one.
By applying the method provided by the embodiment of the invention, the counter is arranged, when the counter is not updated any more, the corresponding face of the counter is deleted, the memory consumption is reduced, and the algorithm efficiency can be obviously improved in high-traffic scenes such as markets, stations, hospitals and the like.
The age display method provided by the embodiment of the invention can be implemented in various scenes, for example, in an implementation scene, the implementation scene comprises user terminal equipment and electronic equipment connected with the user terminal equipment.
During implementation, the user terminal device may be a camera, the electronic device may be, for example, a mobile phone, a tablet computer, a smart wearable device, a personal computer, a server, a cloud computing platform, and the like, the user terminal device may be integrated into the electronic device, or may be separately provided from the electronic device, and under the condition that the user terminal and the electronic device are separately provided, the user terminal device may be provided in a scene such as a mall, a station, a hospital, and the like, and the electronic device may be provided in a monitoring center.
In the embodiment of the present invention, based on the above implementation scenario, as shown in fig. 4, a flowchart of another method of the age display method provided in the embodiment of the present invention specifically includes the following steps:
step one, the user terminal equipment can collect video stream information by a user and transmit the collected video stream to the electronic equipment.
And step two, the electronic equipment intercepts the video stream information transmitted by the user terminal equipment, can reserve all frames, can also take 1 frame every N (N is more than or equal to 1) frames, and can be set based on model efficiency and system load.
And step three, transmitting the acquired image data of each frame to a face detection model in real time, wherein the face detection model can be any authorized model meeting the precision requirement, and returns face data existing in the image, including the face image, coordinates of the upper left corner and the lower right corner of a rectangular frame at the position of the face image and the confidence coefficient of a face object, and the confidence coefficient of the face object is higher in the interval of [0, 1] and better. When a plurality of face objects exist in the image, the face data can be returned in the form of array or list according to the high-low confidence degree sequence.
And step four, resizing the face image obtained by the face detection model again, packaging and transmitting the face image to a face attribute analysis model, wherein the face attribute analysis model can be any authorized model meeting the precision requirement, and the age recognition result age and the confidence coefficient corresponding to each face object returned by the face attribute analysis model are obtained.
Step five, updating an information set storage region by using the face age information and confidence coefficient obtained by the current frame image, wherein the information set storage region can be a dictionary trace _ labels, and if the trace _ labels are empty, turning to step six; if not, go to step seven.
Step six, trace _ labels are empty, if the number of the face objects is more than or equal to 1, different face objects are numbered in sequence, different object identification ids (for example, 0,1,2, …) are given, the center point coordinate (cx, cy) of each face rectangular frame is determined, a target face information set corresponding to the face objects is established, the target face information set can be a list heap of a stack structure, age information (confidence, age) is stored in the face information set, and a counter count is established to be 0; values (value) are put into trace _ labels with id as key (key), [ (cx, cy), heap, count ].
The structure of trace _ labels is as follows:
Trace_labels={id:[center,heap,count],...}
center=(cx,cy)
heap=[(confidengce,age),...]
that is, the information set storage area contains a plurality of face information sets, each face information set is composed of an object identifier, at least one piece of face information and a counter, and the face information may include one or more of face center coordinates, an age recognition result, a confidence of the age recognition result, and the like.
And seventhly, circularly iterating each face to calculate the Euclidean distance (distance) between the coordinates (cx1, cy1) of the center point of the face and the center points (cx2, cy2) of the existing faces in the trace _ labels, wherein the trace _ labels are not empty and the number of the faces is more than or equal to 1.
Step eight, if the minimum value of all distances between the human face object and the existing human face object is larger than a preset distance threshold value, the human face object is considered to be different from the existing human face object, and a new human face key value pair is created according to the method of the step six and is put into trace _ labels; and otherwise, the face object corresponding to the minimum distance value is considered to be the same, and the counter count is added by 1. If the number of the elements in the heap is smaller than a preset number threshold value, directly putting (confidence, age) into the heap; if the number of the elements in the heap is larger than or equal to the threshold value and the confidence of the face is larger than the minimum confidence in the heap, replacing the element containing the minimum confidence; otherwise, no changes are made.
Step nine, calculating the weighted average age mean _ age of each face, wherein the weighting coefficient is the confidence coefficient of the age.
Step ten, dynamically displaying the weighted average age on a user screen, referring to fig. 5, which is an exemplary diagram of a display interface of a target face image provided in an embodiment of the present invention, wherein a frame line on a face object is a rectangular face frame of the face object, a display position of the target age may be a lower right corner of the rectangular face frame, it should be noted that the display position of the target age shown in fig. 5 is only exemplary, and may be set at any position of the interface according to actual requirements, which is not limited in the embodiment of the present invention.
By applying the method provided by the embodiment of the invention, because a certain amount of face information of the same face is generally stored in the face information set heap, the weighted average age is more stable, the change is smoother, and better feeling is provided for users. In the embodiment of the invention, the same face in different frame images can be continuously tracked, so that the age information of the same face under different angles, illumination, postures, shelters and fuzzy conditions can be collected; collected age information can be stored in a heap structure, and a certain amount of most reliable age information with the highest confidence coefficient can be quickly selected and reserved to be used as a basis for calculating the final display age. The weighted average age can be calculated by taking the confidence coefficient as a coefficient on the basis of the age data with the same face amount and high confidence coefficient, so that the tracked age displayed on the user interface is very stable and smooth and has higher accuracy. According to the method provided by the embodiment of the invention, the counter parameters are set, when the counter is not updated any more, the corresponding face of the counter is deleted, the memory consumption is reduced, and the algorithm efficiency can be obviously improved in high-traffic scenes such as shopping malls, stations, hospitals and the like.
Corresponding to the method illustrated in fig. 1, an embodiment of the present invention further provides an age display apparatus, which is used for implementing the method illustrated in fig. 1 specifically, the age display apparatus provided in the embodiment of the present invention may be applied to a server, and a schematic structural diagram of the age display apparatus is illustrated in fig. 6, and specifically includes:
a receiving unit 601, configured to determine, when a target face image is received, face information corresponding to each face object in the target face image, where the face information of each face object at least includes an age recognition result of the face object and a confidence of the age recognition result;
an executing unit 602, configured to determine, for each face object in the target face image, whether a target face information set corresponding to the face object already exists, and if the target face information set corresponding to the face object already exists, determine, based on a confidence of an age identification result of the face object, whether the face information of the face object meets a storage condition corresponding to the target face information set; if the face information meets the storage condition, storing the face information into the target face information set so as to complete the updating of the target face information set; acquiring a target age corresponding to the face object according to the age identification result of each piece of face information stored in the updated target face information set;
a display unit 603, configured to display a target age corresponding to each face object at a corresponding display position, where each display position is on a display interface of the target face image.
In an embodiment of the present invention, based on the above scheme, optionally, the execution unit 602 for determining whether the target face information set corresponding to the face object already exists includes:
judging whether a pre-established information set storage area is empty or not;
if the information set storage area is empty, judging that a target face information set corresponding to the face object does not exist;
if the information set storage area is not empty, determining each currently established face information set in the information set storage area, and the Euclidean distance between the center point coordinate of the face object and the center point coordinate of the face object to which each face information in each face information set belongs; judging whether the minimum Euclidean distance in the Euclidean distances is larger than a preset distance threshold value or not; if the minimum Euclidean distance is not greater than the distance threshold, judging that the face information set corresponding to the minimum Euclidean distance is a target face information set corresponding to the face object; and if the distance is larger than the distance threshold, judging that the target face information set corresponding to the face object does not exist.
In an embodiment of the present invention, based on the above scheme, optionally, the execution unit 602, which determines whether the face information of the face object meets the storage condition corresponding to the target face information set based on the confidence level in the face information corresponding to the face object, is configured to:
judging whether the number of the face information in the target face information set is greater than or equal to a preset number threshold value or not;
if the number of the face information in the target face information set is greater than or equal to the number threshold, determining whether the confidence of the age identification result of the face object is greater than the minimum confidence of the confidence of each face information in the target face information set, and if the confidence of the age identification result of the face object is greater than the minimum confidence, judging that the face information of the face object meets the storage condition corresponding to the target face information set; if the confidence of the age identification result of the face is not greater than the minimum confidence, judging that the face information corresponding to the face object does not meet the storage condition corresponding to the target face information set;
and if the number of the face information in the target face information set is smaller than the preset number threshold, judging that the face information corresponding to the face object meets the storage condition corresponding to the target face information set.
In an embodiment of the present invention, based on the above scheme, optionally, if the confidence of the age recognition result of the face object is greater than the minimum confidence, the executing unit 602, configured to store the face information into the target face information set to complete updating of the target face information set, is configured to: and replacing and storing the face information of the face object to the face information to which the minimum confidence degree belongs in the target face information set so as to finish updating the target face information set.
In an embodiment of the present invention, based on the above scheme, optionally, the age display device further includes a processing unit, and the processing unit is configured to:
if the target face information set corresponding to the face object does not exist, allocating an object identifier for the face object;
generating a target face information set corresponding to the face object based on the object identification and the face information of the face object;
and acquiring the target age corresponding to the face object according to the age identification result in the target face information set.
In an embodiment of the present invention, based on the above scheme, optionally, the execution unit 602, configured to obtain the target age corresponding to the face object according to the age identification result of each piece of face information stored in the updated target face information set, is configured to:
obtaining a weighting coefficient of each age recognition result in the target face information set according to the confidence degree of the age recognition result of each face information stored in the updated target face information set;
and carrying out weighted average on each age recognition result in the updated target face information set according to the weighting coefficient of each age recognition result in the updated target face information set to obtain the target age corresponding to the face object.
In an embodiment of the present invention, based on the above scheme, optionally, the age display device further includes a detection unit, where the detection unit is configured to:
updating the numerical value of a counter corresponding to the target face information set, and detecting the counter;
and if the numerical value of the counter is not updated within a preset time length, deleting the target face information set.
The specific principle and implementation process of each unit and module in the age display device disclosed in the embodiment of the present invention are the same as those of the age display method disclosed in the embodiment of the present invention, and reference may be made to corresponding parts in the age display method provided in the embodiment of the present invention, which are not described herein again.
The embodiment of the invention also provides a storage medium, which comprises a stored instruction, wherein when the instruction runs, the equipment where the storage medium is located is controlled to execute the age display method.
An electronic device is provided in an embodiment of the present invention, and its structural diagram is shown in fig. 7, which specifically includes a memory 701 and one or more instructions 702, where the one or more instructions 702 are stored in the memory 701, and are configured to be executed by one or more processors 703 to perform the following operations according to the one or more instructions 702:
when a target face image is received, determining face information corresponding to each face object in the target face image, wherein the face information of each face object at least comprises an age identification result of the face object and a confidence coefficient of the age identification result;
judging whether a target face information set corresponding to the face object exists for each face object in the target face image, and judging whether the face information of the face object meets the storage condition corresponding to the target face information set based on the confidence coefficient of the age identification result of the face object if the target face information set corresponding to the face object exists; if the face information meets the storage condition, storing the face information into the target face information set so as to complete the updating of the target face information set; acquiring a target age corresponding to the face object according to the age identification result of each piece of face information stored in the updated target face information set;
and displaying the target age corresponding to each human face object at the corresponding display position, wherein each display position is positioned on a display interface of the target human face image.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the units may be implemented in the same software and/or hardware or in a plurality of software and/or hardware when implementing the invention.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The age display method provided by the invention is described in detail above, and the principle and the implementation of the invention are explained in the text by applying specific examples, and the description of the above examples is only used to help understanding the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. An age display method, comprising:
when a target face image is received, determining face information corresponding to each face object in the target face image, wherein the face information of each face object at least comprises an age identification result of the face object and a confidence coefficient of the age identification result;
judging whether a target face information set corresponding to the face object exists for each face object in the target face image, and judging whether the face information of the face object meets the storage condition corresponding to the target face information set based on the confidence coefficient of the age identification result of the face object if the target face information set corresponding to the face object exists; if the face information meets the storage condition, storing the face information into the target face information set so as to complete the updating of the target face information set; acquiring a target age corresponding to the face object according to the age identification result of each piece of face information stored in the updated target face information set;
and displaying the target age corresponding to each human face object at the corresponding display position, wherein each display position is positioned on a display interface of the target human face image.
2. The method of claim 1, wherein the determining whether the target face information set corresponding to the face object already exists comprises:
judging whether a pre-established information set storage area is empty or not;
if the information set storage area is empty, judging that a target face information set corresponding to the face object does not exist;
if the information set storage area is not empty, determining each currently established face information set in the information set storage area, and the Euclidean distance between the center point coordinate of the face object and the center point coordinate of the face object to which each face information in each face information set belongs; judging whether the minimum Euclidean distance in the Euclidean distances is larger than a preset distance threshold value or not; if the minimum Euclidean distance is not greater than the distance threshold, judging that the face information set corresponding to the minimum Euclidean distance is a target face information set corresponding to the face object; and if the distance is larger than the distance threshold, judging that the target face information set corresponding to the face object does not exist.
3. The method according to claim 1, wherein the determining whether the face information of the face object satisfies the storage condition corresponding to the target face information set based on the confidence level in the face information corresponding to the face object includes:
judging whether the number of the face information in the target face information set is greater than or equal to a preset number threshold value or not;
if the number of the face information in the target face information set is greater than or equal to the number threshold, determining whether the confidence of the age identification result of the face object is greater than the minimum confidence of the confidence of each face information in the target face information set, and if the confidence of the age identification result of the face object is greater than the minimum confidence, judging that the face information of the face object meets the storage condition corresponding to the target face information set; if the confidence of the age identification result of the face is not greater than the minimum confidence, judging that the face information corresponding to the face object does not meet the storage condition corresponding to the target face information set;
and if the number of the face information in the target face information set is smaller than the preset number threshold, judging that the face information corresponding to the face object meets the storage condition corresponding to the target face information set.
4. The method according to claim 3, wherein if the confidence of the age identification result of the face object is greater than the minimum confidence, the storing the face information into the target face information set to complete the update of the target face information set comprises:
and replacing and storing the face information of the face object to the face information to which the minimum confidence degree belongs in the target face information set so as to finish updating the target face information set.
5. The method of claim 1, further comprising:
if the target face information set corresponding to the face object does not exist, allocating an object identifier for the face object;
generating a target face information set corresponding to the face object based on the object identification and the face information of the face object;
and acquiring the target age corresponding to the face object according to the age identification result in the target face information set.
6. The method according to claim 1, wherein the obtaining a target age corresponding to the face object according to an age recognition result of each piece of face information stored in the updated target face information set comprises:
obtaining a weighting coefficient of each age recognition result in the target face information set according to the confidence degree of the age recognition result of each face information stored in the updated target face information set;
and carrying out weighted average on each age recognition result in the updated target face information set according to the weighting coefficient of each age recognition result in the updated target face information set to obtain the target age corresponding to the face object.
7. The method of claim 1, wherein after storing the face information into the target face information set, further comprising:
updating the numerical value of a counter of the target face information set, and detecting the counter;
and if the numerical value of the counter is not updated within a preset time length, deleting the target face information set.
8. An age display device, comprising:
the system comprises a receiving unit, a judging unit and a judging unit, wherein the receiving unit is used for determining face information corresponding to each face object in a target face image when the target face image is received, and the face information of each face object at least comprises an age identification result of the face object and a confidence coefficient of the age identification result;
the execution unit is used for judging whether a target face information set corresponding to the face object exists for each face object in the target face image, and judging whether the face information of the face object meets the storage condition corresponding to the target face information set based on the confidence of the age identification result of the face object if the target face information set corresponding to the face object exists; if the face information meets the storage condition, storing the face information into the target face information set so as to complete the updating of the target face information set; acquiring a target age corresponding to the face object according to the age identification result of each piece of face information stored in the updated target face information set;
and the display unit is used for displaying the target age corresponding to each face object at the corresponding display position, wherein each display position is positioned on the display interface of the target face image.
9. A storage medium, characterized in that the storage medium comprises stored instructions, wherein when the instructions are executed, the storage medium is controlled to execute the age display method according to any one of claims 1 to 7.
10. An electronic device comprising a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by the one or more processors to perform the age display method of any one of claims 1-7.
CN202011409809.1A 2020-12-04 2020-12-04 Age display method and device, storage medium and electronic equipment Pending CN112464842A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011409809.1A CN112464842A (en) 2020-12-04 2020-12-04 Age display method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011409809.1A CN112464842A (en) 2020-12-04 2020-12-04 Age display method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN112464842A true CN112464842A (en) 2021-03-09

Family

ID=74805789

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011409809.1A Pending CN112464842A (en) 2020-12-04 2020-12-04 Age display method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112464842A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130049099A (en) * 2011-11-03 2013-05-13 한국전자통신연구원 Method and apparatus for estimating age or gender using face image
CN105678269A (en) * 2016-01-11 2016-06-15 华侨大学 Dynamic interval-based face age estimation method
KR101756352B1 (en) * 2016-10-28 2017-07-10 주식회사 아이오로라 Method for estimating age of face in image using extended local binary pattern
US20170286753A1 (en) * 2016-04-01 2017-10-05 Hon Hai Precision Industry Co., Ltd. Method for identifying age based on facial feature
CN109145876A (en) * 2018-09-29 2019-01-04 北京达佳互联信息技术有限公司 Image classification method, device, electronic equipment and storage medium
CN109993150A (en) * 2019-04-15 2019-07-09 北京字节跳动网络技术有限公司 The method and apparatus at age for identification
CN110084289A (en) * 2019-04-11 2019-08-02 北京百度网讯科技有限公司 Image labeling method, device, electronic equipment and storage medium
US20200057883A1 (en) * 2017-11-28 2020-02-20 Tencent Technology (Shenzhen) Company Limited Facial attribute recognition method, electronic device, and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130049099A (en) * 2011-11-03 2013-05-13 한국전자통신연구원 Method and apparatus for estimating age or gender using face image
CN105678269A (en) * 2016-01-11 2016-06-15 华侨大学 Dynamic interval-based face age estimation method
US20170286753A1 (en) * 2016-04-01 2017-10-05 Hon Hai Precision Industry Co., Ltd. Method for identifying age based on facial feature
KR101756352B1 (en) * 2016-10-28 2017-07-10 주식회사 아이오로라 Method for estimating age of face in image using extended local binary pattern
US20200057883A1 (en) * 2017-11-28 2020-02-20 Tencent Technology (Shenzhen) Company Limited Facial attribute recognition method, electronic device, and storage medium
CN109145876A (en) * 2018-09-29 2019-01-04 北京达佳互联信息技术有限公司 Image classification method, device, electronic equipment and storage medium
CN110084289A (en) * 2019-04-11 2019-08-02 北京百度网讯科技有限公司 Image labeling method, device, electronic equipment and storage medium
CN109993150A (en) * 2019-04-15 2019-07-09 北京字节跳动网络技术有限公司 The method and apparatus at age for identification

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LAI, DH 等: "Age estimation with dynamic age range", MULTIMEDIA TOOLS AND APPLICATIONS, vol. 76, no. 5, pages 6551 - 6573, XP036197762, DOI: 10.1007/s11042-015-3230-0 *
王先梅;梁玲燕;王志良;胡四泉;: "人脸图像的年龄估计技术研究", 中国图象图形学报, no. 06, pages 603 - 618 *

Similar Documents

Publication Publication Date Title
Liu et al. Real-time robust vision-based hand gesture recognition using stereo images
WO2018153294A1 (en) Face tracking method, storage medium, and terminal device
CN111401318B (en) Action recognition method and device
CN114359974B (en) Human body posture detection method and device and storage medium
CN110147532B (en) Encoding method, apparatus, device and storage medium
WO2021097750A1 (en) Human body posture recognition method and apparatus, storage medium, and electronic device
CN112364799A (en) Gesture recognition method and device
CN115311730B (en) Face key point detection method and system and electronic equipment
CN111507285A (en) Face attribute recognition method and device, computer equipment and storage medium
CN112163577A (en) Character recognition method and device in game picture, electronic equipment and storage medium
CN113128526B (en) Image recognition method and device, electronic equipment and computer-readable storage medium
CN111753813A (en) Image processing method, device, equipment and storage medium
CN116563588A (en) Image clustering method and device, electronic equipment and storage medium
CN111260697A (en) Target object identification method, system, device and medium
CN111796701A (en) Model training method, operation processing method, device, storage medium and equipment
CN112464842A (en) Age display method and device, storage medium and electronic equipment
CN113158912A (en) Gesture recognition method and device, storage medium and electronic equipment
CN113723306A (en) Push-up detection method, device and computer readable medium
CN111739098A (en) Speed measuring method and device, electronic equipment and storage medium
CN117553808B (en) Deep learning-based robot positioning navigation method, device, equipment and medium
CN118097521B (en) Object recognition method, device, apparatus, medium and program product
CN114827706B (en) Image processing method, computer program product, electronic device, and storage medium
CN111797863A (en) Model training method, data processing method, device, storage medium and equipment
CN111796924A (en) Service processing method, device, storage medium and electronic equipment
CN117173731B (en) Model training method, image processing method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination