diff --git a/README.rst b/README.rst index d2b8e13..2c7210f 100755 --- a/README.rst +++ b/README.rst @@ -33,6 +33,7 @@ You can find some research projects that are built on top of Torchreid `here `_ for detailed changes. - [May 2020] Added the person attribute recognition code used in `Omni-Scale Feature Learning for Person Re-Identification (ICCV'19) `_. See ``projects/attribute_recognition/``. - [May 2020] ``1.2.1``: Added a simple API for feature extraction (``torchreid/utils/feature_extractor.py``). See the `documentation `_ for the instruction. - [Apr 2020] Code for reproducing the experiments of `deep mutual learning `_ in the `OSNet paper `__ (Supp. B) has been released at ``projects/DML``. diff --git a/tools/compute_mean_std.py b/tools/compute_mean_std.py index 2f4f107..e0a5dbe 100644 --- a/tools/compute_mean_std.py +++ b/tools/compute_mean_std.py @@ -42,7 +42,7 @@ def main(): std = 0. n_samples = 0. for data in train_loader: - data = data[0] + data = data['img'] batch_size = data.size(0) data = data.view(batch_size, data.size(1), -1) mean += data.mean(2).sum(0) diff --git a/tools/visualize_actmap.py b/tools/visualize_actmap.py index 0d769b6..ae69991 100644 --- a/tools/visualize_actmap.py +++ b/tools/visualize_actmap.py @@ -48,7 +48,7 @@ def visactmap( print('Visualizing activation maps for {} ...'.format(target)) for batch_idx, data in enumerate(data_loader): - imgs, paths = data[0], data[3] + imgs, paths = data['img'], data['impath'] if use_gpu: imgs = imgs.cuda() diff --git a/torchreid/__init__.py b/torchreid/__init__.py index 77a24e6..a8d65a9 100644 --- a/torchreid/__init__.py +++ b/torchreid/__init__.py @@ -2,7 +2,7 @@ from __future__ import print_function, absolute_import from torchreid import data, optim, utils, engine, losses, models, metrics -__version__ = '1.2.3' +__version__ = '1.2.4' __author__ = 'Kaiyang Zhou' __homepage__ = 'https://kaiyangzhou.github.io/' __description__ = 'Deep learning person re-identification in PyTorch' diff --git a/torchreid/data/datasets/dataset.py b/torchreid/data/datasets/dataset.py index 00e1ed6..d922bb2 100644 --- a/torchreid/data/datasets/dataset.py +++ b/torchreid/data/datasets/dataset.py @@ -265,12 +265,7 @@ class ImageDataset(Dataset): img = read_image(img_path) if self.transform is not None: img = self.transform(img) - item = { - 'img': img, - 'pid': pid, - 'camid': camid, - 'impath': img_path - } + item = {'img': img, 'pid': pid, 'camid': camid, 'impath': img_path} return item def show_summary(self): @@ -379,11 +374,7 @@ class VideoDataset(Dataset): imgs.append(img) imgs = torch.cat(imgs, dim=0) - item = { - 'img': imgs, - 'pid': pid, - 'camid': camid - } + item = {'img': imgs, 'pid': pid, 'camid': camid} return item