Skip to content

Commit

Permalink
build lists of users indices and lighting in DVS gesture
Browse files Browse the repository at this point in the history
  • Loading branch information
neworderofjamie committed Mar 8, 2024
1 parent 20df5ee commit 5d3f7bc
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 5d3f7bc

Please sign in to comment.