Skip to content

Commit

Permalink
Timestamps saved in float64
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoStoff committed Jul 3, 2020
1 parent d7eb007 commit 0d3bdbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions data_loader/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@ def __getitem__(self, index, seed=None):
item = {'frame': frame,
'flow': flow,
'events': voxel,
'timestamp': ts_k,
'timestamp': torch.tensor(ts_k, dtype=torch.float64),
'data_source_idx': self.data_source_idx,
'dt': dt}
'dt': torch.tensor(dt, dtype=torch.float64)}
else:
item = {'events': voxel,
'timestamp': ts_k,
'timestamp': torch.tensor(ts_k, dtype=torch.float64),
'data_source_idx': self.data_source_idx,
'dt': dt}
'dt': torch.tensor(dt, dtype=torch.float64)}
return item

def compute_frame_indices(self):
Expand Down
2 changes: 1 addition & 1 deletion inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def main(args, model):
else:
flow = flow_t.cpu().numpy()/item['dt'].numpy()
ts = item['timestamp'].cpu().numpy()
flow_dict = {'flow': flow, 'ts': ts}
flow_dict = flow
fname = 'flow_{:010d}.npy'.format(i)
np.save(os.path.join(args.output_folder, fname), flow_dict)
with open(os.path.join(args.output_folder, fname), "a") as myfile:
Expand Down

0 comments on commit 0d3bdbf

Please sign in to comment.