The object detection based on complex sea surface is a popular and challenging task. To solve the problem of poor performance of CNN detectors for sea surface objects, we propose Sw-YoloX, which uses Swin Transformer as the backbone and the decoupled head of YoloX as the prediction part. Then the CBAM and ASPP module are integrated in the neck of the detector, which expands the receptive field of grid cells and suppresses invalid semantic information, thus solving the problem of poor localization performance of the original Swin Transformer for small objects. In addition, a variety of training strategies are integrated to effectively improve the detector performance, such as multiple data augmentation, SimOTA matching strategy, multi-scale training, hyperparameter tuning and self-training classifiers. Finally, the XM-10000 dataset is constructed based on sea surface monitoring data from Xiamen, China for model validation. With end-to-end training, Sw-YoloX achieves higher performance than baselines and mainstream state-of-the-art methods and can better adapt to the task of complex sea surface object detection, with F1-Score of 78.1, mAP of 54.4, and recall is 72.0. This research, which has now been deployed in the coastal defense department in Xiamen, China, has important implications for searching for survivors and preventing smuggling.