The detection of ship targets in remote sensing satellite images is an important means to obtain all ships on the sea surface by satellite image. It can realize the monitoring of sea surface resources, so it has important civil and military significance. Because of the complex background, ship detection in harbour is one of the difficulties. In recent years, many target detection methods based on deep learning have been proposed, and they have achieved good results in natural scene images. YOLOv3 is an advanced end-to-end method because of its high detection accuracy and fast detection speed. But even advanced methods have their shortcomings in this task. Ships in port usually dock side by side, which leads to missed detection of many targets when NMS (Non-Maximum Suppression) operation is performed on the predicted bounding boxes. In this paper, we replace the original NMS with Soft-NMS on the basis of YOLOv3. This operation makes the detector miss fewer targets. At the same time, we added IoU loss when calculating the loss of the prediction box and ground truth box. IoU loss takes the prediction box and the IoU value of its corresponding ground truth box as the evaluation criterion, which makes the target box generated by the detector more fitted to the target. In order to validate the effectiveness of the proposed algorithm, we use harbour remote sensing data collected from Google image and GaoFen-2 (GF-2) satellite, the experimental results show good performance of the proposed method in the detection of ship targets in harbour.