Skip to content

Commit

Permalink
Merge pull request #281 from neworderofjamie/dvs_user
Browse files Browse the repository at this point in the history
Exposes 'user' ID and lighting description for DVS gesture
  • Loading branch information
biphasic authored Mar 9, 2024
2 parents 20df5ee + 5d3f7bc commit db10787
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tonic/datasets/dvsgesture.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,21 @@ def __init__(
if not self._check_exists():
self.download()

self.users = []
self.lighting = []
file_path = os.path.join(self.location_on_system, self.folder_name)
for path, dirs, files in os.walk(file_path):
dirs.sort()
for file in files:
if file.endswith("npy"):
self.data.append(path + "/" + file)
self.targets.append(int(file[:-4]))
rel_path = os.path.relpath(path, file_path)
if rel_path != ".":
user, lighting = rel_path.split("_", 1)
user = int(user[4:])
dirs.sort()
for file in files:
if file.endswith("npy"):
self.data.append(os.path.join(path, file))
self.targets.append(int(file[:-4]))
self.users.append(user)
self.lighting.append(lighting)

def __getitem__(self, index):
"""
Expand Down

0 comments on commit db10787

Please sign in to comment.