Study notes for ship target detection

1 Acknowledgements

Thanks to the information provided by netizen lihe2019- "Ubuntu 16.04 Nvidia driver installation (run mode)"
Thanks to netizen xunan003 for the information- "Ubuntu 16.04 system run mode to install nvidia graphics driver"

2 Server configuration

2.2.1 Install the graphics driver

Step 9: Using CUDA to directly install the graphics card driver fails, and the error "code: 256" is reported, so I still use the "driver+CUDA" method to install separately;
step 10: Download the graphics card driver from Nvidia official website, https://www. nvidia.cn/geforce/drivers/ ;
step 10: Check whether the graphics card driver is installed successfully:

  1. Whether the resolution of the desktop is displayed normally;
  2. Whether the command nvidia-smi can be used normally.

2.2.2 The graphics driver is abnormal after the Ubuntu-16.04 system update

Ubuntu-16.04 may appear abnormal after the system update. The specific manifestation is that if you
enter nvidia-smi , the following output appears,

Terminal outputs:
NVIDIA-SMI has failed because it couldn‘t communicate with NVIDIA driver. Make sure that the latest driver is installed and running.

At present, I don’t know the reason for this abnormality. The solution is to refer to the blog post "Ubuntu 16.04 Nvidia Driver Installation (Run Method)" . You
need to install dkms.

sudo apt-get install dkms

Then use the command,

sudo dkms install -m nvidia -v gpu-driver-number

The sample code is as follows:

sudo dkms install -m nvidia -v 450.07

Then enter nvidia-smi to see if the graphics card driver can be used normally;
after the installation is complete, restart the computer to see if the resolution of the display interface returns to normal;

3 Install third-party software dependencies

4 Data set collection

4.1 HRSC2016 data set

We do not use the HRSC2016 data set for the time being. The target size of the data set is too large (there are probably only 1 or 2 targets in a picture), and the target of our task is relatively small;

4.2 Kaggle-Airbus-Ship: Data set of Kaggle ship inspection competition

We will use this data set for pre-training; the
data set address: https://www.kaggle.com/c/airbus-ship-detection/data

4.2.1 Data set characteristics

The image size is all the same, and is 768×768;

4.2.2 The format of the annotation file-RLE encoding

In Kaggle-Airbus-Ship (KAS), the format of the label information is "run-length encoding format", so it needs to be parsed separately;
since the KAS data set is a binary classification problem, the label image is equivalent to a binary image. Therefore, run-length encoding can be used to encode the label information;
for the analysis of the label format, you can refer to the
repo: https://github.com/pascal1129/kaggle_airbus_ship_detection/blob/master/0_rle_to_coco/0_csv_show_RLE.py

4.2.3 Pre-training data preprocessing-convert the mask label to a positive rectangle label

We use OpenCV to perform such processing: convert the mask label to a regular rectangle label;
the code used is

contours, hierarchy = cv2.findContours(all_masks, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
# 参数解释:
# cv2.RETR_EXTERNAL:取二值区域的外轮廓,(不会检测内轮廓)
# cv2.CHAIN_APPROX_NONE:将物体边界上所有连续的轮廓点保存到contours向量内

5 Data reading and preprocessing

5.1 Remote sensing image format reading-.tif format and other formats

Use the gdal library,

6 Model design

Input image: 768×768 (consistent with KAS data set)

Guess you like

Origin blog.csdn.net/songyuc/article/details/108118622