Object detection method and device, electronic device and computer-readable storage medium
By detecting the matching relationship between faces and human objects in dense scenes, adjusting the detection frame, and combining the object detection network and the matching detection network, the problem of inaccurate target detection in dense scenes is solved and the detection accuracy is improved.
Patent Information
- Application Number
- CN202180001428.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-12-29
- Filing Date
- 2021-04-27
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-04-27
AI Technical Summary
In dense scenes, object detectors may lead to false detection problems because occlusions between different objects lead to inaccurate human detection.
By detecting face objects and human objects in the image to be processed, determining the matching relationship between the face object and the human body object based on the matching relationship, and adjusting the detection frame to improve detection accuracy. Use a combination of object detection network and matching detection network to optimize detection results by training network parameters.
It reduces false detections and false detections, improves the accuracy of human object detection, and ensures the accuracy of target detection in dense scenes.
Smart Images

Figure CN113196292B_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This disclosure is the Chinese national phase of the PCT application filed on April 27, 2021, with international application number PCT / IB2021 / 053446, and claims priority to the Singapore patent application filed on December 29, 2020, with application number 10202013165P and invention name “Object detection method and device and electronic device”. The entire contents of the Singapore patent application disclosure are incorporated herein by reference. Technical Field
[0003] The present disclosure relates to the technical field of machine learning, and in particular to an object detection method and device, an electronic device, and a computer-readable storage medium. Background Art
[0004] Object detection is an important part of intelligent video analysis. For example, human bodies, animals, etc. in video frames or scene images can be used as detection targets. In related technologies, object detectors such as Faster RCNN (Region Convolutional Neural Network) can be used to obtain object detection frames in video frames or scene images.
[0005] However, in dense scenes, different targets may block each other. For example, in a scene with relatively dense personnel, different personnel may block each other with arms, hands, legs and other human body parts. In this case, the use of conventional detectors may cause false detection of human bodies. For example, there are only two people in the scene image, but three human frames are detected. This situation is usually called false detection. Inaccurate target detection may lead to errors in subsequent processing based on the detected target. Summary of the invention
[0006] In view of this, the present disclosure at least provides an object detection method and device and an electronic device to improve the accuracy of target detection in dense scenes.
[0007] In a first aspect, an object detection method is provided, the method comprising: detecting a face object and a body object in an image to be processed; determining a matching relationship between the detected face object and the body object; and in response to determining that the body object matches the face object based on the matching relationship, determining that the body object is a detected target object.
[0008] In some embodiments, detecting facial objects and human objects in the image to be processed includes: performing object detection on the image to be processed to obtain a detection frame of the facial object and a detection frame of the human object in the image to be processed.
[0009] In some embodiments, the method further includes: in response to determining that there is no facial object matching the human object in the image to be processed based on the matching relationship, removing the detection frame of the human object.
[0010] In some embodiments, the method further includes: in response to determining based on the matching relationship that there is no facial object matching the human object in the image to be processed, and the human object is located in a preset edge area of the image to be processed, determining the human object as a detected target object.
[0011] In some embodiments, determining the matching relationship between the detected facial object and the human object includes: determining position information and / or visual information of the facial object and the human object based on the detection results of the facial object and the human object; and determining the matching relationship between the facial object and the human object based on the position information and / or the visual information.
[0012] In some embodiments, the position information includes position information of a detection frame; determining the matching relationship between the facial object and the human body object based on the position information and / or the visual information includes: for each of the facial objects, based on the position information of the detection frame, determining a detection frame of the human body object that satisfies a preset position overlap relationship with the detection frame of the facial object as a target detection frame; and determining the human body object in the target detection frame as a human body object that matches the facial object.
[0013] In some embodiments, determining the matching relationship between the detected facial object and the human body object includes: in response to the detected facial object being not obscured by the detected human body object and other facial objects, determining the matching relationship between the detected facial object and the human body object.
[0014] In some embodiments, the detected facial objects include at least one facial object, and the detected human body objects include at least one human body object; determining the matching relationship between the detected facial objects and the human body objects includes: combining each detected facial object with each detected human body object to obtain at least one facial-human body combination, and determining the matching relationship for each combination.
[0015] In some embodiments, the detecting of facial objects and human objects in the image to be processed includes: performing object detection on the image to be processed using an object detection network to obtain a detection frame of the facial object and a detection frame of the human object in the image to be processed; the determining of the matching relationship between the detected facial objects and the human objects includes: determining the matching relationship between the detected facial objects and the human objects using a matching detection network; wherein the object detection network and the matching detection network are trained in the following manner: detecting at least one facial frame and at least one human frame in a sample image through the object detection network to be trained; obtaining a predicted value of the matching relationship between the detected facial frames and human frames through the matching detection network to be trained; and adjusting the network parameters of at least one of the object detection network and the matching detection network based on the difference between the predicted value and the label value of the matching relationship.
[0016] In a second aspect, an object detection device is provided, which includes: a detection processing module, used to detect facial objects and human objects in an image to be processed; a matching processing module, used to determine a matching relationship between the detected facial objects and human objects; and a target object determination module, used to determine that the human object is a detected target object in response to determining that the human object matches the facial object based on the matching relationship.
[0017] In some embodiments, the detection processing module is further used to: perform object detection on the image to be processed to obtain a detection frame of a face object and a detection frame of a body object in the image to be processed.
[0018] In some embodiments, the target object determination module is further used to remove the detection frame of the human object in response to determining based on the matching relationship that there is no facial object matching the human object in the image to be processed.
[0019] In some embodiments, the target object determination module is further used to determine the human object as the detected target object in response to determining based on the matching relationship that there is no facial object matching the human object in the image to be processed, and the human object is located in a preset edge area of the image to be processed.
[0020] In some embodiments, the matching processing module is further used to: determine the position information and / or visual information of the facial object and the human object based on the detection results of the facial object and the human object; determine the matching relationship between the facial object and the human object based on the position information and / or the visual information.
[0021] In some embodiments, the position information includes position information of the detection frame; the matching processing module is further used to: for each of the facial objects, determine, based on the position information of the detection frame, a detection frame of a human object that satisfies a preset position overlap relationship with the detection frame of the facial object as a target detection frame; and determine the human object in the target detection frame as a human object that matches the facial object.
[0022] In some embodiments, the matching processing module is further used to: in response to the detected face object not being blocked by the detected human body object and other face objects, determine the matching relationship between the detected face object and the human body object.
[0023] In some embodiments, the detected facial objects include at least one facial object, and the detected human body objects include at least one human body object; the matching processing module is further used to: combine each detected facial object with each detected human body object to obtain at least one facial and human body combination, and determine the matching relationship for each combination.
[0024] In some embodiments, the detection processing module is further used to: use an object detection network to perform object detection on the image to be processed, and obtain a detection frame of a face object and a detection frame of a human body object in the image to be processed; the matching processing module is further used to: use a matching detection network to determine the matching relationship between the detected face object and the detected human body object; the device also includes: a network training module, used to: detect at least one face frame and at least one human body frame in a sample image through the object detection network to be trained; obtain a predicted value of the matching relationship between the detected face frame and the human body frame through the matching detection network to be trained; and adjust the network parameters of at least one of the object detection network and the matching detection network based on the difference between the predicted value and the label value of the matching relationship.
[0025] According to a third aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store computer instructions executable on the processor, and the processor is used to implement a method of any embodiment of the present disclosure when executing the computer instructions.
[0026] According to a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor implements the method of any embodiment of the present disclosure.
[0027] According to a fifth aspect, a computer program is provided, comprising a computer-readable code, wherein when the computer-readable code is executed in an electronic device, a processor in the electronic device is enabled to implement a method of any embodiment of the present disclosure.
[0028] The object detection method, device, and electronic device provided by the embodiments of the present disclosure assist in the detection of human objects by detecting the matching relationship between human objects and facial objects, and use human objects with matching facial objects as the target objects to be detected. On the one hand, since the detection accuracy of facial objects is relatively high, the detection accuracy of human objects can be improved by assisting the detection of human objects with the facial objects; on the other hand, the facial objects belong to human objects, so the detection of facial objects can assist in the positioning of human objects. This solution can reduce the occurrence of false detections or misdetections, and improve the detection accuracy of human objects. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in one or more embodiments of the present disclosure, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in one or more embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0030] Figure 1 A flow chart of an object detection method provided by at least one embodiment of the present disclosure is shown;
[0031] Figure 2 A schematic diagram of a detection frame of a human body object and a human face object provided by at least one embodiment of the present disclosure is shown;
[0032] Figure 3 A schematic diagram showing a network architecture used in an object detection method provided by at least one embodiment of the present disclosure;
[0033] Figure 4 A schematic diagram of the structure of an object detection device provided by at least one embodiment of the present disclosure is shown;
[0034] Figure 5 A schematic structural diagram of an object detection device provided by at least one embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0035] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of the present disclosure, the technical solutions in one or more embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in one or more embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on one or more embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present disclosure.
[0036] When detecting targets in dense scenes, false detections may sometimes occur. For example, in a relatively densely populated gaming venue, many people gather in the venue to play games, and in the images captured of the gaming venue, there may be occlusions between people, such as leg occlusions, arm occlusions, etc. The existence of such occlusions between human bodies may lead to false detections. In order to improve the accuracy of target detection in dense scenes, an embodiment of the present disclosure provides an object detection method, which can be applied to detect individual human bodies in densely populated scenes as target objects for detection.
[0037] Figure 1 FIG. 1 is a flow chart of an object detection method provided by at least one embodiment of the present disclosure. Figure 1 As shown, the method may include the following processing:
[0038] In step 100, face objects and human body objects are detected in the image to be processed.
[0039] The image to be processed may be a dense scene image, and it is expected that a predetermined target object is detected from the image. Exemplarily, the image to be processed may be an image of a multiplayer game scene, and the purpose of detection is to detect the number of people in the image to be processed, so each person in the image can be called a target object to be detected.
[0040] In this step, each face object and human body object included in the image to be processed may be detected. In one example, when detecting the face object and human body object in the image to be processed, object detection may be performed on the image to be processed to obtain a detection frame of the face object and a detection frame of the human body object in the image. For example, feature extraction may be performed on the image to be processed to obtain image features, and then object detection may be performed based on the image features to obtain the detection frame of the face object and the detection frame of the human body object.
[0041] Figure 2 FIG. 2 schematically shows a plurality of detection frames that have been detected. Figure 2As shown, detection frame 21 includes a human object, detection frame 22 includes another human object, detection frame 23 includes a face object, and detection frame 24 includes another face object.
[0042] In step 102, a matching relationship between the detected face object and the human body object is determined.
[0043] In this step, the detected face objects may include at least one face object, and the detected human body objects may include at least one human body object. Based on the detection frames detected in step 100, each detected face object may be combined with each detected human body object to obtain at least one face-body combination, and the matching relationship may be determined for each combination. Figure 2 In the example, the matching relationship between detection frame 21 and detection frame 23 can be detected, the matching relationship between the above-mentioned detection frame 22 and detection frame 24 can be detected, and the matching relationship between detection frame 21 and detection frame 24 and the matching relationship between detection frame 22 and detection frame 23 can also be detected.
[0044] The matching relationship indicates whether the face object and the human body object match. For example, the face object and the human body object belonging to the same person can be determined to be matched. Exemplarily, the human body object included in the detection frame 21 and the face object included in the detection frame 23 belong to the same person in the image, and the two are matched; conversely, the human body object included in the detection frame 21 and the face object included in the detection frame 24 do not belong to the same person, and the two are not matched.
[0045] In actual implementation, the above-mentioned matching relationship can be detected in a variety of ways. In an exemplary embodiment, the position information and / or visual information of the facial object and the human object can be determined based on the detection results of the facial object and the human object; and the matching relationship between the facial object and the human object can be determined based on the position information and / or visual information.
[0046] The position information may represent the spatial position of the face object and the human body object in the image, or the spatial distribution relationship between the face object and the human body object. Visual information represents the visual feature information of each object in the image, which is generally an image feature, such as the image features of the face object and the human body object in the image obtained by extracting the visual features of the image.
[0047] In one example, for each of the facial objects, according to the position information of the detected human body objects and the detection frames of the facial objects, the detection frame of the human body object that satisfies the preset position overlap relationship with the detection frame of the facial object can be determined as the target detection frame, and the human body object in the target detection frame can be determined as the human body object that matches the facial object. Exemplarily, the preset position overlap relationship can be as follows: there is an overlap between the detection frame of the facial object and the detection frame of the human body object, and the overlap area accounts for more than 90% of the area of the detection frame of the facial object. In step 100, the detection frames of the facial objects detected are respectively combined with the detection frames of the human body objects, and it is detected whether the two paired detection frames satisfy the above-mentioned preset overlap relationship. If the two detection frames satisfy the above-mentioned preset overlap relationship, it is determined that the facial objects and human body objects included in the two detection frames are matched.
[0048] In another example, the matching relationship between the face object and the human body object can also be determined based on the visual information of the face object and the human body object. For example, the image features of the detected face object and human body object, i.e., visual information, can be obtained, and the visual information of the two objects can be combined to determine whether the face object and the human body object are matched. Exemplarily, a neural network can be trained to detect the matching relationship based on the visual information, and the trained neural network can be used to obtain a conclusion on whether the face object and the human body object are matched based on the input visual information of the two objects.
[0049] In another example, the matching relationship between the face object and the human body object can also be detected by combining the position information and visual information of the face object and the human body object. Exemplarily, whether the face object and the human body object match can be determined based on both the visual information of the face object and the human body object and the position information of the two. For example, the spatial distribution relationship between the face object and the human body object can be combined with the visual information of the two, or the position overlap relationship between the face object and the human body object detection frame can be combined with the visual information of the two, and a trained neural network can be used to comprehensively determine whether the face object and the human body object match. The trained neural network can include a visual information matching branch and a position information matching branch, and the visual information of the face object and the human body object is matched through the visual information matching branch, and the position information of the face object and the human body object is matched through the position information matching branch, and the matching results of the two branches are combined to obtain a conclusion on whether the face object and the human body object match; or, the trained neural network can adopt an "end-to-end" mode to process the visual information and position information of the face object, and the visual information and position information of the human body object to obtain the matching relationship between the face object and the human body object.
[0050] In step 104, in response to determining that the human object matches the human face object based on the matching relationship, the human object is determined to be a detected target object.
[0051] In this step, based on the matching relationship detected in step 102, if there is a matching face object in the image for a human object, the human object can be determined as the detected target object. Otherwise, if there is no matching face object in the image for a human object, it can be determined that the human object is not the target object finally detected.
[0052] In addition, based on the detection of the matching relationship between the face object and the human body object, if it is determined based on the detected matching relationship that a certain human body object does not have a matching face object, the detection frame of the human body object can be removed. For example, assuming that a detection frame of a human body object is detected in the image, the detection frame is located in a preset edge area of the image, and the preset edge area can be a predefined area within a certain range from the edge of the image, and there is no face object matching the human body object in the detection frame in the image, then the human body object in the detection frame is not detected as a target object. Optionally, the detection frame located in the preset edge area of the image can be removed.
[0053] In other examples, if the human object has no matching facial object because the detection frame of the human object is at the edge of the image, the human object in the detection frame can also be determined as the target object. For example, when it is determined based on the detection of the matching relationship that there is no matching facial object for the human object in the detection frame, it can also be determined whether the detection frame is in the preset edge area of the image. When it is determined that the detection frame is still in the preset edge area, even though there is no facial object matching the human object in the image, the human object can be determined as the detected target object. In actual implementation, whether to use the human object in this case as the final detected target object can be flexibly determined according to actual business needs. For example, in the scenario of counting the number of people, the human object in this case can be retained as the final detected target object.
[0054] In addition, before detecting the above-mentioned matching relationship, it is also possible to detect whether the face object is blocked by other face objects or any human body object. In the case where the face object is not blocked by other face objects and any human body object, an operation of determining the matching relationship between the face object and the detected human body object is performed. Otherwise, if a detected face object is blocked by other face objects, or the detected face object is blocked by any human body object in the image, the face object can be deleted from the detection result. For example, in the scene of a multiplayer tabletop game, since there are usually a large number of people participating in the game, there may be a situation where different people block each other, including limbs or even partial occlusion of the face. In this case, if the face is blocked by other people's limbs or faces, it may cause the detection accuracy of the face object to decrease, and then the detection accuracy of the human body object when the face object is used to assist the detection of the human body object will also be affected; and as mentioned above, in the case of determining that the face object is not blocked by other human bodies or faces, the detection of the face object itself has a higher accuracy, and then using the face object to assist the detection of the human body object can also help improve the detection accuracy of the human body object.
[0055] Furthermore, if the detection frame of a certain face object and the detection frame of a human body object meet a preset position overlap relationship, and the face object is not blocked by other face objects and human body objects, it can be determined that the face object and the human body object match. For example, see Figure 2 As shown in the figure, the human body object in the detection frame 21 and the face object in the detection frame 23 satisfy the preset position overlapping relationship, and the face object in the detection frame 23 is not blocked by other face objects and human body objects, then it is determined that the human body object and the face object in the above two detection frames are matched, and the human body object in the detection frame 21 is the detected target object.
[0056] The object detection method of the disclosed embodiment assists in the detection of human objects by detecting the matching relationship between human objects and facial objects, and uses human objects with matching facial objects as the detected target objects. On the one hand, since the detection accuracy of facial objects is relatively high, the detection accuracy of human objects can be improved by assisting the detection of human objects with the facial objects; on the other hand, since the facial objects belong to human objects, the detection of facial objects can assist in the positioning of human objects. This solution can reduce the occurrence of false detection or misdetection, and improve the detection accuracy of target objects.
[0057] In addition, in crowded scenes, there are intersections or occlusions between multiple human bodies. Traditional human body detection methods may detect the intersecting limbs of different people as human objects. The object detection method of this embodiment can effectively filter out such misdetected human objects by performing face object matching on the detected human objects, thereby providing more accurate human object detection results.
[0058] Figure 3 FIG. 1 is a schematic diagram showing a network architecture used in an object detection method provided by at least one embodiment of the present disclosure. Figure 3 As shown, the network for target detection may include a feature extraction network 31, an object detection network 32 and a matching detection network 33.
[0059] The feature extraction network 31 is used to process the image ( Figure 3 The input image in the image is subjected to feature extraction to obtain an image feature map. In one example, the feature extraction network 31 may include a backbone network and FPN (Feature Pyramid Networks). After the image to be processed is processed by the backbone network and FPN in turn, a feature map can be extracted.
[0060] For example, the backbone network can use VGGNet, ResNet, etc., and FPN can convert the feature map obtained by the backbone network into a multi-layer pyramid structure feature map. The backbone network mentioned above is the image feature extraction part of the target detection network, and FPN is equivalent to the neck part of the target detection network. By performing feature enhancement processing, the shallow features extracted by the backbone can be enhanced.
[0061] The object detection network 32 is used to perform object detection according to the image feature map, and detect and obtain at least one face frame and at least one human body frame in the image to be processed, wherein the face frame is a detection frame containing a face object, and the human body frame is a detection frame containing a human body object.
[0062] like Figure 3 As shown, the object detection network 32 may include RPN (Region Proposal Network) and RCNN (Regional Convolutional Neural Network), wherein RPN may predict anchor boxes of various objects based on the image feature map output by FPN, and RCNN may predict multiple bounding boxes (bbox) based on the anchor box and the image feature map output by FPN, and the bounding boxes may include human objects or face objects. As described above, the bbox including human objects is the human box, and the bbox including face objects is the face box.
[0063] The matching detection network 33 is used to detect the matching relationship between the face object and the body object based on the body object, face object and image feature map in the bounding box output by the RCNN.
[0064] The object detection network 32 and matching detection network 33 are equivalent to the detectors in the object detection task, and are used to output the detection results. The detection results in the embodiment of the present disclosure include human objects, face objects, and matching pairs. The matching pair is a pair of matching human objects and face objects.
[0065] It should be noted that the network structures of the above-mentioned feature extraction network 31, object detection network 32 and matching detection network 33 are not limited in the embodiment of the present disclosure. Figure 3 The structure shown is only an example. Figure 3 Instead of using FPN in the image processing, the feature map extracted by backbone is directly used to predict the object position through RPN / RCNN, etc. For another example, Figure 3 The example is a network framework for object detection using two stages, which performs object detection by using a feature extraction network and an object detection network. In actual implementation, a one-stage object detection network can also be used, that is, there is no need to set up an independent feature extraction network, and a one-stage object detection network can be used as the object detection network in this embodiment to achieve feature extraction and object detection. When a one-stage object detection network is used, after predicting a human object and a face object, a matching pair can be predicted based on the human object and the face object.
[0066] for Figure 3 The network structure shown can be trained first, and then the trained network can be used to detect the target object in the image to be processed. The training and application process of the network will be described as follows.
[0067] Sample images can be used for network training. For example, a sample image set can be obtained, and each sample image in the sample image set can be input into Figure 3The feature extraction network 31 shown in the figure obtains the extracted image feature map. Then, the object detection network 32 is used to detect and obtain at least one face frame and at least one body frame in the sample image according to the image feature map. Then, the matching detection network 33 is used to obtain the pairwise matching relationship between the detected face frames and body frames. For example, any face frame is combined with any body frame to form a face-body combination, and whether the face object and the body object in the combination are matched is detected. The detection result of the matching relationship can be called the predicted value of the matching relationship, and the true value of the matching relationship can be called the label value of the matching relationship. Finally, according to the difference between the label value of the matching relationship and the predicted value, the network parameters of at least one of the feature extraction network, the object detection network and the matching detection network are adjusted. When the predetermined network training end condition is reached, the network training is terminated to obtain the trained network. Figure 3 The network structure for target detection is shown.
[0068] After the network training is completed, for example, to detect several human bodies in a certain image to be processed, where there are occlusions between different people in the image to be processed, the image to be processed can be processed according to Figure 3 The network architecture shown is used for processing. First, the image feature map is extracted by the trained feature extraction network 31, and then the face frame and the human body frame in the image are obtained by the trained object detection network 32, and the matching face objects and human body objects are detected by the trained matching detection network 33, that is, the matching pair is obtained. Then, the human body object that has not successfully matched the face object can be removed, and the human body object is not used as the detected target object. If the human body object has no matching face object, it can be considered that the human body object belongs to the human body false detection. In this way, by filtering the detection results of human body objects with higher precision face object detection results, the detection accuracy of human body objects can be improved, especially when applied in multi-person scenes where human body objects are occluded, false detection can be reduced.
[0069] The object detection method of the disclosed embodiment assists in the detection of human objects by utilizing higher-precision detection of facial objects and the association between facial objects and human objects, thereby improving the detection accuracy of human objects and solving the problem of false detection caused by occlusion between objects.
[0070] In some embodiments, the detection result of the target object in the image to be processed may be saved. For example, in a multiplayer game, the detection result is saved in the cache of the multiplayer game, so as to analyze the game status, personnel changes, etc. according to the cached information. Alternatively, the detection result of the target object in the image to be processed may be visualized, for example, a detection frame of the detected target object is drawn and displayed in the image to be processed.
[0071] In order to implement the object detection method of any embodiment of the present disclosure, Figure 4 FIG. 2 shows a schematic diagram of the structure of an object detection device provided by at least one embodiment of the present disclosure. Figure 4 As shown, the device may include: a detection processing module 41, a matching processing module 42 and a target object determination module 43.
[0072] The detection processing module 41 is used to detect face objects and human body objects in the image to be processed.
[0073] The matching processing module 42 is used to determine the matching relationship between the detected face object and the human body object.
[0074] The target object determination module 43 is configured to determine that the human object is a detected target object in response to determining that the human object matches the face object based on the matching relationship.
[0075] In one example, the detection processing module 41 is further used to: perform object detection on the image to be processed to obtain a detection frame of a face object and a detection frame of a body object in the image to be processed.
[0076] In one example, the target object determination module 43 is further configured to remove the detection frame of the human object in response to determining based on the matching relationship that there is no facial object matching the human object in the image to be processed.
[0077] In one example, the target object determination module 43 is also used to determine the human object as the detected target object in response to determining based on the matching relationship that there is no facial object matching the human object in the image to be processed, and the human object is located in a preset edge area of the image to be processed.
[0078] In one example, the matching processing module 42 is further used to: determine the position information and / or visual information of the facial object and the human object based on the detection results of the facial object and the human object; determine the matching relationship between the facial object and the human object based on the position information and / or visual information.
[0079] In one example, the position information includes position information of the detection frame, and the matching processing module 42 is further used to: for each of the facial objects, determine, based on the position information of the detection frame, a detection frame of a human object that satisfies a preset position overlap relationship with the detection frame of the facial object as a target detection frame, and determine the human object in the target detection frame as a human object that matches the facial object.
[0080] In one example, the matching processing module 42 is further used to: in response to the detected face object not being blocked by the detected human body object and other face objects, determine a matching relationship between the detected face object and the human body object.
[0081] In an example, the detected facial objects may include at least one facial object, and the detected human body objects may include at least one human body object; the matching processing module 42 is further used to: combine each detected facial object with each detected human body object to obtain at least one facial and human body combination, and determine the matching relationship for each combination.
[0082] In an example, Figure 5 As shown, the apparatus may further include a network training module 44 .
[0083] The detection processing module 41 is further used to: use an object detection network to perform object detection on the image to be processed, and obtain a detection frame of a face object and a detection frame of a human body object in the image to be processed.
[0084] The matching processing module 42 is further used to: use a matching detection network to determine the matching relationship between the detected face object and the human body object.
[0085] The network training module 44 is used to: detect at least one face frame and at least one body frame in the sample image through the object detection network to be trained; obtain the predicted value of the matching relationship between the detected face frames and the body frames through the matching detection network to be trained; and adjust the network parameters of at least one of the object detection network and the matching detection network based on the difference between the predicted value and the label value of the matching relationship.
[0086] The object detection device of the disclosed embodiment assists in the detection of human objects by utilizing the detection of the matching relationship between human objects and facial objects, and uses human objects with matching facial objects as detected target objects, thereby achieving high detection accuracy of human objects.
[0087] The present disclosure also provides an electronic device, which includes a memory and a processor, wherein the memory is used to store computer instructions that can be executed on the processor, and the processor is used to implement the method of any embodiment of the present disclosure when executing the computer instructions.
[0088] The present disclosure further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the processor is enabled to implement the method described in any embodiment of the present disclosure.
[0089] The present disclosure also provides a computer program, including a computer-readable code, wherein when the computer-readable code is executed in an electronic device, a processor in the electronic device is enabled to implement the method described in any embodiment of the present disclosure.
[0090] It should be understood by those skilled in the art that one or more embodiments of the present disclosure may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0091] The term “and / or” used herein means at least one of the two. For example, “A and / or B” includes three options: A, B, and “A and B”.
[0092] Each embodiment in the present disclosure is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the data processing device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0093] The above describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0094] Embodiments of the subject matter and functional operations described in the present disclosure may be implemented in the following: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in the present disclosure and their structural equivalents, or a combination of one or more of them. Embodiments of the subject matter described in the present disclosure may be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible non-transitory program carrier to be executed by a data processing device or to control the operation of the data processing device. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagation signal, such as a machine-generated electrical, optical or electromagnetic signal, which is generated to encode information and transmit it to a suitable receiver device for execution by a data processing device. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.
[0095] The processes and logic flows described in the present disclosure may be performed by one or more programmable computers executing one or more computer programs to perform the corresponding functions by operating on input data and generating output. The processes and logic flows may also be performed by, and the apparatus may be implemented as, special purpose logic circuitry, such as an FPGA (field programmable gate array) or an ASIC (application specific integrated circuit).
[0096] Computers suitable for executing computer programs include, for example, general and / or special microprocessors, or any other type of central processing unit. Typically, the central processing unit will receive instructions and data from a read-only memory and / or a random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, the computer will also include one or more large-capacity storage devices for storing data, such as magnetic disks, magneto-optical disks, or optical disks, or the computer will be operably coupled to this large-capacity storage device to receive data from it or transmit data to it, or both. However, the computer does not necessarily have such a device. In addition, the computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB), a flash drive, to name a few.
[0097] Computer readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including, for example, semiconductor memory devices (e.g., EPROM, EEPROM and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD ROM and DVD-ROM disks. The processor and memory may be supplemented by, or incorporated in, special purpose logic circuitry.
[0098] Although the present disclosure includes many specific implementation details, these should not be interpreted as limiting the scope of any disclosure or the scope of protection claimed, but are mainly used to describe the features of the specific disclosed embodiments. Certain features described in multiple embodiments in the present disclosure may also be implemented in combination in a single embodiment. On the other hand, the various features described in a single embodiment may also be implemented separately in multiple embodiments or implemented in any suitable sub-combination. In addition, although features may work in certain combinations as described above and even initially claim protection, one or more features from the claimed combination may be removed from the combination in some cases, and the claimed combination may point to a sub-combination or a variation of a sub-combination.
[0099] Similarly, although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order shown or performed sequentially, or requiring that all illustrated operations be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.
[0100] The above descriptions are only some embodiments of one or more embodiments of the present disclosure and are not intended to limit one or more embodiments of the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present disclosure shall be included in the scope of protection of one or more embodiments of the present disclosure.
Claims
1. An object detection method, comprising: Detecting face objects and human body objects in the image to be processed; In response to the detected human face object not being blocked by the detected human body object and other human face objects, determining a matching relationship between the detected human face object and the human body object; In response to determining that the human object matches the face object based on the matching relationship, determining that the human object is a detected target object, The step of detecting the face object and the body object in the image to be processed includes: Performing object detection on the image to be processed to obtain a detection frame of a face object and a detection frame of a human body object in the image to be processed, The method further includes: in response to determining based on the matching relationship that there is no face object matching the human object in the image to be processed, removing the detection frame of the human object and not treating the human object as a detected target object.
2. The method according to claim 1, wherein: The determining a matching relationship between the detected face object and the human body object comprises: Determine the position information and / or visual information of the face object and the body object according to the detection results of the face object and the body object; A matching relationship between the face object and the body object is determined according to the position information and / or the visual information.
3. The method according to claim 2, wherein: The position information includes position information of the detection frame; The determining the matching relationship between the face object and the human body object according to the position information and / or the visual information includes: For each of the face objects, According to the position information of the detection frame, determining a detection frame of a human body object that satisfies a preset position overlap relationship with the detection frame of the face object as a target detection frame; The human object in the target detection frame is determined as a human object that matches the human face object.
4. The method according to claim 1, wherein: The detected face objects include at least one face object, and the detected human body objects include at least one human body object; The determining a matching relationship between the detected face object and the human body object comprises: Each detected face object is combined with each detected human body object to obtain at least one face-body combination, and the matching relationship is determined for each combination.
5. The method according to any one of claims 1 to 4, wherein: The detecting of face objects and human body objects in the image to be processed comprises: Using an object detection network to perform object detection on the image to be processed, and obtaining a detection frame of a face object and a detection frame of a human body object in the image to be processed; The determining a matching relationship between the detected face object and the human body object comprises: Using a matching detection network to determine a matching relationship between the detected face object and the human body object; The object detection network and the matching detection network are trained as follows: Detecting at least one face frame and at least one human body frame in a sample image by means of the object detection network to be trained; Obtaining predicted values of matching relationships between detected face frames and human body frames through the matching detection network to be trained; Based on the difference between the predicted value and the label value of the matching relationship, a network parameter of at least one of the object detection network and the matching detection network is adjusted.
6. An object detection device, the device comprising: A detection processing module, used for detecting face objects and human body objects in the image to be processed; a matching processing module, configured to determine a matching relationship between the detected human face object and the human body object in response to the detected human face object not being blocked by the detected human body object and other human face objects; a target object determination module, configured to determine that the human object is a detected target object in response to determining that the human object matches the human face object based on the matching relationship, The detection processing module is further used to perform object detection on the image to be processed to obtain a detection frame of a face object and a detection frame of a human body object in the image to be processed. Among them, the target object determination module is also used to remove the detection frame of the human object and not use the human object as the detected target object in response to determining based on the matching relationship that there is no facial object matching the human object in the image to be processed.
7. The device according to claim 6, wherein: The matching processing module is further used to: determine the position information and / or visual information of the facial object and the human object based on the detection results of the facial object and the human object; and determine the matching relationship between the facial object and the human object based on the position information and / or the visual information.
8. The device according to claim 7, wherein: The position information includes position information of the detection frame; The matching processing module is further used for: For each of the face objects, According to the position information of the detection frame, determining a detection frame of the human body object that satisfies a preset position overlap relationship with the detection frame of the face object as the target detection frame; The human object in the target detection frame is determined as a human object that matches the human face object.
9. The device according to claim 6, wherein: When the detected facial objects include at least one facial object and the detected human body objects include at least one human body object, the matching processing module is further used to: combine each detected facial object with each detected human body object to obtain at least one face-human body combination, and determine the matching relationship for each combination.
10. The device according to any one of claims 6 to 9, wherein: The detection processing module is further used to: use an object detection network to perform object detection on the image to be processed, and obtain a detection frame of a face object and a detection frame of a human body object in the image to be processed; The matching processing module is further used to: determine the matching relationship between the detected face object and the human body object using a matching detection network; The device also includes: a network training module, which is used to: detect at least one face frame and at least one body frame in a sample image through the object detection network to be trained; obtain the predicted value of the matching relationship between the detected face frames and the body frames through the matching detection network to be trained; and adjust the network parameters of at least one of the object detection network and the matching detection network based on the difference between the predicted value and the label value of the matching relationship.
11. An electronic device, comprising a memory and a processor, wherein the memory is used to store computer instructions executable on the processor, and the processor is used to implement any one of the methods described in claims 1 to 5 when executing the computer instructions.
12. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the processor implements the method according to any one of claims 1 to 5.
