Commit cfc3f545 authored by zhangwenwei's avatar zhangwenwei
Browse files

Merge branch 'pipeline_md' into 'master'

update pipeline markdown

See merge request open-mmlab/mmdet.3d!143
parents 2f5604d2 a5108be2
...@@ -19,33 +19,64 @@ We present a classical pipeline in the following figure. The blue blocks are pip ...@@ -19,33 +19,64 @@ We present a classical pipeline in the following figure. The blue blocks are pip
The operations are categorized into data loading, pre-processing, formatting and test-time augmentation. The operations are categorized into data loading, pre-processing, formatting and test-time augmentation.
Here is an pipeline example for Faster R-CNN. Here is an pipeline example for PointPillars.
```python ```python
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [ train_pipeline = [
dict(type='LoadImageFromFile'), dict(
dict(type='LoadAnnotations', with_bbox=True), type='LoadPointsFromFile',
dict(type='Resize', img_scale=(1333, 800), keep_ratio=True), load_dim=5,
dict(type='RandomFlip', flip_ratio=0.5), use_dim=5,
dict(type='Normalize', **img_norm_cfg), file_client_args=file_client_args),
dict(type='Pad', size_divisor=32), dict(
dict(type='DefaultFormatBundle'), type='LoadPointsFromMultiSweeps',
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']), sweeps_num=10,
file_client_args=file_client_args),
dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True),
dict(
type='GlobalRotScaleTrans',
rot_range=[-0.3925, 0.3925],
scale_ratio_range=[0.95, 1.05],
translation_std=[0, 0, 0]),
dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5),
dict(type='PointsRangeFilter', point_cloud_range=point_cloud_range),
dict(type='ObjectRangeFilter', point_cloud_range=point_cloud_range),
dict(type='ObjectNameFilter', classes=class_names),
dict(type='PointShuffle'),
dict(type='DefaultFormatBundle3D', class_names=class_names),
dict(type='Collect3D', keys=['points', 'gt_bboxes_3d', 'gt_labels_3d'])
] ]
test_pipeline = [ test_pipeline = [
dict(type='LoadImageFromFile'), dict(
type='LoadPointsFromFile',
load_dim=5,
use_dim=5,
file_client_args=file_client_args),
dict(
type='LoadPointsFromMultiSweeps',
sweeps_num=10,
file_client_args=file_client_args),
dict( dict(
type='MultiScaleFlipAug', type='MultiScaleFlipAug',
img_scale=(1333, 800), img_scale=(1333, 800),
pts_scale_ratio=1.0,
flip=False, flip=False,
pcd_horizontal_flip=False,
pcd_vertical_flip=False,
transforms=[ transforms=[
dict(type='Resize', keep_ratio=True), dict(
dict(type='RandomFlip'), type='GlobalRotScaleTrans',
dict(type='Normalize', **img_norm_cfg), rot_range=[0, 0],
dict(type='Pad', size_divisor=32), scale_ratio_range=[1., 1.],
dict(type='ImageToTensor', keys=['img']), translation_std=[0, 0, 0]),
dict(type='Collect', keys=['img']), dict(type='RandomFlip3D'),
dict(
type='PointsRangeFilter', point_cloud_range=point_cloud_range),
dict(
type='DefaultFormatBundle3D',
class_names=class_names,
with_label=False),
dict(type='Collect3D', keys=['points'])
]) ])
] ]
``` ```
...@@ -54,75 +85,53 @@ For each operation, we list the related dict fields that are added/updated/remov ...@@ -54,75 +85,53 @@ For each operation, we list the related dict fields that are added/updated/remov
### Data loading ### Data loading
`LoadImageFromFile` `LoadPointsFromFile`
- add: img, img_shape, ori_shape - add: points
`LoadAnnotations` `LoadPointsFromMultiSweeps`
- add: gt_bboxes, gt_bboxes_ignore, gt_labels, gt_masks, gt_semantic_seg, bbox_fields, mask_fields - update: points
`LoadProposals` `LoadAnnotations`
- add: proposals - add: gt_bboxes_3d, gt_labels_3d, pts_instance_mask, pts_semantic_mask, bbox3d_fields, pts_mask_fields, pts_seg_fields
### Pre-processing ### Pre-processing
`Resize` `GlobalRotScaleTrans`
- add: scale, scale_idx, pad_shape, scale_factor, keep_ratio - add: pcd_trans, pcd_rotation, pcd_scale_factor
- update: img, img_shape, *bbox_fields, *mask_fields, *seg_fields - update: points, *bbox3d_fields
`RandomFlip` `RandomFlip3D`
- add: flip - add: flip, pcd_horizontal_flip, pcd_vertical_flip
- update: img, *bbox_fields, *mask_fields, *seg_fields - update: points, *bbox3d_fields
`Pad` `PointsRangeFilter`
- add: pad_fixed_size, pad_size_divisor - update: points
- update: img, pad_shape, *mask_fields, *seg_fields
`RandomCrop` `ObjectRangeFilter`
- update: img, pad_shape, gt_bboxes, gt_labels, gt_masks, *bbox_fields - update: gt_bboxes_3d, gt_labels_3d
`Normalize` `ObjectNameFilter`
- add: img_norm_cfg - update: gt_bboxes_3d, gt_labels_3d
- update: img
`SegRescale` `PointShuffle`
- update: gt_semantic_seg - update: points
`PhotoMetricDistortion` `PointsRangeFilter`
- update: img - update: points
`Expand`
- update: img, gt_bboxes
`MinIoURandomCrop`
- update: img, gt_bboxes, gt_labels
`Corrupt`
- update: img
### Formatting ### Formatting
`ToTensor` `DefaultFormatBundle3D`
- update: specified by `keys`. - update: voxels, coors, voxel_centers, num_points, points, gt_bboxes_3d, gt_labels_3d, gt_bboxes, gt_labels
`ImageToTensor`
- update: specified by `keys`.
`Transpose`
- update: specified by `keys`.
`ToDataContainer`
- update: specified by `fields`.
`DefaultFormatBundle`
- update: img, proposals, gt_bboxes, gt_bboxes_ignore, gt_labels, gt_masks, gt_semantic_seg
`Collect` `Collect3D`
- add: img_meta (the keys of img_meta is specified by `meta_keys`) - add: img_meta (the keys of img_meta is specified by `meta_keys`)
- remove: all other keys except for those specified by `keys` - remove: all other keys except for those specified by `keys`
### Test time augmentation ### Test time augmentation
`MultiScaleFlipAug` `MultiScaleFlipAug`
- update: scale, pcd_scale_factor, flip, flip_direction, pcd_horizontal_flip, pcd_vertical_flip with list of augmented data with these specific parameters
## Extend and use custom pipelines ## Extend and use custom pipelines
...@@ -148,17 +157,29 @@ For each operation, we list the related dict fields that are added/updated/remov ...@@ -148,17 +157,29 @@ For each operation, we list the related dict fields that are added/updated/remov
3. Use it in config files. 3. Use it in config files.
```python ```python
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [ train_pipeline = [
dict(type='LoadImageFromFile'), dict(
dict(type='LoadAnnotations', with_bbox=True), type='LoadPointsFromFile',
dict(type='Resize', img_scale=(1333, 800), keep_ratio=True), load_dim=5,
dict(type='RandomFlip', flip_ratio=0.5), use_dim=5,
dict(type='Normalize', **img_norm_cfg), file_client_args=file_client_args),
dict(type='Pad', size_divisor=32), dict(
type='LoadPointsFromMultiSweeps',
sweeps_num=10,
file_client_args=file_client_args),
dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True),
dict(
type='GlobalRotScaleTrans',
rot_range=[-0.3925, 0.3925],
scale_ratio_range=[0.95, 1.05],
translation_std=[0, 0, 0]),
dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5),
dict(type='PointsRangeFilter', point_cloud_range=point_cloud_range),
dict(type='ObjectRangeFilter', point_cloud_range=point_cloud_range),
dict(type='ObjectNameFilter', classes=class_names),
dict(type='MyTransform'), dict(type='MyTransform'),
dict(type='DefaultFormatBundle'), dict(type='PointShuffle'),
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']), dict(type='DefaultFormatBundle3D', class_names=class_names),
dict(type='Collect3D', keys=['points', 'gt_bboxes_3d', 'gt_labels_3d'])
] ]
``` ```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment