mattpoggi / depthstillation

Demo code for paper "Learning optical flow from still images", CVPR 2021.
MIT License
152 stars 11 forks source link

Png format to .flo format #6

Closed zhilaAI closed 3 years ago

zhilaAI commented 3 years ago

Hello, Thank you for your great code. How did you train the models for optical flow where the ground truth should be in .flow but your code generates .png format?

Thank you.

FilippoAleotti commented 3 years ago

Hi, You can both: 1) save depthstilled flow maps as flo file, instead of png 2) change the way you load the ground truths in your data loaders, as in RAFT

zhilaAI commented 3 years ago

Thanks for your response. For the first option, I tried but OpenCV and Matplotlib do not support the .flo format. I do try the second option.

mattpoggi commented 3 years ago

Hi, to read .flo files you can use the readFlow function defined here:

https://github.com/princeton-vl/RAFT/blob/master/core/utils/frame_utils.py

zhilaAI commented 3 years ago

Hi, Ya, I checked the code and saw the readFlow function but the problem is writing files in .flo format. Thanks for your suggestion.

mattpoggi commented 3 years ago

Sorry, my misunderstanding. From the same file, have you tried the writeFlow function?

zhilaAI commented 3 years ago

No no thanks for your help. Yes, I tried to use writeFlow to convert png to .flo format but failed.

mattpoggi commented 3 years ago

Did you try it to save flow_01 or flow_16bit?

zhilaAI commented 3 years ago

I tried flow_16bit

mattpoggi commented 3 years ago

Ok, that one is already converted to the KITTI format. You should try with flow_01

zhilaAI commented 3 years ago

I'll try the flow_01 file.

Thank you.