-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MOT] add MOT data #2789
[MOT] add MOT data #2789
Conversation
'DecodeVideo', 'Resize_LetterBox', 'AugmentHSV', 'NormalizedBbox2PixelBbox', | ||
'RandomAffine', 'BboxXYWH2XYXY', | ||
'Gt2JDETargetThres', 'Gt2JDETargetMax', | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里面感觉DecodeVideo,AugmentHSV,NormalizedBbox2PixelBbox,RandomAffine,BboxXYWH2XYXY都属于通用的预处理操作?可以放到operators里?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里面感觉DecodeVideo,AugmentHSV,NormalizedBbox2PixelBbox,RandomAffine,BboxXYWH2XYXY都属于通用的预处理操作?可以放到operators里?
原本是放在operators.py里的,那只有'Gt2JDETargetThres', 'Gt2JDETargetMax'需要分出去到mot_operators.py吗?,还是也放在batch_operators.py ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, mot_operators.py里只保留了'Resize_LetterBox', 'Gt2JDETargetThres', 'Gt2JDETargetMax'
|
||
|
||
@register_op | ||
class Norm2PixelBbox(BaseOperator): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Norm2PixelBbox, BboxCXCYWH2XYXY能否去除?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config里的EvalReader有用到,是eval检测结果时用到的
dataset_dir (str): root directory for dataset. | ||
image_dir (str): directory for images. | ||
anno_path (str): annotation file path. | ||
image_lists (str|list): mot data image lists, muiti-source mot dataset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
给个示例更好,看着下面有‘image_lists’, ‘labels_with_ids’硬规则
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已加在注释中
|
||
|
||
@register_mot_op | ||
class Resize_LetterBox(BaseOperator): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注意Python Code Style
Resize_LetterBox -> ResizeLetterBox
Letter这里是啥意思呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
letterbox是resize的一种,保持图片的长宽比,剩下的部分填补灰色,以免暴力resize造成图片失真。ultralytics/yolov3#232
现有operators.py的4个OP各自稍微改动也可以组成letterbox的效果,但是不完全对齐,与其改动4个OP不如新加一个OP
super(DecodeVideo, self).__init__() | ||
|
||
def apply(self, sample, context=None): | ||
im = sample['image'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的 sample['image']是个video吗?
Decode的含义是解码,VideoCapture才包含解码。下面cvtColor是解码之后的color space的变化。这里这个命名不适合。
另外,DecodeVideo这个函数有用吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sample['image']是图片,视频是在dataloader里解码为图片的,所以送入DecodeVideo的已经是numpy的图片。DecodeVideo在config的TestMOTReader里,制作demo时或者infer直接读视频去过模型得到结果, 因为读图片文件夹的话,时间长点的视频抽出来的图片数太多太多,也占空间。
已暂时去除。
ppdet/data/source/mot.py
Outdated
img_index = 0 | ||
for data_name in self.image_lists: | ||
with open( | ||
os.path.join(dataset_dir, 'image_lists', data_name), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的image_lists应该对应anno_path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个严格意义上不是anno,就只是个图片路径的list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
!MOTDataSet | ||
dataset_dir: dataset/mot | ||
image_lists: ['citypersons.val', 'caltech.val'] # for detection | ||
# image_lists: ['caltech.10k.val', 'cuhksysu.val', 'prw.val'] # for reid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个在什么场景用到,如果有模型依赖这个的话,可以另加一个mot_reid.yml
的数据集配置
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个在什么场景用到,如果有模型依赖这个的话,可以另加一个
mot_reid.yml
的数据集配置
eval 模型的指标可选择3种模式。eval检测使用['citypersons.val', 'caltech.val'],eval reid 使用['caltech.10k.val', 'cuhksysu.val', 'prw.val'],这两种是EvalDataset的配置(MOTDataSet),就和其他检测模型的流程一样。eval 跟踪的指标MOTA,具体eval哪个跟踪数据集由运行命令行参数控制,是EvalMOTDataset的配置(ImageFolder),每个视频序列是按图片文件夹形式去读取的。
eval检测或reid并不常用,个人觉得没有必要分出去再写一个
""" Resize the image numpy. | ||
""" | ||
im = sample['image'] | ||
h, w = sample['im_shape'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
h, w = im.shape
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
if isinstance(self.anno_path, list): | ||
for path in self.anno_path: | ||
self.dataset_dir = get_dataset_path(self.dataset_dir, path, | ||
self.image_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里self.dataset_dir
会被重写覆盖?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不会覆盖,只是检查各个数据集目录是否存在。self.dataset_dir在configs/datasets/mot.yml里一般设置为dataset/mot
* add mot data * fix operators, source * fix data source transform * fix parse_dataset register_op * fix scale_factor, RandomAffine * add assert for check * fix ci
* add mot data * fix operators, source * fix data source transform * fix parse_dataset register_op * fix scale_factor, RandomAffine * add assert for check * fix ci
* add mot data * fix operators, source * fix data source transform * fix parse_dataset register_op * fix scale_factor, RandomAffine * add assert for check * fix ci
No description provided.