未验证 提交 058fafd2 编写于 作者: G Guanghua Yu 提交者: GitHub

fix mosaic in voc dataset (#6021)

* fix mosaic in voc dataset

* fix is_crowd
上级 ec1e082f
...@@ -3217,9 +3217,11 @@ class Mosaic(BaseOperator): ...@@ -3217,9 +3217,11 @@ class Mosaic(BaseOperator):
_gt_bbox[:, 2] = scale * gt_bbox[:, 2] + padw _gt_bbox[:, 2] = scale * gt_bbox[:, 2] + padw
_gt_bbox[:, 3] = scale * gt_bbox[:, 3] + padh _gt_bbox[:, 3] = scale * gt_bbox[:, 3] + padh
is_crowd = sp['is_crowd'] if 'is_crowd' in sp else np.zeros(
(len(_gt_bbox), 1), dtype=np.int32)
mosaic_gt_bbox.append(_gt_bbox) mosaic_gt_bbox.append(_gt_bbox)
mosaic_gt_class.append(sp['gt_class']) mosaic_gt_class.append(sp['gt_class'])
mosaic_is_crowd.append(sp['is_crowd']) mosaic_is_crowd.append(is_crowd)
# 2. clip bbox and get mosaic_labels([gt_bbox, gt_class, is_crowd]) # 2. clip bbox and get mosaic_labels([gt_bbox, gt_class, is_crowd])
if len(mosaic_gt_bbox): if len(mosaic_gt_bbox):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册