Skip to content

Commit adc809d

Browse files
authored
Update utils.py
Enable running spdnet example in windows
1 parent f84e520 commit adc809d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/shared/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import zipfile
33
import os
44
import glob
5+
from pathlib import Path
56

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

0 commit comments

Comments
 (0)