How to explicitly specify crop dimensions in Crop Layer

23 views
Skip to first unread message

Tarun Sharma

unread,
Jun 8, 2016, 12:25:20 PM6/8/16
to Caffe Users
Hello ...Crop layer usually takes two input blobs (bottom), and resizes the first one to the dimensions of the second one. I wanted to how to explicitly specify the dimensions to crop to instead of using two blobs.

layer {
  name: "crop"
  type: "Crop"
  bottom: "pool5"
  bottom: ""
  top: "cropped"
}


I don't have another blob to specify in the second bottom but I want to resize the output from 15x15 to 7x7. How to specify the dimensions to crop to explicitly ?


Thank you

Tarun Sharma

unread,
Jun 8, 2016, 2:04:59 PM6/8/16
to Caffe Users
I got this to work by creating another dummy input layer and then using this in the crop function. Please let me know if there is a better method to do this

layer {
   name: "input"
   type: "Input"
   top: "input"
   input_param {
   shape {
     dim: 5
     dim: 512
     dim: 7
     dim: 7

  }
}
}

layer {
  name: "crop"
  type: "Crop"
  bottom: "pool5"
  bottom: "input"
  top: "cropped"
Reply all
Reply to author
Forward
0 new messages