caffe-ssd uses single-channel grayscale images for training

There are mainly two methods,
(1) One is pseudo-single channel.
Add force_color:True in transform_param{...} to force the grayscale image to a color image for training'
(2) Modify the network to single-channel input
(2.1) Add –gray to the input parameter of create_anoset.py in create_data.sh to generate single-channel lmdb format data
(2.2) The mean_value in the data layer AnnotatedData layer in train.prototxt only retains one channel, and will be related to the color channel data enhancement. The parameters are removed (distort_param{…})
(2.3) The mean_value in test.prototxt also retains only one channel
(2.4) The dim in input_shape in deploy.prototxt is changed from 3 to 1,
and then single-channel image training can be performed . Correspondingly, during testing, it is also necessary to extract a single channel from the read jpg format image before testing.

Reference:
1. Questions and answers from the author of the SSD source code on github: How to use SSD to train and test images with only one channel?
2. How to convert grayscale images to color images: SSD trains single-channel images

おすすめ

転載: blog.csdn.net/alansss/article/details/107073905