Target detection method, device, computer equipment and storage medium

The deep learning model automatically detects items hanging from the handlebars of two-wheelers, solving the problem of high cost of traditional manual inspections, achieving efficient and automated safety inspection, and ensuring the safety of two-wheeler drivers.

CN111401282BActive Publication Date: 2024-10-01刘丽
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010207471.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-23
Publication Date
2024-10-01
Estimated Expiration
2040-03-23

AI Technical Summary

Technical Problem

When using a two-wheeled vehicle, hanging items from the handlebars will affect the stability of the ride, posing serious safety risks. Moreover, traditional detection methods rely on manual inspection, resulting in high labor costs.

Method used

Using a deep learning model, the first and second target detection models are used to extract features from the image to be detected, automatically detect items in the two-wheeled vehicle area and handlebars, identify license plate characters and compare them with standards, generate detection results, and reduce labor costs and calculations. time.

Benefits of technology

The automated detection of items hanging from the handlebars of two-wheelers has been realized, significantly reducing labor costs, improving detection efficiency, and ensuring driver safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111401282B_ABST
    Figure CN111401282B_ABST
Patent Text Reader

Abstract

The present application relates to a target detection method, device, computer equipment and storage medium, the method comprising: extracting features from an image to be detected by a compressed basic network block in a first target detection model to obtain a first feature map; obtaining a detection result of a two-wheeled vehicle area according to the first feature map; when the detection result of the two-wheeled vehicle area is that a two-wheeled vehicle area exists, obtaining a two-wheeled vehicle area image; extracting features from a two-wheeled vehicle area map by a compressed basic network block in a second target detection model to obtain a second feature map; obtaining a detection result of a target object according to the second feature map; obtaining a target detection result of a two-wheeled vehicle to be detected according to the detection result of the target object. The method automatically obtains the detection result of a target object of a two-wheeled vehicle to be detected based on a deep learning model, which greatly reduces the manpower cost; by using a compressed version of the target detection model for detection, the amount of calculation is reduced and the calculation time is shortened, thereby reducing the time cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle detection technology, and in particular to a target detection method, device, computer equipment and storage medium. Background Art

[0002] When using a two-wheeled vehicle, if you hang objects on the handlebars of the two-wheeled vehicle, it may affect the stability during the riding process, making it difficult to control when performing operations such as steering, posing a serious safety hazard.

[0003] Taking a two-wheeled vehicle as an example, in order to ensure the personal safety of the motorcycle driver, according to the regulations on motorcycle safe driving and traffic safety, it is prohibited to hang objects on the handlebars when driving a motorcycle. In traditional technology, the detection of whether there are objects hanging on the handlebars of a motorcycle mainly relies on manual inspection, which has the problem of high labor costs. Summary of the invention

[0004] Based on this, it is necessary to provide a target detection method, device, computer equipment and storage medium that can save manpower costs when inspecting objects hanging on the handlebars of a two-wheeled vehicle in response to the above technical problems.

[0005] In a first aspect, an embodiment of the present application provides a target detection method, the method comprising:

[0006] The first target detection model is used to detect the two-wheeled vehicle to be detected in the image to be detected, and the compressed basic network block in the first target detection model is used to extract features of the image to be detected to obtain a first feature map;

[0007] Obtaining a detection result of the two-wheeled vehicle area according to the first feature map;

[0008] When the detection result of the two-wheeled vehicle area is that the two-wheeled vehicle area exists, acquiring an image of the two-wheeled vehicle area;

[0009] The two-wheeled vehicle region image is detected by using the second target detection model, and the features of the two-wheeled vehicle region image are extracted by using the compressed basic network block in the second target detection model to obtain a second feature map;

[0010] Obtaining a detection result of the target object according to the second feature map;

[0011] According to the detection result of the target object, the target detection result of the two-wheeled vehicle to be detected is obtained.

[0012] In one embodiment, obtaining a detection result of the target object according to the second feature map includes:

[0013] The detection results of the license plate area and the objects at the handlebars in the two-wheeled vehicle area image are obtained according to the second feature map.

[0014] In one embodiment, obtaining a target detection result of a two-wheeled vehicle to be detected according to the detection result of the target object includes:

[0015] When the license plate area exists in the acquired two-wheeled vehicle area image and there is an object at any handlebar, the license plate area image is acquired;

[0016] Recognize license plate characters in license plate images;

[0017] The license plate characters are compared with the standard license plate characters. If they are consistent, a target detection result indicating that the two-wheeled vehicle to be detected has failed is generated.

[0018] In one embodiment, obtaining the detection result of the two-wheeled vehicle to be detected according to the detection result of the target object includes:

[0019] When there is no license plate area or no object at the handlebar in the acquired two-wheeled vehicle area image, a target detection result is generated indicating that the two-wheeled vehicle to be detected has passed the detection.

[0020] In one embodiment, the method further comprises:

[0021] When the detection result of the two-wheeled vehicle area is that there is no two-wheeled vehicle area, a target detection result that the two-wheeled vehicle to be detected has passed the detection is generated.

[0022] In one embodiment, the first target detection model and / or the second target detection model is a CenterNet model, and the compressed basic network block in the CenterNet model is an hourglass network block.

[0023] In a second aspect, an embodiment of the present application provides a target detection device, the device comprising:

[0024] A first target detection module is used to detect the two-wheeled vehicle to be detected in the image to be detected by using the first target detection model, and to extract features of the image to be detected by using the compressed basic network block in the first target detection model to obtain a first feature map;

[0025] A first detection result acquisition module, used to obtain a detection result of the two-wheeled vehicle area according to the first feature map;

[0026] An image acquisition module, used for acquiring an image of the two-wheeled vehicle area when the detection result of the two-wheeled vehicle area is that the two-wheeled vehicle area exists;

[0027] A second target detection module is used to detect the two-wheeled vehicle area image using a second target detection model, and extract features of the two-wheeled vehicle area image through the compressed basic network block in the second target detection model to obtain a second feature map;

[0028] A second detection result acquisition module, used for the module, for obtaining a detection result of the target object according to the second feature map;

[0029] The detection result generating module is used to obtain the target detection result of the two-wheeled vehicle to be detected according to the detection result of the target object.

[0030] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the target detection method described in any one of the embodiments of the first aspect is implemented.

[0031] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the target detection method described in any one of the embodiments of the first aspect above is implemented.

[0032] The above-mentioned target detection method, device, computer equipment and storage medium use a first target detection model including a compressed basic network block to detect the two-wheeled vehicle to be detected in the image to be detected, and obtain the detection result of the two-wheeled vehicle area; use a second target detection model including a compressed basic network block to detect the two-wheeled vehicle area image, and obtain the detection result of the target object; and obtain the target detection result of the two-wheeled vehicle to be detected based on the detection result of the target object. This method uses a deep learning model to automatically obtain the detection result of the target object of the two-wheeled vehicle to be detected, which greatly reduces the manpower cost; by using a compressed version of the target detection model for detection, the calculation amount is reduced and the calculation time is shortened, thereby reducing the time cost and improving the detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A diagram showing an application environment of a target detection method in an embodiment;

[0034] Figure 2 Schematic diagram of a target detection method in one embodiment;

[0035] Figure 3 A schematic diagram of a process for generating target detection results in one embodiment;

[0036] Figure 4 Schematic diagram of a target detection method in one embodiment;

[0037] Figure 5 is a structural block diagram of a target detection device in one embodiment;

[0038] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0040] The target detection method provided in this application can be applied to Figure 1 In the application environment shown. The application environment includes a terminal 110 and an image acquisition device 120, and at least a trained first target detection model and a second target detection model are deployed in the terminal 110. The first target detection model and the second target detection model can be pre-trained using other terminals outside the terminal 110. The image acquisition device 120 can be in the terminal 110 or a separate device. Specifically, the terminal 110 uses the first target detection model to detect the two-wheeled vehicle to be detected in the image to be detected collected by the image acquisition device 120, and extracts features of the image to be detected by the compressed basic network block in the first target detection model to obtain a first feature map; obtains the detection result of the two-wheeled vehicle area according to the first feature map; when the detection result of the two-wheeled vehicle area is that there is a two-wheeled vehicle area, the terminal 110 obtains the two-wheeled vehicle area image; the terminal 110 uses the second target detection model to detect the two-wheeled vehicle area image, and extracts features of the two-wheeled vehicle area map by the compressed basic network block in the second target detection model to obtain a second feature map; obtains the detection result of the target object according to the second feature map; and obtains the target detection result of the two-wheeled vehicle to be detected according to the detection result of the target object. The terminal 110 may be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable mobile devices, and the image acquisition device 120 is not limited to various cameras and video cameras.

[0041] In one embodiment, Figure 2 As shown, a target detection method is provided, which is applied to Figure 1 The terminal 120 in the example is used as an example to illustrate, and the following steps are included:

[0042] Step S210: Use the first target detection model to detect the two-wheeled vehicle to be detected in the image to be detected, and extract features of the image to be detected through the compressed basic network block in the first target detection model to obtain a first feature map.

[0043] Among them, the image to be detected refers to the image to be detected. The image to be detected can be acquired by an image acquisition device, and the image acquisition device can be a camera, a camera or a smart phone. Two-wheeled vehicles are not limited to bicycles, electric vehicles or motorcycles. The basic network block can refer to a basic feature extraction network composed of at least one CNN (Convolutional Neural Network). Common CNN models are not limited to VGGNet (Visual Geometry Group Networks, a deep convolutional neural network), GoogLeNet (a neural network), and ResNet (Residual Networks, a deep residual network). The compressed basic network block can refer to a basic network block after reducing the number of original basic networks. For example, the basic network block in the original first target detection model contains 4 ResNets, and the number of ResNets in the compressed basic network block can be less than 4. The first target detection model is not limited to RefineDet (a single-stage based detector), Faster R-CNN (a target detection network), SSD (Single Shot Multibox Detector), and CornerNet (a target detection model). Specifically, after acquiring the image to be detected acquired by the image acquisition device, the image to be detected is input into the trained first target detection model. The compressed basic network block in the first target detection model is used to extract features from the image to be detected to obtain a corresponding first feature map.

[0044] Step S220, obtaining a detection result of the two-wheeled vehicle area according to the first feature map.

[0045] Step S230: When the detection result of the two-wheeled vehicle area is that there is a two-wheeled vehicle area, an image of the two-wheeled vehicle area is acquired.

[0046] Specifically, after obtaining the first feature map of the image to be detected, the detection results of each target object in the image to be detected are predicted based on the first feature map, and the detection results are not limited to including the category score and position information of the target object. In the present embodiment, the target object of the image to be detected is not limited to including two-wheeled vehicles, such as motorcycles and electric vehicles. If the first target detection model detects that the image to be detected contains a two-wheeled vehicle area, then the two-wheeled vehicle area can be extracted and saved by cropping or the like according to the position information of the two-wheeled vehicle area to obtain the corresponding two-wheeled vehicle area image. Furthermore, in the present embodiment, if the first target detection model detects that there is no two-wheeled vehicle area in the image to be detected, then the detection process can be terminated.

[0047] Step S240, using the second target detection model to detect the two-wheeled vehicle area image, and extracting features of the two-wheeled vehicle area image through the compressed basic network block in the second target detection model to obtain a second feature map.

[0048] Among them, similar to the first target detection model, the basic network block in the second target detection model can also adopt a compressed basic network block. The second target detection model is not limited to RefineDet, Faster R-CNN, SSD, CornerNet. Specifically, after obtaining the two-wheeled vehicle area image, the two-wheeled vehicle area image is input into the trained second target detection model. The two-wheeled vehicle area image is feature extracted by the compressed basic network block in the second target detection model to obtain the corresponding second feature map.

[0049] Step S250, obtaining a detection result of the target area according to the second feature map.

[0050] Specifically, after obtaining the second feature map of the two-wheeled vehicle region image, the category score and position of each target object in the two-wheeled vehicle region image are predicted based on the second feature map. The target object in the two-wheeled vehicle region image may be determined according to actual conditions, for example, it may be a license plate, a handlebar, a helmet, etc. The second target detection model outputs the detection result of the target object, and the detection result is not limited to including the category score and position information of the target object.

[0051] Step S260, obtaining the target detection result of the two-wheeled vehicle to be detected according to the detection result of the target area.

[0052] Specifically, the terminal obtains the detection result of the target object obtained by detecting the two-wheeled vehicle area image, compares the detection result with the preset condition, and obtains the target detection result of the two-wheeled vehicle to be detected. For example, if the target object is a helmet, the preset condition is that if the helmet is detected, the detection passes; otherwise, the detection fails. If the two-wheeled vehicle area image output by the second target detection model does not contain a helmet, a target detection result of failing the detection of the two-wheeled vehicle to be detected is generated.

[0053] In the above target detection method, a first target detection model including a compressed basic network block is used to detect the two-wheeled vehicle to be detected in the image to be detected, and a detection result of the two-wheeled vehicle area is obtained; a second target detection model including a compressed basic network block is used to detect the two-wheeled vehicle area image, and a detection result of the target area is obtained; and a target detection result of the two-wheeled vehicle to be detected is obtained based on the detection result of the target area. This method automatically obtains the detection result of the target area of ​​the two-wheeled vehicle to be detected based on the deep learning model, which greatly reduces the manpower cost; by using a compressed version of the target detection model for detection, the amount of calculation is reduced and the calculation time is shortened, thereby reducing the time cost.

[0054] In one embodiment, obtaining the detection result of the target object according to the second feature map includes: obtaining the detection result of the license plate area and the object at the handlebar in the two-wheeled vehicle area image according to the second feature map.

[0055] Specifically, taking a two-wheeled vehicle as a motorcycle as an example, in order to ensure the personal safety of the motorcycle driver, according to the regulations on safe driving and traffic safety of motorcycles, it is prohibited to hang objects on the handlebars when driving a motorcycle. Therefore, in this embodiment, the target object in the two-wheeled vehicle area image is not limited to the objects including the license plate and the handlebars. If the first target detection model detects that the image to be detected contains a two-wheeled vehicle, the two-wheeled vehicle area image is obtained. The two-wheeled vehicle area image is input into the second target detection model, and the second target detection model is used to detect whether the two-wheeled vehicle area image contains the license plate area and whether the handlebars contain objects. The detection result obtained is not limited to the presence of the license plate area and the objects at the handlebars in the two-wheeled vehicle area image, the absence of the license plate area and the absence of the objects at the handlebars, and the presence of the license plate area or the objects at the handlebars.

[0056] In one embodiment, Figure 3 As shown, in step S260, the target detection result of the two-wheeled vehicle to be detected is obtained according to the detection result of the target object, including the following steps.

[0057] Step S261, when the license plate area exists in the acquired two-wheeled vehicle area image and there is an object at any handlebar, the license plate area image is acquired.

[0058] Specifically, when a license plate area is detected in the two-wheeled vehicle area image and an object is present at any handlebar, the license plate area can be extracted and saved by cropping or the like according to the position information of the license plate area to obtain a corresponding license plate area image.

[0059] Step S262, identifying the license plate characters in the license plate area image.

[0060] Specifically, the license plate characters in the license plate area image may be identified by using a trained text recognition model. The text recognition model is not limited to CRNN (Convolutional Recurrent Neural Network). The license plate area image is input into the trained text recognition model to obtain the license plate characters output by the text recognition model.

[0061] Step S263, comparing the license plate characters with the standard license plate characters, if they are consistent, generating a test result indicating that the two-wheeled vehicle to be tested has failed the test.

[0062] The standard license plate characters may be accurate license plate characters acquired in advance. For example, to review the violation of a motorcycle, the standard license plate characters may be acquired from the traffic management department. Specifically, after acquiring the license plate characters output by the text recognition model, the license plate characters are compared with the acquired standard license plate characters. If the two characters are consistent, it indicates that the two-wheeled vehicle to be detected is in violation, and a test result indicating that the two-wheeled vehicle to be detected has not passed the test is generated; otherwise, it indicates that the two-wheeled vehicle to be detected has not violated the rules, and a test result indicating that the two-wheeled vehicle to be detected has passed the test is generated.

[0063] In one embodiment, based on the detection result of the target object, a target detection result of the two-wheeled vehicle to be detected is obtained, including: when there is no license plate area in the acquired two-wheeled vehicle area image or there is no object at the handlebar, a target detection result that the two-wheeled vehicle to be detected passes the detection is generated.

[0064] Specifically, for the detection of objects hanging on the handlebars of two-wheeled vehicles, if the second target detection model detects that there is no license plate area or no objects on the handlebars in the two-wheeled vehicle area image, it indicates that the two-wheeled vehicle to be detected has not violated the regulations, and a detection result that the two-wheeled vehicle to be detected has passed the detection is generated. In this embodiment, by detecting the license plate and objects on the handlebars of the two-wheeled vehicle based on the deep learning theory, the objects hanging on the handlebars of the two-wheeled vehicle to be detected are effectively supervised, which can effectively ensure the personal safety of the two-wheeled vehicle driver and other drivers and passengers, and reduce the labor cost.

[0065] In one embodiment, the first target detection model and / or the second target detection model is a CenterNet model, and the compressed basic network block in the CenterNet model is an hourglass network block.

[0066] Specifically, the basic network block in the traditional CenterNet model includes two hourglass networks. In this embodiment, the first target detection model and / or the second target detection model adopts the improved CenterNet model, and the Hourglass network in the CenterNet model is compressed from the original two to one, thereby reducing the amount of calculation and shortening the calculation time, thereby improving the detection efficiency of the two-wheeled vehicle to be detected.

[0067] In one implementation, Figure 4 As shown, the above target detection model is explained through a specific embodiment. In this implementation, the first target detection model and the second target detection model adopt the improved CenterNet target detection model, that is, the two Hourglass network blocks in the original CenterNet target detection model are compressed into one. The two-wheeled vehicle is a motorcycle. The target objects in the two-wheeled vehicle image include the license plate and the objects at the handlebar. The following steps are included.

[0068] Step S401: Input the image to be detected into the first CenterNet target detection model. Use an Hourglass network block in the first CenterNet target detection model to extract features of the image to be detected to obtain a first feature map.

[0069] Step S402, obtaining a detection result of the motorcycle area according to the first feature map.

[0070] Specifically, if the detection shows that there is a motorcycle area, then the process proceeds to step S403 to obtain the motorcycle area image; otherwise, it indicates that the image to be detected does not contain a motorcycle area, and the process proceeds to step S410 to generate a target detection result that the two-wheeled vehicle to be detected passes the detection. Furthermore, in this embodiment, the category of the image to be detected is not limited to background category, motorcycle category, and other vehicle categories. By adding the background category, the target object (motorcycle) is easier to train and recognize, thereby improving the accuracy of target detection.

[0071] Step S403, obtaining a motorcycle area image. Specifically, according to the position information of the motorcycle area output by the first CenterNet object detection model, the motorcycle area image is obtained by cropping or the like.

[0072] Step S404: Input the motorcycle region image to the second CenterNet target detection model. Perform feature extraction on the motorcycle region image through an Hourglass network block in the second CenterNet target detection model to obtain a second feature map.

[0073] Step S405, obtaining detection results of the license plate area and the objects hanging on the handlebars according to the second feature map.

[0074] Specifically, if the detection shows that there is a license plate area and an object exists at any handlebar, then the process proceeds to step S406 to obtain the license plate area image; otherwise, it indicates that the motorcycle is not in violation of the rules, and the process proceeds to step S410 to generate a target detection result that the two-wheeled vehicle to be detected has passed the detection. Furthermore, in this embodiment, the categories of the motorcycle area image are not limited to background categories, license plate categories, and object categories at the handlebars. By adding the background category, the target object (license plate and object at the handlebars) is easier to train and identify, thereby improving the accuracy of target detection.

[0075] Step S406, obtaining a license plate area image. Specifically, according to the position information of the license plate area output by the second CenterNet object detection model, the license plate area image is obtained by cropping or other methods.

[0076] Step S407, input the license plate area image into a text recognition model. The license plate characters in the license plate area image are recognized by the text recognition model. The text recognition model may adopt an LSTM model (Long Short-Term Memory).

[0077] Step S408, compare the license plate characters with the standard license plate characters. If they are consistent, it indicates that the motorcycle is driving in violation of the rules, and the process proceeds to step S409 to generate a target detection result that the two-wheeled vehicle to be detected has not passed the detection; otherwise, it indicates that the motorcycle is driving without violating the rules, and the process proceeds to step S410 to generate a target detection result that the two-wheeled vehicle to be detected has passed the detection.

[0078] The following is an explanation of the training and generation method of the first CenterNet target detection model used in this implementation. First, obtain multiple image samples taken under different conditions. Label the categories in each image sample, that is, label the motorcycle area and other vehicle areas in each image sample to generate a sample set. Then, use the loss function to iteratively train the first CenterNet target detection model to be trained, and update the model parameters of the first CenterNet target detection model to be trained during the iterative training process. Among them, the following loss function can be used for iterative training:

[0079]

[0080]

[0081]

[0082]

[0083]

[0084] in, Represents the focal loss when detecting corner points. Represents the Focal loss when detecting the center point, Represents the pull loss (position loss) when detecting corner points, Indicates the pushloss (position loss) when detecting corner points, Represents the L1loss when detecting corner points, represents the L1 loss when detecting the center point, α, β, and γ represent the weights of the corresponding losses, which can be set to 0.1, 0.1, and 1 respectively.

[0085] Where: L det Medium cij Represents the score of the predicted heat map c class position (i, j), ycij Represents the value of the label heat map at position (i, j) after non-standard Gaussian enhancement.

[0086] L pull and L push Zhonge tk represents the eigenvalue of the upper left corner point, e bk represents the eigenvalue of the lower right corner point, e k It represents the average of the eigenvalues ​​of the upper left and lower right corner points, and the value of Δ is set to 1.

[0087] L off Middle k Indicates the offset, x k and k are the x- and y-coordinates of the corner point k.

[0088] When the preset stop condition is reached, the first CenterNet target detection model finally used can be generated according to the model parameters of the first CenterNet target detection model with the smallest loss value or the best robustness during the training process.

[0089] For the training generation method of the second CenterNet target detection model, you can refer to the training generation method of the first CenterNet target detection model, and no further explanation is given here.

[0090] The following is an explanation of the training and generation method of the LSTM model used in this implementation. First, obtain multiple license plate image samples. Perform sequence annotation on each license plate image sample to generate a sample set. Then, use the loss function to iteratively train the LSTM model to be trained, and update the model parameters of the LSTM model to be trained during the iterative training process. The following loss function can be used for iterative training:

[0091] L(s)=-∑log(p(z|x)),(x,z)∈s

[0092] Where p(z|x) represents the probability of outputting sequence z given input x, and s is the training set.

[0093] When the preset stop condition is reached, the final LSTM model can be generated according to the model parameters of the LSTM model with the smallest loss value or the best robustness during the training process.

[0094] It should be understood that although Figure 1-4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-4At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0095] In one embodiment, Figure 5 As shown, a target detection device 500 is provided, including: a first detection result acquisition module 501, a first detection result acquisition module 502, an image acquisition module 503, a second target detection module 504, a second detection result acquisition module 505 and a detection result generation module 506.

[0096] A first target detection module 501 is used to detect a two-wheeled vehicle to be detected in an image to be detected by using a first target detection model, and extract features of the image to be detected by using a compressed basic network block in the first target detection model to obtain a first feature map;

[0097] A first detection result acquisition module 502, configured to obtain a detection result of a two-wheeled vehicle region according to a first feature map;

[0098] An image acquisition module 503 is used to acquire an image of the two-wheeled vehicle area when the detection result of the two-wheeled vehicle area is that the two-wheeled vehicle area exists;

[0099] A second target detection module 504 is used to detect the two-wheeled vehicle region image using a second target detection model, and extract features of the two-wheeled vehicle region image using the compressed basic network block in the second target detection model to obtain a second feature map;

[0100] A second detection result acquisition module 505, used for a module, for obtaining a detection result of the target object according to the second feature map;

[0101] The detection result generating module 506 is used to obtain the target detection result of the two-wheeled vehicle to be detected according to the detection result of the target object.

[0102] In one embodiment, the second detection result acquisition module 505 is used to obtain detection results of the license plate area and the objects at the handlebars in the two-wheeled vehicle area image according to the second feature map.

[0103] In one embodiment, the detection result generation module 506 includes: a license plate area image acquisition unit, which is used to acquire a license plate area image when a license plate area exists in the two-wheeled vehicle area image and an object exists at any handlebar; a recognition unit, which is used to recognize license plate characters in the license plate image; a comparison unit, which compares the license plate characters with standard license plate characters; and a detection result generation unit, which is used to generate a target detection result that the two-wheeled vehicle to be detected has failed the detection when the license plate characters are consistent with the standard license plate characters.

[0104] In one embodiment, the detection result generating module 506 is used to generate a target detection result indicating that the two-wheeled vehicle to be detected has passed the detection when there is no license plate area in the acquired two-wheeled vehicle area image or there is no object at the handlebar.

[0105] In one embodiment, the detection result generating module 506 is used to generate a target detection result indicating that the two-wheeled vehicle to be detected has passed the detection when the detection result of the two-wheeled vehicle area is that there is no two-wheeled vehicle area.

[0106] In one embodiment, the first target detection model and / or the second target detection model is a CenterNet model, and the compressed basic network block in the CenterNet model is an hourglass network block.

[0107] For the specific definition of the target detection device, please refer to the definition of the target detection method above, which will not be repeated here. Each module in the above target detection device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0108] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a target detection method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0109] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0110] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0111] A first target detection model is used to detect a two-wheeled vehicle to be detected in an image to be detected, and a first feature map is obtained by extracting features of the image to be detected through the compressed basic network block in the first target detection model; a detection result of a two-wheeled vehicle area is obtained according to the first feature map; when the detection result of the two-wheeled vehicle area is that a two-wheeled vehicle area exists, an image of the two-wheeled vehicle area is obtained; a second target detection model is used to detect the two-wheeled vehicle area image, and a second feature map is obtained by extracting features of the two-wheeled vehicle area map through the compressed basic network block in the second target detection model; a detection result of the target object is obtained according to the second feature map; and a target detection result of the two-wheeled vehicle to be detected is obtained according to the detection result of the target object.

[0112] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0113] The detection results of the license plate area and the objects at the handlebars in the two-wheeled vehicle area image are obtained according to the second feature map.

[0114] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0115] When a license plate area exists in the acquired two-wheeled vehicle area image and an object exists at any handlebar, the license plate area image is acquired; the license plate characters in the license plate image are recognized; the license plate characters are compared with the standard license plate characters, and if they are consistent, a target detection result indicating that the two-wheeled vehicle to be detected has failed the detection is generated.

[0116] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0117] When there is no license plate area or no object at the handlebar in the acquired two-wheeled vehicle area image, a target detection result is generated indicating that the two-wheeled vehicle to be detected has passed the detection.

[0118] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0119] When the detection result of the two-wheeled vehicle area is that there is no two-wheeled vehicle area, a target detection result that the two-wheeled vehicle to be detected has passed the detection is generated.

[0120] In one embodiment, the first target detection model and / or the second target detection model is a CenterNet model, and the compressed basic network block in the CenterNet model is an hourglass network block.

[0121] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0122] A first target detection model is used to detect a two-wheeled vehicle to be detected in an image to be detected, and a first feature map is obtained by extracting features of the image to be detected through the compressed basic network block in the first target detection model; a detection result of a two-wheeled vehicle area is obtained according to the first feature map; when the detection result of the two-wheeled vehicle area is that a two-wheeled vehicle area exists, an image of the two-wheeled vehicle area is obtained; a second target detection model is used to detect the two-wheeled vehicle area image, and a second feature map is obtained by extracting features of the two-wheeled vehicle area map through the compressed basic network block in the second target detection model; a detection result of the target object is obtained according to the second feature map; and a target detection result of the two-wheeled vehicle to be detected is obtained according to the detection result of the target object.

[0123] In one embodiment, the computer program, when executed by a processor, implements the following steps:

[0124] The detection results of the license plate area and the objects at the handlebars in the two-wheeled vehicle area image are obtained according to the second feature map.

[0125] In one embodiment, the computer program, when executed by a processor, implements the following steps:

[0126] When a license plate area exists in the acquired two-wheeled vehicle area image and an object exists at any handlebar, the license plate area image is acquired; the license plate characters in the license plate image are recognized; the license plate characters are compared with the standard license plate characters, and if they are consistent, a target detection result indicating that the two-wheeled vehicle to be detected has failed the detection is generated.

[0127] In one embodiment, the computer program, when executed by a processor, implements the following steps:

[0128] When there is no license plate area or no object at the handlebar in the acquired two-wheeled vehicle area image, a target detection result is generated indicating that the two-wheeled vehicle to be detected has passed the detection.

[0129] In one embodiment, the computer program, when executed by a processor, implements the following steps:

[0130] When the detection result of the two-wheeled vehicle area is that there is no two-wheeled vehicle area, a target detection result that the two-wheeled vehicle to be detected has passed the detection is generated.

[0131] In one embodiment, the first target detection model and / or the second target detection model is a CenterNet model, and the compressed basic network block in the CenterNet model is an hourglass network block.

[0132] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0133] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0134] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A target detection method, It is characterized in that include: Using a first target detection model to detect a two-wheeled vehicle to be detected in an image to be detected, and extracting features of the image to be detected by using a compressed basic network block in the first target detection model to obtain a first feature map; Obtaining a detection result of a two-wheeled vehicle area according to the first feature map; When the detection result of the two-wheeled vehicle area is that there is a two-wheeled vehicle area, acquiring an image of the two-wheeled vehicle area; Using a second target detection model to detect the two-wheeled vehicle region image, and extracting features of the two-wheeled vehicle region image using a compressed basic network block in the second target detection model to obtain a second feature map; Obtaining a detection result of the target object according to the second feature map; Obtaining a target detection result of the two-wheeled vehicle to be detected according to the detection result of the target object; Among them, the basic network block refers to a basic feature extraction network composed of multiple convolutional neural networks, and the compressed basic network block refers to a basic network block obtained by reducing the number of original convolutional neural networks; the first target detection model and the second target detection model are CenterNet models, and the compressed basic network block in the CenterNet model is an hourglass network Hourglass network block.

2. The method according to claim 1, It is characterized in that The obtaining a detection result of the target object according to the second feature map includes: The detection results of the license plate area and the objects at the handlebars in the two-wheeled vehicle area image are obtained according to the second feature map.

3. The method according to claim 2, It is characterized in that The step of obtaining the target detection result of the two-wheeled vehicle to be detected according to the detection result of the target object comprises: When a license plate area exists in the acquired two-wheeled vehicle area image and an object exists at any handlebar, acquiring the license plate area image; Recognizing license plate characters in the license plate area image; The license plate characters are compared with the standard license plate characters. If they are consistent, a target detection result indicating that the two-wheeled vehicle to be detected has failed the detection is generated.

4. The method according to claim 2, It is characterized in that The step of obtaining the detection result of the two-wheeled vehicle to be detected according to the detection result of the target object comprises: When there is no license plate area or no object at the handlebar in the acquired two-wheeled vehicle area image, a target detection result is generated indicating that the two-wheeled vehicle to be detected has passed the detection.

5. The method according to claim 1, It is characterized in that The method further comprises: When the detection result of the two-wheeled vehicle area is that there is no two-wheeled vehicle area, a target detection result that the two-wheeled vehicle to be detected has passed the detection is generated.

6. A target detection device, It is characterized in that include: A first target detection module, configured to detect a two-wheeled vehicle to be detected in an image to be detected by using a first target detection model, and extract features of the image to be detected by using a compressed basic network block in the first target detection model to obtain a first feature map; A first detection result acquisition module, used to obtain a detection result of a two-wheeled vehicle area according to the first feature map; An image acquisition module, configured to acquire an image of the two-wheeled vehicle area when the detection result of the two-wheeled vehicle area is that the two-wheeled vehicle area exists; A second target detection module is used to detect the two-wheeled vehicle area image using a second target detection model, and extract features of the two-wheeled vehicle area image using a compressed basic network block in the second target detection model to obtain a second feature map; A second detection result acquisition module, used for obtaining a detection result of the target object according to the second feature map; A detection result generating module, used for obtaining the target detection result of the two-wheeled vehicle to be detected according to the detection result of the target object; Among them, the basic network block refers to a basic feature extraction network composed of multiple convolutional neural networks, and the compressed basic network block refers to a basic network block obtained by reducing the number of original convolutional neural networks; the first target detection model and the second target detection model are CenterNet models, and the compressed basic network block in the CenterNet model is an hourglass network Hourglass network block.

7. The device according to claim 6, It is characterized in that The second detection result acquisition module is used to obtain the detection results of the license plate area and the objects at the handlebars in the two-wheeled vehicle area image according to the second feature map.

8. The device according to claim 7, It is characterized in that The detection result generation module is also used to obtain a license plate area image when a license plate area exists in the two-wheeled vehicle area image and an object exists at any handlebar; identify the license plate characters in the license plate image; compare the license plate characters with the standard license plate characters, and if they are consistent, generate a target detection result that the two-wheeled vehicle to be detected fails the detection.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.