如果你已经按照上一篇的步骤做好了训练过程,那么你会得到一个名为VGG_FACE.caffemodel的模型,下面我们来对该模型进行测试。
一、新建配置文件
在测试之前我们需要新建一个配置文件,该配置文件与VGG_FACE_deploy.prototxt比较相像,但还是有点不一样。上篇中的VGG_FACE_deploy.prototxt是为了训练模型,而我们需要新建的配置文件是为了测试模型。你可以复制一份VGG_FACE_deploy.prototxt并且命名为deploy.prototxt,deploy.prototxt内容如下:(推荐直接复制)
name: "VGG_FACE_16_Net"
input: "data"
input_dim: 1
input_dim: 3
input_dim: 224
input_dim: 224
force_backward: true
layer {
name: "conv1_1"
type: "Convolution"
bottom: "data"
top: "conv1_1"
convolution_param {
num_output: 64
kernel_size: 3
pad: 1
}
}
layer {
name: "relu1_1"
type: "ReLU"
bottom: "conv1_1"
top: "conv1_1"
}
layer {
name: "conv1_2"
type: "Convolution"
bottom: "conv1_1"
top: "conv1_2"
convolution_param {
num_output: 64
kernel_size: 3
pad: 1
}
}
layer {
name: "relu1_2"
type: "ReLU"
bottom: "conv1_2"
top: "conv1_2"
}
layer {
name: "pool1"
type: "Pooling"
bottom: "conv1_2"
top: "pool1"
pooling_param {
pool: MAX
kernel_size: 2
stride: 2
}
}
layer {
name: "conv2_1"
type: "Convolution"
bottom: "pool1"
top: "conv2_1"
convolution_param {
num_output: 128
kernel_size: 3
pad: 1
}
}
layer {
name: "relu2_1"
type: "ReLU"
bottom: "conv2_1"
top: "conv2_1"
}
layer {
name: "