Skip to content

fix matcaffe prepare_batch indexing#1460

Closed
cvondrick wants to merge 1 commit intoBVLC:devfrom
cvondrick:patch-4
Closed

fix matcaffe prepare_batch indexing#1460
cvondrick wants to merge 1 commit intoBVLC:devfrom
cvondrick:patch-4

Conversation

@cvondrick
Copy link

The data_transformer.cpp code crops centers according to the formula

 floor((image_dim - cropped_dim) / 2) 

However, the matlab code crops centers according to the formula:

 floor((image_dim - cropped_dim + 1) / 2) + 1

where the additional +1's are for matlab's indexing at 1. However, you only need one +1. Right now, this causes matcaffe to crop centers one pixel off from the data_transformer.cpp, which makes the extracted features different. I think you should remove one of the +1s so that matcaffe matches data_transformer.cpp exactly.

The data_transformer.cpp code crops centers according to the formula
   floor((image_dim - cropped_dim) / 2)
However, the matlab code crops centers according to the formula:
   floor((image_dim - cropped_dim + 1) / 2) + 1
where the additional +1's are for matlab's indexing at 1. However, you only need one +1. Right now, this causes matcaffe to crop centers one pixel off from the data_transformer.cpp, which makes the extracted features different. I think you should remove one of the +1s so that matcaffe matches data_transformer.cpp exactly.
@shelhamer shelhamer added the ES label Mar 10, 2015
@shelhamer
Copy link
Member

Follow-up if this wasn't addressed by the new matcaffe in #2505.

@shelhamer shelhamer closed this May 30, 2015
@shelhamer shelhamer added Matlab and removed ES labels May 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments