pull/405/head
KaiyangZhou 2020-06-23 14:07:54 +01:00
parent aefe335d68
commit d18b3ad99a
5 changed files with 6 additions and 14 deletions

View File

@ -33,6 +33,7 @@ You can find some research projects that are built on top of Torchreid `here <ht
What's new
------------
- [Jun 2020] ``1.2.4``: Dataloader's output from ``__getitem__`` has been changed from ``list`` to ``dict``. Previously, an element, e.g. image tensor, was fetched with ``imgs=data[0]``. Now it should be obtained by ``imgs=data['img']``. See this `commit <https://github.com/KaiyangZhou/deep-person-reid/commit/aefe335d68f39a20160860e6d14c2d34f539b8a5>`_ for detailed changes.
- [May 2020] Added the person attribute recognition code used in `Omni-Scale Feature Learning for Person Re-Identification (ICCV'19) <https://arxiv.org/abs/1905.00953>`_. See ``projects/attribute_recognition/``.
- [May 2020] ``1.2.1``: Added a simple API for feature extraction (``torchreid/utils/feature_extractor.py``). See the `documentation <https://kaiyangzhou.github.io/deep-person-reid/user_guide.html>`_ for the instruction.
- [Apr 2020] Code for reproducing the experiments of `deep mutual learning <https://zpascal.net/cvpr2018/Zhang_Deep_Mutual_Learning_CVPR_2018_paper.pdf>`_ in the `OSNet paper <https://arxiv.org/pdf/1905.00953v6.pdf>`__ (Supp. B) has been released at ``projects/DML``.

View File

@ -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)

View File

@ -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()

View File

@ -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'

View File

@ -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