Skip to content

Commit

Permalink
try/catch case where DAVIS dataset doesn't have optitrack targets
Browse files Browse the repository at this point in the history
  • Loading branch information
biphasic committed Jul 10, 2023
1 parent b118083 commit 142d3b4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tonic/datasets/davisdataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,11 @@ def __getitem__(self, index):
images["frames"] = np.stack(images["frames"])
images["ts"] = ((images["ts"] - images["ts"][0]) * 1e6).astype(int)
data = (events, imu, images)
target = topics["/optitrack/davis"]
target["ts"] = ((target["ts"] - target["ts"][0]) * 1e6).astype(int)
try:
target = topics["/optitrack/davis"]
target["ts"] = ((target["ts"] - target["ts"][0]) * 1e6).astype(int)
except KeyError:
target = None

if self.transform is not None:
data = self.transform(data)
Expand Down

0 comments on commit 142d3b4

Please sign in to comment.