Skip to content

Commit

Permalink
change .h5 file loader to h5py
Browse files Browse the repository at this point in the history
  • Loading branch information
ZuowenWang0000 committed Dec 11, 2023
1 parent 6bc0a0f commit e139f40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tonic/datasets/threeET_eyetracking.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
from typing import Any, Callable, Optional, Tuple

import h5py
import numpy as np
import tables

from tonic.dataset import Dataset
from tonic.io import make_structured_array
Expand Down Expand Up @@ -78,8 +78,8 @@ def __getitem__(self, index: int) -> Tuple[Any, Any]:
(events, target) where target is index of the target class.
"""
# get events from .h5 file
with tables.open_file(self.data[index], "r") as f:
events = f.root.events.read()
with h5py.File(self.data[index], "r") as f:
events = f["events"][:]
# load the sparse labels
with open(self.targets[index], "r") as f:
target = np.array(
Expand Down

0 comments on commit e139f40

Please sign in to comment.