diff --git a/configs/datasets/mot.yml b/configs/datasets/mot.yml index e6e8ee7196f6bfb8e7ee6b4e3018ef3d8a176940..26b30c00be486b22f3e37ef824a382ce1a2d614d 100644 --- a/configs/datasets/mot.yml +++ b/configs/datasets/mot.yml @@ -19,13 +19,15 @@ TrainDataset: image_lists: ['mot17.train', 'caltech.all', 'cuhksysu.train', 'prw.train', 'citypersons.train', 'eth.train'] data_fields: ['image', 'gt_bbox', 'gt_class', 'gt_ide'] +# for detection or reid evaluation, no use in MOT evaluation EvalDataset: !MOTDataSet dataset_dir: dataset/mot - image_lists: ['citypersons.val', 'caltech.val'] # for detection - # image_lists: ['caltech.10k.val', 'cuhksysu.val', 'prw.val'] # for reid + image_lists: ['citypersons.val', 'caltech.val'] # for detection evaluation + # image_lists: ['caltech.10k.val', 'cuhksysu.val', 'prw.val'] # for reid evaluation data_fields: ['image', 'gt_bbox', 'gt_class', 'gt_ide'] +# for detection inference, no use in MOT inference TestDataset: !ImageFolder dataset_dir: dataset/mot diff --git a/ppdet/data/source/mot.py b/ppdet/data/source/mot.py index a8a11dc91d7f8d974d71b3207fd8686c03839625..1e61f440812f905b0f8eeb539530765cea84e6f3 100644 --- a/ppdet/data/source/mot.py +++ b/ppdet/data/source/mot.py @@ -124,28 +124,6 @@ class MOTDataSet(DetDataset): self.img_start_index[data_name] = img_index img_index += len(self.img_files[data_name]) - # check data directory, images and labels_with_ids - if len(self.img_files[data_name]) == 0: - continue - else: - # self.img_files[data_name] each line following this: - # {self.dataset_dir}/MOT17/images/... - first_path = self.img_files[data_name][0] - data_dir = first_path.replace(self.dataset_dir, - '').split('/')[1] - data_dir = os.path.join(self.dataset_dir, data_dir) - assert os.path.exists(data_dir), \ - "The data directory {} does not exist.".format(data_dir) - - data_dir_images = os.path.join(data_dir, 'images') - assert os.path.exists(data_dir), \ - "The data images directory {} does not exist.".format(data_dir_images) - - data_dir_labels_with_ids = os.path.join(data_dir, - 'labels_with_ids') - assert os.path.exists(data_dir), \ - "The data labels directory {} does not exist.".format(data_dir_labels_with_ids) - # record label_files self.label_files[data_name] = [ x.replace('images', 'labels_with_ids').replace( diff --git a/ppdet/data/transform/mot_operators.py b/ppdet/data/transform/mot_operators.py index 54f6438eb20a4e9adaf5cf3d476977eaa765cb88..4944ec6fa4b1e1652f794da7cf218d81aa103c6d 100644 --- a/ppdet/data/transform/mot_operators.py +++ b/ppdet/data/transform/mot_operators.py @@ -25,6 +25,7 @@ from numbers import Integral import cv2 import copy import numpy as np +import random import math from .operators import BaseOperator, register_op