CN112926542A - Performance detection method and device, electronic equipment and storage medium - Google Patents
Performance detection method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN112926542A CN112926542A CN202110384949.6A CN202110384949A CN112926542A CN 112926542 A CN112926542 A CN 112926542A CN 202110384949 A CN202110384949 A CN 202110384949A CN 112926542 A CN112926542 A CN 112926542A
- Authority
- CN
- China
- Prior art keywords
- image
- gender
- face
- target person
- detection
- 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.)
- Granted
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 185
- 238000012544 monitoring process Methods 0.000 claims abstract description 52
- 238000000034 method Methods 0.000 claims abstract description 31
- 230000001815 facial effect Effects 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 6
- 238000012545 processing Methods 0.000 abstract description 15
- 230000006870 function Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 230000003287 optical effect Effects 0.000 description 6
- 238000012549 training Methods 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 2
- 238000013135 deep learning Methods 0.000 description 2
- 238000003062 neural network model Methods 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 238000012512 characterization method Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 230000008034 disappearance Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000000474 nursing effect Effects 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/161—Detection; Localisation; Normalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/40—Scenes; Scene-specific elements in video content
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Human Computer Interaction (AREA)
- Closed-Circuit Television Systems (AREA)
- Image Analysis (AREA)
Abstract
The embodiment of the invention discloses a method and a device for detecting the performance, electronic equipment and a storage medium. The method comprises the following steps: acquiring a current image frame from a monitoring video, and acquiring a face detection frame and a face confidence of the face detection frame in the current image frame; when the face confidence coefficient meets a preset confidence coefficient condition, tracking a target person in the face detection frame and acquiring a face image of the target person; selecting a target image meeting a preset quality condition from the face image; and performing gender detection on the target image to obtain gender identification of the target person. The embodiment of the invention provides a solution for the requirement of automatic gender detection in various scenes, and can realize automatic gender detection in various scenes; in addition, by presetting the confidence level condition and the quality condition, the target image for executing the gender detection can be accurately obtained, the image processing quantity is reduced, and the detection efficiency and accuracy are improved.
Description
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method and a device for detecting gender, electronic equipment and a storage medium.
Background
In real life, there is a need for gender detection in many scenarios. Such as: a dormitory building for girls, which generally only allows girls to enter in order to protect personal safety of girls, so that sex detection is required to detect intruding males; for another example, in a mother-infant room, in order to protect female privacy, only females are generally allowed to enter the room, and therefore gender detection is also required, but the related implementation scheme for automatically performing gender detection is lacking in the prior art.
Disclosure of Invention
Embodiments of the present invention provide a gender detection method, apparatus, electronic device and storage medium, which provide a solution to the need for gender automatic detection in various scenarios, and can implement gender automatic detection in various scenarios.
In a first aspect, an embodiment of the present invention provides a method for detecting a gender, where the method includes:
acquiring a current image frame from a monitoring video, and acquiring a face detection frame in the current image frame and a face confidence of the face detection frame;
when the face confidence coefficient meets a preset confidence coefficient condition, tracking a target person in the face detection frame and acquiring a face image of the target person;
selecting a target image meeting a preset quality condition from the face image;
and performing gender detection on the target image to obtain gender identification of the target person.
Further, after tracking the target person in the face detection frame and acquiring the face image of the target person, the method further includes:
and determining whether the quality score of the face image of the target person acquired at the current moment is greater than a preset score.
Further, the selecting a target image satisfying a preset quality condition from the face image includes:
and when the quality score of the facial image of the target person acquired at the current moment is larger than the preset score, determining the facial image of the target person acquired at the current moment as the target image.
Further, the selecting a target image satisfying a preset quality condition from the face image includes:
when the quality score of the face image of the target person acquired at the current moment is not greater than the preset score, determining whether the tracking duration of the target person at the current moment exceeds a preset duration;
and when the tracking time of the target person at the current moment exceeds the preset time, selecting a face image with the highest quality score from the face images of the target person obtained in the tracking time to obtain the target image.
Further, performing gender detection on the target image to obtain a gender identification of the target person, including:
inputting the target image into a gender detection model to perform gender detection to obtain a gender probability value of the target person;
and determining the gender identification of the target person according to the gender probability value of the target person and a preset gender probability threshold.
Further, after the performing gender detection on the target image to obtain the gender identification of the target person, the method further includes:
determining whether the gender identification of the target person is consistent with the gender identification allowed by the current area;
and when the gender identification of the target person is inconsistent with the gender identification allowed in the current area, giving an alarm for prompting, and storing the target image into a preset image library.
Further, the gender detection model comprises four Thin modules, each Thin module is built by two basic blocks, a 1x1 pointwise convolution and a 3x3 depth separable convolution, and each basic block is formed by combining two 1x1 pointwise convolutions and a 3x3 depth separable convolution.
In a second aspect, an embodiment of the present invention further provides a gender detecting device, including:
the confidence coefficient acquisition module is used for acquiring a current image frame from a monitoring video and acquiring a face detection frame in the current image frame and the face confidence coefficient of the face detection frame;
the image tracking module is used for tracking a target person in the face detection frame and acquiring a face image of the target person when the face confidence coefficient meets a preset confidence coefficient condition;
the image selection module is used for selecting a target image meeting a preset quality condition from the face image;
and the gender determination module is used for executing gender detection on the target image to obtain the gender identification of the target person.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method for gender detection as described in any of the embodiments of the present invention.
In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement any one of the gender detection methods described in the embodiments of the present invention.
In the embodiment of the invention, the current image frame can be obtained from the monitoring video, the face detection frame in the current image frame and the face confidence of the face detection frame are obtained, when the face confidence meets the preset confidence condition, the target person in the face detection frame is tracked, the face image of the target person is obtained, the target image meeting the preset quality condition is selected from the face image, and gender detection is carried out on the target image to obtain the gender identification of the target person. In other words, in the embodiment of the invention, the gender detection of the person can be realized by analyzing and processing the monitoring video, so that the monitoring video of the scene can be analyzed and processed aiming at the scene with the gender detection requirement, a solution is provided for the gender automatic detection requirement under various scenes, and the gender automatic detection can be realized under various scenes; in addition, by presetting the confidence level condition and the quality condition, the target image for executing the gender detection can be accurately obtained, the image processing quantity is reduced, and the detection efficiency and accuracy are improved.
Drawings
Fig. 1 is a schematic flow chart of a gender detection method according to an embodiment of the present invention.
Fig. 2 is another schematic flow chart of a gender detection method according to an embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a basic block provided in an embodiment of the present invention.
Fig. 4 is a schematic structural diagram of a Thin module according to an embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a gender detection apparatus according to an embodiment of the present invention.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
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.
Fig. 1 is a schematic flow chart of a gender detection method provided by an embodiment of the present invention, which may be implemented by a gender detection apparatus provided by an embodiment of the present invention, and the apparatus may be implemented in software and/or hardware. In a particular embodiment, the apparatus may be integrated in an electronic device, which may be, for example, a server. The following embodiments will be described by taking as an example that the apparatus is integrated in an electronic device, and referring to fig. 1, the method may specifically include the following steps:
For example, the monitoring video may be from a video acquisition device, the video acquisition device may be a camera, a video recorder, or other devices with a video acquisition function, and the monitoring video may be a monitoring video acquired in real time or a monitoring video acquired in advance; when the monitoring video is the monitoring video acquired in real time, the current image frame can be the latest frame in the monitoring video, and in this case, the real-time monitoring video is used for detecting the gender of the target person in the current scene in real time; when the surveillance video is a pre-collected surveillance video, the current image frame may be a start frame or any one frame in an intermediate process of the surveillance video, or may be a currently played frame during playback of the surveillance video, in which case, the pre-collected surveillance video is used to detect the gender of the target person in the current scene.
After acquiring a current image frame from the surveillance video, face detection may be performed on the current image frame; for example, the current image frame may be input into a face detection model, so as to detect and locate a face in the current image frame by using the face detection model, and the detection output of the face detection model may include a face detection frame in the current image frame and a face confidence of the face detection frame; of course, the face detection model may also output other related information, such as position information (e.g., position coordinates) of the face detection frame, and person identification information of the target person in the face detection frame, where the person identification information may be a code, a number id, and the like of the person, and one piece of person identification information may uniquely identify or correspond to one person.
In the embodiment of the invention, the face detection frame is used for marking the position of the face in the current image frame, the face confidence coefficient is used for representing the probability or degree of the face in the face detection frame, the face detection model can be a deep learning network model, and the face detection model can be obtained by pre-training.
And 102, tracking the target person in the face detection frame and acquiring the face image of the target person when the face confidence coefficient meets the preset confidence coefficient condition.
For example, a confidence threshold may be preset according to actual requirements or experimental data, and whether the face confidence of the face detection frame meets a preset confidence condition is determined by the confidence threshold. For example, the face confidence may be compared with a confidence threshold, and if the face confidence is greater than the confidence threshold, the face confidence is determined to satisfy the preset confidence condition, otherwise, if the face confidence is not greater than the confidence threshold, the face confidence is determined not to satisfy the preset confidence condition.
In a specific implementation, when the face confidence meets a preset confidence condition, it is indicated that the face detection frame is likely to be a face, and a target person in the face detection frame, that is, a person in the face detection frame, may be tracked and a face image of the target person may be obtained. For example, the target person may be tracked according to the identification information of the target person, and a face image of the target person may be obtained, where the obtained face image may include multiple faces.
And 103, selecting a target image meeting a preset quality condition from the face image.
Specifically, for example, a quality threshold may be preset according to actual requirements or experimental data, and whether each face image meets a preset quality condition is determined according to the quality threshold. For example, for any one face image, the quality score of the face image may be compared with a quality threshold, if the quality score of the face image is greater than the quality threshold, it is determined that the face image satisfies a preset quality condition, otherwise, if the quality score of the face image is not greater than the quality threshold, it is determined that the face image does not satisfy the preset quality condition; and traversing each face image to obtain a target image.
Certainly, in order to avoid that the target image cannot be selected due to unreasonable quality threshold setting, in practical applications, the face image with the highest quality score in the acquired face images may also be directly used as the target image, which is not specifically limited herein.
And 104, performing gender detection on the target image to obtain gender identification of the target person.
For example, the target image may be input to a gender detection model to perform gender detection, the output of the gender detection model may be a probability that the target person belongs to each gender (male, female), and the gender identification of the target person, such as male, female, may be obtained according to the probability that the target person belongs to each gender. For example, the gender probability that the target person belongs to a male and the gender probability that the target person belongs to a female may be compared, and if the gender probability that the target person belongs to a male is greater than the gender probability that the target person belongs to a female, the gender identification of the target person is determined to be a male. In addition, the gender detection model can be a deep neural network model, and the gender detection model can be obtained by training in advance.
In the embodiment of the invention, the current image frame can be obtained from the monitoring video, the face detection frame in the current image frame and the face confidence of the face detection frame are obtained, when the face confidence meets the preset confidence condition, the target person in the face detection frame is tracked, the face image of the target person is obtained, the target image meeting the preset quality condition is selected from the face image, and gender detection is carried out on the target image to obtain the gender identification of the target person. In other words, in the embodiment of the invention, the gender detection of the person can be realized by analyzing and processing the monitoring video, so that the monitoring video of the scene can be analyzed and processed aiming at the scene with the gender detection requirement, a solution is provided for the gender automatic detection requirement under various scenes, and the gender automatic detection can be realized under various scenes; in addition, by presetting the confidence level condition and the quality condition, the target image for executing the gender detection can be accurately obtained, the image processing quantity is reduced, and the detection efficiency and accuracy are improved.
The gender detection method provided by the embodiment of the present invention is further described below, and as shown in fig. 2, the method may specifically include the following steps:
For example, the monitoring video may be from a video acquisition device, the video acquisition device may be a camera, a video recorder, or other devices with a video acquisition function, and the monitoring video may be a monitoring video acquired in real time or a monitoring video acquired in advance; when the monitoring video is the monitoring video acquired in real time, the current image frame can be the latest frame in the monitoring video, and in this case, the real-time monitoring video is used for detecting the gender of the target person in the current scene in real time; when the surveillance video is a pre-collected surveillance video, the current image frame may be a start frame or any one frame in an intermediate process of the surveillance video, or may be a currently played frame during playback of the surveillance video, in which case, the pre-collected surveillance video is used to detect the gender of the target person in the current scene. Specifically, in the present embodiment, for convenience of description, a case where the monitoring video is a monitoring video acquired in real time is taken as an example for explanation.
After acquiring a current image frame from the surveillance video, face detection may be performed on the current image frame; for example, the current image frame may be input into a face detection model, so as to detect and locate a face in the current image frame by using the face detection model, and the detection output of the face detection model may include a face detection frame in the current image frame and a face confidence of the face detection frame; of course, the face detection model may also output other related information, such as outputting position information (e.g., position coordinates) of the face detection frame, and person identification information of the target person in the face detection frame, where the person identification information may be a code, a number id, and the like of the person, and one piece of person identification information may uniquely identify or correspond to one person.
In the embodiment of the invention, the face detection frame is used for marking the position of the face in the current image frame, and the face detection frame can be a rectangular frame, a square frame and the like; the face confidence is used to indicate the probability or degree of the face in the face detection box, and the face confidence is 70%, 80%, for example; in addition, the face detection model can be a deep learning network model, and the face detection model can be obtained by training in advance.
And step 202, when the face confidence coefficient meets a preset confidence coefficient condition, tracking a target person in the face detection frame and acquiring a face image of the target person.
For example, a confidence threshold, such as 80%, 90%, or the like, may be preset according to actual requirements or experimental data, and it is determined whether the face confidence of the face detection box meets a preset confidence condition according to the set confidence threshold. For example, the face confidence may be compared with a confidence threshold, and if the face confidence is greater than the confidence threshold, the face confidence is determined to satisfy the preset confidence condition, otherwise, if the face confidence is not greater than the confidence threshold, the face confidence is determined not to satisfy the preset confidence condition.
In a specific implementation, when the face confidence meets a preset confidence condition, it is indicated that the face detection frame is likely to be a face, a tracker may be created, the tracker is used to track a target person in the face detection frame, record a tracking duration, and obtain a face image of the target person, where the target person is a person in the face detection frame. For example, the target person may be tracked according to the identification information of the target person, and a facial image of the target person may be acquired (e.g., captured from the surveillance video) according to a certain rule (e.g., every 1 second or 2 seconds), where the acquired facial image may include multiple pieces of facial images.
And step 206, selecting the face image with the highest quality score from the face images of the target person obtained in the tracking time length to obtain the target image.
In a specific embodiment, when the target person starts to be tracked, an image storage area can be created for the target person according to the identification information of the target person, and after a first face image of the target person is obtained, the quality of the first face image can be scored to obtain the quality score of the first face image; judging whether the quality score of the first face image is larger than a preset score, if so, taking the first face image as a target image and stopping acquiring the face image of the target person; and if not, storing the first face image into the created image storage area and continuously tracking the target person to obtain the face image of the target person.
If the target person is continuously tracked to obtain the face image of the target person, then, each face image is obtained, and the quality of the face image is scored; if the quality score of the face image is higher than a preset score, taking the face image as a target image and stopping obtaining; if the quality score of the face image is not higher than the preset score, acquiring the quality scores of all face images currently stored in an image storage area, finding out the maximum value of the quality score, comparing the quality score of the face image with the maximum value of the quality score, if the quality score of the face image is larger than the maximum value of the quality score, storing the face image into the image storage area, and if the quality score of the face image is not larger than the maximum value of the quality score, discarding the face image; and continuously acquiring the face image of the target person until the tracking time of the target person at the current moment exceeds the preset time and the face image with the quality score exceeding the preset score is not acquired, and taking the face image of the target person with the highest quality score stored in the image storage area as the target image.
Specifically, the preset value and the preset time duration can be selected according to actual needs or experimental data, the preset value is 80 minutes, 90 minutes and the like, and the preset time duration is 3 minutes, 5 minutes and the like.
And step 207, inputting the target image into a gender detection model to perform gender detection, and obtaining a gender probability value of the target person.
For example, the target image may be input to a gender detection model to perform gender detection, the output of the gender detection model may be a probability that the target person belongs to each gender (male, female), and the gender identification of the target person, such as male, female, may be obtained according to the probability that the target person belongs to each gender. For example, the gender probability that the target person belongs to a male and the gender probability that the target person belongs to a female may be compared, and if the gender probability that the target person belongs to a male is greater than the gender probability that the target person belongs to a female, the gender identification of the target person is determined to be a male. The gender detection model can be a deep neural network model, and the gender detection model can be obtained by training in advance.
And step 208, determining the gender identification of the target person according to the gender probability value of the target person and a preset gender probability threshold.
In specific implementation, a gender probability threshold can be set to improve the accuracy of gender identification. For example, after obtaining the probability that the target person belongs to each gender, the gender probability that the target person belongs to a male and the gender probability that the target person belongs to a female are determined; if the gender probability that the target person belongs to the male is larger, comparing the gender probability that the target person belongs to the male with a preset gender probability threshold, and if the gender probability that the target person belongs to the male is larger than the preset gender probability threshold, determining that the gender of the target person is identified as the male; and if the gender probability that the target person belongs to the female is higher than the preset gender probability threshold, comparing the gender probability that the target person belongs to the female with the preset gender probability threshold, and if the gender probability that the target person belongs to the female is higher than the preset gender probability threshold, determining that the gender identification of the target person is female.
In a specific embodiment, it may also be determined whether the gender identification of the target person is consistent with the gender identification allowed in the current region, and if so, it is indicated that the gender of the person is allowed to enter or stay in the current region, and no processing is performed; if not, it indicates that the current region does not allow the person of the gender to enter or stay, step 210 is performed.
And step 210, giving an alarm, and storing the target image into a preset image library.
In a specific embodiment, the alarm notification may be sent to an alarm device to notify the alarm device to perform an alarm prompt, where the alarm device may be, for example, a speaker, a loudspeaker, a display screen, and the alarm prompt may be in the form of voice, text, and the like, and is not limited herein.
In addition, a target image (only a face image, which can be understood as a small image) can be stored in a preset image library for relevant personnel to check, even an original image frame (including images of a face region, a background and the like, which can be understood as a large image) corresponding to the target image can be stored in the preset image library, and the image stored in the preset image library can carry information such as a video acquisition device number and shooting time, so that relevant personnel can check conveniently. Specifically, the preset image library may be built in a File Transfer Protocol (FTP) server. To improve the database performance, images in the preset image library may be deleted periodically, for example, the preset image library may store images generated within a short time, and images over a month may be deleted.
And step 211, ending.
In the embodiment of the invention, the current image frame can be obtained from the monitoring video, the face detection frame in the current image frame and the face confidence of the face detection frame are obtained, when the face confidence meets the preset confidence condition, the target person in the face detection frame is tracked, the face image of the target person is obtained, the target image meeting the preset quality condition is selected from the face image, and gender detection is carried out on the target image to obtain the gender identification of the target person. In other words, in the embodiment of the invention, the gender detection of the person can be realized by analyzing and processing the monitoring video, so that the monitoring video of the scene can be analyzed and processed aiming at the scene with the gender detection requirement, a solution is provided for the gender automatic detection requirement under various scenes, and the gender automatic detection can be realized under various scenes; in addition, by presetting the confidence level condition and the quality condition, the target image for executing the gender detection can be accurately obtained, the image processing quantity is reduced, and the detection efficiency and accuracy are improved.
In a specific embodiment, in order to improve the detection efficiency, the embodiment of the invention further designs a gender detection model, wherein the gender detection model comprises a plurality of Thin modules, each Thin module is built by a foundation block, 1 × 1 dot-by-dot convolution and 3 × 3 depth separable convolution, and each foundation block is formed by combining 1 × 1 dot-by-dot convolution and 3 × 3 depth separable convolution.
Specifically, as shown in table 1 below, the gender detection model may include four Thin modules, each Thin module being built up from two basic blocks, a 1 × 1 pointwise convolution and a 3 × 3 depth separable convolution, and each basic block being formed by combining two 1 × 1 pointwise convolutions and a 3 × 3 depth separable convolution.
TABLE 1
In a specific implementation, the basic block structure may be as shown in fig. 3, and the Thin module structure may be as shown in fig. 4.
The basic block adopts the convolution of small kernels of 1 multiplied by 1 and 3 multiplied by 3, so that the number of network parameters can be reduced, and the calculation efficiency is higher. As shown in fig. 3, point-by-point convolution of 1x1 PW (1) is used to implement dimension reduction and reduce the number of parameters, and a multi-branch fusion mode is adopted for 1x1 PW (2) and 3x3 DW (1), so as to better implement feature characterization.
The Thin module, as shown in fig. 4, uses Skip Connection (Skip Connection) to multiplex features, and at the same time, it can effectively reduce the problems of gradient disappearance and network degradation, making training easier, where 3 × 3 DW (2) is used to reduce the size of the feature map, where Block is the basic Block in fig. 3. Note that all the above convolutions are followed by the BN layer and the ReLU layer.
Experiments prove that the gender detection model is constructed by four Thin modules, the total parameter of the gender detection model is about 670000, the size of a model file is about 2.8M, the memory occupation amount is extremely low, the calculation complexity is kept, and the superior performance of the model is ensured.
The gender detection method provided by the implementation of the invention is explained in two specific application scenarios.
For example, the gender detection method of the embodiment of the invention can be applied to a dormitory for female, a camera can be installed at an entrance of each dormitory for female, the camera can be associated with a speaker or can be integrated with a speaker, a monitoring video is collected by the camera, the collected monitoring video can be stored in a video monitoring server according to a camera identifier (such as a camera serial number id, a serial number and the like), when gender detection is required, the monitoring video can be obtained from the video monitoring server, the gender detection process is executed on the obtained monitoring video by using the method provided by the embodiment of the invention, once a male is detected to appear in the monitoring video collected by a certain camera, an alarm notification can be sent to the corresponding camera according to the camera identifier, so that the corresponding camera can perform alarm prompt by using the speaker integrated with the camera, or the corresponding camera carries out alarm prompt by utilizing the associated loudspeaker, thereby playing a role in protecting the personal safety of the girls.
For another example, the gender detection method of the embodiment of the invention can be applied to a mother-and-baby room or a nursing room arranged in a public place, a camera can be installed at the entrance of the mother-and-baby room, the camera can be associated with a loudspeaker or can be integrated with a loudspeaker, monitoring videos are collected by the camera, the collected monitoring videos can be stored in a video monitoring server, and when gender detection is required, the method provided by the embodiment of the invention can be used for executing a gender detection process on the acquired monitoring video, once a male is detected to appear in the monitoring video, an alarm notification can be sent to the camera head, so that the camera head utilizes a loudspeaker integrated with the camera head to carry out alarm prompt, or the camera is enabled to use the related loudspeaker to give an alarm for prompting, so that the function of protecting the privacy of the female is achieved.
It should be noted that the above application scenarios are only examples, and in practical applications, the application scenarios may also be applied in other scenarios with gender detection requirements, such as a public toilet, and are not specifically limited herein.
Fig. 5 is a schematic structural diagram of a gender detection device provided by an embodiment of the present invention, and as shown in fig. 5, the gender detection device includes:
a confidence obtaining module 501, configured to obtain a current image frame from a monitoring video, and obtain a face detection frame in the current image frame and a face confidence of the face detection frame;
an image tracking module 502, configured to track a target person in the face detection frame and obtain a face image of the target person when the face confidence meets a preset confidence condition;
an image selecting module 503, configured to select a target image meeting a preset quality condition from the face image;
a gender determination module 504, configured to perform gender detection on the target image to obtain a gender identification of the target person.
In one embodiment, the apparatus further comprises:
and the quality determining module is used for determining whether the quality score of the face image of the target person acquired at the current moment is greater than a preset score.
In an embodiment, the selecting module 503 selects a target image satisfying a predetermined quality condition from the face image, including:
and when the quality score of the facial image of the target person acquired at the current moment is larger than the preset score, determining the facial image of the target person acquired at the current moment as the target image.
In an embodiment, the selecting module 503 selects a target image satisfying a predetermined quality condition from the face image, including:
when the quality score of the face image of the target person acquired at the current moment is not greater than the preset score, determining whether the tracking duration of the target person at the current moment exceeds a preset duration;
and when the tracking time of the target person at the current moment exceeds the preset time, selecting a face image with the highest quality score from the face images of the target person obtained in the tracking time to obtain the target image.
In an embodiment, the determining the gender of the target image by the gender determining module 504 to obtain the gender identification of the target person includes:
inputting the target image into a gender detection model to perform gender detection to obtain a gender probability value of the target person;
and determining the gender identification of the target person according to the gender probability value of the target person and a preset gender probability threshold.
In one embodiment, the apparatus further comprises:
the alarm module is used for determining whether the gender identification of the target person is consistent with the gender identification allowed by the current area; and when the gender identification of the target person is inconsistent with the gender identification allowed in the current area, giving an alarm for prompting, and storing the target image into a preset image library.
In one embodiment, the gender detection model includes four Thin modules, each Thin module is built by two basic blocks, a 1 × 1 pointwise convolution and a 3 × 3 depth separable convolution, and each basic block is formed by two 1 × 1 pointwise convolutions and a 3 × 3 depth separable convolution in combination.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the functional module, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
The device provided by the embodiment of the invention can acquire the current image frame from the monitoring video, acquire the face detection frame in the current image frame and the face confidence of the face detection frame, track the target person in the face detection frame and acquire the face image of the target person when the face confidence meets the preset confidence condition, select the target image meeting the preset quality condition from the face image, and perform gender detection on the target image to obtain the gender identification of the target person. In other words, in the embodiment of the invention, the gender detection of the person can be realized by analyzing and processing the monitoring video, so that the monitoring video of the scene can be analyzed and processed aiming at the scene with the gender detection requirement, a solution is provided for the gender automatic detection requirement under various scenes, and the gender automatic detection can be realized under various scenes; in addition, by presetting the confidence level condition and the quality condition, the target image for executing the gender detection can be accurately obtained, the image processing quantity is reduced, and the detection efficiency and accuracy are improved.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. FIG. 6 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 6 is only an example and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in FIG. 6, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, and commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, to implement the gender detection method provided by the embodiment of the present invention, which includes:
acquiring a current image frame from a monitoring video, and acquiring a face detection frame in the current image frame and a face confidence of the face detection frame;
when the face confidence coefficient meets a preset confidence coefficient condition, tracking a target person in the face detection frame and acquiring a face image of the target person;
selecting a target image meeting a preset quality condition from the face image;
and performing gender detection on the target image to obtain gender identification of the target person.
The fourth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the gender detection method according to the fourth embodiment of the present invention, and the method includes:
acquiring a current image frame from a monitoring video, and acquiring a face detection frame in the current image frame and a face confidence of the face detection frame;
when the face confidence coefficient meets a preset confidence coefficient condition, tracking a target person in the face detection frame and acquiring a face image of the target person;
selecting a target image meeting a preset quality condition from the face image;
and performing gender detection on the target image to obtain gender identification of the target person.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
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.
Claims (10)
1. A method for detecting a gender, comprising:
acquiring a current image frame from a monitoring video, and acquiring a face detection frame in the current image frame and a face confidence of the face detection frame;
when the face confidence coefficient meets a preset confidence coefficient condition, tracking a target person in the face detection frame and acquiring a face image of the target person;
selecting a target image meeting a preset quality condition from the face image;
and performing gender detection on the target image to obtain gender identification of the target person.
2. The method of claim 1, further comprising, after tracking the target person in the face detection frame and acquiring the face image of the target person:
and determining whether the quality score of the face image of the target person acquired at the current moment is greater than a preset score.
3. The method according to claim 2, wherein the selecting a target image satisfying a preset quality condition from the face image comprises:
and when the quality score of the facial image of the target person acquired at the current moment is larger than the preset score, determining the facial image of the target person acquired at the current moment as the target image.
4. The method according to claim 2, wherein the selecting a target image satisfying a preset quality condition from the face image comprises:
when the quality score of the face image of the target person acquired at the current moment is not greater than the preset score, determining whether the tracking duration of the target person at the current moment exceeds a preset duration;
and when the tracking time of the target person at the current moment exceeds the preset time, selecting a face image with the highest quality score from the face images of the target person obtained in the tracking time to obtain the target image.
5. The method of claim 1, wherein performing gender detection on the target image to obtain a gender identification of the target person comprises:
inputting the target image into a gender detection model to perform gender detection to obtain a gender probability value of the target person;
and determining the gender identification of the target person according to the gender probability value of the target person and a preset gender probability threshold.
6. The method of claim 5, wherein after performing gender detection on the target image to obtain the gender identification of the target person, the method further comprises:
determining whether the gender identification of the target person is consistent with the gender identification allowed by the current area;
and when the gender identification of the target person is inconsistent with the gender identification allowed in the current area, giving an alarm for prompting, and storing the target image into a preset image library.
7. The method of claim 5, wherein the gender detection model comprises four Thin modules, each of which is built from two base blocks, a 1x1 pointwise convolution and a 3x3 depth separable convolution, each of which is combined from two 1x1 pointwise convolutions and a 3x3 depth separable convolution.
8. A gender detection device, comprising:
the confidence coefficient acquisition module is used for acquiring a current image frame from a monitoring video and acquiring a face detection frame in the current image frame and the face confidence coefficient of the face detection frame;
the image tracking module is used for tracking a target person in the face detection frame and acquiring a face image of the target person when the face confidence coefficient meets a preset confidence coefficient condition;
the image selection module is used for selecting a target image meeting a preset quality condition from the face image;
and the gender determination module is used for executing gender detection on the target image to obtain the gender identification of the target person.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the gender detection method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method for gender detection as claimed in one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110384949.6A CN112926542B (en) | 2021-04-09 | 2021-04-09 | Sex detection method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110384949.6A CN112926542B (en) | 2021-04-09 | 2021-04-09 | Sex detection method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112926542A true CN112926542A (en) | 2021-06-08 |
CN112926542B CN112926542B (en) | 2024-04-30 |
Family
ID=76173833
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110384949.6A Active CN112926542B (en) | 2021-04-09 | 2021-04-09 | Sex detection method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112926542B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115082836A (en) * | 2022-07-23 | 2022-09-20 | 深圳神目信息技术有限公司 | Behavior recognition-assisted target object detection method and device |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070104362A1 (en) * | 2005-11-08 | 2007-05-10 | Samsung Electronics Co., Ltd. | Face recognition method, and system using gender information |
CN104036236A (en) * | 2014-05-27 | 2014-09-10 | 厦门瑞为信息技术有限公司 | Human face gender recognition method based on multi-parameter index weighting |
CN105488478A (en) * | 2015-12-02 | 2016-04-13 | 深圳市商汤科技有限公司 | Face recognition system and method |
CN109543560A (en) * | 2018-10-31 | 2019-03-29 | 百度在线网络技术(北京)有限公司 | Dividing method, device, equipment and the computer storage medium of personage in a kind of video |
CN109977781A (en) * | 2019-02-26 | 2019-07-05 | 上海上湖信息技术有限公司 | Method for detecting human face and device, readable storage medium storing program for executing |
CN110717414A (en) * | 2019-09-24 | 2020-01-21 | 青岛海信网络科技股份有限公司 | Target detection tracking method, device and equipment |
CN111401315A (en) * | 2020-04-10 | 2020-07-10 | 浙江大华技术股份有限公司 | Face recognition method, recognition device and storage device based on video |
CN111652175A (en) * | 2020-06-11 | 2020-09-11 | 山东大学 | Real-time surgical tool detection method applied to robot-assisted surgical video analysis |
US20200311962A1 (en) * | 2019-03-26 | 2020-10-01 | Nec Laboratories America, Inc. | Deep learning based tattoo detection system with optimized data labeling for offline and real-time processing |
CN111797733A (en) * | 2020-06-22 | 2020-10-20 | 浙江大华技术股份有限公司 | Behavior recognition method, behavior recognition device, behavior recognition equipment and storage medium based on image |
WO2020244032A1 (en) * | 2019-06-03 | 2020-12-10 | 罗普特科技集团股份有限公司 | Face image detection method and apparatus |
-
2021
- 2021-04-09 CN CN202110384949.6A patent/CN112926542B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070104362A1 (en) * | 2005-11-08 | 2007-05-10 | Samsung Electronics Co., Ltd. | Face recognition method, and system using gender information |
CN104036236A (en) * | 2014-05-27 | 2014-09-10 | 厦门瑞为信息技术有限公司 | Human face gender recognition method based on multi-parameter index weighting |
CN105488478A (en) * | 2015-12-02 | 2016-04-13 | 深圳市商汤科技有限公司 | Face recognition system and method |
CN109543560A (en) * | 2018-10-31 | 2019-03-29 | 百度在线网络技术(北京)有限公司 | Dividing method, device, equipment and the computer storage medium of personage in a kind of video |
CN109977781A (en) * | 2019-02-26 | 2019-07-05 | 上海上湖信息技术有限公司 | Method for detecting human face and device, readable storage medium storing program for executing |
US20200311962A1 (en) * | 2019-03-26 | 2020-10-01 | Nec Laboratories America, Inc. | Deep learning based tattoo detection system with optimized data labeling for offline and real-time processing |
WO2020244032A1 (en) * | 2019-06-03 | 2020-12-10 | 罗普特科技集团股份有限公司 | Face image detection method and apparatus |
CN110717414A (en) * | 2019-09-24 | 2020-01-21 | 青岛海信网络科技股份有限公司 | Target detection tracking method, device and equipment |
CN111401315A (en) * | 2020-04-10 | 2020-07-10 | 浙江大华技术股份有限公司 | Face recognition method, recognition device and storage device based on video |
CN111652175A (en) * | 2020-06-11 | 2020-09-11 | 山东大学 | Real-time surgical tool detection method applied to robot-assisted surgical video analysis |
CN111797733A (en) * | 2020-06-22 | 2020-10-20 | 浙江大华技术股份有限公司 | Behavior recognition method, behavior recognition device, behavior recognition equipment and storage medium based on image |
Non-Patent Citations (1)
Title |
---|
张童;谭南林;包辰铭;: "应用于嵌入式平台的实时红外行人检测方法", 激光与红外, no. 02, 20 February 2020 (2020-02-20) * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115082836A (en) * | 2022-07-23 | 2022-09-20 | 深圳神目信息技术有限公司 | Behavior recognition-assisted target object detection method and device |
Also Published As
Publication number | Publication date |
---|---|
CN112926542B (en) | 2024-04-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021217934A1 (en) | Method and apparatus for monitoring number of livestock, and computer device and storage medium | |
CN109784177A (en) | Missing crew's method for rapidly positioning, device and medium based on images match | |
TW201730836A (en) | Systems and methods for bulk redaction of recorded data | |
JP7047970B2 (en) | Methods, devices and programs for determining periods of interest and at least one area of interest for managing events. | |
US11113838B2 (en) | Deep learning based tattoo detection system with optimized data labeling for offline and real-time processing | |
JPWO2014175356A1 (en) | Information processing system, information processing method, and program | |
CN111241883A (en) | Method and device for preventing remote detected personnel from cheating | |
WO2020052062A1 (en) | Detection method and device | |
CN113379999A (en) | Fire detection method and device, electronic equipment and storage medium | |
CN112926542B (en) | Sex detection method and device, electronic equipment and storage medium | |
CN110246292B (en) | Household video monitoring method, device and storage medium | |
CN104050785A (en) | Safety alert method based on virtualized boundary and face recognition technology | |
US9805272B1 (en) | Storage system of original frame of monitor data and storage method thereof | |
CN113869115A (en) | Method and system for processing face image | |
KR20170098113A (en) | Method for creating image group of electronic device and electronic device thereof | |
CN112686744A (en) | Method and device for monitoring external access service, electronic equipment and storage medium | |
US12094250B2 (en) | Image processing apparatus, control method, and non-transitory storage medium | |
CN114245032B (en) | Automatic switching method and system for video framing, video player and storage medium | |
WO2019187107A1 (en) | Information processing device, control method, and program | |
US8682834B2 (en) | Information processing apparatus and information processing method | |
US20200349359A1 (en) | Dynamic workstation assignment | |
CN112989083B (en) | Personnel identity analysis method, device, equipment and storage medium | |
JP2020136855A (en) | Monitoring system, monitor support device, monitoring method, monitor support method, and program | |
CN117354469B (en) | District monitoring video target tracking method and system based on security precaution | |
KR102560607B1 (en) | Augmented reality-based memo processing device, system and method |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |