Parking space detection method and device, computer device and storage medium
By using feature extraction and corner detection technologies in the parking space detection model, the problem of low accuracy in existing parking space detection has been solved. In particular, in the detection of adjacent parking spaces, higher detection accuracy and a reduced false positive rate have been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA AUTOMOTIVE INNOVATION CORP
- Filing Date
- 2023-04-25
- Publication Date
- 2026-05-12
AI Technical Summary
Existing parking space detection methods rely on ultrasonic sensors and radar positioning, resulting in low detection accuracy, especially when detecting corner points of adjacent parking spaces.
The parking space detection model uses image processing technology to identify the center point and corner point information of the target parking space in the image to be tested. It utilizes a feature extraction network, a parking space center point detection head network, and a parking space corner point detection head network, combined with an attention sub-network and an auxiliary learning network, to accurately filter out the location of the target parking space corner point through distance filtering conditions.
It improves the accuracy of parking space detection, especially in the detection of corner points of adjacent parking spaces, reducing the false judgment rate and achieving accurate division of adjacent parking spaces.
Smart Images

Figure CN116597412B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, particularly to the fields of object detection and autonomous driving technology, and specifically to a parking space detection method, device, computer equipment, and storage medium. Background Technology
[0002] In daily life, reversing into a parking space and parallel parking have always been challenging tasks for drivers. With the rapid development of autonomous driving in the automotive field, the field of automatic parking is also emerging. How to accurately detect available parking spaces is a key issue.
[0003] Vacant parking spaces can be identified by their corner points. However, previous methods for detecting parking spaces mostly relied on ultrasonic sensors and radar positioning, but these methods have low accuracy. Summary of the Invention
[0004] Therefore, it is necessary to provide a parking space detection method, device, computer equipment, and storage medium that can improve the accuracy of parking space detection, addressing the aforementioned technical problems.
[0005] Firstly, this application provides a parking space detection method, the method comprising:
[0006] The image to be tested is input into the parking space detection model to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space in the image to be tested; wherein, the parking space corner information includes the number of parking space corners, the position of the parking space corners and the type of parking space corners, and the target pixel is the pixel of the parking space corner corresponding to the center point of the target parking space;
[0007] If the number of parking space corner points of the target pixel is greater than the number of parking space corner point types corresponding to the target pixel, then the target parking space corner point position of the target parking space center point is selected from the parking space corner point positions based on the distance between each parking space corner point position corresponding to the target pixel and the center position of the target parking space center point. In one embodiment, the parking space detection model includes a feature extraction network, a parking space center point detection head network, and a parking space corner point detection head network;
[0008] The image to be tested is input into the parking space detection model to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space in the image, including:
[0009] The image to be tested is input into the feature extraction network to obtain the feature map of the image to be tested;
[0010] The feature map to be tested is input into the parking space center point detection head network to obtain the center position of the target parking space center point in the feature map to be tested.
[0011] The feature map to be tested and the center position are input into the parking space corner detection head network to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space.
[0012] In one embodiment, the feature map to be tested and the center position are input into the parking space corner detection head network to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space, including:
[0013] Based on the center position, extract the pixel region of the center point of the target parking space from the feature map to be tested;
[0014] The pixel region is input into the parking space corner detection head network to obtain the parking space corner information of each pixel within the pixel region; the parking space corner information also includes the type confidence of the parking space corner type;
[0015] Based on type confidence, select the parking corner information of the target pixel from the parking corner information of each pixel.
[0016] In one embodiment, the feature extraction network includes a feature encoding subnetwork and an attention subnetwork;
[0017] The image to be tested is input into the feature extraction network to obtain the feature map of the image to be tested, including:
[0018] The image to be tested is input into the feature encoding sub-network to obtain the basic feature map of the image to be tested;
[0019] The basic feature map is input into the attention sub-network to obtain the feature map to be tested.
[0020] In one embodiment, the selection of a target parking space corner position from the parking space corner positions according to the distance between each parking space corner position corresponding to the target pixel and the center position of the target parking space center point includes: selecting the parking space corner position with the smallest distance between each parking space corner position corresponding to the target pixel and the center position of the target parking space center point as the target parking space corner position of the target parking space center point.
[0021] In one embodiment, the method further includes:
[0022] Obtain a sample image, and a first label and a second label for the sample image; wherein, the first label includes the sample parking space bounding boxes in the sample image; the second label includes the center point of the sample parking space in the sample image, and the parking space corner point information of the sample pixel corresponding to the center point of the sample parking space; the sample pixel is the pixel of the parking space corner point corresponding to the center point of the sample parking space.
[0023] The sample image is input into the initial parking space detection model to obtain the prediction result; the prediction result includes the predicted center point of the parking space and the parking space corner point information of the predicted pixel point corresponding to the predicted center point of the parking space.
[0024] Determine the first difference between the prediction result and the second label;
[0025] The sample feature map of the sample image is input into the decoding sub-network in the auxiliary learning network to obtain the semantic feature map;
[0026] The sample feature map and semantic feature map are input into the segmentation subnetwork in the auxiliary learning network to obtain the predicted parking space box;
[0027] Determine the second difference between the predicted parking space frame and the first label;
[0028] Based on the first and second differences, the initial parking space detection model and the auxiliary learning network are jointly trained to obtain the trained parking space detection model.
[0029] In one embodiment, the image to be tested is input into a feature coding subnetwork to obtain a basic feature map of the image to be tested, including:
[0030] The image to be tested is input into the feature encoding sub-network, which then performs a 16-fold downsampling on the image to be tested, resulting in the basic feature map of the image to be tested.
[0031] Secondly, this application also provides a parking space detection device, which includes:
[0032] The recognition module is used to input the image to be tested into the parking space detection model to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space in the image to be tested; wherein, the parking space corner information includes the number of parking space corners, the position of the parking space corners and the type of parking space corners, and the target pixel is the pixel of the parking space corner corresponding to the center point of the target parking space;
[0033] The judgment module is used to select the target parking space corner position of the center point of the target parking space from each parking space corner position based on the distance between the position of each parking space corner corresponding to the target pixel and the center position of the target parking space center point.
[0034] Thirdly, this application also provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0035] The image to be tested is input into the parking space detection model to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space in the image to be tested; wherein, the parking space corner information includes the number of parking space corners, the position of the parking space corners and the type of parking space corners, and the target pixel is the pixel of the parking space corner corresponding to the center point of the target parking space;
[0036] If the number of parking space corner points of the target pixel is greater than the number of parking space corner point types corresponding to the target pixel, then the target parking space corner point position of the target parking space center point is selected from the parking space corner point positions based on the distance between the position of each parking space corner point corresponding to the target pixel and the center position of the target parking space center point.
[0037] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0038] The image to be tested is input into the parking space detection model to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space in the image to be tested; wherein, the parking space corner information includes the number of parking space corners, the position of the parking space corners and the type of parking space corners, and the target pixel is the pixel of the parking space corner corresponding to the center point of the target parking space;
[0039] If the number of parking space corner points of the target pixel is greater than the number of parking space corner point types corresponding to the target pixel, then the target parking space corner point position of the target parking space center point is selected from the parking space corner point positions based on the distance between the position of each parking space corner point corresponding to the target pixel and the center position of the target parking space center point.
[0040] The aforementioned parking space detection method, apparatus, computer equipment, and storage medium identify the center point of the target parking space in the image under test based on a parking space detection model, and determine the target pixel corresponding to the center point of the target parking space. Then, the parking space corner information corresponding to the target pixel is identified, that is, it is determined whether the number of parking space corners of the target pixel is greater than the number of parking space corner types corresponding to the target pixel. If so, it means that the center point of the target parking space is associated with at least two parking space corner positions of the same type at the same location, that is, at least two parking space corner positions may come from adjacent parking spaces. At this time, using distance as a filtering condition, the target parking space corner positions belonging to the center of the target parking space can be accurately filtered out, realizing the accurate division of adjacent parking space corners of adjacent parking spaces and improving the accuracy of parking space detection. Attached Figure Description
[0041] Figure 1 This is a flowchart illustrating a parking space detection method in one embodiment;
[0042] Figure 2 This is a schematic diagram showing two corner points falling into the same pixel in one embodiment;
[0043] Figure 3 This is a schematic diagram illustrating how two corner points are associated with the center point of the same parking space in one embodiment.
[0044] Figure 4 This is a schematic diagram illustrating two corner points associated with the center point of the same parking space in another embodiment;
[0045] Figure 5 This is a schematic diagram of a parking space detection model in one embodiment;
[0046] Figure 6 This is a flowchart illustrating the process of determining parking space corner information in one embodiment;
[0047] Figure 7 This is a schematic diagram of a parking space detection model in another embodiment;
[0048] Figure 8 This is a schematic diagram of the attention subnetwork in one embodiment;
[0049] Figure 9 This is a flowchart illustrating the process of determining a target pixel in one embodiment;
[0050] Figure 10 This is a schematic diagram of the initial parking space detection model in one embodiment;
[0051] Figure 11 This is a flowchart illustrating the process of training the initial parking space detection model in another embodiment;
[0052] Figure 12 This is a flowchart illustrating the parking space detection method in another embodiment;
[0053] Figure 13 This is a structural block diagram of a parking space detection device in one embodiment;
[0054] Figure 14 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0056] In daily life, reversing into a parking space and parallel parking have always been challenging tasks for drivers. With the rapid development of autonomous driving in the automotive field, the field of automatic parking is also emerging. How to accurately detect available parking spaces is a key issue.
[0057] Vacant parking spaces can be identified by their corner points. However, in the process of parking space detection, previous methods mostly relied on image processing, ultrasonic sensors, and radar positioning to detect parking spaces. When detecting the corner points of adjacent parking spaces, the detection accuracy of traditional methods is low.
[0058] Based on this, this application provides a parking space detection method, which is applicable to parking space detection scenarios, especially scenarios involving the detection of corner points of adjacent parking spaces. Optionally, this method can be executed by a computer device, which can be a server or a terminal device, such as an in-vehicle terminal. Specifically, in one embodiment, as... Figure 1 As shown, the method specifically includes the following steps:
[0059] S101, Input the image to be tested into the parking space detection model to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space in the image to be tested.
[0060] The image to be tested can be a fisheye image of the parking environment where the vehicle is located, obtained through a fisheye camera. Optionally, the image to be tested may include at least one unoccupied parking space. The parking space detection model can be a neural network used to detect parking space-related information.
[0061] Understandably, parking space corner points are an important feature of a parking space, as they represent its location. Typically, the edges of a parking space consist of two sets of parallel straight lines. Obtaining the positions of the four corner points essentially provides complete information about the parking space's location, because the lines connecting the corner points can represent the parking space lines. Therefore, parking space corner points are an inherent attribute of parking spaces and can be used to represent relevant parking space information.
[0062] For example, the image to be tested can be directly input into the parking space detection model, or the image to be tested can be preprocessed (such as size modification) before being input into the parking space detection model.
[0063] Specifically, the parking space detection model analyzes the image under test to identify the location of the center point of each target parking space and the type of parking space corresponding to each center point; then, it determines the corner point information of each target parking space. The parking space types include, but are not limited to, non-parallel parking spaces, angled parking spaces, and straight parking spaces.
[0064] For any target parking space center point, determine the target pixel point corresponding to that center point. The target pixel point corresponding to the center point of the target parking space is also the pixel point of the parking space corner point corresponding to that center point. Since one parking space corresponds to multiple parking space corner points, there are also multiple target pixel points corresponding to any target parking space center point.
[0065] In one possible implementation, the target pixel can be a pixel in the image to be tested. For example, if the resolution of the image to be tested is 512*512 (length*width), the target pixel is the corresponding pixel in 512x512. Specifically, a parking space corner point can correspond to multiple pixels in the image to be tested, and all pixels corresponding to the parking space corner point are taken as a target pixel of the parking space corner point.
[0066] In another possible implementation, the target pixel can be a corresponding pixel in a scaled image of the image under test, which contains semantic information of the image under test and preserves the relative positions of features (e.g., the center point of a parking space) with other features (e.g., the corner points of each parking space). For example, the scaled image can be a feature map of the image under test after feature extraction, which can be extracted by a feature extraction network in a parking space detection model. In this case, the target pixel in the feature map is correlated with the image under test.
[0067] The parking space corner information for the target pixel includes the number of parking space corners, their positions, and their types. Specifically, the number of parking space corners can be the number of corners within a single pixel (a grid) in the feature map to be tested; the type of parking space corner can be any one of the following: front left corner (top left corner), rear left corner, front right corner (top right corner), or rear right corner. The position of the parking space corner can be its location (x, y coordinates) in the image (or feature map) to be tested, or it can be the offset of the parking space corner relative to the center point of the corresponding target parking space (including the offset in the x-axis direction and the offset in the y-axis direction).
[0068] Furthermore, for any target parking space center point, any target pixel corresponding to that center point can only correspond to one parking space corner point type, but that target pixel can include at least one parking space corner point. For example, the target parking space center point k1 corresponds to a target pixel (x1, y1), which can only correspond to one parking space corner point type (e.g., upper right corner point) for the target parking space center point k1. In this case, even if at least two parking space corner point positions fall within the target pixel, for the target parking space center point k1, at least two parking space corner point positions are identified by the parking space detection model as the upper right corner point of the target parking space center point k1.
[0069] like Figure 2As shown, corner points a and b fall within the same target pixel and are both identified as the upper right corner by the parking space detection model (becoming the upper right corner of center point k1). However, the parking space corner positions of corner points a and b are not the same. Similarly, for the target parking space center point k2, corner points a and b may both be identified as the upper left corner of the target parking space center point k2 by the parking space detection model. But in reality, corner points a and b should come from two different parking spaces (i.e., target parking space center point k1 and target parking space center point k2).
[0070] In traditional technology, after identifying a parking space corner within the target pixel, the corner is usually assigned to the two adjacent parking spaces (or at least two parking spaces), and the two parking space corners are no longer identified or reassigned. For certain scenarios with high detection accuracy requirements, the above method has detection errors.
[0071] S102, if the number of parking space corner points of the target pixel is greater than the number of parking space corner point types corresponding to the target pixel, then select the target parking space corner point position of the target parking space center point from each parking space corner point position according to the distance between the position of each parking space corner point corresponding to the target pixel and the center position of the target parking space center point.
[0072] Optionally, for any target pixel at the center of any target parking space, if the number of parking space corner points of that target pixel is greater than the number of parking space corner point types corresponding to that target pixel (such as corner point a and corner point b in the example above), it means that at least two parking space corner points in the target pixel belong to the same parking space corner point type. In reality, the above-mentioned at least two parking space corner points should belong to two different parking spaces. However, because the similarity between the parking space corner points (corner point a and corner point b) is high, they are both identified by the parking space detection model as parking space corner points corresponding to the center of the target parking space. Therefore, in order to reduce the false positive rate, it is necessary to further filter the parking space corner point positions corresponding to the center of the target parking space.
[0073] For example, a target parking space center point corresponds to 4 parking space corner point types, and the parking space detection model identifies 5 parking space corner point positions within the 4 target pixels corresponding to the target parking space center point. In this case, it is necessary to further filter the 5 parking space corner point positions to obtain the parking space corner point positions that correspond one-to-one with each parking space corner point type, that is, 4 parking space corner point positions.
[0074] Specifically, for each target pixel in the center of any target parking space, if the number of parking space corner points of the target pixel is greater than the number of parking space corner point types corresponding to the target pixel, then calculate the distance between the position of each parking space corner point corresponding to the target pixel and the center position of the target parking space center point; then, determine the distance error based on the calculated distances (calculate the distance difference), and adjust the positions of the two corner points based on the distance error, and select the target parking space corner point position from the two adjusted corner point positions.
[0075] The aforementioned parking space detection method identifies the center point of the target parking space in the image under test based on a parking space detection model and determines the target pixel corresponding to the center point. Then, it identifies the corner point information of the parking space corresponding to the target pixel, that is, it determines whether the number of corner points of the target pixel is greater than the number of corner point types corresponding to the target pixel. If so, it means that the center point of the target parking space is associated with at least two corner point positions of the same type at the same location, that is, at least two corner point positions may come from adjacent parking spaces. At this time, using distance as a filtering condition, the corner point position of the target parking space belonging to the center of the target parking space can be accurately filtered out, realizing the accurate division of adjacent parking space corner points of adjacent parking spaces and improving the accuracy of parking space detection.
[0076] In one possible implementation, such as Figure 3 As shown, the boundaries of two adjacent parking spaces share a non-physical dividing line. In this case, provided that the distance between the parking range of the target parking space center k2 and the corner point a of the parking space meets the error range, and the distance between the parking range of the target parking space center k1 and the corner point b of the parking space meets the error range, the corresponding target parking space corner point position can be selected for the two parking spaces from the two adjusted corner point positions mentioned above.
[0077] In another possible implementation, such as Figure 4 In the scenario shown, the boundary between two adjacent parking spaces includes a first dividing line and a second dividing line in the form of a solid (e.g., in the scenario of a multi-level parking garage). In this case, each target parking space center needs to correspond to a more accurate parking range. Therefore, this embodiment provides an optional method to select the target parking space corner position from each parking space corner position based on the distance between the corner position of each parking space corresponding to the target pixel and the center position of the parking space center point. That is, it provides a way to refine S102. The specific implementation process may include: taking the parking space corner position with the smallest distance between the corner position of each parking space corresponding to the target pixel and the center position of the target parking space center point as the target parking space corner position of the target parking space center point.
[0078] Specifically, for any target pixel at the center of any target parking space, if there are at least two corner points within that target pixel, the corner point closest to the center of the target parking space is taken as the target corner point position of the target parking space center. If there is only one corner point within that target pixel, the corner point position is determined to be the closest to the center of the target parking space, and this corner point position is taken as the target corner point position of the target parking space center.
[0079] In this embodiment, for each target parking space center point, for target pixels where the number of parking space corner points is greater than the number of corresponding parking space corner point types, the parking space corner point position within that target pixel that is closest to the target parking space center point is taken as the target parking space corner point. This ensures that each target parking space center point is matched with the parking space corner point position that is closest to it, guaranteeing that there is a corresponding spacing between adjacent parking spaces and improving the parking space detection accuracy.
[0080] like Figure 5 As shown, in one embodiment, the parking space detection model 1 includes at least a feature extraction network 10, a parking space center point detection head network 20, and a parking space corner point detection head network 30. Correspondingly, this embodiment provides an optional method for inputting the image to be tested into the parking space detection model to obtain the parking space corner point information of the target pixel corresponding to the center point of the target parking space in the image to be tested, that is, a method for refining S101, such as... Figure 6 As shown, the specific implementation process may include:
[0081] S601, the image to be tested is input into the feature extraction network to obtain the feature map of the image to be tested.
[0082] The feature map to be tested is the feature map to be tested after feature extraction. In this embodiment, the image to be tested is generally a 3-channel image. The feature extraction network 10 can process multiple images at the same time, and the number of images is set to B.
[0083] In one implementation, the feature extraction network 10 can be a convolutional neural network. To ensure model speed, lightweight networks such as DLA34 can be used. Specifically, the feature extraction network 10 includes five downsampled convolutional layers, resulting in five levels of feature maps. The sizes of each feature map are 1 / 2, 1 / 4, 1 / 8, 1 / 16, and 1 / 16 of the image to be tested, with 64, 128, 256, 512, and 512 channels, respectively. A 16x downsampling method is used for the image to be tested. For some networks, the convolutional stride may need to be modified. In the convolutional layers after reaching the 16x downsampled size, the convolutional stride is set to 1. In this embodiment, the purpose of setting 16x downsampling is to ensure that each grid (corresponding to the size of a target pixel) in the feature map to be tested includes at most two parking space corner positions, thus achieving effective filtering.
[0084] Based on the feature extraction network 10, a test feature map with a 16x downsampling can be obtained. This test feature map is 1 / 16 of the scaled input test image, that is, one grid in the test feature map represents 16 pixels of the test image. The parking space detection model can determine the position of the center point of each target parking space in the test feature map, as well as the parking space corner information within the target pixel corresponding to the center point of each target parking space.
[0085] In another possible implementation, such as Figure 7 As shown, the feature extraction network 10 includes a feature encoding subnetwork 101 and an attention subnetwork 102; correspondingly, the image to be tested is input into the feature extraction network to obtain the feature map to be tested of the image to be tested, including: inputting the image to be tested into the feature encoding subnetwork to obtain the basic feature map of the image to be tested; and inputting the basic feature map into the attention subnetwork to obtain the feature map to be tested.
[0086] The feature encoding sub-network 101 may include the five downsampling convolutional layers mentioned above. In this case, the basic feature map of the image under test after 16 times downsampling can be obtained based on the feature encoding sub-network 101.
[0087] The attention subnetwork 102 can employ a global context block (GCblock), such as... Figure 8 As shown, the global context module consists of three parts: context modeling, feature transformation, and feature aggregation.
[0088] Specifically, the basic feature map (C*H*W) is input into the global context module. Context Modeling uses global attention pooling to model the context, establishing long-distance dependencies between features to extract global context information. Transform uses a bottleneck to capture inter-channel dependencies, introducing layer normalization to reduce the optimization difficulty of the network and as a regularization to improve its generalization. Fusion performs feature fusion through broadcast element-wise addition to obtain the feature map to be tested.
[0089] In this embodiment, the introduction of GC block further analyzes the global context information in the feature map to be tested based on the multi-scale feature map, and extracts the long-distance dependence between channels in the feature map to be tested, so as to focus the target information to be detected (e.g., the parking space center point and parking space corner point information of the target pixel in this embodiment), thereby improving the recognition rate and positioning accuracy of the target detection task.
[0090] S602, input the feature map to be tested into the parking space center point detection head network to obtain the center position of the target parking space center point in the feature map to be tested.
[0091] The parking space center point detection head network 20 includes corresponding convolutional layers and activation functions. The parking space center point detection head network 20 obtains the k target parking space center points with the highest confidence from the feature map to be tested; based on the channel where the target parking space center point is located, it obtains the category to which the target parking space center point belongs and determines the position of the target parking space center point in the feature map to be tested; further, based on the position of the target parking space center point in the feature map to be tested, the actual position of the target parking space center point can be further determined.
[0092] Therefore, for any target parking space center point, in the output channels of the parking space center point detection head network 20 heads, two channels are used to output the coordinates (coordinates in the x-direction and y-direction) of the target parking space center point in the feature map to be tested, and the remaining channels are used to output the confidence that the target parking space center point belongs to each parking space type.
[0093] S603 inputs the feature map to be tested and the center position into the parking space corner detection head network to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space.
[0094] The parking space corner detection head network 30 includes corresponding convolutional layers and activation functions, which are used to determine the target pixel corresponding to the center point of the target parking space from each pixel of the feature map to be tested, and to determine the parking space corner information corresponding to the target pixel.
[0095] Specifically, the parking space corner detection head network 30 includes a front left corner detection head, a rear left corner detection head, a front right corner detection head, and a rear right corner detection head. Each detection head has five output channels, one of which is used to output the confidence level of the parking space corner type, and the other four channels are used to output the coordinates (or offset) of the parking space corner. In addition, the parking space corner detection head network 30 also includes a corner count detection head, which is used to identify the number of corners in each grid (pixel) in the feature map to be tested. Therefore, the output channel of the corner count detection head is used to output the number of corners.
[0096] Optionally, when determining the parking space corner information of a target pixel using the parking space corner detection head network 30 for any target parking space center point: First, determine the pixel region in the feature map to be tested that is associated with the target parking space center point, and take the pixels in the pixel region as associated pixels; for any associated pixel, the corner number detection head detects the number of corners in the associated pixel, and then the corner number detection head outputs the number of corners to the left front corner detection head, left rear corner detection head, right front corner detection head and right rear corner detection head respectively; then, the left front corner detection head, left rear corner detection head, right front corner detection head and right rear corner detection head output the confidence level of the associated pixel belonging to each parking space corner type respectively, and based on each confidence level, determine the target pixel, and output the parking space corner position corresponding to each target pixel based on the corresponding number of corners.
[0097] Specifically, for any target pixel obtained above, if there is only one parking space corner point within the target pixel, then each detection head (left front corner detection head, left rear corner detection head, right front corner detection head, and right rear corner detection head) uses only two output channels when outputting the parking space corner point position. One channel is used to output the x-axis coordinate (or offset) of the parking space corner point position, and the other channel is used to output the y-axis coordinate (or offset) of the parking space corner point position. If there are two parking space corner points within the target pixel, then each detection head uses four output channels when outputting the parking space corner point position. The first channel is used to output the x-axis coordinate (or offset) of one parking space corner point, and the second channel is used to output the y-axis coordinate (or offset) of that parking space corner point; the third channel is used to output the x-axis coordinate (or offset) of the other parking space corner point, and the second channel is used to output the y-axis coordinate (or offset) of the other parking space corner point.
[0098] Among them, when determining the pixel region within the feature map to be tested that is associated with the center point of the target parking space, such as Figure 9 As shown, the specific process may include the following:
[0099] S901, based on the center position, extracts the pixel region of the center point of the target parking space from the feature map to be tested.
[0100] In one possible implementation, for each target parking space center point, a pixel region can be determined based on the position of the target parking space center point and a preset region range parameter. The preset region range parameter can be set based on empirical values or obtained from other calculation models. For example, the preset region range parameter can be based on the range of the parking space detection box. In another possible implementation, for each target parking space center point, when generating the pixel region, a preset number of pixels can be added outwards from the target parking space center point to obtain the pixel region corresponding to the target parking space center point. This pixel region ensures that a complete parking space can be obtained in the image under test.
[0101] S902 inputs the pixel area into the parking space corner detection head network to obtain the parking space corner information of each pixel within the pixel area.
[0102] Specifically, for each pixel in the pixel region, the parking space corner information also includes the type confidence of the parking space corner type. Optionally, the type confidence of the parking space corner type for each pixel includes four confidence values, which are the confidence values of the pixel belonging to each parking space corner type output by the aforementioned left front corner detection head, left rear corner detection head, right front corner detection head, and right rear corner detection head.
[0103] Specifically, for any given pixel, the corner detection head in the parking space corner detection head network 30 detects the number of corners within that pixel, and then outputs the number of corners to the left front corner detection head, left rear corner detection head, right front corner detection head, and right rear corner detection head respectively; the left front corner detection head, left rear corner detection head, right front corner detection head, and right rear corner detection head of the parking space corner detection head network 30 respectively output the four confidence scores corresponding to that pixel, as well as the corresponding number of parking space corner positions corresponding to the number of corners within that pixel.
[0104] S903 selects the parking corner information of the target pixel from the parking corner information of each pixel based on the type confidence level.
[0105] Specifically, the parking space corner detection head network 30 determines the pixel with the maximum confidence corresponding to each parking space corner type based on the confidence of each pixel, and takes the pixel as the target pixel. The target pixel includes at least one corner position.
[0106] In one embodiment, such as Figure 10As shown, the initial parking space detection model 1' includes an initial feature extraction network, a parking space center point detection head network 20', and a parking space corner point detection head network 30'; wherein, the initial feature extraction network includes an encoding sub-network 101' and an attention sub-network 102'; the initial parking space detection model is also connected to an auxiliary learning network, which includes a decoding sub-network 40 and a semantic segmentation sub-network 50;
[0107] like Figure 11 As shown, the parking space detection method also includes:
[0108] S1101, Obtain the sample image, and the first and second labels of the sample image.
[0109] The first label includes the parking space bounding boxes of each sample image, and the auxiliary learning network is trained using the first label.
[0110] The second label includes the center point of the sample parking space in the sample image, and the corner point information of the sample pixel corresponding to the center point of the sample parking space. The sample pixel is the pixel of the corner point of the sample parking space corresponding to the center point of the sample parking space. Specifically, the initial parking space center point detection head network 20' and parking space corner point detection head network 30' are trained using the second label.
[0111] S1102, input the sample image into the initial parking space detection model to obtain the prediction result.
[0112] The prediction results include the predicted center point of the parking space and the corner point information of the predicted pixel corresponding to the predicted center point of the parking space.
[0113] Specifically, the sample image is input into the initial feature extraction network. The encoding subnetwork 101' and attention subnetwork 102' in the initial feature extraction network extract features from the sample image to obtain a sample feature map. The initial parking space center point detection head network 20' and parking space corner point detection head network 30' are used to identify the sample feature map to obtain the prediction result.
[0114] S1103, determine the first difference between the prediction result and the second label.
[0115] The first difference represents the difference between the parking space corner information of the predicted parking space center point and the parking space corner information of the sample parking space center point, as well as the difference between the predicted parking space center point and the sample parking space center point in the prediction result.
[0116] S1104, input the sample feature map of the sample image into the decoding sub-network in the auxiliary learning network to obtain the semantic feature map.
[0117] The input to the decoding sub-network 40 is the sample feature map mentioned above, and the sample feature map includes multiple feature maps of different scales.
[0118] Specifically, the decoding sub-network 40 and the initial encoding sub-network 101' refer to the U-net network structure. The decoding sub-network 40 includes multiple upsampling convolutional layers of different scales, which are used to generate multiple feature maps of the same scale as those in the initial encoding sub-network 101'. The feature maps of the same scale generated during the upsampling and downsampling processes are combined, that is, the feature layers of the same scale in the encoding sub-network 101' and the decoding sub-network 40 are connected. Therefore, the output of the decoding sub-network 40 is a multi-scale semantic feature map after upsampling.
[0119] S1105, the sample feature map and semantic feature map are input into the segmentation subnetwork in the auxiliary learning network to obtain the predicted parking space box.
[0120] The semantic segmentation sub-network 50 is a semantic segmentation network model. The output of the semantic segmentation sub-network 50 is the pre-stored parking space bounding boxes in the image to be tested. The semantic segmentation sub-network 50 fuses low-level and high-level feature information and uses multiple prediction methods to combine deep and shallow features to obtain more accurate parking space bounding box prediction results.
[0121] S1106, Determine the second difference between the predicted parking space frame and the first label.
[0122] The second difference represents the offset between the predicted parking space frame and the sample parking space frame.
[0123] S1107, Based on the first difference and the second difference, the initial parking space detection model and the auxiliary learning network are jointly trained to obtain the trained parking space detection model.
[0124] Specifically, during the training phase, when training the initial parking space center point detection head network 20' and parking space corner point detection head network 30' using the first difference and the second label, the L1 loss function can be used; at the same time, the auxiliary learning network is trained synchronously using the first label.
[0125] Specifically, after training, based on the initial encoding subnetwork 101' and attention subnetwork 102', parking space center point detection head network 20' and parking space corner point detection head network 30', the encoding subnetwork 101 and attention subnetwork 102, parking space center point detection head network 20 and parking space corner point detection head network 30 in parking space detection model 1 are obtained.
[0126] In this embodiment, during the training process, the semantic segmentation network 50 is added for supervision, which speeds up the parking space detection model to learn the position of the parking space line, and the network converges faster, making the localization of parking space corner information more accurate. In the application stage (online inference stage), the parking space detection model only includes the trained encoding sub-network 101, attention sub-network 102, parking space center point detection head 20 and parking space corner point detection head 30. The model learns the results of the training stage, is more robust, and the model structure in the application stage is more lightweight, resulting in faster detection speed.
[0127] For example, based on the above embodiments, this embodiment provides a parking space detection method, applied to... Figure 7 The parking space detection model 1 in the text can specifically include the following process;
[0128] S1201, Input the image to be tested into the feature coding sub-network to obtain the basic feature map of the image to be tested;
[0129] S1202, Input the basic feature map into the attention sub-network to obtain the feature map to be tested;
[0130] S1203, Input the feature map to be tested into the parking space center point detection head network to obtain the center position of the target parking space center point in the feature map to be tested;
[0131] S1204, Extract the pixel region of the center point of the target parking space from the feature map to be tested based on the center position;
[0132] S1205, input the pixel area into the parking space corner detection head network to obtain the parking space corner information of each pixel in the pixel area;
[0133] The parking space corner information also includes the type confidence of the parking space corner type;
[0134] S1206, Based on the type confidence, select the parking corner information of the target pixel from the parking corner information of each pixel;
[0135] Among them, the parking space corner point information includes the number of parking space corner points, the location of the parking space corner points and the type of parking space corner points, and the target pixel point is the pixel point of the parking space corner point corresponding to the center point of the parking space;
[0136] S1207, If the number of parking space corner points of the target pixel is greater than the number of parking space corner point types corresponding to the target pixel, then select the target parking space corner point position of the target parking space center point from each parking space corner point position according to the distance between the position of each parking space corner point corresponding to the target pixel and the center position of the target parking space center point.
[0137] Among the various parking space corner points corresponding to the target pixel, the parking space corner point with the smallest distance from the center point of the target parking space center point is taken as the target parking space corner point position of the target parking space center point.
[0138] The specific processes of S1201-S1207 described above can be found in the description of the above method embodiments. Their implementation principles and technical effects are similar, and will not be repeated here.
[0139] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0140] Based on the same inventive concept, this application also provides a parking space detection device for implementing the parking space detection method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more parking space detection device embodiments provided below can be found in the limitations of the parking space detection method described above, and will not be repeated here.
[0141] In one embodiment, such as Figure 13 As shown, a parking space detection device 100 is provided, including: an identification module 110 and a judgment module 120, wherein:
[0142] The recognition module 110 is used to input the image to be tested into the parking space detection model to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space in the image to be tested; wherein, the parking space corner information includes the number of parking space corners, the position of the parking space corners and the type of parking space corners, and the target pixel is the pixel of the parking space corner corresponding to the center point of the target parking space;
[0143] The judgment module 120 is used to select the target parking space corner position of the target parking space center point from each parking space corner position based on the distance between the position of each parking space corner point corresponding to the target pixel and the center position of the target parking space center point if the number of parking space corner points of the target pixel is greater than the number of parking space corner point types corresponding to the target pixel.
[0144] In one embodiment, the parking space detection model includes a feature extraction network, a parking space center point detection head network, and a parking space corner point detection head network; the recognition module 110 includes:
[0145] The feature extraction submodule is used to input the image to be tested into the feature extraction network to obtain the feature map of the image to be tested;
[0146] The center point detection submodule is used to input the image to be tested into the feature extraction network to obtain the feature map of the image to be tested;
[0147] The corner detection submodule is used to input the feature map to be tested and the center position into the parking space corner detection head network to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space.
[0148] In one embodiment, the corner detection submodule is further configured to: extract the pixel region of the center point of the target parking space from the feature map to be tested based on the center position;
[0149] The pixel region is input into the parking space corner detection head network to obtain the parking space corner information of each pixel within the pixel region; the parking space corner information also includes the type confidence of the parking space corner type;
[0150] Based on type confidence, select the parking corner information of the target pixel from the parking corner information of each pixel.
[0151] In one embodiment, the feature extraction network includes a feature encoding subnetwork and an attention subnetwork; the feature extraction submodule is further configured to: input the image to be tested into the feature encoding subnetwork to obtain the basic feature map of the image to be tested;
[0152] The basic feature map is input into the attention sub-network to obtain the feature map to be tested.
[0153] In one embodiment, the determining module 120 is further configured to: take the parking space corner position with the smallest distance from the center position of the center point of the target parking space among the parking space corner positions corresponding to the target pixel as the target parking space corner position of the center point of the target parking space.
[0154] In one embodiment, the parking space detection device further includes a training module, which is used for:
[0155] Obtain a sample image, and a first label and a second label for the sample image; wherein, the first label includes the sample parking space bounding boxes in the sample image; the second label includes the center point of the sample parking space in the sample image, and the parking space corner point information of the sample pixel corresponding to the center point of the sample parking space; the sample pixel is the pixel of the parking space corner point corresponding to the center point of the sample parking space.
[0156] The sample image is input into the initial parking space detection model to obtain the prediction result; the prediction result includes the predicted center point of the parking space and the parking space corner point information of the predicted pixel point corresponding to the predicted center point of the parking space.
[0157] Determine the first difference between the prediction result and the second label;
[0158] The sample feature map of the sample image is input into the decoding sub-network in the auxiliary learning network to obtain the semantic feature map;
[0159] The sample feature map and semantic feature map are input into the segmentation subnetwork in the auxiliary learning network to obtain the predicted parking space box;
[0160] Determine the second difference between the predicted parking space frame and the first label;
[0161] Based on the first and second differences, the initial parking space detection model and the auxiliary learning network are jointly trained to obtain the trained parking space detection model.
[0162] In one embodiment, the feature extraction submodule is further configured to:
[0163] The image to be tested is input into the feature encoding sub-network, which then performs a 16-fold downsampling on the image to be tested, resulting in the basic feature map of the image to be tested.
[0164] Each module in the aforementioned parking space detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0165] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 14As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a parking space detection method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0166] Those skilled in the art will understand that Figure 14 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0167] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0168] The image to be tested is input into the parking space detection model to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space in the image to be tested; wherein, the parking space corner information includes the number of parking space corners, the position of the parking space corners and the type of parking space corners, and the target pixel is the pixel of the parking space corner corresponding to the center point of the target parking space;
[0169] If the number of parking space corner points of the target pixel is greater than the number of parking space corner point types corresponding to the target pixel, then the target parking space corner point position of the target parking space center point is selected from the parking space corner point positions based on the distance between the position of each parking space corner point corresponding to the target pixel and the center position of the target parking space center point.
[0170] In one embodiment, the parking space detection model includes a feature extraction network, a parking space center point detection head network, and a parking space corner point detection head network. When the processor executes a computer program to input the image to be tested into the parking space detection model and obtains the parking space corner point information of the target pixel corresponding to the center point of the target parking space in the image to be tested, the following steps are specifically implemented: inputting the image to be tested into the feature extraction network to obtain the feature map to be tested; inputting the feature map to be tested into the parking space center point detection head network to obtain the center position of the target parking space center point in the feature map to be tested; inputting the feature map to be tested and the center position into the parking space corner point detection head network to obtain the parking space corner point information of the target pixel corresponding to the center point of the target parking space. In one embodiment, when the processor executes the logic of inputting the computer program to the feature map to be tested and the center position into the parking space corner detection head network to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space, the following steps are specifically implemented: extracting the pixel region of the center point of the target parking space from the feature map to be tested based on the center position; inputting the pixel region into the parking space corner detection head network to obtain the parking space corner information of each pixel within the pixel region; wherein, the parking space corner information also includes the type confidence of the parking space corner type; and selecting the parking space corner information of the target pixel from the parking space corner information of each pixel based on the type confidence.
[0171] In one embodiment, the feature extraction network includes a feature encoding subnetwork and an attention subnetwork. When the processor executes a computer program to input the image to be tested into the feature extraction network to obtain the feature map to be tested of the image to be tested, the following steps are specifically implemented: inputting the image to be tested into the feature encoding subnetwork to obtain the basic feature map of the image to be tested; inputting the basic feature map into the attention subnetwork to obtain the feature map to be tested.
[0172] In one embodiment, when the processor executes the logic of selecting the target parking space corner position from the parking space corner positions based on the distance between the parking space corner positions corresponding to the target pixel and the center position of the target parking space center point, the following steps are specifically implemented: the parking space corner position with the smallest distance between the parking space corner positions corresponding to the target pixel and the center position of the target parking space center point is taken as the target parking space corner position of the target parking space center point.
[0173] In one embodiment, when the processor executes the computer program, it further implements the following steps: acquiring a sample image, and a first label and a second label for the sample image; wherein the first label includes each sample parking space bounding box in the sample image; the second label includes the center point of the sample parking space in the sample image, and the parking space corner information of the sample pixel corresponding to the center point of the sample parking space; the sample pixel is the pixel of the parking space corner corresponding to the center point of the sample parking space; inputting the sample image into an initial parking space detection model to obtain a prediction result; wherein the prediction result includes the predicted center point of the parking space, and the parking space corner information of the predicted pixel corresponding to the center point of the predicted parking space; determining a first difference between the prediction result and the second label; inputting the sample feature map of the sample image into the decoding subnetwork in the auxiliary learning network to obtain a semantic feature map; inputting the sample feature map and the semantic feature map into the segmentation subnetwork in the auxiliary learning network to obtain a predicted parking space bounding box; determining a second difference between the predicted parking space bounding box and the first label; and jointly training the initial parking space detection model and the auxiliary learning network based on the first difference and the second difference to obtain a trained parking space detection model.
[0174] In one embodiment, when the processor executes a computer program to input the image to be tested into a feature coding subnetwork to obtain the basic feature map of the image to be tested, the following steps are specifically implemented:
[0175] The image to be tested is input into the feature encoding sub-network, which then performs a 16-fold downsampling on the image to be tested, resulting in the basic feature map of the image to be tested.
[0176] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0177] The image to be tested is input into the parking space detection model to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space in the image to be tested; wherein, the parking space corner information includes the number of parking space corners, the position of the parking space corners and the type of parking space corners, and the target pixel is the pixel of the parking space corner corresponding to the center point of the target parking space;
[0178] If the number of parking space corner points of the target pixel is greater than the number of parking space corner point types corresponding to the target pixel, then the target parking space corner point position of the target parking space center point is selected from the parking space corner point positions based on the distance between the position of each parking space corner point corresponding to the target pixel and the center position of the target parking space center point.
[0179] In one embodiment, the parking space detection model includes a feature extraction network, a parking space center point detection head network, and a parking space corner point detection head network. When the logic of the computer program inputting the image to be tested into the parking space detection model to obtain the parking space corner point information of the target pixel corresponding to the center point of the target parking space in the image to be tested is executed by the processor, the following steps are specifically implemented: inputting the image to be tested into the feature extraction network to obtain the feature map to be tested; inputting the feature map to be tested into the parking space center point detection head network to obtain the center position of the target parking space center point in the feature map to be tested; inputting the feature map to be tested and the center position into the parking space corner point detection head network to obtain the parking space corner point information of the target pixel corresponding to the center point of the target parking space.
[0180] In one embodiment, when the logic of the computer program inputting the feature map to be tested and the center position into the parking space corner detection head network to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space is executed by the processor, the following steps are specifically implemented: extracting the pixel region of the target parking space center point from the feature map to be tested based on the center position; inputting the pixel region into the parking space corner detection head network to obtain the parking space corner information of each pixel within the pixel region; wherein, the parking space corner information also includes the type confidence of the parking space corner type; and selecting the parking space corner information of the target pixel from the parking space corner information of each pixel based on the type confidence.
[0181] In one embodiment, the feature extraction network includes a feature encoding subnetwork and an attention subnetwork. When the logic of the computer program inputting the image to be tested into the feature extraction network to obtain the feature map to be tested of the image to be tested is executed by the processor, the following steps are specifically implemented: inputting the image to be tested into the feature encoding subnetwork to obtain the basic feature map of the image to be tested; inputting the basic feature map into the attention subnetwork to obtain the feature map to be tested.
[0182] In one embodiment, when the logic of selecting the target parking space corner position from the parking space corner positions based on the distance between the target pixel and the center position of the target parking space center point is executed by the processor, the following steps are specifically implemented: the parking space corner position with the smallest distance between the target pixel and the center position of the target parking space center point is taken as the target parking space corner position of the target parking space center point.
[0183] In one embodiment, when the computer program is executed by a processor, it further implements the following steps: acquiring a sample image, and a first label and a second label for the sample image; wherein the first label includes each sample parking space bounding box in the sample image; the second label includes the center point of the sample parking space in the sample image, and the parking space corner information of the sample pixel corresponding to the center point of the sample parking space; the sample pixel is the pixel of the parking space corner corresponding to the center point of the sample parking space; inputting the sample image into an initial parking space detection model to obtain a prediction result; wherein the prediction result includes the predicted center point of the parking space, and the parking space corner information of the predicted pixel corresponding to the center point of the predicted parking space; determining a first difference between the prediction result and the second label; inputting the sample feature map of the sample image into the decoding subnetwork in the auxiliary learning network to obtain a semantic feature map; inputting the sample feature map and the semantic feature map into the segmentation subnetwork in the auxiliary learning network to obtain a predicted parking space bounding box; determining a second difference between the predicted parking space bounding box and the first label; and jointly training the initial parking space detection model and the auxiliary learning network based on the first difference and the second difference to obtain a trained parking space detection model.
[0184] In one embodiment, when the logic of the computer program inputting the image to be tested into the feature encoding sub-network to obtain the basic feature map of the image to be tested is executed by the processor, the following steps are specifically implemented: inputting the image to be tested into the feature encoding sub-network, and performing a 16-fold downsampling on the image to be tested through the feature encoding sub-network to obtain the basic feature map of the image to be tested.
[0185] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this 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, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0186] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.
[0187] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A parking space detection method, characterized in that, The method includes: The image to be tested is input into the parking space detection model to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space in the image to be tested; wherein, the parking space corner information includes the number of parking space corners, the position of the parking space corners and the type of parking space corners, and the target pixel is the pixel of the parking space corner corresponding to the center point of the target parking space; If the number of parking space corner points of the target pixel is greater than the number of parking space corner point types corresponding to the target pixel, then the target parking space corner point position of the target parking space center point is selected from the parking space corner point positions according to the distance between each parking space corner point position corresponding to the target pixel and the center position of the target parking space center point. The parking space detection model is obtained by jointly training an initial parking space detection model and an auxiliary learning network based on a first difference and a second difference. The first difference represents the difference between the predicted parking space center point and the pre-labeled parking space center point of the sample image, as well as the difference between the predicted parking space center point and the sample parking space center point. The second difference represents the difference between the predicted parking space bounding box and the pre-labeled sample parking space bounding box. The auxiliary learning network is trained using the sample parking space bounding boxes.
2. The method according to claim 1, characterized in that, The parking space detection model includes a feature extraction network, a parking space center point detection head network, and a parking space corner point detection head network; The step of inputting the image to be tested into the parking space detection model to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space in the image to be tested includes: The image to be tested is input into the feature extraction network to obtain the feature map of the image to be tested; The feature map to be tested is input into the parking space center point detection head network to obtain the center position of the target parking space center point in the feature map to be tested. The feature map to be tested and the center position are input into the parking space corner detection head network to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space.
3. The method according to claim 2, characterized in that, The step of inputting the feature map to be tested and the center position into the parking space corner detection head network to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space includes: Based on the center position, extract the pixel region of the center point of the target parking space from the feature map to be tested; The pixel region is input into the parking space corner detection head network to obtain parking space corner information for each pixel within the pixel region; wherein, the parking space corner information also includes the type confidence of the parking space corner type; Based on the type confidence level, select the parking corner information of the target pixel from the parking corner information of each pixel.
4. The method according to claim 2, characterized in that, The feature extraction network includes a feature encoding subnetwork and an attention subnetwork; The step of inputting the image to be tested into the feature extraction network to obtain the feature map of the image to be tested includes: The image to be tested is input into the feature encoding sub-network to obtain the basic feature map of the image to be tested; The basic feature map is input into the attention subnetwork to obtain the feature map to be tested.
5. The method according to claim 1, characterized in that, The step of selecting the target parking space corner position from the parking space corner positions based on the distance between the target pixel's corresponding parking space corner position and the center position of the target parking space center point includes: The parking space corner position with the smallest distance to the center position of the target parking space center point among all the parking space corner positions corresponding to the target pixel is taken as the target parking space corner position of the target parking space center point.
6. The method according to claim 1, characterized in that, The method further includes: Acquire a sample image, and a first label and a second label for the sample image; wherein, the first label includes each sample parking space frame in the sample image; the second label includes the center point of the sample parking space in the sample image, and the parking space corner information of the sample pixel corresponding to the center point of the sample parking space; the sample pixel is the pixel of the parking space corner corresponding to the center point of the sample parking space. The sample image is input into the initial parking space detection model to obtain the prediction result; wherein, the prediction result includes the predicted parking space center point and the parking space corner point information of the predicted pixel point corresponding to the predicted parking space center point; Determine the first difference between the prediction result and the second label; The sample feature map of the sample image is input into the decoding sub-network in the auxiliary learning network to obtain the semantic feature map; The sample feature map and the semantic feature map are input into the segmentation subnetwork in the auxiliary learning network to obtain the predicted parking space box; Determine the second difference between the predicted parking space frame and the first label; Based on the first difference and the second difference, the initial parking space detection model and the auxiliary learning network are jointly trained to obtain the trained parking space detection model.
7. The method according to claim 4, characterized in that, The step of inputting the image to be tested into the feature encoding sub-network to obtain the basic feature map of the image to be tested includes: The image to be tested is input into the feature encoding sub-network, and the image to be tested is downsampled by 16 times by the feature encoding sub-network to obtain the basic feature map of the image to be tested.
8. A parking space detection device, characterized in that, The device includes: The recognition module is used to input the image to be tested into the parking space detection model to obtain the parking space corner information of the target pixel corresponding to the center point of the target parking space in the image to be tested; wherein, the parking space corner information includes the number of parking space corners, the position of the parking space corners and the type of parking space corners, and the target pixel is the pixel of the parking space corner corresponding to the center point of the target parking space; The judgment module is used to select the target parking space corner position of the target parking space center point from each parking space corner position based on the distance between each parking space corner position corresponding to the target pixel and the center position of the target parking space center point if the number of parking space corner points of the target pixel is greater than the number of parking space corner point types corresponding to the target pixel. The parking space detection model is obtained by jointly training an initial parking space detection model and an auxiliary learning network based on a first difference and a second difference. The first difference represents the difference between the predicted parking space center point and the pre-labeled parking space center point of the sample image, as well as the difference between the predicted parking space center point and the sample parking space center point. The second difference represents the difference between the predicted parking space bounding box and the pre-labeled sample parking space bounding box. The auxiliary learning network is trained using the sample parking space bounding boxes.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.