본문 바로가기
Two/영상처리

mmdetection 개요 및 설치

by DH Father 2024. 1. 8.

mmdetection 개요 및 설치

개요 및 설치



mmdetection 개요 및 설치

openmmlab에서 제공하는 mmpretrain은 classification 프레임워크이다. 

이번에는 object detection을 지원하는 mmdetection에 대해 알아보자.

 

mmdetection은 object detection, instance segmentation, panoptic segmentation 방법을 지원한다. 

panoptic segmenation 이 생소하여 찾아봤다.

 

sementic vs instance vs panoptic segmentation

sementic : 모든 요소에 대해 클래스 라벨을 예측하는것

instance : 이미지 내의 모든 물체에 대해 클래스 라벨을 예측하고 ID를 부여하는 것

panoptic : 위 두가지 segmentation을 결합한것

 

 

mmdetection 구성

mmdetection의 구성은 간략히 아래와 같다. 

1. apis 

model inference 를 위한 API 제공

2. structures  

bbox, mask, DetDataSample 같은 데이터 structure를 제공

3. datasets  

- trainsforms : augmentation transforms를 포함함

- samplers : dataloader 관련

4. models  

- detectors : detection model classes를 정의함

- data_preprocessors : input data preprocessing

- backbones : backbone network

- necks : neck component

- dense_heads : dense prediction을 위한 detection heads

- roi_heads 

- seg_heads

- losses

- task_modules

-layers 

5. engine  

- runner / schedulers / optimizers / hooks

6. evaluation  

7. visualization  

 

mmdetection 설치

자세한 내용은 문서를 참조하자.

1. 가상환경 설치

2. PyTorch 설치

3. MMEngine, MMCV 설치

pip install -U openmim
mim install mmengine
mim install "mmcv>=2.0.0"

4. MMDetection 설치 - from source

git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -v -e .
# "-v" means verbose, or more output
# "-e" means installing a project in editable mode,
# thus any local modifications made to the code will take effect without reinstallation.

5. verify the installation

5.1 download config & checkpoint file

mim download mmdet --config rtmdet_tiny_8xb32-300e_coco --dest .

 

5.2 verify inference demo - from source

python demo/image_demo.py demo/demo.jpg rtmdet_tiny_8xb32-300e_coco.py --weights rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth --device cpu

 

*** Tracking Installation (tracking 관련)

1. MMEngine, MMCV 설치

2. intall MMDetection

3. intall TrackEval

pip install git+https://github.com/JonathonLuiten/TrackEval.git

4. verify intallation

4.1 download config & checkpoint file

mim download mmdet --config bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval --dest .

4.2 verify inference demo

python demo/mot_demo.py demo/demo_mot.mp4 bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval.py --checkpoint bytetrack_yolox_x_crowdhuman_mot17-private-half_20211218_205500-1985c9f0.pth --out mot.mp4

 

 

Reference

https://engineer-mole.tistory.com/273

https://mmdetection.readthedocs.io/en/latest/get_started.html

'Two > 영상처리' 카테고리의 다른 글

mmdetection - tutorial (2)  (0) 2024.01.15
mmdetection - tutorial (1)  (0) 2024.01.11
mmpretrain 적용 - CIFAR10  (1) 2024.01.08
mmpretrain 사용법 (4)  (0) 2023.12.31
mmpretrain 사용법 (3)  (1) 2023.12.30