Skip to content

Commit

Permalink
Merge pull request #7 from jliersch/master
Browse files Browse the repository at this point in the history
Update utils.py
  • Loading branch information
master committed Apr 27, 2023
2 parents f84e520 + adc809d commit f706e2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/shared/utils.py
Expand Up @@ -2,6 +2,7 @@
import zipfile
import os
import glob
from pathlib import Path

import tqdm
import scipy.io
Expand Down Expand Up @@ -41,5 +42,5 @@ def load_matlab_data(key, data_dir, *folders):
examples, labels = [], []
for filename in glob.glob(os.path.join(*folders)):
examples.append(scipy.io.loadmat(filename)[key])
labels.append(int(filename.split("/")[-2]))
labels.append(int(Path(filename).parts[-2]))
return np.stack(examples), np.array(labels) - 1

0 comments on commit f706e2f

Please sign in to comment.