Training method and device of parking space line detection model and vehicle
By using preset training sets and preset loss functions during the training process of the parking line detection model, we ensure that each training batch contains non-standard parking sample images and the model is adjusted by parameterizing the problem of inaccurate detection of parking line boundary areas, and higher parking detection accuracy and automatic parking success rate are achieved.
Patent Information
- Application Number
- CN202411368255.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-04-11
AI Technical Summary
The existing parking space line detection model has poor detection and segmentation of parking space line boundary areas, resulting in inaccurate parking space detection during automatic parking.
A training method for parking space line detection model is proposed. By obtaining a preset training set, the training samples used in each training batch are generated, including non-standard parking space sample images, and the model is parameterized based on the preset loss function to improve the detection accuracy of the edge area of parking space line.
Through this method, the parking space line detection model can more accurately detect and divide the parking space line boundary area, improve the vehicle's parking space detection accuracy during automatic parking, and thus improve the success rate of automatic parking.
Smart Images

Figure CN119810788A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of automatic parking technology, and specifically relates to a training method, device and vehicle for a parking space line detection model, as well as a parking space detection method, a parking space detection device, a computer-readable storage medium and a computer program product. Background Art
[0002] Parking space detection is one of the key technologies of automatic parking technology and is a prerequisite for successful parking. Before the vehicle performs automatic parking, the surrounding environment data can be collected through sensors, and then, based on the collected data, the parking space is detected using a pre-trained parking space line detection model to determine a suitable parking space. In the process of implementing the present invention, the inventor found that the existing parking space line detection model has poor detection and segmentation effects on the parking space line boundary area, resulting in inaccurate parking space detection during the automatic parking process. Summary of the invention
[0003] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a parking space detection method, device and vehicle, as well as a parking space line detection model training method, parking space detection device, computer-readable storage medium and computer program product, which can solve the technical problem that the existing parking space line detection model has poor detection and segmentation effect on the parking space line boundary area, thereby causing inaccurate parking space detection during the automatic parking process.
[0004] In a first aspect, an embodiment of the present application provides a method for training a parking space line detection model, comprising:
[0005] Obtain a preset training set, which includes non-standard parking space sample images and standard parking space sample images;
[0006] Generate training samples used in each training batch based on a preset training set, where the training samples used in each training batch include non-standard parking space sample images;
[0007] The parking space line detection model is trained based on the training samples used in each training batch.
[0008] In some embodiments, the proportion of non-standard parking space images included in the training samples used in each training batch is greater than or equal to a first proportion, and the first proportion is the proportion of non-standard parking space sample images in a preset training set.
[0009] In some embodiments, the standard parking space sample images include standard indoor parking space sample images and standard outdoor parking space sample images;
[0010] The proportion of standard indoor parking space sample images in the training samples used in each training batch is less than or equal to a second proportion, where the second proportion is the proportion of standard indoor parking space sample images in a preset training set; and / or,
[0011] The proportion of standard outdoor parking space sample images in the training samples used in each training batch is less than or equal to a third proportion, and the third proportion is the proportion of standard outdoor parking space sample images in a preset training set.
[0012] In some embodiments, it also includes:
[0013] The parameters of the parking space line detection model are adjusted based on a preset loss function, in which the weight of the loss value of the pixel points in the edge area of the parking space line in the parking space image is set to be greater than the weight of the loss value of the pixel points in other areas of the parking space image.
[0014] In some embodiments, adjusting parameters of the parking space line detection model based on a preset loss function includes:
[0015] Detect the parking space image based on the parking space line detection model trained in the current round to obtain the detection result;
[0016] Obtain loss values corresponding to pixels in the parking space image based on the detection results;
[0017] Obtaining a model loss value of a parking space line detection model based on loss values corresponding to pixels in the parking space image and a preset loss function, wherein a weight of a loss value of a pixel in an edge region of the parking space line in the parking space image is set to be greater than a weight of a loss value of a pixel in other regions of the parking space image;
[0018] Adjust the parameters of the parking space line detection model trained in the current round based on the model loss value.
[0019] In some embodiments, the preset loss function is:
[0020]
[0021] Wherein, L is the model loss value of the parking space line detection model, N is the number of pixels in the parking space image, m is the number of pixels in the parking space line edge area in the parking space image, n is the number of pixels in other areas of the parking space image, and L l is the loss value corresponding to the pixel in the parking space image, α is the weight of the loss value of the pixel in the edge area of the parking space line in the parking space image, β is the weight of the loss value of the pixel in other areas of the parking space image, and α is greater than β.
[0022] In a second aspect, an embodiment of the present application provides a parking space detection method, including:
[0023] Based on the parking space line detection model obtained by the training method of the first aspect, the parking space image to be detected is detected to obtain a parking space detection result of the parking space image to be detected.
[0024] In some embodiments, it also includes:
[0025] Image processing technology is used to optimize the position of the parking space detection result to obtain a parking space detection result after position optimization.
[0026] In some embodiments, the parking space detection result includes a parking space line pattern obtained by segmenting the parking space image to be detected, and the parking space detection result is optimized by using image processing technology to obtain a parking space detection result after position optimization, including:
[0027] Using image processing technology to obtain the middle line of each parking space line in the parking space line pattern;
[0028] Based on the middle lines of each parking space line in the parking space line pattern, a parking space detection result after position optimization is determined.
[0029] In some embodiments, the method of obtaining the middle line of each parking space line in the parking space line pattern by using image processing technology includes:
[0030] Determine the corner point position in the parking space line pattern, and obtain the parking space line pattern at the corner point position;
[0031] Performing line segment detection on the parking space line pattern at the corner point position based on a line segment detection algorithm to obtain a first line segment and a second line segment of each parking space line edge in the parking space line pattern;
[0032] A middle line of each parking space line in the parking space line pattern is determined based on the first line segment and the second line segment.
[0033] In some embodiments, the above-mentioned line segment detection algorithm is used to perform line segment detection on the parking space line pattern at the corner point position to obtain the first line segment and the second line segment of each parking space line edge in the parking space line pattern, including:
[0034] Performing line segment detection on the parking space line pattern at the corner point position based on a line segment detection algorithm to obtain at least two line segments;
[0035] Based on the slopes and point sequences of at least two line segments, a first line segment and a second line segment of each parking space line edge in the parking space line pattern are determined.
[0036] In some embodiments, the above-mentioned method of determining the parking space detection result after the position optimization based on the middle line of each parking space line in the parking space line pattern includes:
[0037] Based on the middle lines of each parking space line in the parking space line pattern, as well as the corner point positions and parking space size feature information, the parking space detection result after position optimization is determined.
[0038] In some embodiments, at least one of the following is also included:
[0039] Determine the width of the parking space entrance;
[0040] Determine whether the parking space is a vertical parking space or a horizontal parking space;
[0041] Determine the parking angle.
[0042] In a third aspect, an embodiment of the present application provides an automatic parking method, including:
[0043] Obtaining a parking space detection result based on the method of the second aspect;
[0044] The vehicle is controlled to park based on the parking space detection result.
[0045] In a fourth aspect, an embodiment of the present application provides a training device for a parking space line detection model, comprising:
[0046] A data acquisition module, used to acquire a preset training set, wherein the preset training set includes non-standard parking space sample images and standard parking space sample images;
[0047] A data processing module, used for generating training samples used in each training batch based on a preset training set, wherein the training samples used in each training batch include non-standard parking space sample images;
[0048] The model training module is used to train the parking space line detection model based on the training samples used in each training batch.
[0049] In a fifth aspect, an embodiment of the present application provides a parking space detection device, including:
[0050] The parking space detection module is used to detect the parking space image to be detected by using the parking space line detection model obtained by the above-mentioned training device to obtain the parking space detection result of the parking space image to be detected.
[0051] In a sixth aspect, an embodiment of the present application provides an automatic parking device, comprising the above-mentioned parking space detection device, and a parking control module for controlling the vehicle to park based on the parking space detection result of the parking space detection device.
[0052] In the seventh aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory, the memory storing a program or instruction that can be run on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the training method of the parking space detection model as described in the first aspect; or, when executed by the processor, the program or instruction, when executed by the processor, implements the steps of the parking space detection method as described in the second aspect; or, when executed by the processor, the program or instruction, when executed by the processor, implements the steps of the automatic parking method as described in the third aspect.
[0053] In an eighth aspect, an embodiment of the present application provides a vehicle, comprising the above-mentioned electronic device, wherein the memory of the electronic device stores a program or instruction that can be run on a processor, and when the program or instruction is executed by the processor, the steps of the parking space detection method as described in the second aspect are implemented; or, when the program or instruction is executed by the processor, the steps of the automatic parking method as described in the third aspect are implemented.
[0054] In the ninth aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that a program or instruction is stored on the readable storage medium, and when the program or instruction is executed by the processor, the steps of the training method of the parking space detection model as described in the first aspect are implemented; or, when the program or instruction is executed by the processor, the steps of the parking space detection method as described in the second aspect are implemented; or, when the program or instruction is executed by the processor, the steps of the automatic parking method as described in the third aspect are implemented.
[0055] In the tenth aspect, an embodiment of the present application provides a computer program product, which, when executed by a processor of a vehicle, implements the steps of the training method of the parking space detection model as described in the first aspect; or, when the program or instructions are executed by the processor, implements the steps of the parking space detection method as described in the second aspect; or, when the program or instructions are executed by the processor, implements the steps of the automatic parking method as described in the third aspect.
[0056] The technical solution provided by the present application requires first obtaining a preset training set, then generating training samples used for each batch based on the preset training set, wherein the training samples used for each batch include non-standard parking space sample images, and finally training the parking line detection model based on the training samples used for each batch, wherein the preset training set includes non-standard parking space sample images and standard parking space sample images. Since the above technical solution ensures that the training samples used for each training batch include non-standard parking space sample images during the training of the parking line detection model, the data set is balanced, and the model can be exposed to more comprehensive and representative sample data, thereby enabling the model to more accurately detect and segment the parking line boundary area. Furthermore, when the above technical solution is applied in the automatic parking method of a vehicle, the parking space detection accuracy of the vehicle during the automatic parking process can be improved, thereby improving the success rate of the automatic parking of the vehicle.
[0057] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0059] Figure 1 A schematic diagram of a flow chart of a method for training a parking space line detection model in an embodiment of the present application;
[0060] Figure 2 Schematic diagram of the model structure based on the DeepLabv3+ network in the embodiment of the present application;
[0061] Figure 3 This is a schematic diagram of a process of adjusting parameters of a parking space line detection model based on a preset loss function in an embodiment of the present application;
[0062] Figure 4 A schematic diagram of a parking space detection method in an embodiment of the present application;
[0063] Figure 5 A schematic diagram of a flow chart of another parking space detection method in an embodiment of the present application;
[0064] Figure 6 for Figure 5 A schematic diagram of a specific execution flow of step 302 of the illustrated embodiment;
[0065] Figure 7 for Figure 5 A schematic diagram of a specific execution flow of step 401 of the illustrated embodiment;
[0066] Figure 8 for Figure 7 Schematic diagram of the specific execution flow of step 502 in the illustrated embodiment
[0067] Fig. 9A for Figure 7 Schematic diagram of obtaining a parking space line pattern at a corner point in step 501 of the illustrated embodiment Figure 1 ;
[0068] Fig. 9B for Fig. 9A A partial enlarged schematic diagram of
[0069] Fig.10 for Figure 8 In step 601 of the illustrated embodiment, a schematic diagram of at least two line segments is obtained;
[0070] Fig.11 for Figure 7 A schematic diagram of determining the middle line of each parking space line in the parking space line pattern in step 503 of the illustrated embodiment;
[0071] Fig.12 A schematic diagram of a process flow of an automatic parking method in an embodiment of the present application;
[0072] Fig.13 This is a schematic diagram of the structure of a training device for a parking space line detection model in an embodiment of the present application;
[0073] Fig.14 This is a schematic diagram of the structure of a parking space detection device in an embodiment of the present application;
[0074] Fig.15 This is a schematic diagram of the structure of an automatic parking device in an embodiment of the present application;
[0075] Fig.16 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application;
[0076] Fig.17 It is a schematic diagram of the structure of a vehicle in an embodiment of the present application. DETAILED DESCRIPTION
[0077] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes and are not intended to limit the scope of protection of the present application.
[0078] It should be understood that the various steps described in the method implementation of the present application can be performed in different orders and / or performed in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.
[0079] As described in the background technology section, in the prior art, when training the parking line detection model, the number of non-standard parking spaces in the data set used is relatively small and the types are diverse. Since non-standard parking spaces are often located in complex environments, their backgrounds are mostly floor tiles, and the parking lines may be composed of floor tiles of different colors or shapes. Therefore, when the model processes the parking line segmentation task in such complex scenes, it is difficult to achieve the expected effect, and the segmentation accuracy needs to be improved.
[0080] In addition, when using the above-mentioned pre-trained parking space line detection model to detect and segment parking spaces in parking space images, the detected parking spaces may not be able to completely match the position and shape of the actual parking spaces. This is mainly because there are few parking space line pixels in the parking space image, and the proportion of the number of pixels in the overall image is small, which causes the model to be biased towards pixel classes with a larger proportion of pixels during detection; and the long-term use of the edges of the parking space lines can easily cause the color of the parking space lines to become lighter, which increases the difficulty of the model to detect the parking space lines, so the pre-trained parking space line detection model will have poor detection and segmentation effects on the parking space line boundary area.
[0081] Therefore, in the technical solution provided in the embodiment of the present application, in the process of training the parking line detection model, it is necessary to first obtain a preset training set, and then generate training samples used in each batch based on the preset training set, and the training samples used in each batch include non-standard parking sample images. Finally, the parking line detection model is trained based on the training samples used in each batch, and the above-mentioned preset training set includes non-standard parking sample images and standard parking sample images. Since the above-mentioned technical solution ensures that the training samples used in each training batch include non-standard parking sample images in the process of training the parking line detection model, the data set is balanced, and the model can be exposed to more comprehensive and representative sample data, so that the model can more accurately detect and segment the parking line boundary area. When the above-mentioned technical solution is used in the automatic parking system of a vehicle, the parking space detection accuracy of the vehicle during the automatic parking process can be improved, thereby increasing the probability of successful automatic parking of the vehicle.
[0082] Figure 1 FIG. 1 is a flow chart of a method for training a parking space line detection model in an embodiment of the present application. The method for training a parking space line detection model can be implemented by a corresponding training device for a parking space line detection model, such as Figure 1 As shown, the method comprises the following steps:
[0083] Step 101: Obtain a preset training set, wherein the preset training set includes non-standard parking space sample images and standard parking space sample images;
[0084] The preset training set in the technical solution provided in the embodiment of the present application includes non-standard parking space sample images and standard parking space sample images. The non-standard parking space sample images are mostly obtained from complex actual environments, for example, a ground paved with fine tiles, the background of which is mostly tiles, and the parking space lines are mostly composed of tiles of different colors or shapes; the standard parking space sample images are mostly obtained from an environment with a relatively simple background, stable lighting conditions, and clear parking space lines, for example, from parking lots, underground garages, outdoor garages and other environments. The parking space lines in the standard parking space sample images are mostly standard white or yellow lines, and the parameters such as the width and spacing of the lines all meet unified specifications.
[0085] Step 102: Generate training samples used in each training batch based on a preset training set, wherein the training samples used in each training batch include non-standard parking space sample images;
[0086] This step is to further process the data in the preset training set after obtaining the preset training set in step 101 to obtain training samples used in each training batch, and ensure that the training samples used in each training batch include non-standard parking space sample images.
[0087] Step 103: training the parking space line detection model based on the training samples used in each training batch.
[0088] This step is to train the constructed parking line detection model based on step 102. The parking line detection model can be selected from various types of parking line detection models, such as LansNet model, SCNN model, RESA model and DeepLabv3+ network-based model. For example, for the DeepLabv3+ network-based model, its structure diagram is as follows: Figure 2As shown in the figure, it includes an encoding module and a decoding module; in the encoding module, the image is input into the backbone network of the model to extract the image features, and then a 1*1 convolution, three 3*3 hole convolutions and a global average pooling are used to process the output of the backbone network, and then a 1*1 convolution is used to reduce the dimension of the feature map of the above output, where the backbone network outputs two parts of features, one part of the features is the feature map of the last layer of convolution output, and the other part of the features is the feature map of the intermediate low-level features; then in the decoding module, a 1*1 convolution is first used to reduce the dimension of the intermediate low-level features output by the backbone network. The feature map of the low-level features is reduced in dimension, and then the output features of another part of the processed backbone network are interpolated and upsampled. The reduced-dimensional low-level feature map and the feature map obtained by linear interpolation upsampling are then concatenated and sent to a set of 3*3 convolution blocks for processing. Finally, linear interpolation upsampling is performed to obtain a predicted image with the same resolution as the original image. In this process, the encoding module uses the method of dilated convolution to capture richer contextual information without losing spatial information. Subsequently, the decoding module is used to decode the above-extracted features and finally output the segmentation result.
[0089] As mentioned above, the parking space line detection model trained by this method can more accurately detect and segment the parking space line boundary area. When the above model is applied to the vehicle's automatic parking system, the parking space detection accuracy of the vehicle during the automatic parking process can be improved, thereby increasing the probability of successful automatic parking of the vehicle.
[0090] The preset training set in the above embodiment includes non-standard parking space sample images and standard parking space sample images. Compared with standard parking space sample images, non-standard parking space sample images are more difficult to identify. This is mainly because the information contained in non-standard parking space images is more complex and diverse. The background is often paved with floor tiles, and the parking space lines may be naturally outlined by floor tiles of different colors or shapes, which increases the difficulty of identifying non-standard parking space sample images.
[0091] In some embodiments, the proportion of non-standard parking space images included in the training samples used in each of the above batches is greater than or equal to a first proportion, and the first proportion is the proportion of non-standard parking space sample images in a preset training set. This setting can improve the accuracy and generalization ability of parking space segmentation of the trained parking space line detection model in non-standard scenarios.
[0092] In the embodiment of the present application, the above-mentioned standard parking space sample images include standard indoor parking space sample images and standard outdoor parking space sample images.
[0093] In some embodiments, the proportion of standard indoor parking space sample images in the training samples used in each of the training batches is less than or equal to a second proportion, which is the proportion of standard indoor parking space sample images in a preset training set; and / or,
[0094] The proportion of standard outdoor parking space sample images in the training samples used in each training batch is less than or equal to a third proportion, and the third proportion is the proportion of standard outdoor parking space sample images in a preset training set.
[0095] Usually, in the process of training the model, a suitable loss function is determined, which is mainly used to quantify the difference between the model prediction value and the true value. The parameters of the model are adjusted through the above quantification results, that is, the value of the loss function, to achieve the purpose of optimizing the model.
[0096] In the present application, the loss function is preset, and then the parameters of the parking space detection model are adjusted based on the preset loss function. In the preset function, the weight of the loss value of the pixel points in the edge area of the parking space line in the parking space image is set to be greater than the weight of the loss value of the pixel points in other areas of the parking space image. The other areas include the center area of the parking space line, the internal area of the parking space, or the road area, etc. Through such a setting, the weights between the pixel points at the edge of the parking space line and the pixel points in other areas in the parking space image can be better balanced, thereby effectively preventing the situation in which the model is overly biased towards the pixels in these non-critical areas when training the parking space line detection model because the number of pixels in other areas of the parking space image far exceeds the number of pixels in the edge area of the parking space line.
[0097] Specifically, the process of adjusting the parameters of the parking space line detection model based on the preset loss function is as follows: Figure 3 As shown, the following steps are included:
[0098] Step 201: Detect the parking space image based on the parking space line detection model trained in the current round to obtain the detection result; the parking space image in this step can be a bird's-eye view captured by the vehicle, which is obtained by collecting information based on the cameras around the vehicle and merging it into the processor, and then undergoing distortion correction and seamless segmentation. The parking space line detection model trained in the current round is used to perform fine segmentation of lanes and parking space lines on the collected bird's-eye view to achieve the purpose of parking space line detection in the parking space image.
[0099] Usually, during the training of a machine learning model, multiple training rounds are set. After each training round, a model trained in the current round is obtained, that is, the parking space line detection model trained in the current round in this embodiment. After that, the model trained in each round can be retained, or the model trained in each round can be evaluated, and only the model with better effect can be retained. Training the model for multiple rounds and saving the model trained in each round helps to record the changing trend of the model performance and promptly discover and correct overfitting or underfitting problems. In addition, saving models trained in multiple rounds also provides flexibility for subsequent model selection, and the best performing model can be selected for deployment according to the needs of the actual application scenario.
[0100] Step 202: Obtain loss values corresponding to pixel points in the parking space image based on the detection results;
[0101] Based on the above step 201, the embodiment of the present application can obtain the loss value corresponding to the pixel point in the parking space image, and the loss value represents the degree of difference between the predicted value and the true value of each pixel point in the parking space image during the training process of the model. The loss value can be obtained through Focal Loss, wherein the pixel points in the parking space image include the pixel points in the edge area of the parking space line, and other areas outside the pixel points in the edge area of the parking space line, such as the center area of the parking space line, the internal area of the parking space, or the pixel points in the road area.
[0102] Step 203: obtaining a model loss value of the parking space line detection model based on the loss values corresponding to the pixels in the parking space image and a preset loss function;
[0103] In this step, the loss value of the pixel point in the parking space image obtained in step 202 is calculated through a pre-set loss function to obtain the loss value of the model trained in the current round.
[0104] Step 204: Adjust the parameters of the parking space line detection model trained in the current round based on the model loss value.
[0105] Based on step 203, the parameters of the parking space line detection model trained in the current round are adjusted, wherein the parameters include weights, biases, etc. The parking space line detection model with adjusted parameters is trained for multiple rounds to obtain a final parking space line detection model that can better detect and segment the parking space line boundary area.
[0106] In some embodiments, the above preset loss function can be set to:
[0107]
[0108] Wherein, L is the model loss value of the parking space line detection model, N is the number of pixels in the parking space image, m is the number of pixels in the parking space line edge area in the parking space image, n is the number of pixels in other areas of the parking space image, and L l is the loss value corresponding to the pixel in the parking space image, α is the weight of the loss value of the pixel in the edge area of the parking space line in the parking space image, β is the weight of the loss value of the pixel in other areas of the parking space image, and α is greater than β.
[0109] The L in the preset loss function in the above embodiment is l It is calculated using the focal loss function, which includes:
[0110]
[0111] L l =-(1-p t ) γ log(p t )
[0112] Among them, L l is the loss value corresponding to the pixel in the parking space image, p t is the probability that the pixel predicted by the model in the parking space image belongs to a certain type of pixel, and γ is the weight factor for adjusting each pixel in the parking space image.
[0113] The loss value L of the pixel in the parking space image obtained by the focal loss function l After that, the preset loss function is sampled to calculate the model loss value L of the parking line detection model, and finally the parameters of the parking line detection model trained in the current round are adjusted based on the model loss value L of the parking line detection model.
[0114] Figure 4 FIG. 1 is a flow chart of a parking space detection method in an embodiment of the present application. The parking space detection method can be implemented by a corresponding parking space detection device, such as Figure 4 As shown, the method comprises the following steps:
[0115] Step 301: Based on the parking space line detection model obtained by the parking space line detection model training method, the parking space image to be detected is detected to obtain a parking space detection result of the parking space image to be detected;
[0116] This step is in Figure 1-Figure 3On the basis of the embodiment shown, the parking space line detection model with adjusted parameters is trained for multiple rounds to obtain a final parking space line detection model that can better detect and segment the parking space line boundary area, and the parking space image to be detected is detected by the obtained parking space line detection model to obtain a parking space detection result of the parking space image to be detected, and the above parking space detection result includes a parking space line pattern obtained by image segmentation of the parking space image to be detected, and the parking space line pattern is as follows Fig. 9A shown.
[0117] Figure 5 FIG. 1 is a flow chart of another parking space detection method in an embodiment of the present application. Figure 5 As shown, in Figure 4 Based on the flowchart shown in FIG. 1 , the following steps are further included:
[0118] Step 302: Optimize the position of the parking space detection result by using image processing technology to obtain a parking space detection result after position optimization.
[0119] In this step, the deep learning technology is used in step 301 to obtain a parking space line detection model that can better detect and segment the parking space line boundary area, and the model is used to detect the parking space image to be detected. After obtaining the parking space detection result of the parking space image to be detected, the detection result of the parking space image to be detected is further processed in combination with image processing technology to obtain a more accurate parking space detection result. The image processing technology includes corner point detection algorithm, line segment detection algorithm, etc.
[0120] As mentioned above, by using deep learning technology, a parking space line detection model that can better detect and segment the boundary area of parking space lines can be obtained, and the model is used to detect the parking space image to be detected. After obtaining the parking space detection result of the parking space image to be detected, the detection result of the parking space image to be detected is further processed by image processing technology. The parking space in the parking space image to be detected can be detected more accurately, thereby ensuring the accuracy and reliability of parking space recognition during automatic parking, thereby increasing the probability of successful automatic parking of the vehicle.
[0121] In some embodiments, Figure 6 for Figure 5 The specific execution flow diagram of step 302 of the embodiment shown in FIG. Figure 6 As shown, the following steps are included:
[0122] Step 401, using image processing technology to obtain the middle line of each parking space line in the parking space line pattern;
[0123] This step is based on obtaining the parking space detection result of the parking space image to be detected in step 301, and processing the parking space line pattern using image processing technology, for example, using corner point detection and line segment detection algorithms to process the parking space line pattern to obtain the middle line of each parking space line in the parking space line pattern.
[0124] Step 402: Determine a parking space detection result after position optimization based on the middle lines of each parking space line in the parking space line pattern.
[0125] The width range of each parking space line in the parking space line pattern in the technical solution provided by this application is relatively large, but each parking space line is defined by line segments on both sides, and the line segments on both sides are prone to breakage, missing, etc., which further affects the accuracy of parking space detection. In the embodiment of this application, the middle line of each parking space line is used to determine the parking space, which can more accurately define the parking space, thereby increasing the probability of successful automatic parking of subsequent vehicles.
[0126] In some embodiments, in order to determine the parking space detection result after position optimization, in addition to considering the middle lines of each parking space line in the parking space line pattern of the parking space image to be detected, it is also necessary to consider the corner point position and parking space size feature information of the parking space line pattern of the parking space image to be detected. The corner point position of the above-mentioned parking space line pattern is used as the basis for trimming the middle lines of each parking space line in the parking space line pattern to obtain the middle lines of each parking space line of appropriate length; and the parking space size can be used as a screening condition, and is used in the process of screening the middle lines of each parking space line in the parking space line pattern. The size of the parking space is set according to relevant standards. For example, a large parking space is 15.6 meters long and 3.25 meters wide, which is suitable for parking medium and large vehicles; a small parking space is 6 meters long and 2.5 meters wide, which is suitable for parking small vehicles.
[0127] In some embodiments, in addition to determining the parking space detection result after the position optimization according to the above embodiments, it also includes further determining some parking space information, for example, at least one of the following:
[0128] Determine the width of the parking space entrance;
[0129] Determine whether the parking space is a vertical parking space or a horizontal parking space;
[0130] Determine the parking angle.
[0131] Specifically, the parking space information can also be determined based on the middle lines of each parking space line in the above-mentioned parking space line pattern, as well as the corner point positions and parking space size feature information, wherein a vertical parking space refers to a parking space that is perpendicular to the parking space boundary line, and a horizontal parking space refers to a parking space that is horizontal to the parking space boundary line; the parking space angle refers to the angle between the parking direction of the vehicle in the parking space and the parking space line, which can be determined based on the middle line angles of the above-mentioned parking space lines. It is mainly used to describe the direction and position of the parking vehicle in the parking space. Common parking space angles include parallel, inclined and vertical.
[0132] Specifically, Figure 7 for Figure 6 The specific execution flow diagram of step 401 of the embodiment shown in FIG. Figure 7 As shown, the following steps are included:
[0133] Step 501, determining the corner point position in the parking space line pattern, and obtaining the parking space line pattern at the corner point position;
[0134] In this step, the parking space line pattern can be as follows Fig. 9A As shown, see Figure 5 After obtaining the parking space line pattern of the parking space image to be detected, the corner point detection algorithm is then used to determine the corner point position in the parking space line pattern, such as Fig. 9A Then, the parking space line pattern is clipped to obtain the parking space line pattern at the corner point position, such as Fig. 9B As shown, the corner point detection algorithm is mainly used to detect whether there are corner points in the image. The above-mentioned corner points refer to the intersections of different parking lines in the parking line pattern; the parking line pattern at the corner point position is part of the parking line pattern of the parking space image to be detected.
[0135] Step 502: Perform line segment detection on the parking space line pattern at the corner point position based on a line segment detection algorithm to obtain a first line segment and a second line segment of each parking space line edge in the parking space line pattern;
[0136] In this step, after the parking space line pattern at the corner point position is obtained in step 501, line segment detection is performed on it through a line segment detection algorithm, wherein the line segment detection algorithm is mainly used to detect the local straight line contour on the image, for example, the line segment detection algorithm (Line Segment Dectector, referred to as: LSD) is used to detect the line segments in the parking space line pattern. Specifically, it can be as follows Fig.10 As shown, it is Fig. 9B On this basis, line segments at the edges of each parking space line are obtained, including a first line segment and a second line segment respectively located on both sides of each parking space line.
[0137] The specific implementation process of this step can be as follows Figure 8 As shown, the following steps are included:
[0138] Step 601: Perform line segment detection on the parking space line pattern at the corner point position based on a line segment detection algorithm to obtain at least two line segments;
[0139] In this step, at least two line segments are obtained as described above. Fig.10 As shown, the line segment detection algorithm is used to perform line segment detection on the parking space line pattern at the corner point position to obtain at least two line segments, such as Fig.10 As shown, multiple line segments are obtained at the corner point, and the endpoints of each line segment are represented by different letters, such as a, b, c...n in the figure. At the corner point, multiple endpoints can be set to represent.
[0140] Step 602: Determine a first line segment and a second line segment of each parking space line edge in the parking space line pattern based on the slopes and point sequences of at least two line segments.
[0141] This step is after obtaining at least two line segments, such as Fig.10 As shown, these line segments are matched based on their slopes, point sequences and other features to determine the first line segment and the second line segment of each parking line edge in the parking line pattern. The first line segment and the second line segment have the same slope and the point sequence meets certain requirements, so that the two are two adjacent line segments. Figure 8 If the line segment ab matches the line segment cd, it means that the line segment ab and the line segment cd are the first line segment and the second line segment of the parking space line defined by them respectively; the line segment ef matches the line segment mn, it means that the line segment ef and the line segment mn are the first line segment and the second line segment of the parking space line defined by them respectively; the line segment gh matches the line segment ij, it means that the line segment gh and the line segment ij are the first line segment and the second line segment of the parking space line defined by them respectively; the line segment jk matches the line segment lm, it means that the line segment jk and the line segment lm are the first line segment and the second line segment of the parking space line defined by them respectively.
[0142] Step 503: Determine the middle line of each parking space line in the parking space line pattern based on the first line segment and the second line segment.
[0143] In this step, the middle line of each parking space line in the parking space line pattern is determined based on the first line segment and the second line segment. Fig.11 As shown, it is in Fig.11 After obtaining the first line segment and the second line segment of the edge of each parking line in the parking line pattern, the middle line of each parking line in the parking line pattern is determined based on these line segments, and then the line segments that do not belong to the middle line of each parking line in the determined parking line pattern are filtered out using the line segment length, parking space size and other features of the middle line of each parking line in the parking line pattern. For example, Fig.11The middle line between the middle line segment ab and the line segment cd is filtered out. The first line segment, the second line segment and the middle line of each parking line in the parking line pattern in this step can be marked according to specific needs for easy distinction. For example, the first line segment can be marked as PosLines, the second line segment can be marked as NegLines, and the middle line of each parking line in the parking line pattern can be marked as CandidateLines.
[0144] Fig.12 FIG. 1 is a flow chart of an automatic parking method in an embodiment of the present application. The automatic parking method can be applied to a vehicle, such as Fig.12 As shown, the method comprises the following steps:
[0145] Step 1001: Based on Figure 4-Figure 11 Obtaining a parking space detection result by using the parking space detection method described in any one of the embodiments;
[0146] Step 1002: Control the vehicle to park based on the parking space detection result.
[0147] This step is to use the parking space information contained in the parking space detection result to assist the vehicle in parking after the parking space detection result is obtained in step 1001, and to park the vehicle in the parking space.
[0148] As mentioned above, in Figure 4-Figure 11 In the described embodiment, deep learning and image processing technology are used to detect and segment the parking space line boundary area, so that its accuracy is significantly improved. Therefore, when the vehicle is controlled to park based on the parking space detection result obtained by the parking space detection method, the accuracy and reliability of the parking space recognition of the vehicle during the automatic parking process can be ensured, thereby increasing the probability of successful automatic parking of the vehicle.
[0149] With the above Figure 1 Corresponding to the training method of the provided parking space line detection model, the embodiment of the present application provides a corresponding device. Fig.13 Schematic diagram of the structure of a training device for a parking space line detection model in an example of this application, such as Fig.13 As shown, the training device of the parking space line detection model includes a data acquisition module 11, a data processing module 12, and a model training module 13, wherein the data acquisition module 11 is used to acquire a preset training set, which includes non-standard parking space sample images and standard parking space sample images; the data processing module 12 is used to generate training samples used in each training batch based on the preset training set, and the training samples used in each training batch include non-standard parking space sample images; the model training module 13 is used to train the parking space line detection model based on the training samples used in each training batch.
[0150] In some embodiments, the proportion of non-standard parking space images included in the training samples used in each training batch is greater than or equal to a first proportion, and the first proportion is the proportion of non-standard parking space sample images in a preset training set.
[0151] In some embodiments, the standard parking space sample images include standard indoor parking space sample images and standard outdoor parking space sample images;
[0152] The proportion of standard indoor parking space sample images in the training samples used in each training batch is less than or equal to a second proportion, where the second proportion is the proportion of standard indoor parking space sample images in a preset training set; and / or,
[0153] The proportion of standard outdoor parking space sample images in the training samples used in each training batch is less than or equal to a third proportion, and the third proportion is the proportion of standard outdoor parking space sample images in a preset training set.
[0154] In some embodiments, it also includes:
[0155] The parameters of the parking space line detection model are adjusted based on a preset loss function, in which the weight of the loss value of the pixel points in the edge area of the parking space line in the parking space image is set to be greater than the weight of the loss value of the pixel points in other areas of the parking space image.
[0156] In some embodiments, adjusting parameters of the parking space line detection model based on a preset loss function includes:
[0157] Detect the parking space image based on the parking space line detection model trained in the current round to obtain the detection result;
[0158] Obtain loss values corresponding to pixels in the parking space image based on the detection results;
[0159] Obtaining a model loss value of a parking space line detection model based on loss values corresponding to pixels in the parking space image and a preset loss function, wherein a weight of a loss value of a pixel in an edge region of the parking space line in the parking space image is set to be greater than a weight of a loss value of a pixel in other regions of the parking space image;
[0160] Adjust the parameters of the parking space line detection model trained in the current round based on the model loss value.
[0161] In some embodiments, the preset loss function is:
[0162]
[0163] Wherein, L is the model loss value of the parking space line detection model, N is the number of pixels in the parking space image, m is the number of pixels in the parking space line edge area in the parking space image, n is the number of pixels in other areas of the parking space image, and L l is the loss value corresponding to the pixel in the parking space image, α is the weight of the loss value of the pixel in the edge area of the parking space line in the parking space image, β is the weight of the loss value of the pixel in other areas of the parking space image, and α is greater than β.
[0164] As described in the above embodiment, the parking space line detection model is trained using the above parking space line detection model training method, which can better process data with few parking space line pixels or complex boundaries in the image, so that the trained model can better segment the parking space lines. Furthermore, when the above technical solution is applied in the automatic parking method of the vehicle, the accuracy of the parking space detection of the vehicle during the automatic parking process can be improved, thereby improving the success rate of the automatic parking of the vehicle.
[0165] With the above Figure 4-Figure 11 Corresponding to any of the provided parking space detection methods, the embodiments of the present application provide a corresponding device. Fig.14 This is a schematic diagram of the structure of a parking space detection device in an example of this application, such as Fig.14 As shown, the parking space detection device includes a parking space detection module 21, which is used to detect the parking space image to be detected by using the parking space line detection model obtained by the parking space line detection model training device to obtain a parking space detection result of the parking space image to be detected.
[0166] In some embodiments, it also includes:
[0167] Image processing technology is used to optimize the position of the parking space detection result to obtain a parking space detection result after position optimization.
[0168] In some embodiments, the parking space detection result includes a parking space line pattern obtained by segmenting the parking space image to be detected, and the parking space detection result is optimized by using image processing technology to obtain a parking space detection result after position optimization, including:
[0169] Using image processing technology to obtain the middle line of each parking space line in the parking space line pattern;
[0170] Based on the middle lines of each parking space line in the parking space line pattern, a parking space detection result after position optimization is determined.
[0171] In some embodiments, the method of obtaining the middle line of each parking space line in the parking space line pattern by using image processing technology includes:
[0172] Determine the corner point position in the parking space line pattern, and obtain the parking space line pattern at the corner point position;
[0173] Performing line segment detection on the parking space line pattern at the corner point position based on a line segment detection algorithm to obtain a first line segment and a second line segment of each parking space line edge in the parking space line pattern;
[0174] A middle line of each parking space line in the parking space line pattern is determined based on the first line segment and the second line segment.
[0175] In some embodiments, the above-mentioned line segment detection algorithm is used to perform line segment detection on the parking space line pattern at the corner point position to obtain the first line segment and the second line segment of each parking space line edge in the parking space line pattern, including:
[0176] Performing line segment detection on the parking space line pattern at the corner point position based on a line segment detection algorithm to obtain at least two line segments;
[0177] Based on the slopes and point sequences of at least two line segments, a first line segment and a second line segment of each parking space line edge in the parking space line pattern are determined.
[0178] In some embodiments, the above-mentioned method of determining the parking space detection result after the position optimization based on the middle line of each parking space line in the parking space line pattern includes:
[0179] Based on the middle lines of each parking space line in the parking space line pattern, as well as the corner point positions and parking space size feature information, the parking space detection result after position optimization is determined.
[0180] In some embodiments, at least one of the following is also included:
[0181] Determine the width of the parking space entrance;
[0182] Determine whether the parking space is a vertical parking space or a horizontal parking space;
[0183] Determine the parking angle.
[0184] As described above, by using the parking space detection module to detect the parking space image to be detected, the parking space in the parking space image to be detected can be detected more accurately, thereby ensuring the accuracy and reliability of parking space recognition during automatic parking, thereby increasing the probability of successful automatic parking of the vehicle.
[0185] With the above Fig.12 Corresponding to the provided automatic parking method, the embodiments of the present application provide a corresponding device. Fig.15 This is a schematic diagram of the structure of an automatic parking device in this application example. Fig.15As shown, the automatic parking device includes a parking space detection module 21 and a parking control module 31, wherein the parking space detection module 21 is used to detect the parking space image to be detected by using the parking space line detection model obtained by the training device of the parking space line detection model to obtain the parking space detection result of the parking space image to be detected; the parking control module is used to control the vehicle to park based on the parking space detection result of the parking space detection device.
[0186] As described above, controlling the vehicle to park based on the parking space detection result of the parking space detection device can ensure the accuracy and reliability of the vehicle's parking space recognition during the automatic parking process, thereby increasing the probability of successful automatic parking of the vehicle.
[0187] The present application also provides an electronic device, such as Fig.16 As shown, the electronic device includes: a processor 41 and a memory 42, the memory 42 stores programs or instructions that can be run on the processor, and the above-mentioned programs or instructions are executed by the processor to achieve the following Figure 1-Figure 3 The steps of the training method of the parking space detection model; or, when the program or instruction is executed by the processor, the following is achieved: Figure 4-Figure 11 The steps of the parking space detection method; or, when the program or instruction is executed by the processor, the following is implemented Fig.12 The steps of the automatic parking method.
[0188] The present application also provides a vehicle, such as Fig.17 As shown, the vehicle includes Fig.16 The electronic device 51, wherein the memory of the electronic device stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the following is achieved: Figure 4-Figure 11 The steps of the parking space detection method; or, when the program or instruction is executed by the processor, the following is implemented Fig.12 The steps of the automatic parking method.
[0189] The present application also provides a computer-readable storage medium, wherein a program or instruction is stored on the computer-readable storage medium, and when the program or instruction is executed by a processor, the following is implemented: Figure 1-Figure 3 The steps of the training method of the parking space detection model; or, when the program or instruction is executed by the processor, the following is achieved: Figure 4-Figure 11 The steps of the parking space detection method; or, when the program or instruction is executed by the processor, the following is implemented Fig.12 The steps of the automatic parking method.
[0190] The present application also provides a computer program product, which, when executed by a processor of a vehicle, implements the following Figure 1-Figure 3The steps of the training method of the parking space detection model; or, when the program or instruction is executed by the processor, the following is achieved Figure 4-Figure 11 The steps of the parking space detection method; or, when the program or instruction is executed by the processor, the following is implemented Fig.12 The steps of the automatic parking method.
[0191] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises one..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0192] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of a computer software product plus a necessary general hardware platform, and of course, can also be implemented by hardware. The computer software product is stored in a storage medium (such as ROM, RAM, disk, CD, etc.), including several instructions to enable a terminal or a network-side device to execute the methods described in each embodiment of the present application.
[0193] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms of implementation methods without departing from the purpose of the present application and the scope of protection of the claims, and these implementation methods are all within the protection of the present application.
Claims
1. A method for training a parking space line detection model, characterized in that: include: Acquire a preset training set, wherein the preset training set includes non-standard parking space sample images and standard parking space sample images; Generating training samples used in each training batch based on the preset training set, wherein the training samples used in each training batch include non-standard parking space sample images; The parking space line detection model is trained based on the training samples used in each training batch.
2. The method according to claim 1, characterized in that: The proportion of non-standard parking space images included in the training samples used in each training batch is greater than or equal to a first proportion, and the first proportion is the proportion of non-standard parking space sample images in a preset training set.
3. The method according to claim 2, characterized in that The standard parking space sample images include standard indoor parking space sample images and standard outdoor parking space sample images; The proportion of standard indoor parking space sample images in the training samples used in each training batch is less than or equal to a second proportion, where the second proportion is the proportion of standard indoor parking space sample images in a preset training set; and / or, The proportion of standard outdoor parking space sample images in the training samples used in each training batch is less than or equal to a third proportion, and the third proportion is the proportion of standard outdoor parking space sample images in a preset training set.
4. The method according to any one of claims 1 to 3, characterized in that: Also includes: The parameters of the parking space line detection model are adjusted based on a preset loss function, in which the weight of the loss value of the pixel points in the edge area of the parking space line in the parking space image is set to be greater than the weight of the loss value of the pixel points in other areas of the parking space image.
5. The method according to claim 4, characterized in that The step of adjusting parameters of the parking space line detection model based on a preset loss function includes: Detect the parking space image based on the parking space line detection model trained in the current round to obtain the detection result; Acquire a loss value corresponding to a pixel point in the parking space image based on the detection result; Obtaining a model loss value of the parking space line detection model based on loss values corresponding to pixels in the parking space image and a preset loss function; Parameters of the parking space line detection model trained in the current round are adjusted based on the model loss value.
6. The method according to claim 5, characterized in that The preset loss function is: Wherein, L is the model loss value of the parking space line detection model, N is the number of pixels in the parking space image, m is the number of pixels in the parking space line edge area in the parking space image, n is the number of pixels in other areas of the parking space image, and L l is the loss value corresponding to the pixel point in the parking space image, α is the weight of the loss value of the pixel point in the edge area of the parking space line in the parking space image, β is the weight of the loss value of the pixel point in other areas of the parking space image, and α is greater than β.
7. A parking space detection method, characterized in that: include: Based on the parking space line detection model obtained by the training method according to any one of claims 1 to 6, the parking space image to be detected is detected to obtain a parking space detection result of the parking space image to be detected.
8. The method according to claim 7, characterized in that Also includes: The parking space detection result is position-optimized by using image processing technology to obtain a parking space detection result after position optimization.
9. The method according to claim 8, characterized in that The parking space detection result includes a parking space line pattern obtained by performing image segmentation on the parking space image to be detected, and the position optimization of the parking space detection result using image processing technology to obtain a parking space detection result after position optimization includes: Using image processing technology to obtain the middle line of each parking space line in the parking space line pattern; Based on the middle lines of the parking space lines in the parking space line pattern, the parking space detection result after the position optimization is determined.
10. The method according to claim 9, characterized in that The method of obtaining the middle line of each parking space line in the parking space line pattern by using image processing technology includes: Determine a corner point position in the parking space line pattern, and obtain the parking space line pattern at the corner point position; Performing line segment detection on the parking space line pattern at the corner point position based on a line segment detection algorithm to obtain a first line segment and a second line segment of each parking space line edge in the parking space line pattern; A middle line of each parking space line in the parking space line pattern is determined based on the first line segment and the second line segment.
11. The method according to claim 10, characterized in that The performing line segment detection on the parking space line pattern at the corner point position based on the line segment detection algorithm to obtain the first line segment and the second line segment of each parking space line edge in the parking space line pattern includes: Performing line segment detection on the parking space line pattern at the corner point position based on a line segment detection algorithm to obtain at least two line segments; Based on the slopes and point sequences of the at least two line segments, a first line segment and a second line segment of each parking space line edge in the parking space line pattern are determined.
12. The method according to claim 10, characterized in that The step of determining the parking space detection result after the position optimization based on the middle line of each parking space line in the parking space line pattern includes: Based on the middle lines of each parking space line in the parking space line pattern, as well as the corner point positions and parking space size feature information, the parking space detection result after the position optimization is determined.
13. The method according to claim 12, characterized in that Also includes at least one of the following: Determine the width of the parking space entrance; Determine whether the parking space is a vertical parking space or a horizontal parking space; Determine the parking angle.
14. An automatic parking method, characterized in that: include: Obtaining a parking space detection result based on the method described in any one of claims 7 to 13; The vehicle is controlled to park based on the parking space detection result.
15. A training device for a parking space line detection model, characterized in that: include: A data acquisition module, used to acquire a preset training set, wherein the preset training set includes non-standard parking space sample images and standard parking space sample images; A data processing module, used for generating training samples used in each training batch based on a preset training set, wherein the training samples used in each training batch include non-standard parking space sample images; The model training module is used to train the parking space line detection model based on the training samples used in each training batch.
16. A parking space detection device, characterized in that: include: The parking space detection module is used to detect the parking space image to be detected by the parking space line detection model obtained by the training device according to claim 15, so as to obtain the parking space detection result of the parking space image to be detected.
17. An automatic parking device, characterized in that: It comprises the parking space detection device as claimed in claim 16, and a parking control module, which is used to control the vehicle to park based on the parking space detection result of the parking space detection device.
18. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, wherein the program or instruction, when executed by the processor, implements the training method for the parking space line detection model as described in any one of claims 1 to 6; or, when executed by the processor, the program or instruction, when executed by the processor, implements the steps of the parking space detection method as described in any one of claims 7 to 13; or, when executed by the processor, the program or instruction, when executed by the processor, implements the steps of the automatic parking method as described in claim 14.
19. A vehicle, characterized in that: An electronic device comprising the electronic device of claim 18, wherein the memory of the electronic device stores a program or instruction that can be run on a processor, and the program or instruction, when executed by the processor, implements the steps of the parking space detection method as described in any one of claims 7 to 13; or, the program or instruction, when executed by the processor, implements the steps of the automatic parking method as described in claim 14.
20. A computer-readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, it implements the training method of the parking space line detection model as described in any one of claims 1 to 6; or, when the program or instruction is executed by the processor, it implements the steps of the parking space detection method as described in any one of claims 7 to 13; or, when the program or instruction is executed by the processor, it implements the steps of the automatic parking method as described in claim 14.
21. A computer program product, characterized in that The program product, when executed by a processor of a vehicle, implements the training method of a parking space line detection model as described in any one of claims 1 to 6; or, the program or instruction, when executed by a processor, implements the steps of a parking space detection method as described in any one of claims 7 to 13; or, the program or instruction, when executed by the processor, implements the steps of an automatic parking method as described in claim 14.