Abstract:One of the basic requirements for automatic parking of smart cars is to quickly and accurately detect unoccupied parking slots. To address this issue, an end-to-end train detection network that integrates the direction of the parking line with global features was designed. First, the coordinates of key parking spots and the direction of the corresponding parking line are extracted, and local features are extracted from the global features using the coordinates of the key spots. Integrate key point information, local features, and global features using the cross-attention mechanism, and use the entrance line discriminator to infer the composition relationship of key points’ parking slots. Based on the composition relationship of key points and the direction of the parking line, the regional image of the parking slot is cropped and sent to a customized parking slot occupancy classification network for classification, resulting in the occupancy information of the parking slot. The proposed method was tested on the public benchmark dataset PS2.0, where the detection accuracy of the method for rectangular parking slots was 99.65%, and for tilted parking slots was 99.04%. The detection rate of 80 frames per second was achieved on a single GPU. It has been verified that the proposed method can detect the location, direction, and occupancy of parking slots in real time with high accuracy.