Skip to content

Commit

Permalink
bug fix in combineall
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiyangZhou committed Apr 27, 2019
1 parent a52d128 commit bb6dc46
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions torchreid/data/datasets/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,27 @@ def __add__(self, other):
camid += self.num_train_cams
train.append((img_path, pid, camid))

# set verbose=False to avoid duplicate print
###################################
# Things to do beforehand:
# 1. set verbose=False to avoid unnecessary print
# 2. set combineall=False because combineall would have been applied
# if it was True for a specific dataset, setting it to True will
# create new IDs that should have been included
###################################
if isinstance(train[0][0], str):
return ImageDataset(
train, self.query, self.gallery,
transform=self.transform,
mode=self.mode,
combineall=self.combineall,
combineall=False,
verbose=False
)
else:
return VideoDataset(
train, self.query, self.gallery,
transform=self.transform,
mode=self.mode,
combineall=self.combineall,
combineall=False,
verbose=False
)

Expand All @@ -102,7 +108,8 @@ def __radd__(self, other):
return self.__add__(other)

def parse_data(self, data):
"""Parses data list.
"""Parses data list and returns the number of person IDs
and the number of camera views.
Args:
data (list): contains tuples of (img_path(s), pid, camid)
Expand Down

0 comments on commit bb6dc46

Please sign in to comment.