microsoft/MaskFlownet

What 512 stand for?

chengrongliang opened this issue · 3 comments

pred[:, :, 2] = (64.0 * (flow[:, :, 0] + 512)).astype(np.uint16)

Hi, Simon, why the flow(:,:,1)+512? What's the 512 stand for?

Hi Rongliang,

The constant 64 and 512 comes from KITTI (how to convert our final prediction flow field to submit format for KITTI). You can find more details in the official document for KITTI dataset.

Yes, I found that the flow values(predicted by MaskFlowNet) are much bigger than ground truth, therefore I got bad eval score. The attachment shows the difference between ground truth(frome training data) and predicted result(MaskFlowNet).
Selection_011

Should we judge the overflow problem? For example, (64.0 * min((flow[:, :, 0] + 512), 512))?

The official document shows the value should be limited,

function flow_write (F,filename)
% saves flow field F to png file
% for details see readme.txt

F = double(F);

I(:,:,1) = uint16(max(min(shiftdim(F(:,:,1))*64+2^15,2^16-1),0));
I(:,:,2) = uint16(max(min(shiftdim(F(:,:,2))*64+2^15,2^16-1),0));
I(:,:,3) = uint16(max(min(shiftdim(F(:,:,3)),1),0));
imwrite(I,filename);

So, I think the different between MaskFlowNet results and ground truth may be caused by overflow.