support old/new naming formats

pull/62/head
KaiyangZhou 2018-07-25 09:50:48 +01:00
parent 90929f827f
commit 2978337cd3
1 changed files with 6 additions and 1 deletions

View File

@ -135,7 +135,12 @@ class DukeMTMCVidReID(object):
continue
img_paths.append(res[0])
img_name = osp.basename(img_paths[0])
camid = int(img_name[5]) - 1 # index-0
if img_name.find('_') == -1:
# old naming format: 0001C6F0099X30823.jpg
camid = int(img_name[5]) - 1
else:
# new naming format: 0001_C6_F0099_X30823.jpg
camid = int(img_name[6]) - 1
img_paths = tuple(img_paths)
tracklets.append((img_paths, pid, camid))