mirror of https://github.com/JDAI-CV/fast-reid.git
bugfix for veriwild and vehicleid
Change `camids` from string to int when evaluation, otherwise, it will raise AttributeError #497pull/525/head
parent
ac6256887c
commit
d792a69f3f
|
@ -58,9 +58,11 @@ class VehicleID(ImageDataset):
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
vid = int(line.split(' ')[1])
|
vid = int(line.split(' ')[1])
|
||||||
imgid = line.split(' ')[0]
|
imgid = line.split(' ')[0]
|
||||||
img_path = osp.join(self.image_dir, imgid + '.jpg')
|
img_path = osp.join(self.image_dir, f"{imgid}.jpg")
|
||||||
|
imgid = int(imgid)
|
||||||
if is_train:
|
if is_train:
|
||||||
vid = self.dataset_name + '_' + str(vid)
|
vid = f"{self.dataset_name}_{vid}"
|
||||||
|
imgid = f"{self.dataset_name}_{imgid}"
|
||||||
dataset.append((img_path, vid, imgid))
|
dataset.append((img_path, vid, imgid))
|
||||||
|
|
||||||
if is_train: return dataset
|
if is_train: return dataset
|
||||||
|
|
|
@ -64,9 +64,11 @@ class VeRiWild(ImageDataset):
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
vid = int(line.split('/')[0])
|
vid = int(line.split('/')[0])
|
||||||
imgid = line.split('/')[1].split('.')[0]
|
imgid = line.split('/')[1].split('.')[0]
|
||||||
|
camid = int(self.imgid2camid[imgid])
|
||||||
if is_train:
|
if is_train:
|
||||||
vid = self.dataset_name + '_' + str(vid)
|
vid = f"{self.dataset_name}_{vid}"
|
||||||
dataset.append((self.imgid2imgpath[imgid], vid, self.imgid2camid[imgid]))
|
camid = f"{self.dataset_name}_{camid}"
|
||||||
|
dataset.append((self.imgid2imgpath[imgid], vid, camid))
|
||||||
|
|
||||||
assert len(dataset) == len(img_list_lines)
|
assert len(dataset) == len(img_list_lines)
|
||||||
return dataset
|
return dataset
|
||||||
|
|
Loading…
Reference in New Issue