MMDetection from dacon
https://yskim0.github.io/computer%20vision/2020/11/03/mmdetection-사용하기/
https://dacon.io/competitions/official/235672/codeshare : K-Fashion AI 경진대회 (CV관련)
https://youtu.be/VOn7T6NR1tc
MMdectection
open source object detection toolbox based on PyTorch.
K-Fashion AI 경진대회 baseline github을 참조하여 작성,
대회의 목적은 주어진 이미지자료를 학습하여, 각 클래스와 클래스별 세그멘테이션 마스크에 대해 예측하는 것 .
Installation
mmcv 설치후 , clone후 setup.
mmdetection github에서 v2.3.0
branch로 이동 후 Install.md 기본으로.
아래는 요약본
conda create -n open-mmlab python=3.7 -y conda activate open-mmlab # install latest pytorch prebuilt with the default prebuilt CUDA version (usually the latest) conda install -c pytorch pytorch torchvision -y # install the latest mmcv pip install mmcv-full # install mmdetection git clone https://github.com/open-mmlab/mmdetection.git cd mmdetection pip install -r requirements/build.txt pip install -v -e .
Requirements
- Linux or macOS (Windows is not currently officially supported)
- Python 3.6+
- PyTorch 1.3+
- CUDA 9.2+ (If you build PyTorch from source, CUDA 9.0 is also compatible)
- GCC 5+
- mmcv
$ cat /etc/issue Ubuntu 18.04.5 LTS \ \\l $ python --version Python 3.6.9 $ gcc --version gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 $ python Python 3.6.9 (default, Jul 17 2020, 12:50:27) [GCC 8.4.0] on linux >>> import torch >>> print(torch.__version__) 1.7.1+cu110 >>> quit() $ nvidia-smi Thu Jun 10 08:59:32 2021 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 450.51.06 Driver Version: 450.51.06 CUDA Version: 11.0 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 A100-SXM4-40GB On | 00000000:07:00.0 Off | 0 | | N/A 23C P0 59W / 400W | 0MiB / 40537MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ .... +-------------------------------+----------------------+----------------------+ | 7 A100-SXM4-40GB On | 00000000:BD:00.0 Off | 0 | | N/A 27C P0 59W / 400W | 0MiB / 40537MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+ $dpkg -l | grep mmcv $pip install mmcv-full $pip install mmcv
가상환경 생성
Minicoda 설치후, 가상환경명이 sixxMM 일 경우, 해당 가상환경 생성 / 활성화
$ conda create -n sixxMM python=3.7 -y $ conda activate sixxMM
dacon_utils 폴더 확인
pytorch, torchvision 설치 (버전 주의)
버전주의: mmdetection version==2.3.0일때, torch version == 1.5.0
pytorch official instructions를 참조하여 원하는 버전 설치
현재 1.7.1+cu110
$ conda install pytorch==1.5.0 torchvision==0.6.0 -c pytorch
MMdetection repo. 클론
$ mkdir ~/dacon $ cd ~/dacon
# CLONE mmdetection repository ~/dacon/$ git clone --branch v2.3.0 https://github.com/open-mmlab/mmdetection.git
해당버전으로 clone함. branch == v2.3.0
참고
~/dacon/$ git clone https://github.com/dacon-ai/K-fashion-baseline.git
관련파일 설치
Requirements 설치 : cython , numpy 설치
~/dacon/$ cd ./mmdetection ~dacon/mmdetection$ ~/.local/share/r-miniconda/envs/sixxMM/bin/ pip install -r requirements/build.txt
Set up
~dacon/mmdetection$ ~/.local/share/r-miniconda/envs/sixxMM/bin/ \t\t\t\t pip install -v -e . #위에서 에러가 난다면, ~dacon/mmdetection$ python setup.py develop