Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flipped flow maps in the flow loss #16

Open
sanjayharesh opened this issue Feb 11, 2022 · 3 comments
Open

Flipped flow maps in the flow loss #16

sanjayharesh opened this issue Feb 11, 2022 · 3 comments

Comments

@sanjayharesh
Copy link

Hi Gengshan,

Thanks for the great work.

I noticed that you flip the flows before saving in autogen.py

lasr/preprocess/auto_gen.py

Lines 173 to 178 in 29d8759

write_pfm('%s/FlowFW/flo-%05d.pfm'% (seqname,ix ),flowfw[::-1].astype(np.float32))
write_pfm('%s/FlowFW/occ-%05d.pfm'% (seqname,ix ),occfw[::-1].astype(np.float32))
write_pfm('%s/FlowBW/flo-%05d.pfm'% (seqname,ix+1),flowbw[::-1].astype(np.float32))
write_pfm('%s/FlowBW/occ-%05d.pfm'% (seqname,ix+1),occbw[::-1].astype(np.float32))
cv2.imwrite('%s/JPEGImages/%05d.jpg'% (seqname,ix), imgL_o[:,:,::-1])
cv2.imwrite('%s/JPEGImages/%05d.jpg'% (seqname,ix+1), imgR_o[:,:,::-1])

Is there a good reason to do this?
An unintended consequence is that it leads to flipped flows being loaded at training time and the flow loss ends up being wrong.

Here's an example of flow error being logged while running lasr on Camel example. As you can see, the ground truth flow here is flipped
image

@gengshan-y
Copy link
Collaborator

Hi, it doesn’t save flipped flow image since write_pfm() internally flips it here. Can you check whether the color-coded flow images are flipped?

@sanjayharesh
Copy link
Author

Yes, there's a corresponding flip operation in readPFM as well,

data = np.flipud(data)

So maybe the initial flipping is not needed?

@gengshan-y
Copy link
Collaborator

Yeah, I believe the flip operation is not necessary within the the pfm functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants