How does Caffe handle different input shapes in classification problems by default?

40 views
Skip to first unread message

Hermann Hesse

unread,
Sep 27, 2016, 3:26:59 PM9/27/16
to Caffe Users
Hi all, i'm new in Caffe.

my question is about the way that a neural network do the forwarding in test phase when the input size is different from the input network layer. For example, a network trained with 224x224 images that has the next input in deploy.prototxt:

input: "data"
input_shape {
  dim: 1 
  dim: 3 
  dim: 224 
  dim: 224
}

When next image loaded have a size of 400x400, for example:

input_image = caffe.io.load_image(IMAGE_FILE) # 400x400x3 image
prediction = net.predict([input_image])

How does Caffe handle this input automatically? And if the input have lower size, like 64x64?

Finally, is there any difference if the three last layers of the network are fully-connected or fully-conv (previously tuned with net surgery)?

Thanks a lot!

Hermann Hesse

unread,
Sep 28, 2016, 5:24:13 AM9/28/16
to Caffe Users
As summary: when an image (>224x224x3) comes in a trained neural network (224x224x3), it downsamples the image before forwarding? or maybe it checks more than one crop from the input by means of a sliding window?

Reply all
Reply to author
Forward
0 new messages