hbilen/WSDDN

ROIS offset

zhaohui-yang opened this issue · 2 comments

I'm curious why I should use offset on rois? can't I just rescale rois by 1/16? Thanks~

train.m
ss = [16 16] ;
if is_vgg16
o0 = 8.5 ;
o1 = 9.5 ;
else
o0 = 18 ;
o1 = 9.5 ;
end
rois = [ rois(1,:);
floor((rois(2,:) - o0 + o1) / ss(1) + 0.5) + 1;
floor((rois(3,:) - o0 + o1) / ss(2) + 0.5) + 1;
ceil((rois(4,:) - o0 - o1) / ss(1) - 0.5) + 1;
ceil((rois(5,:) - o0 - o1) / ss(2) - 0.5) + 1];

by the way, there is not momentum when optimizing, right?

when fetch data, rois, you calculate center, newh, neww? Will there be difference if I use rois = rois * scale_ratio

`
h = szIn(1);
w = szIn(2);

bxr = 0.5 * (boxIn(:,2)+boxIn(:,4)) / w;
byr = 0.5 * (boxIn(:,1)+boxIn(:,3)) / h;

bwr = (boxIn(:,4)-boxIn(:,2)+1) / w;
bhr = (boxIn(:,3)-boxIn(:,1)+1) / h;

% boxIn center in new coord
byhat = (szOut(1) * byr);
bxhat = (szOut(2) * bxr);

% relative width, height
bhhat = szOut(1) * bhr;
bwhat = szOut(2) * bwr;

% transformed boxIn
boxOut = [max(1,round(byhat - 0.5 * bhhat)),...
max(1,round(bxhat - 0.5 * bwhat)), ...
min(szOut(1),round(byhat + 0.5 * bhhat)),...
min(szOut(2),round(bxhat + 0.5 * bwhat))];`