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

The shuffle operation in the data loading process. #22

Closed
wanghao14 opened this issue Dec 14, 2019 · 3 comments
Closed

The shuffle operation in the data loading process. #22

wanghao14 opened this issue Dec 14, 2019 · 3 comments

Comments

@wanghao14
Copy link

Hi, thanks for your inspiring work! I am new to tensorflow and optical flow estimation, and I am trying to learn your code recently. I don't quite understand here in your code: the order of the data sequence is shuffled. In this way, can we ensure that a batch of images read from the sequence is consecutive?
Because tensorflow has few documents, I don't know if my understanding is correct. Looking forward to your response.

@Yuliang-Zou
Copy link
Member

Hi @wanghao14 , actually the consecutive frames are concatenated together during data preprocessing. So we can make sure we can get consecutive frames even if the data is shuffled.

@wanghao14
Copy link
Author

@Yuliang-Zou Sorry, I still have some questions.
In the function named format_file_list, the path to the images is stored in the list file_list['image_file_list'], which looks like

['$data_root$/2011_09_26_drive_0001_sync_02/0000000002.jpg', '$data_root$/2011_09_26_drive_0001_sync_02/0000000004.jpg', '$data_root$/2011_09_26_drive_0001_sync_02/0000000005.jpg',..., '$data_root$/2011_10_03_drive_0042_sync_03/0000001166.jpg']

.
Then, it will be used as the input to tf.train.string_input_producer with shuffling, and I think the sequence looks like

['$data_root$/2011_09_26_drive_0001_sync_02/0000000005.jpg', '$data_root$/2011_10_03_drive_0042_sync_03/0000001066.jpg', '$data_root$/2011_09_30_drive_0028_sync_03/0000002128.jpg', '$data_root$/2011_09_26_drive_0001_sync_02/0000000036.jpg', ...]

, which means that the order of image sequence is not consecutive. Then in the function named unpack_image_sequence, the middle(3th) image is treated as target image and the first two images and last two images are treated as source images. I don't think these five images are consecutive, and this is where I am confused. Could you please explain this part? Or some details of your data preprocessing? Because I am new to tensorflow, my question may be naive. I hope it doesn't bother you.

@Yuliang-Zou
Copy link
Member

You can see the data preprocessing in data/kitti/kitti_raw_loader.py. We actually concatenate consecutive frames before we start training.

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