Target object detection method and device
By obtaining the foreground pixel position information of the target object through the anchor-free positioning method and combining it with the anchor regression subtask, the problem of foreground and background imbalance in the one-stage target object detection method is solved, and the detection accuracy is improved.
Patent Information
- Application Number
- CN202010203469.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-20
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2040-03-20
AI Technical Summary
Existing one-stage object detection methods cannot strike a balance between foreground and background in the image to be detected, and the detection accuracy is insufficient.
An anchor-free positioning method is used to obtain the foreground pixel position information of the target object from the image to be detected, and the position information of the target object is obtained by presetting the anchor point. Combining multi-scale feature information and anchor point regression subtask, the imbalance problem between foreground and background is reduced and the detection accuracy is improved.
The anchor-free positioning method alleviates the imbalance problem between foreground and background and improves the accuracy of detection results.
Smart Images

Figure CN113496513B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more particularly to a method, apparatus, electronic device, and storage device for detecting a target object. The present application also relates to a method, apparatus, electronic device, and storage device for obtaining a target object detection model. Background Art
[0002] With the continuous development of computer technology, target object detection methods based on deep learning have been widely used in various fields. For example, in the field of navigation, target object detection methods are used to identify vehicle objects photographed by image sensors so as to follow the vehicle objects. For example, in commodity trading platforms, target object detection methods are used to identify commodity objects included in images or video resources uploaded by users, thereby providing users with matching commodity objects corresponding to the commodity objects.
[0003] Target object detection methods are generally divided into: one-stage (OneStage) target object detection method and two-stage (TwoStages) target object detection method. Among them, since the one-stage target object detection method does not need to select candidate areas in the detection object when detecting the image to be detected, but directly outputs the detection result based on the image to be detected, it has the advantage of relatively fast detection speed. Based on this advantage, the one-stage target object detection method is widely used in fields that require timely response to detection results. For example, in a commodity trading platform, the one-stage target object detection method is used to quickly provide users with matching commodity objects corresponding to the commodity objects contained in the image objects they uploaded.
[0004] Current one-stage target object detection methods are either anchor-based detection methods, such as YoloV2, SSD, RetinaNet, etc., or anchor-free detection methods, such as FSAF, FCOS, CornerNet, CenterNet, etc. However, anchor-based detection methods use anchors in both their classification branch (ClassSubnets) subtask and detection branch (DetectionSubnets) subtask, which exacerbates the imbalance problem between foreground and background; while anchor-free detection methods, although they do not require anchors in the classification branch and regression branch (RegressionSubnets), will increase the difficulty of the regression branch and affect the detection accuracy. Therefore, the existing one-stage target object detection methods have the problem of not being able to balance the foreground and background in the image to be detected and increase the detection accuracy. Summary of the Invention
[0005] The embodiment of the present application provides a target object detection method to solve the problem of the existing one-stage target object detection method that cannot balance the foreground and background in the image to be detected and to increase the detection accuracy.
[0006] The present invention provides a method for detecting a target object, including:
[0007] Obtain an image to be detected containing a target object;
[0008] Inputting the image to be detected into a target object detection model to obtain position information of the target object in the image to be detected;
[0009] Among them, the target object detection model is used to obtain the position information of the foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the target object in the image to be detected based on the target anchor points.
[0010] Optionally, inputting the image to be detected into a target object detection model to obtain position information of the target object in the image to be detected includes:
[0011] Acquiring multi-scale feature information of the image to be detected;
[0012] Obtaining position information of foreground pixels corresponding to the target object according to the anchor-free positioning method and multi-scale feature information of the image to be detected;
[0013] Acquire at least one target anchor point corresponding to the position information of the foreground pixel according to preset anchor point information;
[0014] According to the at least one target anchor point, position information of the target object in the image to be detected is obtained.
[0015] Optionally, obtaining multi-scale feature information of the image to be detected includes:
[0016] The image to be detected is input into the feature pyramid network subtask in the target object detection model to obtain multi-scale feature information of the image to be detected.
[0017] Optionally, obtaining position information of foreground pixels corresponding to the target object according to the anchor-free positioning method and multi-scale feature information of the image to be detected includes:
[0018] According to the multi-scale feature information, position information of foreground pixels corresponding to the target object is obtained by performing pixel-by-pixel analysis on the image to be detected.
[0019] Optionally, acquiring at least one target anchor point corresponding to the position information of the foreground pixel according to preset anchor point size information includes:
[0020] According to the preset anchor point information, with the position information of the foreground pixel as the center point, at least one target anchor point corresponding to the position information of the foreground pixel is acquired.
[0021] Optionally, the
[0022] The acquiring, based on the preset anchor point information and taking the position information of the foreground pixel as the center point, at least one target anchor point corresponding to the position information of the foreground pixel includes:
[0023] According to the preset anchor point information, taking the position information of the foreground pixel as the center point, obtaining at least one original to-be-determined anchor point corresponding to the position information of the foreground pixel, and obtaining at least one predicted position information corresponding to the at least one original to-be-determined anchor point;
[0024] The at least one target anchor point is acquired according to the at least one original anchor point to be determined and the at least one predicted position information.
[0025] The step of determining the at least one original anchor point to be determined and the at least one predicted position information includes:
[0026] performing an intersection-over-union (IoU) calculation on the at least one original anchor point to be determined and the at least one predicted position information to obtain at least one IoU overlap degree corresponding to the at least one original anchor point to be determined and the at least one predicted position information;
[0027] Determining, from the at least one original anchor point to be determined, at least one target anchor point to be determined corresponding to the position information of the foreground pixel according to the at least one intersection-over-union (IoU) overlap;
[0028] At least one target anchor point corresponding to the position information of the foreground pixel is acquired according to the at least one target anchor point to be determined.
[0029] Optionally, acquiring at least one target anchor point corresponding to the position information of the foreground pixel according to the at least one target anchor point to be determined includes:
[0030] Obtaining at least one category prediction score corresponding to the at least one target anchor point to be determined;
[0031] At least one target anchor point corresponding to the position information of the foreground pixel is obtained according to the at least one target anchor point to be determined and the at least one category prediction score.
[0032] Optionally, acquiring at least one target anchor point corresponding to the position information of the foreground pixel according to the at least one target anchor point to be determined and the at least one category prediction score includes:
[0033] The at least one target anchor point to be determined and the at least one category prediction score are processed by a non-maximum suppression method to obtain at least one target anchor point corresponding to the position information of the foreground pixel.
[0034] Optionally, determining, based on the at least one intersection-over-union (IoU) overlap, at least one target anchor point to be determined corresponding to the position information of the foreground pixel from the at least one original anchor point to be determined includes:
[0035] Obtaining the maximum value of the intersection-over-union (IOU) coincidence corresponding to the position information of each foreground pixel from the at least one IOU coincidence;
[0036] The target anchor point to be determined is determined according to the original anchor point to be determined corresponding to the maximum value of the intersection-over-union ratio coincidence corresponding to the position information of each foreground pixel.
[0037] Optionally, obtaining position information of the target object in the image to be detected according to the at least one target anchor point includes:
[0038] The anchor point regression subtask in the target object detection model is used to perform regression analysis on the at least one target anchor point to obtain position information of the target object in the image to be detected.
[0039] Optionally, the method for obtaining the target object detection model includes:
[0040] Get the training sample object containing the original object;
[0041] The target object detection model is trained using the training sample objects, and in the process of training the target object detection model, the parameters of the target object detection model are adjusted using the loss function corresponding to the target object detection model so that the prediction error of the target object detection model reaches a preset convergence condition.
[0042] Optionally, the target object is a commodity object.
[0043] Optionally, the method is applied to a server, and further includes:
[0044] Acquiring feature information of the commodity object according to position information of the commodity object in the image to be detected;
[0045] According to the feature information of the commodity object, information of a matching commodity object corresponding to the commodity object is obtained.
[0046] The information of the matching product object is provided to the client.
[0047] Optionally, the method is applied to a client, and the method further includes:
[0048] Obtaining location information of the target object in the image to be detected provided by the server;
[0049] Identifying the target object in the image to be detected according to the position information;
[0050] The image to be detected in which the target object is identified is displayed.
[0051] Optionally, also include:
[0052] Obtain the target anchor point provided by the server;
[0053] The target anchor is displayed.
[0054] Optionally, displaying the target anchor point includes:
[0055] The target anchor point is displayed in a flashing manner.
[0056] Optionally, the method further includes: obtaining category information to which the target object belongs based on the target object detection model.
[0057] The present invention also provides a method for obtaining a target object detection model, including:
[0058] Get the training sample object containing the original object;
[0059] The target object detection model is trained using the training sample objects, and in the process of training the target object detection model, the parameters of the target object detection model are adjusted using the loss function corresponding to the target object detection model so that the prediction error of the target object detection model reaches a preset convergence condition; wherein, the target object detection model is used to obtain the position information of the foreground pixels corresponding to the original object from the training sample objects using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the original object in the image to be detected based on the target anchor points.
[0060] The present invention further provides a target object detection device, comprising:
[0061] An acquisition unit, configured to acquire an image to be detected containing a target object;
[0062] An information obtaining unit, configured to input the image to be detected into a target object detection model to obtain position information of the target object in the image to be detected;
[0063] Among them, the target object detection model is used to obtain the position information of the foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the target object in the image to be detected based on the target anchor points.
[0064] An embodiment of the present application further provides an electronic device, including:
[0065] processor;
[0066] The memory is used to store a program of the target object detection method. After the device is powered on and the program of the target object detection method is run by the processor, the following steps are performed:
[0067] Obtain an image to be detected containing a target object;
[0068] Inputting the image to be detected into a target object detection model to obtain position information of the target object in the image to be detected;
[0069] Among them, the target object detection model is used to obtain the position information of the foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the target object in the image to be detected based on the target anchor points.
[0070] The present application also provides a storage device storing a program of a target object detection method. The program is executed by a processor to perform the following steps:
[0071] Obtain an image to be detected containing a target object;
[0072] Inputting the image to be detected into a target object detection model to obtain position information of the target object in the image to be detected;
[0073] Among them, the target object detection model is used to obtain the position information of the foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the target object in the image to be detected based on the target anchor points.
[0074] The present application also provides a device for obtaining a target object detection model, including:
[0075] A training sample object acquisition unit, configured to acquire a training sample object containing an original object;
[0076] a training unit, configured to train the target object detection model using the training sample objects, and, during the training of the target object detection model, adjust parameters of the target object detection model using a loss function corresponding to the target object detection model so that a prediction error of the target object detection model reaches a preset convergence condition;
[0077] In which, the target object detection model is used to obtain the position information of the foreground pixels corresponding to the original object from the training sample object using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the original object in the image to be detected based on the target anchor points.
[0078] The present application also provides another electronic device, including:
[0079] processor;
[0080] The memory is used to store a program for obtaining a target object detection model. After the device is powered on and the program for obtaining a target object detection model is run by the processor, the following steps are performed:
[0081] Get the training sample object containing the original object;
[0082] Using the training sample objects to train the target object detection model, and in the process of training the target object detection model, using a loss function corresponding to the target object detection model to adjust the parameters of the target object detection model so that the prediction error of the target object detection model reaches a preset convergence condition;
[0083] In which, the target object detection model is used to obtain the position information of the foreground pixels corresponding to the original object from the training sample object using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the original object in the image to be detected based on the target anchor points.
[0084] The present application also provides another storage device storing a program for a method for obtaining a target object detection model. The program is executed by a processor to perform the following steps:
[0085] Get the training sample object containing the original object;
[0086] Using the training sample objects to train the target object detection model, and in the process of training the target object detection model, using a loss function corresponding to the target object detection model to adjust the parameters of the target object detection model so that the prediction error of the target object detection model reaches a preset convergence condition;
[0087] In which, the target object detection model is used to obtain the position information of the foreground pixels corresponding to the original object from the training sample object using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the original object in the image to be detected based on the target anchor points.
[0088] This application also provides another target object detection method, including:
[0089] Obtain an image to be detected containing a target object;
[0090] Obtaining position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method;
[0091] Obtaining a target anchor point corresponding to the position information of the foreground pixel;
[0092] According to the target anchor point, the position information of the target object in the image to be detected is obtained.
[0093] Optionally, the method is applied to a server, and further includes:
[0094] The target anchor point is provided to the client.
[0095] Optionally, the method is applied to a client, and the method further includes:
[0096] Obtain the target anchor point provided by the server;
[0097] The target anchor is displayed.
[0098] Optionally, displaying the target anchor point includes:
[0099] The target anchor point is displayed in a flashing manner.
[0100] The present application also provides another target object detection device, comprising:
[0101] An image acquisition unit, configured to acquire an image to be detected containing a target object;
[0102] a foreground pixel position information obtaining unit, configured to obtain position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method;
[0103] a target anchor point acquisition unit, configured to acquire a target anchor point corresponding to the position information of the foreground pixel;
[0104] The target object position information obtaining unit is used to obtain the position information of the target object in the image to be detected according to the target anchor point.
[0105] The present application also provides an electronic device, comprising:
[0106] processor;
[0107] The memory is used to store a program of the target object detection method. After the device is powered on and the program of the target object detection method is run by the processor, the following steps are performed:
[0108] Obtain an image to be detected containing a target object;
[0109] Obtaining position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method;
[0110] Obtaining a target anchor point corresponding to the position information of the foreground pixel;
[0111] According to the target anchor point, the position information of the target object in the image to be detected is obtained.
[0112] The present application also provides a storage device storing a program of a target object detection method, wherein the program is executed by a processor to perform the following steps:
[0113] Obtain an image to be detected containing a target object;
[0114] Obtaining position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method;
[0115] Obtaining a target anchor point corresponding to the position information of the foreground pixel;
[0116] According to the target anchor point, the position information of the target object in the image to be detected is obtained.
[0117] Compared with the prior art, this application has the following advantages:
[0118] An embodiment of the present application provides a method for detecting a target object, comprising: obtaining an image to be detected containing a target object; inputting the image to be detected into a target object detection model to obtain position information of the target object in the image to be detected; wherein the target object detection model is configured to obtain position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the target object in the image to be detected based on the target anchor points. After inputting the image to be detected into the target object detection model, the method obtains position information of foreground pixels corresponding to the target object from the image to be detected using the anchor-free positioning method, thereby alleviating the imbalance problem between foreground and background in the image to be detected; at the same time, by obtaining target anchor points corresponding to the position information of the foreground pixels, the position information of the target object in the image to be detected is obtained, thereby increasing the accuracy of the detection results. It can be seen that the method can both alleviate the imbalance problem between foreground and background in the image to be detected and increase the accuracy of the detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0119] Figure 1 This is a schematic diagram of an application scenario of a target object detection method provided in the first embodiment of the present application.
[0120] Figure 2 This is a flowchart of a target object detection method provided in the first embodiment of the present application.
[0121] Figure 3 It is a structural diagram of a target object detection model provided in the first embodiment of the present application.
[0122] Figure 4 This is a flowchart of a method for obtaining a target object detection model provided in the second embodiment of the present application.
[0123] Figure 5 3 is a schematic diagram of a target object detection device provided in the third embodiment of the present application.
[0124] Figure 6 This is a schematic diagram of an electronic device provided in the fourth embodiment of the present application.
[0125] Figure 7 This is a schematic diagram of a device for obtaining a target object detection model provided in the sixth embodiment of the present application.
[0126] Figure 8 This is a flowchart of another target object detection method provided in the ninth embodiment of the present application.
[0127] Figure 9It is a schematic diagram of another target object detection device provided in the tenth embodiment of the present application. DETAILED DESCRIPTION
[0128] The following description sets forth many specific details to facilitate a thorough understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of the present application. Therefore, the present application is not limited to the specific implementations disclosed below.
[0129] In order to make those skilled in the art better understand the present application scheme, the following describes in detail the specific application scenarios of the target object detection method provided by the present application. The target object detection method provided in the first embodiment of the present application can be applied to the scenario of interaction between the client and the server, such as Figure 1 As shown, it is a schematic diagram of an application scenario of a target object detection method provided in the first embodiment of the present application.
[0130] In a specific implementation, based on the need to provide the user with the position information of the target object in the image to be detected, the client establishes a connection with the server after obtaining the image to be detected that contains the target object, and then sends the image to be detected to the server; the server inputs the obtained image to be detected into the target object detection model to obtain the position information of the target object in the image to be detected, wherein the target object detection model is used to obtain the position information of the foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the target object in the image to be detected based on the target anchor points; after the server obtains the position information of the target object in the image to be detected, the position information is provided to the client; thereafter, the client identifies the target object in the image to be detected based on the obtained position information, and displays it to the user for viewing.
[0131] It should be noted that the client can be a mobile terminal device, such as a mobile phone, tablet computer, etc., or a common computer device. The server generally refers to a server, which can be a physical server or a cloud server, and is not specifically limited here.
[0132] In addition, during specific implementation, the target object detection method can also be applied separately to the client or server. For example, after obtaining the image to be detected containing the target object, the client directly inputs the image to be detected into the target object detection model to obtain the position information of the target object in the image to be detected. Afterwards, based on the obtained position information, the target object in the image to be detected is identified and displayed to the user for viewing without the need to interact with the server.
[0133] It should be noted that the above application scenarios are merely specific embodiments of the target object detection method provided in the first embodiment of the present application. The purpose of providing the above application scenarios is to facilitate understanding of the method, and is not to limit the method.
[0134] The first embodiment of the present application provides a target object detection method, such as Figure 2 As shown, it is a flow chart of a target object detection method provided by the first embodiment of this application. Figure 2 The target object detection method provided in the first embodiment of the present application is introduced.
[0135] Step S201: Acquire an image to be detected containing a target object.
[0136] The image to be detected refers to an image containing a target object, and the image may be an image object directly, or may be a video frame in a video resource.
[0137] The target object generally refers to an object with contour features, and the target object can be a vehicle object, a commodity object, etc.
[0138] The obtaining of the image to be detected containing the target object can specifically be that the client obtains the image containing the target object uploaded by the user, or the client obtains the image containing the target object through an image sensor connected to it, such as a camera, and then the client sends the obtained image to be detected to the server.
[0139] It should be noted that, in the first embodiment of the present application, unless otherwise specified, the method is introduced in the context of an interaction scenario between a client and a server.
[0140] Step S202: input the image to be detected into a target object detection model to obtain the position information of the target object in the image to be detected; wherein the target object detection model is used to obtain the position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain a target anchor point corresponding to the position information of the foreground pixel, and obtain the position information of the target object in the image to be detected based on the target anchor point.
[0141] After obtaining the image to be detected, the position information of the target object in the image to be detected can be obtained by inputting the image to be detected into a pre-trained target object detection model, wherein the target object detection model is used to obtain the position information of the foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the target object in the image to be detected according to the target anchor points, such as Figure 3 As shown, it is a schematic diagram of the structure of a target object detection model provided by the first embodiment of the present application. Figure 3 The target object detection model described in this application is introduced.
[0142] The target object detection model is a one-stage target object detection model based on convolutional neural networks (CNN). The model is a multi-branch task model, specifically including: a classification branch subtask 301, an anchor point acquisition subtask 302, and an anchor point regression subtask 303.
[0143] The classification branch subtask 301 is used to obtain the position information of the foreground pixels corresponding to the target object from the image to be detected including the target object using the anchor-free positioning method, such as Figure 3 As shown, the classification branch subtask can be a convolutional layer for pixel classification. The convolutional layer is used to classify each pixel of the image to be detected according to the multi-scale feature information corresponding to the pixel, and determine whether the pixel is a foreground pixel or a background pixel; the anchor point acquisition subtask 302 is used to obtain the target anchor point corresponding to the position information of the foreground pixel, such as Figure 3 As shown, the anchor point acquisition subtask can be a convolution layer for acquiring a target anchor point, which is used to analyze the preset anchor point corresponding to each foreground pixel to acquire the target anchor point; the anchor point regression subtask 303 is used to obtain the position information of the target object in the image to be detected based on the target anchor point, such as Figure 3 The anchor point regression subtask may be a convolutional layer for performing regression prediction (bounding box regression) based on the obtained target anchor point to obtain the position information of the target object in the image to be detected. The specific implementation method thereof is described in detail in the prior art and will not be described here.
[0144] It should be noted that in the field of computer vision, an anchor refers to a pre-set fixed rectangular box corresponding to the target object. The size and position of these rectangular boxes in the image to be detected can be different, and they are used to quickly locate the target object in the image to be detected.
[0145] The foreground pixels corresponding to the target object refer to pixels in the area where the target object is located in the image to be detected; the foreground pixels corresponding to the target object correspond to background pixels outside the area where the target object is located.
[0146] like Figure 3 As shown, in the first embodiment of the present application, the target object detection model also includes a feature pyramid network (FPN) subtask 304, which is specifically used to extract multi-scale feature information of the image to be detected, wherein FPN is a feature extractor designed based on the concept of feature pyramid, the purpose of which is to improve the accuracy and speed of feature extraction. It replaces the feature extractor such as that in FasterR-CNN and can generate a higher quality feature map pyramid.
[0147] The target object detection model can be obtained specifically by the following method: obtaining a training sample object containing the original object; using the training sample object to train the target object detection model, and in the process of training the target object detection model, using the loss function corresponding to the target object detection model to adjust the parameters of the target object detection model so that the prediction error of the target object detection model reaches a preset convergence condition.
[0148] That is, after obtaining a training object containing the original object, the area where the original object is located in the training object is marked by manual or other means to obtain supervision information corresponding to the training object. Afterwards, the labeled training object is used as a training sample object to train a target object detection model. During the training process, the parameters of the target object detection model are adjusted through the loss function corresponding to the target object detection model so that its prediction error reaches the preset convergence condition.
[0149] The target object detection model in the first embodiment of the present application is introduced above. The following describes how to use the model to obtain the position information of the target object in the image to be detected.
[0150] Inputting the image to be detected into the target object detection model to obtain the position information of the target object in the image to be detected includes: obtaining multi-scale feature information of the image to be detected; obtaining position information of foreground pixels corresponding to the target object based on the anchor-free positioning method and the multi-scale feature information of the image to be detected; obtaining at least one target anchor point corresponding to the position information of the foreground pixels based on preset anchor point information; and obtaining the position information of the target object in the image to be detected based on the at least one target anchor point.
[0151] The method of obtaining multi-scale feature information of the image to be detected includes: inputting the image to be detected into a feature pyramid network subtask in the target object detection model to obtain multi-scale feature information of the image to be detected. Because the anchor-based one-stage target object detection method in the prior art exacerbates the imbalance problem between the foreground and background when classifying foreground pixels and background pixels in the image to be detected, the classification branch subtask of the target object detection method provided in the first embodiment of the present application adopts an anchor-free positioning method to obtain foreground pixels corresponding to the target object from the image to be detected, thereby avoiding the imbalance problem between the foreground and background.
[0152] Specifically, in the classification branch subtask of the target object detection model provided in the first embodiment of the present application, the position information of the foreground pixel corresponding to the target object is obtained by an anchor-free positioning method. Specifically, after obtaining the multi-scale feature information of the image to be detected, the multi-scale feature information is input into the convolution layer for pixel classification in the classification branch subtask. The convolution layer analyzes the multi-scale feature information adjacent to each pixel of the image to be detected, determines the distance between each pixel and the feature information of its neighboring pixels, and distinguishes the pixel as a foreground pixel or a background pixel based on the distance. That is, obtaining the position information of the foreground pixel corresponding to the target object according to the anchor-free positioning method and the multi-scale feature information of the image to be detected includes: obtaining the position information of the foreground pixel corresponding to the target object by performing pixel-by-pixel analysis and processing on the image to be detected according to the multi-scale feature information.
[0153] The obtaining, based on the preset anchor point size information, at least one target anchor point corresponding to the position information of the foreground pixel includes: obtaining, based on the preset anchor point information, at least one target anchor point corresponding to the position information of the foreground pixel with the position information of the foreground pixel as the center point.
[0154] Among them, the method of obtaining at least one target anchor point corresponding to the position information of the foreground pixel based on the preset anchor point information and taking the position information of the foreground pixel as the center point includes: obtaining at least one original anchor point to be determined corresponding to the position information of the foreground pixel based on the preset anchor point information and taking the position information of the foreground pixel as the center point, and obtaining at least one predicted position information corresponding to the at least one original anchor point to be determined; obtaining the at least one target anchor point based on the at least one original anchor point to be determined and the at least one predicted position information.
[0155] That is, after obtaining the position information of the foreground pixels corresponding to the target object through the classification branch subtask, the position information of the foreground pixels and the multi-scale feature information corresponding to the foreground pixels are input into the convolution layer for obtaining the target anchor points in the anchor point acquisition subtask. The convolution layer obtains at least one target anchor point corresponding to the position information of each foreground pixel based on the preset anchor point information, such as the number and size information of the preset anchor points corresponding to each foreground pixel, with the position of each foreground pixel in the image to be detected as the center point. For example, if the position information of 4 foreground pixels is obtained, and the preset anchor point information is 9 anchor points of different sizes, then 4*9 target anchor points can be obtained. Of course, in the specific implementation, the preset anchor point information can be set as needed and is not specifically limited here.
[0156] In order to reduce the amount of calculation, when obtaining the target anchor point, you can first obtain at least one original anchor point to be determined according to the preset anchor point information and the position information of the foreground pixel, and obtain at least one predicted position information corresponding to the at least one original anchor point to be determined. Then, according to the at least one original anchor point to be determined and the at least one predicted position information, obtain the at least one target anchor point, that is, according to the preset anchor point information, with the position information of the foreground pixel as the center point, obtain at least one target anchor point corresponding to the position information of the foreground pixel, including: according to the preset anchor point information, with the position information of the foreground pixel as the center point, obtain at least one original anchor point corresponding to the position information of the foreground pixel, and obtain at least one predicted position information corresponding to the at least one original anchor point to be determined; according to the at least one original anchor point to be determined and the at least one predicted position information, obtain the at least one target anchor point.
[0157] Among them, according to the at least one original anchor point to be determined and the at least one predicted position information, it includes: performing intersection-over-union calculation on the at least one original anchor point to be determined and the at least one predicted position information to obtain at least one intersection-over-union overlap corresponding to the at least one original anchor point to be determined and the at least one predicted position information; according to the at least one intersection-over-union overlap, determining at least one target anchor point to be determined corresponding to the position information of the foreground pixel from the at least one original anchor point to be determined; according to the at least one target anchor point to be determined, obtaining at least one target anchor point corresponding to the position information of the foreground pixel.
[0158] In addition, obtaining at least one target anchor point corresponding to the position information of the foreground pixel based on the at least one target anchor point to be determined includes: obtaining at least one category prediction score corresponding to the at least one target anchor point to be determined; obtaining at least one target anchor point corresponding to the position information of the foreground pixel based on the at least one target anchor point to be determined and the at least one category prediction score.
[0159] Among them, the category prediction score is the category of the target object in the original anchor point to be determined obtained when the target object detection model predicts the position information of the target object based on each original anchor point to be determined, and the score obtained to characterize the correctness of the category; therefore, each target anchor point to be determined obtained from the original anchor point to be determined also corresponds to a category prediction score.
[0160] The method of obtaining at least one target anchor point corresponding to the position information of the foreground pixel based on the at least one target anchor point to be determined and the at least one category prediction score includes: processing the at least one target anchor point to be determined and the at least one category prediction score by a non-maximum suppression method to obtain at least one target anchor point corresponding to the position information of the foreground pixel.
[0161] It should be noted that, the method of determining at least one target anchor point to be determined corresponding to the position information of the foreground pixel from the at least one original anchor point to be determined based on the at least one intersection-and-union (IoU) coincidence comprises: obtaining the maximum value of the IoU coincidence corresponding to the position information of each foreground pixel from the at least one IoU coincidence; and determining the target anchor point to be determined based on the original anchor point to be determined corresponding to the maximum value of the IoU coincidence corresponding to the position information of each foreground pixel.
[0162] For example, if the position information of 4 foreground pixels is obtained, and the preset anchor point information is 9 anchor points of different sizes, then 4*9 original anchor points to be determined can be obtained first. At the same time, the predicted position information and category prediction score of the target object corresponding to the 4*9 original anchor points to be determined can also be obtained; then, the intersection over union (IOU) of the 4*9 original anchor points to be determined and the 4*9 predicted position information is obtained respectively, and the position information corresponding to each foreground pixel is obtained from the obtained 4*9 intersection over union. The intersection-and-union (IoU) ratio of the maximum value is obtained, that is, the four maximum IoU ratio coincidences corresponding to the position information of the four foreground pixels can be obtained; then, the four original anchor points to be determined corresponding to the IoU ratio coincidences of the four maximum values are used as the target anchor points to be determined, that is, four target anchor points to be determined can be determined from the 4*9 original anchor points to be determined; then, the four target anchor points to be determined and the corresponding category prediction scores are processed by using the non-maximum suppression (NMS) method to obtain the final target anchor point. Among them, how to calculate the IoU ratio to obtain the IoU ratio coincidence and how to use the NMS method to obtain the final target anchor point are described in detail in the existing technology center and will not be repeated here.
[0163] It should also be noted that the preset anchor point information described in the first embodiment of the present application includes anchor point information of different sizes.
[0164] Obtaining the position information of the target object in the image to be detected based on the at least one target anchor point includes: performing regression analysis on the at least one target anchor point using the anchor point regression subtask in the target object detection model to obtain the position information of the target object in the image to be detected.
[0165] Specifically, after obtaining at least one target anchor point corresponding to the position information of the foreground pixel, the target anchor point is input into the anchor point regression subtask, which is used to perform regression prediction (bounding box regression) based on the obtained target anchor point to obtain the convolutional layer of the target object's position information in the image to be detected. The convolutional layer can obtain a bounding box representing the position information of the target object in the image to be detected based on the target anchor point. The method of using a regressor to regress the anchor point to obtain a bounding box representing the position information of the target object in the image to be detected is described in detail in the prior art and will not be repeated here.
[0166] It should be noted that in the first embodiment of the present application, the position information is identified in the form of (x, y, w, h), where (x, y) is the upper left coordinate point of the bounding box corresponding to the target object, w is the width of the bounding box, and h is the height of the bounding box. Of course, in specific implementation, other forms of description can also be used, which will not be repeated here.
[0167] When the method is applied to a client, the method further includes: obtaining position information of the target object in the image to be detected provided by a server; identifying the target object in the image to be detected based on the position information; and displaying the image to be detected with the target object identified.
[0168] In addition, to enhance the visual effect of the method, the server may provide the target anchor point to the client after obtaining the target anchor point; and the client may display the target anchor point after obtaining the target anchor point provided by the server. Of course, in order not to affect the display of the identified target object in the image to be detected, the target anchor point may be displayed in a flashing manner.
[0169] For example, after the server inputs the image to be detected into the target object detection model, the target object detection model can output the target anchor point while outputting the position information of the target object in the image to be detected; then, the server provides the position information and the target anchor point to the client; after obtaining the position information and the target anchor point, the client can first display the target anchor point in the image to be detected by flashing, and then display the image to be detected with the target object identified.
[0170] Of course, in specific implementation, the target anchor point can also be displayed by other methods. For example, the target anchor point and target object can be identified with identification boxes of different colors in the image to be detected, and the target anchor point and target object can be displayed at the same time. I will not go into details here.
[0171] In addition, when the target object is a commodity object, the target object detection method described in the first embodiment of the present application can be used in the server corresponding to the commodity trading platform to obtain the position information of the commodity object in the image to be detected, and obtain the feature information of the commodity object based on the position information. After that, based on the obtained feature information, the information of the matching commodity object corresponding to the commodity object is obtained, and the information of the matching commodity object is provided to the client, and the client displays the matching commodity object based on the information of the matching commodity object, thereby reducing search delay and improving user experience. That is to say, when the target object detection method described in the first embodiment of the present application is applied to the server, and the target object is a commodity object, the method further includes: obtaining the feature information of the commodity object based on the position information of the commodity object in the image to be detected; and obtaining the information of the matching commodity object corresponding to the commodity object based on the feature information of the commodity object.
[0172] For example, a user uploads an image img001 containing a shoe object "xx" in the search box of a commodity trading platform through a client; thereafter, the client sends the image img001 to the server, and the server inputs img001 into the target object detection model to obtain the position information of the shoe object in the image img001. For example, taking the lower left corner of the image img001 as the initial origin, the obtained position information of the shoe object in the image img001 is (2, 4, 10, 100), which are respectively the coordinates of the upper left point of the bounding box corresponding to the shoe object and the width and height of the bounding box; thereafter, the server extracts the feature information of the shoe object in the said position area, and obtains the information of the matching shoe object corresponding to the shoe object based on the feature information, such as the matching shoe objects are "yy" and "zz" respectively; thereafter, the information of the matching commodity object is provided to the client, and the client displays the matching shoe object based on the information of the matching shoe object, such as displaying the names of the matching shoe objects "yy" and "zz" and their corresponding commodity images.
[0173] It should be noted that the target object detection model can obtain the target object's category information in addition to its location information in the image to be detected. That is, the method further includes obtaining the target object's category information based on the target object detection model. For example, for an image to be detected containing a shoe, the method can obtain not only the shoe's location information in the image to be detected, but also the shoe's category information, which is "shoe."
[0174] According to the above description, when the method obtains the position information of the target object in the image to be detected, the classification branch subtask, anchor point acquisition subtask and anchor point regression subtask in the target object detection model used can be executed in parallel, thereby realizing efficient cascade detection through full convolution, which can increase the detection speed and detection accuracy.
[0175] In addition, in the above introduction, the target object detection model is used to obtain the position information of the foreground pixels corresponding to the target object from the image to be detected, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the target object in the image to be detected. However, in specific implementation, other methods can also be used to obtain the above information. For example, independent models can be used to obtain the above information respectively, that is, a foreground pixel position information acquisition model can be used to obtain the position information of the foreground pixels corresponding to the target object from the image to be detected, a target anchor point acquisition model can be used to obtain the target anchor points corresponding to the position information of the foreground pixels, and finally, a target position information acquisition model can be used to obtain the position information of the target object in the image to be detected. Of course, with the continuous advancement of technology, other methods can also be used to obtain the above information, which will not be repeated here.
[0176] In summary, the target object detection method provided in the first embodiment of the present application includes: obtaining an image to be detected containing a target object; inputting the image to be detected into a target object detection model to obtain position information of the target object in the image to be detected; wherein the target object detection model is used to obtain position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the target object in the image to be detected based on the target anchor points. After inputting the image to be detected into the target object detection model, the method obtains position information of foreground pixels corresponding to the target object from the image to be detected using the anchor-free positioning method, thereby alleviating the imbalance problem between the foreground and background in the image to be detected; at the same time, by obtaining target anchor points corresponding to the position information of the foreground pixels, the position information of the target object in the image to be detected is obtained, thereby increasing the accuracy of the detection results. Therefore, it can be seen that the method can both alleviate the imbalance problem between the foreground and background in the image to be detected and increase the accuracy of the detection results.
[0177] Corresponding to the target object detection method provided in the first embodiment of the present application, the second embodiment of the present application also provides a method for obtaining a target object detection model, see Figure 4As shown, it is a flowchart of a method for obtaining a model provided in the second embodiment of the present application, wherein some steps have been described in detail in the first embodiment of the present application, so the description here is relatively simple. For relevant matters, please refer to some descriptions in a target object detection method provided in the first embodiment of the present application. The processing process described below is only illustrative.
[0178] Step S401, obtaining a training sample object including an original object;
[0179] Step S402: Use the training sample object to train the target object detection model, and in the process of training the target object detection model, use the loss function corresponding to the target object detection model to adjust the parameters of the target object detection model so that the prediction error of the target object detection model reaches a preset convergence condition; wherein, the target object detection model is used to obtain the position information of the foreground pixel corresponding to the original object from the training sample object using an anchor-free positioning method, obtain the target anchor point corresponding to the position information of the foreground pixel, and obtain the position information of the original object in the image to be detected based on the target anchor point.
[0180] Corresponding to the target object detection method provided in the first embodiment of the present application, the fourth embodiment of the present application also provides a target object detection device, see Figure 5 , which is a schematic diagram of a target object detection device provided in the third embodiment of the present application. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment. The device embodiment described below is only illustrative. The target object detection device provided in the third embodiment of the present application includes the following parts:
[0181] The acquisition unit 501 is configured to acquire an image to be detected containing a target object.
[0182] An information obtaining unit 502 is configured to input the image to be detected into a target object detection model to obtain position information of the target object in the image to be detected;
[0183] Among them, the target object detection model is used to obtain the position information of the foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the target object in the image to be detected based on the target anchor points.
[0184] Optionally, the information acquisition unit is specifically used to: obtain multi-scale feature information of the image to be detected; obtain position information of foreground pixels corresponding to the target object based on the anchor-free positioning method and the multi-scale feature information of the image to be detected; obtain at least one target anchor point corresponding to the position information of the foreground pixels based on preset anchor point information; and obtain position information of the target object in the image to be detected based on the at least one target anchor point.
[0185] Optionally, obtaining multi-scale feature information of the image to be detected includes: inputting the image to be detected into a feature pyramid network subtask in the target object detection model to obtain multi-scale feature information of the image to be detected.
[0186] Optionally, obtaining the position information of foreground pixels corresponding to the target object based on the anchor-free positioning method and the multi-scale feature information of the image to be detected includes: obtaining the position information of foreground pixels corresponding to the target object by performing pixel-by-pixel analysis and processing on the image to be detected based on the multi-scale feature information.
[0187] Optionally, obtaining at least one target anchor point corresponding to the position information of the foreground pixel based on preset anchor point size information includes: obtaining at least one target anchor point corresponding to the position information of the foreground pixel based on the preset anchor point information and taking the position information of the foreground pixel as the center point.
[0188] Optionally, the method of obtaining at least one target anchor point corresponding to the position information of the foreground pixel based on the preset anchor point information and taking the position information of the foreground pixel as the center point includes: obtaining at least one original anchor point to be determined corresponding to the position information of the foreground pixel based on the preset anchor point information and taking the position information of the foreground pixel as the center point, and obtaining at least one predicted position information corresponding to the at least one original anchor point to be determined; obtaining the at least one target anchor point based on the original anchor point to be determined and the at least one predicted position information.
[0189] Optionally, based on the at least one original anchor point to be determined and the at least one predicted position information, the method includes: performing intersection-over-union calculation on the at least one original anchor point to be determined and the at least one predicted position information to obtain at least one intersection-over-union overlap corresponding to the at least one original anchor point to be determined and the at least one predicted position information; determining at least one target anchor point to be determined corresponding to the position information of the foreground pixel from the at least one original anchor point to be determined based on the at least one intersection-over-union overlap; and obtaining at least one target anchor point corresponding to the position information of the foreground pixel based on the at least one target anchor point to be determined.
[0190] Optionally, obtaining at least one target anchor point corresponding to the position information of the foreground pixel based on the at least one target anchor point to be determined includes: obtaining at least one category prediction score corresponding to the at least one target anchor point to be determined; obtaining at least one target anchor point corresponding to the position information of the foreground pixel based on the at least one target anchor point to be determined and the at least one category prediction score.
[0191] Optionally, obtaining at least one target anchor point corresponding to the position information of the foreground pixel based on the at least one target anchor point to be determined and the at least one category prediction score includes: processing the at least one target anchor point to be determined and the at least one category prediction score by a non-maximum suppression method to obtain at least one target anchor point corresponding to the position information of the foreground pixel.
[0192] Optionally, the method of determining at least one target anchor point to be determined corresponding to the position information of the foreground pixel from the at least one original anchor point to be determined based on the at least one intersection-and-union coincidence, includes: obtaining the maximum intersection-and-union coincidence corresponding to the position information of each foreground pixel from the at least one intersection-and-union coincidence; and determining the target anchor point to be determined based on the original anchor point to be determined corresponding to the maximum intersection-and-union coincidence corresponding to the position information of each foreground pixel.
[0193] Optionally, obtaining the position information of the target object in the image to be detected based on the at least one target anchor point includes: performing regression analysis on the at least one target anchor point using the anchor point regression subtask in the target object detection model to obtain the position information of the target object in the image to be detected.
[0194] Optionally, the use of the anchor point regression subtask in the target object detection model to perform regression analysis on the at least one target anchor point to obtain the position information of the target object in the image to be detected includes: using the anchor point regression subtask in the target object detection model to perform regression analysis on the at least one target anchor point to obtain at least one to-be-determined position information of the target object in the image to be detected; and obtaining the position information of the target object in the image to be detected based on the at least one to-be-determined position information.
[0195] Optionally, the target object is a commodity object.
[0196] Optionally, the device further includes: a category information acquisition unit, configured to obtain category information to which the target object belongs based on the target object detection model.
[0197] Corresponding to the target object detection method provided in the first embodiment of the present application, the fourth embodiment of the present application further provides an electronic device, see Figure 6 , which is a schematic diagram of an electronic device provided in the fourth embodiment of the present application. Since the electronic device embodiment is basically similar to the method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment. The electronic device embodiment described below is only illustrative. The electronic device provided in the fourth embodiment of the present application includes:
[0198] Processor 601;
[0199] The memory 602 is used to store a program for the target object detection method. After the device is powered on and the program for the target object detection method is run by the processor, the following steps are performed:
[0200] Obtain an image to be detected containing a target object;
[0201] Inputting the image to be detected into a target object detection model to obtain position information of the target object in the image to be detected;
[0202] Among them, the target object detection model is used to obtain the position information of the foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the target object in the image to be detected based on the target anchor points.
[0203] Corresponding to the target object detection method provided in the first embodiment of this application, the fifth embodiment of this application also provides a storage device. Since the storage device embodiment is basically similar to the method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment. The storage device embodiment described below is merely illustrative. The fifth embodiment of this application provides a storage device that stores a program for the target object detection method. The program is executed by a processor to perform the following steps:
[0204] Obtain an image to be detected containing a target object;
[0205] Inputting the image to be detected into a target object detection model to obtain position information of the target object in the image to be detected;
[0206] Among them, the target object detection model is used to obtain the position information of the foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the target object in the image to be detected based on the target anchor points.
[0207] Corresponding to the method for obtaining a target object detection model provided in the second embodiment of the present application, the sixth embodiment of the present application further provides a device for obtaining a target object detection model, see Figure 7 , which is a schematic diagram of a target object detection model acquisition device provided in the sixth embodiment of this application. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment. The device embodiment described below is only illustrative. The seventh embodiment of this application provides a target object detection model acquisition device including the following parts:
[0208] The training sample object acquisition unit 701 is configured to acquire a training sample object including an original object.
[0209] a training unit 702 configured to train the target object detection model using the training sample objects, and, during the training of the target object detection model, adjust parameters of the target object detection model using a loss function corresponding to the target object detection model so that a prediction error of the target object detection model meets a preset convergence condition;
[0210] In which, the target object detection model is used to obtain the position information of the foreground pixels corresponding to the original object from the training sample object using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the original object in the image to be detected based on the target anchor points.
[0211] Corresponding to the method for obtaining a target object detection model provided in the second embodiment of the present application, the seventh embodiment of the present application further provides an electronic device. Since the electronic device embodiment is substantially similar to the method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment. The electronic device embodiment described below is merely illustrative. The electronic device provided in the seventh embodiment of the present application includes:
[0212] processor;
[0213] The memory is used to store a program for a method for obtaining a target object detection model. After the device is powered on and the program for obtaining the target object detection model is run by the processor, the following steps are performed:
[0214] Get the training sample object containing the original object;
[0215] Using the training sample objects to train the target object detection model, and in the process of training the target object detection model, using a loss function corresponding to the target object detection model to adjust the parameters of the target object detection model so that the prediction error of the target object detection model reaches a preset convergence condition;
[0216] In which, the target object detection model is used to obtain the position information of the foreground pixels corresponding to the original object from the training sample object using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the original object in the image to be detected based on the target anchor points.
[0217] Corresponding to the method for obtaining a target object detection model provided in the second embodiment of the present application, the eighth embodiment of the present application further provides a storage device. Since the storage device embodiment is substantially similar to the method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment. The storage device embodiment described below is merely illustrative. The eighth embodiment of the present application provides a storage device that stores a program for obtaining a target object detection model. The program is executed by a processor to perform the following steps:
[0218] Get the training sample object containing the original object;
[0219] Using the training sample objects to train the target object detection model, and in the process of training the target object detection model, using a loss function corresponding to the target object detection model to adjust the parameters of the target object detection model so that the prediction error of the target object detection model reaches a preset convergence condition;
[0220] In which, the target object detection model is used to obtain the position information of the foreground pixels corresponding to the original object from the training sample object using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the original object in the image to be detected based on the target anchor points.
[0221] Corresponding to the target object detection method provided in the first embodiment of the present application, the ninth embodiment of the present application also provides another target object detection method, please refer to Figure 8 As shown, it is a flowchart of another target object detection method provided in the ninth embodiment of the present application, wherein some steps have been described in detail in the first embodiment of the present application, so the description here is relatively simple. For relevant matters, please refer to some descriptions in the target object detection method provided in the first embodiment of the present application. The processing process described below is only illustrative.
[0222] Step S801: Acquire an image to be detected containing a target object.
[0223] Step S802: obtaining position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method.
[0224] Step S803: Acquire a target anchor point corresponding to the position information of the foreground pixel.
[0225] Step S804: Obtaining position information of the target object in the image to be detected according to the target anchor point.
[0226] It should be noted that, to enhance the visual effect of the method, when the method is applied to the server, the method further includes: providing the target anchor point to the client. Furthermore, when the method is applied to the client, the method further includes: obtaining the target anchor point provided by the server; and displaying the target anchor point, wherein displaying the target anchor point includes: displaying the target anchor point by flashing.
[0227] That is, when the server obtains the target anchor point corresponding to the position information of the foreground pixel, it can provide the target anchor point to the client; and after obtaining the target anchor point, the client can display the target anchor point in the image to be detected by flashing.
[0228] For example, for the image img001 to be detected containing the shoe object "xx", after the server obtains img001, it first uses the anchor-free positioning method to obtain the position information of the foreground pixel corresponding to the shoe object "xx" from img001; then, the server obtains the target anchor point corresponding to the position information of the foreground pixel, and can provide the target anchor point to the client. The client can quickly display the target anchor point in the image to be retrieved by flashing. After that, the client can also identify the shoe object in img001 through an identification box based on the position information of the shoe object "xx" in img001 provided by the server, and display img001 with the shoe object identified.
[0229] Of course, in a specific implementation, after the server obtains the position information of the target object in the image to be detected, the target anchor point and the position information can be provided to the client at the same time; and after the client obtains the target anchor point and the position information, it can first display the target anchor point and then display the image to be detected with the target object identified, or it can identify the target anchor point and the target object with identification boxes of different colors and display the target anchor point and the target object at the same time, or it can also display the target anchor point through other methods, which will not be repeated here.
[0230] Corresponding to the target object detection method provided in the ninth embodiment of the present application, the tenth embodiment of the present application also provides another target object detection device, see Figure 9 , which is a schematic diagram of a target object detection device provided in the tenth embodiment of the present application. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment. The device embodiment described below is only illustrative. The target object detection device provided in the tenth embodiment of the present application includes the following parts:
[0231] The image acquisition unit 901 is used to acquire an image to be detected containing a target object.
[0232] The foreground pixel position information obtaining unit 902 is configured to obtain position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method.
[0233] The target anchor point acquisition unit 903 is configured to acquire a target anchor point corresponding to the position information of the foreground pixel.
[0234] The target object position information obtaining unit 904 is configured to obtain the position information of the target object in the image to be detected according to the target anchor point.
[0235] Corresponding to the target object detection method provided in the ninth embodiment of the present application, the eleventh embodiment of the present application further provides an electronic device. Since the electronic device embodiment is substantially similar to the method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment. The electronic device embodiment described below is merely illustrative. The electronic device provided in the eleventh embodiment of the present application includes:
[0236] processor;
[0237] The memory is used to store a program for the target object detection method. After the device is powered on and the program for the target object detection method is run by the processor, the following steps are performed:
[0238] Obtain an image to be detected containing a target object;
[0239] Obtaining position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method;
[0240] Obtaining a target anchor point corresponding to the position information of the foreground pixel;
[0241] According to the target anchor point, the position information of the target object in the image to be detected is obtained.
[0242] Corresponding to the target object detection method provided in the ninth embodiment of the present application, the twelfth embodiment of the present application further provides a storage device. Since the storage device embodiment is substantially similar to the method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment. The storage device embodiment described below is merely illustrative. The twelfth embodiment of the present application provides a storage device that stores a program for the target object detection method. The program is executed by a processor to perform the following steps:
[0243] Obtain an image to be detected containing a target object;
[0244] Obtaining position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method;
[0245] Obtaining a target anchor point corresponding to the position information of the foreground pixel;
[0246] According to the target anchor point, the position information of the target object in the image to be detected is obtained.
[0247] Although the present application is disclosed as above with the preferred embodiments, it is not intended to limit the present application. Any person skilled in the art may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
[0248] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0249] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0250] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0251] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
Claims
1. A target object detection method, characterized in that: include: Obtain an image to be detected containing a target object; Inputting the image to be detected into a target object detection model to obtain position information of the target object in the image to be detected; The target object detection model is used to obtain position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain a target anchor point corresponding to the position information of the foreground pixels, and obtain position information of the target object in the image to be detected based on the target anchor point; The step of inputting the image to be detected into the target object detection model to obtain the position information of the target object in the image to be detected includes: using the target object detection model to determine the position information of the target object in the image to be detected based on the position information of the foreground pixels corresponding to the target object and preset anchor point information, wherein the position information of the foreground pixels corresponding to the target object is determined based on the distance between each pixel and the feature information of its neighboring pixels; Wherein, the use of the target object detection model to determine the position information of the target object in the image to be detected according to the position information of the foreground pixels corresponding to the target object and the preset anchor point information includes: using the target object detection model to obtain multi-scale feature information of the image to be detected; obtaining the position information of the foreground pixels corresponding to the target object according to the anchor-free positioning method and the multi-scale feature information of the image to be detected, wherein the anchor-free positioning method is determined based on a convolutional layer for pixel classification; according to the preset anchor point information, with the position information of the foreground pixel as the center point, obtaining at least one original anchor point to be determined corresponding to the position information of the foreground pixel, and obtaining at least one predicted position information corresponding to the at least one original anchor point to be determined; according to the at least one original anchor point to be determined and the at least one predicted position information, obtaining at least one target anchor point corresponding to the position information of the foreground pixel; according to the at least one target anchor point, obtaining the position information of the target object in the image to be detected.
2. The target object detection method according to claim 1, characterized in that: The acquiring of multi-scale feature information of the image to be detected includes: The image to be detected is input into the feature pyramid network subtask in the target object detection model to obtain multi-scale feature information of the image to be detected.
3. The target object detection method according to claim 1, characterized in that: The obtaining, according to the anchor-free positioning method and the multi-scale feature information of the image to be detected, position information of foreground pixels corresponding to the target object includes: According to the multi-scale feature information, position information of foreground pixels corresponding to the target object is obtained by performing pixel-by-pixel analysis on the image to be detected.
4. The target object detection method according to claim 3, characterized in that: The step of determining the at least one original anchor point to be determined and the at least one predicted position information includes: performing an intersection-over-union (IoU) calculation on the at least one original anchor point to be determined and the at least one predicted position information to obtain at least one IoU overlap degree corresponding to the at least one original anchor point to be determined and the at least one predicted position information; Determining, from the at least one original anchor point to be determined, at least one target anchor point to be determined corresponding to the position information of the foreground pixel according to the at least one intersection-over-union (IoU) overlap; At least one target anchor point corresponding to the position information of the foreground pixel is acquired according to the at least one target anchor point to be determined.
5. The target object detection method according to claim 4, characterized in that: The acquiring, according to the at least one target anchor point to be determined, at least one target anchor point corresponding to the position information of the foreground pixel includes: Obtaining at least one category prediction score corresponding to the at least one target anchor point to be determined; At least one target anchor point corresponding to the position information of the foreground pixel is obtained according to the at least one target anchor point to be determined and the at least one category prediction score.
6. The target object detection method according to claim 5, characterized in that: The acquiring, according to the at least one to-be-determined target anchor point and the at least one category prediction score, at least one target anchor point corresponding to the position information of the foreground pixel comprises: The at least one target anchor point to be determined and the at least one category prediction score are processed by a non-maximum suppression method to obtain at least one target anchor point corresponding to the position information of the foreground pixel.
7. The target object detection method according to claim 4, characterized in that: The determining, based on the at least one intersection-over-union (IoU) overlap, at least one target anchor point to be determined corresponding to the position information of the foreground pixel from the at least one original anchor point to be determined includes: Obtaining the maximum value of the intersection-over-union (IOU) coincidence corresponding to the position information of each foreground pixel from the at least one IOU coincidence; The target anchor point to be determined is determined according to the original anchor point to be determined corresponding to the maximum value of the intersection-over-union ratio coincidence corresponding to the position information of each foreground pixel.
8. The target object detection method according to claim 1, wherein: The obtaining, according to the at least one target anchor point, position information of the target object in the image to be detected includes: The anchor point regression subtask in the target object detection model is used to perform regression analysis on the at least one target anchor point to obtain position information of the target object in the image to be detected.
9. The target object detection method according to claim 1, characterized in that: The method for obtaining the target object detection model includes: Obtain a training sample object containing an original object; use the training sample object to train the target object detection model, and during the training of the target object detection model, use a loss function corresponding to the target object detection model to adjust the parameters of the target object detection model so that the prediction error of the target object detection model reaches a preset convergence condition.
10. The target object detection method according to claim 1, characterized in that: The target object is a commodity object.
11. The target object detection method according to claim 10, characterized in that: The method is applied to the server, and the method further includes: Acquiring feature information of the commodity object according to position information of the commodity object in the image to be detected; According to the feature information of the commodity object, information of a matching commodity object corresponding to the commodity object is obtained; and the information of the matching commodity object is provided to a client.
12. The target object detection method according to claim 1, characterized in that: The method is applied to a client, and further includes: Obtaining location information of the target object in the image to be detected provided by the server; Identifying the target object in the image to be detected according to the position information; The image to be detected in which the target object is identified is displayed.
13. The target object detection method according to claim 12, characterized in that: Also includes: Obtain the target anchor point provided by the server; The target anchor is displayed.
14. The target object detection method according to claim 13, characterized in that: The displaying of the target anchor point includes: The target anchor point is displayed in a flashing manner.
15. The target object detection method according to claim 1, characterized in that: Also includes: According to the target object detection model, category information to which the target object belongs is obtained.
16. A method for obtaining a target object detection model, characterized in that: include: Get the training sample object containing the original object; Using the training sample objects to train the target object detection model, and in the process of training the target object detection model, using a loss function corresponding to the target object detection model to adjust the parameters of the target object detection model so that the prediction error of the target object detection model reaches a preset convergence condition; The target object detection model is used to obtain the position information of the foreground pixels corresponding to the original object from the training sample object using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the original object in the image to be detected based on the target anchor points; The obtaining of the position information of the original object in the image to be detected includes: using the target object detection model to determine the position information of the original object in the image to be detected based on the position information of the foreground pixels corresponding to the original object and preset anchor point information, wherein the position information of the foreground pixels corresponding to the original object is determined based on the distance between each pixel and the feature information of its neighboring pixels; Wherein, the use of the target object detection model to determine the position information of the original object in the image to be detected based on the position information of the foreground pixels corresponding to the original object and the preset anchor point information includes: using the target object detection model to obtain multi-scale feature information of the image to be detected; obtaining the position information of the foreground pixels corresponding to the original object according to the anchor-free positioning method and the multi-scale feature information of the image to be detected, wherein the anchor-free positioning method is determined based on a convolutional layer for pixel classification; according to the preset anchor point information, with the position information of the foreground pixel as the center point, obtaining at least one original anchor point to be determined corresponding to the position information of the foreground pixel, and obtaining at least one predicted position information corresponding to the at least one original anchor point to be determined; according to the at least one original anchor point to be determined and the at least one predicted position information, obtaining at least one target anchor point corresponding to the position information of the foreground pixel; according to the at least one target anchor point, obtaining the position information of the original object in the image to be detected.
17. A target object detection device, characterized in that: include: An acquisition unit, configured to acquire an image to be detected containing a target object; An information obtaining unit, configured to input the image to be detected into a target object detection model to obtain position information of the target object in the image to be detected; The target object detection model is used to obtain position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain a target anchor point corresponding to the position information of the foreground pixels, and obtain position information of the target object in the image to be detected based on the target anchor point; The information obtaining unit is further configured to: determine, using the target object detection model, the position information of the target object in the image to be detected based on the position information of the foreground pixels corresponding to the target object and preset anchor point information, wherein the position information of the foreground pixels corresponding to the target object is determined based on the distance between each pixel and the feature information of its neighboring pixels; In which, the information acquisition unit is also used to: obtain multi-scale feature information of the image to be detected using the target object detection model; obtain position information of foreground pixels corresponding to the target object according to the anchor-free positioning method and the multi-scale feature information of the image to be detected, wherein the anchor-free positioning method is determined based on a convolutional layer for pixel classification; according to preset anchor point information, with the position information of the foreground pixel as the center point, obtain at least one original anchor point to be determined corresponding to the position information of the foreground pixel, and obtain at least one predicted position information corresponding to the at least one original anchor point to be determined; according to the at least one original anchor point to be determined and the at least one predicted position information, obtain at least one target anchor point corresponding to the position information of the foreground pixel; according to the at least one target anchor point, obtain the position information of the target object in the image to be detected.
18. An electronic device, characterized in that: include: processor; The memory is used to store a program of the target object detection method. After the device is powered on and the program of the target object detection method is run by the processor, the following steps are performed: Obtain an image to be detected containing a target object; Inputting the image to be detected into a target object detection model to obtain position information of the target object in the image to be detected; The target object detection model is used to obtain position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain a target anchor point corresponding to the position information of the foreground pixels, and obtain position information of the target object in the image to be detected based on the target anchor point; The step of inputting the image to be detected into the target object detection model to obtain the position information of the target object in the image to be detected includes: using the target object detection model to determine the position information of the target object in the image to be detected based on the position information of the foreground pixels corresponding to the target object and preset anchor point information, wherein the position information of the foreground pixels corresponding to the target object is determined based on the distance between each pixel and the feature information of its neighboring pixels; Wherein, the use of the target object detection model to determine the position information of the target object in the image to be detected according to the position information of the foreground pixels corresponding to the target object and the preset anchor point information includes: using the target object detection model to obtain multi-scale feature information of the image to be detected; obtaining the position information of the foreground pixels corresponding to the target object according to the anchor-free positioning method and the multi-scale feature information of the image to be detected, wherein the anchor-free positioning method is determined based on a convolutional layer for pixel classification; according to the preset anchor point information, with the position information of the foreground pixel as the center point, obtaining at least one original anchor point to be determined corresponding to the position information of the foreground pixel, and obtaining at least one predicted position information corresponding to the at least one original anchor point to be determined; according to the at least one original anchor point to be determined and the at least one predicted position information, obtaining at least one target anchor point corresponding to the position information of the foreground pixel; according to the at least one target anchor point, obtaining the position information of the target object in the image to be detected.
19. A storage device, characterized in that: A program storing a target object detection method is executed by a processor to perform the following steps: Obtain an image to be detected containing a target object; Inputting the image to be detected into a target object detection model to obtain position information of the target object in the image to be detected; The target object detection model is used to obtain position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method, obtain a target anchor point corresponding to the position information of the foreground pixels, and obtain position information of the target object in the image to be detected based on the target anchor point; The step of inputting the image to be detected into the target object detection model to obtain the position information of the target object in the image to be detected includes: using the target object detection model to determine the position information of the target object in the image to be detected based on the position information of the foreground pixels corresponding to the target object and preset anchor point information, wherein the position information of the foreground pixels corresponding to the target object is determined based on the distance between each pixel and the feature information of its neighboring pixels; Wherein, the use of the target object detection model to determine the position information of the target object in the image to be detected according to the position information of the foreground pixels corresponding to the target object and the preset anchor point information includes: using the target object detection model to obtain multi-scale feature information of the image to be detected; obtaining the position information of the foreground pixels corresponding to the target object according to the anchor-free positioning method and the multi-scale feature information of the image to be detected, wherein the anchor-free positioning method is determined based on a convolutional layer for pixel classification; according to the preset anchor point information, with the position information of the foreground pixel as the center point, obtaining at least one original anchor point to be determined corresponding to the position information of the foreground pixel, and obtaining at least one predicted position information corresponding to the at least one original anchor point to be determined; according to the at least one original anchor point to be determined and the at least one predicted position information, obtaining at least one target anchor point corresponding to the position information of the foreground pixel; according to the at least one target anchor point, obtaining the position information of the target object in the image to be detected.
20. A device for obtaining a target object detection model, characterized in that: include: A training sample object acquisition unit, configured to acquire a training sample object containing an original object; a training unit, configured to train the target object detection model using the training sample objects, and, during the training of the target object detection model, adjust parameters of the target object detection model using a loss function corresponding to the target object detection model so that a prediction error of the target object detection model reaches a preset convergence condition; The target object detection model is used to obtain the position information of the foreground pixels corresponding to the original object from the training sample object using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the original object in the image to be detected based on the target anchor points; The training unit is further configured to use the target object detection model to determine the position information of the original object in the image to be detected based on the position information of the foreground pixels corresponding to the original object and preset anchor point information, wherein the position information of the foreground pixels corresponding to the original object is determined based on the distance between each pixel and the feature information of its neighboring pixels; In which, the training unit is also used to use the target object detection model to obtain multi-scale feature information of the image to be detected; according to the anchor-free positioning method and the multi-scale feature information of the image to be detected, obtain the position information of the foreground pixel corresponding to the original object, wherein the anchor-free positioning method is determined based on the convolution layer for pixel classification; according to the preset anchor point information, with the position information of the foreground pixel as the center point, obtain at least one original anchor point to be determined corresponding to the position information of the foreground pixel, and obtain at least one predicted position information corresponding to the at least one original anchor point to be determined; according to the at least one original anchor point to be determined and the at least one predicted position information, obtain at least one target anchor point corresponding to the position information of the foreground pixel; according to the at least one target anchor point, obtain the position information of the original object in the image to be detected.
21. An electronic device, characterized in that: include: processor; The memory is used to store a program for obtaining a target object detection model. After the device is powered on and the program for obtaining a target object detection model is run by the processor, the following steps are performed: Get the training sample object containing the original object; Using the training sample objects to train the target object detection model, and in the process of training the target object detection model, using a loss function corresponding to the target object detection model to adjust the parameters of the target object detection model so that the prediction error of the target object detection model reaches a preset convergence condition; The target object detection model is used to obtain the position information of the foreground pixels corresponding to the original object from the training sample object using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the original object in the image to be detected based on the target anchor points; The obtaining of the position information of the original object in the image to be detected includes: using the target object detection model to determine the position information of the original object in the image to be detected based on the position information of the foreground pixels corresponding to the original object and preset anchor point information, wherein the position information of the foreground pixels corresponding to the original object is determined based on the distance between each pixel and the feature information of its neighboring pixels; Wherein, the use of the target object detection model to determine the position information of the original object in the image to be detected based on the position information of the foreground pixels corresponding to the original object and the preset anchor point information includes: using the target object detection model to obtain multi-scale feature information of the image to be detected; obtaining the position information of the foreground pixels corresponding to the original object according to the anchor-free positioning method and the multi-scale feature information of the image to be detected, wherein the anchor-free positioning method is determined based on a convolutional layer for pixel classification; according to the preset anchor point information, with the position information of the foreground pixel as the center point, obtaining at least one original anchor point to be determined corresponding to the position information of the foreground pixel, and obtaining at least one predicted position information corresponding to the at least one original anchor point to be determined; according to the at least one original anchor point to be determined and the at least one predicted position information, obtaining at least one target anchor point corresponding to the position information of the foreground pixel; according to the at least one target anchor point, obtaining the position information of the original object in the image to be detected.
22. A storage device, characterized in that: A program storing a method for obtaining a target object detection model is executed by a processor to perform the following steps: Get the training sample object containing the original object; Using the training sample objects to train the target object detection model, and in the process of training the target object detection model, using a loss function corresponding to the target object detection model to adjust the parameters of the target object detection model so that the prediction error of the target object detection model reaches a preset convergence condition; The target object detection model is used to obtain the position information of the foreground pixels corresponding to the original object from the training sample object using an anchor-free positioning method, obtain the target anchor points corresponding to the position information of the foreground pixels, and obtain the position information of the original object in the image to be detected based on the target anchor points; The obtaining of the position information of the original object in the image to be detected includes: using the target object detection model to determine the position information of the original object in the image to be detected based on the position information of the foreground pixels corresponding to the original object and preset anchor point information, wherein the position information of the foreground pixels corresponding to the original object is determined based on the distance between each pixel and the feature information of its neighboring pixels; Wherein, the use of the target object detection model to determine the position information of the original object in the image to be detected based on the position information of the foreground pixels corresponding to the original object and the preset anchor point information includes: using the target object detection model to obtain multi-scale feature information of the image to be detected; obtaining the position information of the foreground pixels corresponding to the original object according to the anchor-free positioning method and the multi-scale feature information of the image to be detected, wherein the anchor-free positioning method is determined based on a convolutional layer for pixel classification; according to the preset anchor point information, with the position information of the foreground pixel as the center point, obtaining at least one original anchor point to be determined corresponding to the position information of the foreground pixel, and obtaining at least one predicted position information corresponding to the at least one original anchor point to be determined; according to the at least one original anchor point to be determined and the at least one predicted position information, obtaining at least one target anchor point corresponding to the position information of the foreground pixel; according to the at least one target anchor point, obtaining the position information of the original object in the image to be detected.
23. A target object detection method, characterized in that: include: Obtain an image to be detected containing a target object; Obtaining position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method; Obtaining a target anchor point corresponding to the position information of the foreground pixel; Obtaining position information of the target object in the image to be detected according to the target anchor point; Wherein, obtaining the position information of the target object in the image to be detected includes: using a target object detection model to determine the position information of the target object in the image to be detected based on the position information of the foreground pixels corresponding to the target object and preset anchor point information, wherein the position information of the foreground pixels corresponding to the target object is determined based on the distance between each pixel and the feature information of its neighboring pixels; The method of using the target object detection model to determine the position information of the target object in the image to be detected according to the position information of the foreground pixels corresponding to the target object and the preset anchor point information includes: The target object detection model is used to obtain multi-scale feature information of the image to be detected; based on the anchor-free positioning method and the multi-scale feature information of the image to be detected, the position information of the foreground pixel corresponding to the target object is obtained, wherein the anchor-free positioning method is determined based on a convolutional layer that performs pixel classification; based on preset anchor point information, with the position information of the foreground pixel as the center point, at least one original anchor point to be determined corresponding to the position information of the foreground pixel is obtained, and at least one predicted position information corresponding to the at least one original anchor point to be determined is obtained; based on the at least one original anchor point to be determined and the at least one predicted position information, at least one target anchor point corresponding to the position information of the foreground pixel is obtained; based on the at least one target anchor point, the position information of the target object in the image to be detected is obtained.
24. The target object detection method according to claim 23, characterized in that: The method is applied to the server, and the method further includes: The target anchor point is provided to the client.
25. The target object detection method according to claim 23, characterized in that: The method is applied to a client, and further includes: Obtain the target anchor point provided by the server; The target anchor is displayed.
26. The target object detection method according to claim 25, characterized in that: The displaying of the target anchor point includes: The target anchor point is displayed in a flashing manner.
27. A target object detection device, characterized in that: include: An image acquisition unit, configured to acquire an image to be detected containing a target object; a foreground pixel position information obtaining unit, configured to obtain position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method; a target anchor point acquisition unit, configured to acquire a target anchor point corresponding to the position information of the foreground pixel; a target object position information obtaining unit, configured to obtain position information of the target object in the image to be detected based on the target anchor point; The target object position information obtaining unit is further configured to determine the position information of the target object in the image to be detected based on the position information of the foreground pixels corresponding to the target object and preset anchor point information using a target object detection model, wherein the position information of the foreground pixels corresponding to the target object is determined based on the distance between each pixel and feature information of its neighboring pixels; In which, the target object position information obtaining unit is further used to obtain multi-scale feature information of the image to be detected using a target object detection model; obtain the position information of the foreground pixel corresponding to the target object according to the anchor-free positioning method and the multi-scale feature information of the image to be detected, wherein the anchor-free positioning method is determined based on a convolutional layer for pixel classification; according to preset anchor point information, with the position information of the foreground pixel as the center point, obtain at least one original anchor point to be determined corresponding to the position information of the foreground pixel, and obtain at least one predicted position information corresponding to the at least one original anchor point to be determined; according to the at least one original anchor point to be determined and the at least one predicted position information, obtain at least one target anchor point corresponding to the position information of the foreground pixel; according to the at least one target anchor point, obtain the position information of the target object in the image to be detected.
28. An electronic device, characterized in that: include: processor; The memory is used to store a program of the target object detection method. After the device is powered on and the program of the target object detection method is run by the processor, the following steps are performed: Obtain an image to be detected containing a target object; Obtaining position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method; Obtaining a target anchor point corresponding to the position information of the foreground pixel; Obtaining position information of the target object in the image to be detected according to the target anchor point; Wherein, obtaining the position information of the target object in the image to be detected includes: using a target object detection model to determine the position information of the target object in the image to be detected based on the position information of the foreground pixels corresponding to the target object and preset anchor point information, wherein the position information of the foreground pixels corresponding to the target object is determined based on the distance between each pixel and the feature information of its neighboring pixels; The method of using the target object detection model to determine the position information of the target object in the image to be detected according to the position information of the foreground pixels corresponding to the target object and the preset anchor point information includes: The target object detection model is used to obtain multi-scale feature information of the image to be detected; based on the anchor-free positioning method and the multi-scale feature information of the image to be detected, the position information of the foreground pixel corresponding to the target object is obtained, wherein the anchor-free positioning method is determined based on a convolutional layer that performs pixel classification; based on preset anchor point information, with the position information of the foreground pixel as the center point, at least one original anchor point to be determined corresponding to the position information of the foreground pixel is obtained, and at least one predicted position information corresponding to the at least one original anchor point to be determined is obtained; based on the at least one original anchor point to be determined and the at least one predicted position information, at least one target anchor point corresponding to the position information of the foreground pixel is obtained; based on the at least one target anchor point, the position information of the target object in the image to be detected is obtained.
29. A storage device, characterized in that: A program storing a target object detection method is executed by a processor to perform the following steps: Obtain an image to be detected containing a target object; Obtaining position information of foreground pixels corresponding to the target object from the image to be detected using an anchor-free positioning method; Obtaining a target anchor point corresponding to the position information of the foreground pixel; Obtaining position information of the target object in the image to be detected according to the target anchor point; Wherein, obtaining the position information of the target object in the image to be detected includes: using a target object detection model to determine the position information of the target object in the image to be detected based on the position information of the foreground pixels corresponding to the target object and preset anchor point information, wherein the position information of the foreground pixels corresponding to the target object is determined based on the distance between each pixel and the feature information of its neighboring pixels; The method of using the target object detection model to determine the position information of the target object in the image to be detected according to the position information of the foreground pixels corresponding to the target object and the preset anchor point information includes: The target object detection model is used to obtain multi-scale feature information of the image to be detected; based on the anchor-free positioning method and the multi-scale feature information of the image to be detected, the position information of the foreground pixel corresponding to the target object is obtained, wherein the anchor-free positioning method is determined based on a convolutional layer that performs pixel classification; based on preset anchor point information, with the position information of the foreground pixel as the center point, at least one original anchor point to be determined corresponding to the position information of the foreground pixel is obtained, and at least one predicted position information corresponding to the at least one original anchor point to be determined is obtained; based on the at least one original anchor point to be determined and the at least one predicted position information, at least one target anchor point corresponding to the position information of the foreground pixel is obtained; based on the at least one target anchor point, the position information of the target object in the image to be detected is obtained.
Citation Information
Patent Citations
Method for unsupervised segmentation of complex targets from dynamic scene based on multi-scale combination feature convex optimization
CN105869178A
Target detection method, device and equipment, and target detection network training method, device and equipment
CN110298298A