From bb6dc46e21e335789b9d891f7191c1da3a5d2e01 Mon Sep 17 00:00:00 2001 From: KaiyangZhou Date: Sat, 27 Apr 2019 23:30:32 +0100 Subject: [PATCH] bug fix in combineall --- torchreid/data/datasets/dataset.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/torchreid/data/datasets/dataset.py b/torchreid/data/datasets/dataset.py index 2c93a17..bf1db07 100644 --- a/torchreid/data/datasets/dataset.py +++ b/torchreid/data/datasets/dataset.py @@ -76,13 +76,19 @@ class Dataset(object): 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: @@ -90,7 +96,7 @@ class Dataset(object): train, self.query, self.gallery, transform=self.transform, mode=self.mode, - combineall=self.combineall, + combineall=False, verbose=False ) @@ -102,7 +108,8 @@ class Dataset(object): 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)