Project

[MMDetection3D] Customize Datasets _ Intro

scone 2023. 2. 10. 12:16

다시 이 시점이 왔다.

 

이게 어려워 보여서 다른 라이브러리 찾다가 easy pointpillars 깃허브를 찾아서 해봤던건데

그냥 어려워도 삽질 해가면서 잘 만들어진 패키지 가지고 계속 시도해볼걸 그랬다.

 

참고 : Waymo Dataset을 가지고 Kitti Dataset으로 변환하는 방법

https://mmdetection3d.readthedocs.io/en/latest/2_new_data_model.html

 

MMDetection3D 사용 Steps

  1. Data Set을 준비합니다.
  2. Config 파일을 세팅 합니다.
  3. Train, Test, Inference 를 진행 합니다.

 

Prepare Customized DATA

Customized Data를 가지고 MMDetection3D를 활용하는 방법으로는 크게 세가지가 있다.

  1. 기존에 존재하는 데이터셋에 형식을 맞춘다. ( 가령 Kitti )
  2. Middle Format에서 형식을 맞추는 방법도 있다.
  3. 아예 새로운 데이터 셋 형식을 만들어 모델에다가 넣는다.

1번과 2번은 reorganize 이후, config 파일만 수정하면 되지만

3번 같은 경우 코드 전체를 수정해야하기 때문에 난이도가 수직 상승한다.

 

KITTI dataset format

참고로 내가 만들고자 하는 Kitti format은 다음과 같이 생겼다.

필요한 것만 가져왔기 때문에 실제 Kitti data 전부의 format은 아니다.

mmdetection3d
├── mmdet3d
├── tools
├── configs
├── data
│   ├── kitti
│   │   ├── ImageSets
│   │   ├── testing
│   │   │   ├── calib
│   │   │   ├── image_2
│   │   │   ├── velodyne
│   │   ├── training
│   │   │   ├── calib
│   │   │   ├── image_2
│   │   │   ├── label_2
│   │   │   ├── velodyne
  • annotation에 대한 설명

devkit_object.zip
0.06MB

#Values    Name      Description
----------------------------------------------------------------------------
   1    type         Describes the type of object: 'Car', 'Van', 'Truck',
                     'Pedestrian', 'Person_sitting', 'Cyclist', 'Tram',
                     'Misc' or 'DontCare'
   1    truncated    Float from 0 (non-truncated) to 1 (truncated), where
                     truncated refers to the object leaving image boundaries
   1    occluded     Integer (0,1,2,3) indicating occlusion state:
                     0 = fully visible, 1 = partly occluded
                     2 = largely occluded, 3 = unknown
   1    alpha        Observation angle of object, ranging [-pi..pi]
   4    bbox         2D bounding box of object in the image (0-based index):
                     contains left, top, right, bottom pixel coordinates
   3    dimensions   3D object dimensions: height, width, length (in meters)
   3    location     3D object location x,y,z in camera coordinates (in meters)
   1    rotation_y   Rotation ry around Y-axis in camera coordinates [-pi..pi]
   1    score        Only for results: Float, indicating confidence in
                     detection, needed for p/r curves, higher is better.

 

Data Convert

 

이제.. 하나하나 필요한 데이터를 채워 봅시다.