ClementPinard / FlowNetPytorch

Pytorch implementation of FlowNet by Dosovitskiy et al.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calculate EPE after multiplying raw optical flow output by div_flow (20)

xuanlongORZ opened this issue · comments

Hi Clement,
First, thank you for your code. I found an issue, when you calculate real EPE in validation, you first calculate the EPE between raw output and gt, then multiply by div_flow. In this way, I can get a good result. However, when I calculate EPE after multiplying raw optical flow output by div_flow, the result is much worse. So I don't know which one should correct and whether I should multiply div_flow to get the real optical flow output for the image pairs from other datasets (sintel, kitti...).
To make it clear:
epe_in_your_code = div_flow*realEPE(output, target, sparse=args.sparse)
epe_for_real_flow = realEPE(upsample(output)*div_flow, target, sparse=args.sparse) <== I don't know if it should be correct

According to another re-implementation https://github.com/ezjong/lightprobnets/tree/master/, this guy did the trick before calculating the epe both during training and validation (run_inference) time. In this case, the calculations can be unified:

during training time:
one_stage_epe(raw optical flow, downsample((1/20)*target)) = one stage raw epe

during inference time:
upsample(raw optical flow)*20 = real optical flow,
epe (real optical flow, target) = real epe

I'm sorry I realized that you normalized the target flow.
I checked if I erased normalization in target_transform then multiply the raw output flow by 20, the result will be good.
I'll close the issue.