Skip to content

Commit 2e97f19

Browse files
authored
[MOT] Fix mot source (#3061)
* fix mot_source * fix mot_source, test=document_fix
1 parent 2b7a999 commit 2e97f19

File tree

3 files changed

+5
-24
lines changed

3 files changed

+5
-24
lines changed

configs/datasets/mot.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ TrainDataset:
1919
image_lists: ['mot17.train', 'caltech.all', 'cuhksysu.train', 'prw.train', 'citypersons.train', 'eth.train']
2020
data_fields: ['image', 'gt_bbox', 'gt_class', 'gt_ide']
2121

22+
# for detection or reid evaluation, no use in MOT evaluation
2223
EvalDataset:
2324
!MOTDataSet
2425
dataset_dir: dataset/mot
25-
image_lists: ['citypersons.val', 'caltech.val'] # for detection
26-
# image_lists: ['caltech.10k.val', 'cuhksysu.val', 'prw.val'] # for reid
26+
image_lists: ['citypersons.val', 'caltech.val'] # for detection evaluation
27+
# image_lists: ['caltech.10k.val', 'cuhksysu.val', 'prw.val'] # for reid evaluation
2728
data_fields: ['image', 'gt_bbox', 'gt_class', 'gt_ide']
2829

30+
# for detection inference, no use in MOT inference
2931
TestDataset:
3032
!ImageFolder
3133
dataset_dir: dataset/mot

ppdet/data/source/mot.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -124,28 +124,6 @@ def parse_dataset(self):
124124
self.img_start_index[data_name] = img_index
125125
img_index += len(self.img_files[data_name])
126126

127-
# check data directory, images and labels_with_ids
128-
if len(self.img_files[data_name]) == 0:
129-
continue
130-
else:
131-
# self.img_files[data_name] each line following this:
132-
# {self.dataset_dir}/MOT17/images/...
133-
first_path = self.img_files[data_name][0]
134-
data_dir = first_path.replace(self.dataset_dir,
135-
'').split('/')[1]
136-
data_dir = os.path.join(self.dataset_dir, data_dir)
137-
assert os.path.exists(data_dir), \
138-
"The data directory {} does not exist.".format(data_dir)
139-
140-
data_dir_images = os.path.join(data_dir, 'images')
141-
assert os.path.exists(data_dir), \
142-
"The data images directory {} does not exist.".format(data_dir_images)
143-
144-
data_dir_labels_with_ids = os.path.join(data_dir,
145-
'labels_with_ids')
146-
assert os.path.exists(data_dir), \
147-
"The data labels directory {} does not exist.".format(data_dir_labels_with_ids)
148-
149127
# record label_files
150128
self.label_files[data_name] = [
151129
x.replace('images', 'labels_with_ids').replace(

ppdet/data/transform/mot_operators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import cv2
2626
import copy
2727
import numpy as np
28+
import random
2829
import math
2930

3031
from .operators import BaseOperator, register_op

0 commit comments

Comments
 (0)