Skip to content

Commit

Permalink
Update video, offset in loop
Browse files Browse the repository at this point in the history
  • Loading branch information
achalddave committed Jan 19, 2017
1 parent ebcb4fb commit 4df498d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion data_loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,14 @@ function SequentialSampler:sample_keys(num_sequences)
self.batch_size, num_sequences))
for sequence = 1, num_sequences do
local sampled_key = self.next_frames[sequence]
local video, offset = self.data_source:frame_video_offset(sampled_key)
local sequence_valid = true
local video, offset
-- Add steps from the sequence to batch_keys until the sequence ends.
for step = 1, self.sequence_length do
sequence_valid =
self.key_label_map[sampled_key] ~= nil and sequence_valid
if sequence_valid then
video, offset = self.data_source:frame_video_offset(sampled_key)
table.insert(batch_keys[step], sampled_key)
else
table.insert(batch_keys[step], END_OF_SEQUENCE)
Expand Down

0 comments on commit 4df498d

Please sign in to comment.