Skip to content

Commit

Permalink
fix data_list_path filename
Browse files Browse the repository at this point in the history
  • Loading branch information
ziao-guo committed Mar 26, 2024
1 parent 6256b71 commit 5fc5de3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pygmtools/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self, name, sets, obj_resize=(256, 256), problem='2GM', filter='int
data_set = eval(self.name)(self.sets, self.obj_resize, **args)
suffix = data_set.suffix
self.data_path = os.path.join(data_set.dataset_dir, 'data-' + str(self.obj_resize) + '-' + suffix + '.json')
self.data_list_path = os.path.join(data_set.dataset_dir, sets + '.json')
self.data_list_path = os.path.join(data_set.dataset_dir, sets + '-' + suffix + '.json')
self.classes = data_set.classes

with open(self.data_path) as f:
Expand Down
16 changes: 8 additions & 8 deletions pygmtools/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ def process(self):
Process the dataset and generate ``data-(size, size).json`` for preprocessed dataset, ``train.json`` for
training set, and ``test.json`` for testing set.
"""
train_file = os.path.join(self.dataset_dir, 'train.json')
test_file = os.path.join(self.dataset_dir, 'test.json')
train_file = os.path.join(self.dataset_dir, 'train-' + self.suffix + '.json')
test_file = os.path.join(self.dataset_dir, 'test-' + self.suffix + '.json')
img_file = os.path.join(self.dataset_dir, 'data-' + str(self.obj_resize) + '-' + self.suffix + '.json')
if not (os.path.exists(train_file) and os.path.exists(test_file) and os.path.exists(img_file)):
if not (os.path.exists(train_file) and os.path.exists(test_file)):
Expand Down Expand Up @@ -564,8 +564,8 @@ def process(self):
Process the dataset and generate ``data-(size, size).json`` for preprocessed dataset, ``train.json`` for
training set, and ``test.json`` for testing set.
"""
train_file = os.path.join(self.dataset_dir, 'train.json')
test_file = os.path.join(self.dataset_dir, 'test.json')
train_file = os.path.join(self.dataset_dir, 'train-' + self.suffix + '.json')
test_file = os.path.join(self.dataset_dir, 'test-' + self.suffix + '.json')
img_file = os.path.join(self.dataset_dir, 'data-' + str(self.obj_resize) + '-' + self.suffix + '.json')

data_list = []
Expand Down Expand Up @@ -850,8 +850,8 @@ def process(self):
Process the dataset and generate ``data-(size, size).json`` for preprocessed dataset, ``train.json`` for
training set, and ``test.json`` for testing set.
"""
train_file = os.path.join(self.dataset_dir, 'train.json')
test_file = os.path.join(self.dataset_dir, 'test.json')
train_file = os.path.join(self.dataset_dir, 'train-' + self.suffix + '.json')
test_file = os.path.join(self.dataset_dir, 'test-' + self.suffix + '.json')
img_file = os.path.join(self.dataset_dir, 'data-' + str(self.obj_resize) + '-' + self.suffix + '.json')
if (not os.path.exists(train_file)) or (not os.path.exists(test_file)) or (not os.path.exists(img_file)):
train_list = []
Expand Down Expand Up @@ -1104,7 +1104,7 @@ def process(self):
Process the dataset and generate ``data-(size, size).json`` for preprocessed dataset, ``train.json`` for
training set, and ``test.json`` for testing set.
"""
set_file = os.path.join(self.dataset_dir, self.sets + '.json')
set_file = os.path.join(self.dataset_dir, self.sets + '-' + self.suffix + '.json')
img_file = os.path.join(self.dataset_dir, 'data-' + str(self.obj_resize) + '-' + self.suffix + '.json')

if not os.path.exists(set_file):
Expand Down Expand Up @@ -1301,7 +1301,7 @@ def process(self):
Process the dataset and generate ``data-(size, size).json`` for preprocessed dataset, ``train.json`` for
training set, and ``test.json`` for testing set.
"""
set_file = os.path.join(self.dataset_dir, self.sets + '.json')
set_file = os.path.join(self.dataset_dir, self.sets + '-' + self.suffix + '.json')
img_file = os.path.join(self.dataset_dir, 'data-' + str(self.obj_resize) + '-' + self.suffix + '.json')

if not os.path.exists(set_file):
Expand Down

0 comments on commit 5fc5de3

Please sign in to comment.