Skip to content

boostcampaitech2/semantic-segmentation-level2-cv-11

Repository files navigation

Data Preperation

Aistages에서 제공하는 쓰레기 데이터를 사용합니다.

$ wget https://aistages-prod-server-public.s3.amazonaws.com/app/Competitions/000078/data/data.zip

Quick Start Examples

baseline code

train

configs/ 경로에 있는 config.ini 파일을 통해 hyper parameters 및 path 등을 수정합니다.

config.ini를 바탕으로 train을 시작합니다.

$ python train.py --config_dir {config.ini path} 

or

$ nohup python train.py --config_dir {config.ini path}&
inference

Train과 마찬가지로 configs/ 경로에 있는 config.ini 파일을 통해 inference 를 수행합니다.

$ python train.py --config_dir {config.ini path} --model_dir {model.pt path}

mmsegmentation

train
  • 경로: /mmsegmentation
  1. 원하는 모델과 파라마티, 하이퍼 파라미터 config 세팅
  2. work_dir을 지정, wandb project name, entity 설정
  3. config_dir 지정후 코드 실행
$ python tools/train.py [config_dir]
inference
  • 경로: /mmsegmentation
  1. --config_dir Inference할 config 선택
  2. --epoch Inference할 저장되어있는 pth파일 선택
$ python tools/inference.py --config_dir[config_dir] --epoch [epoch.pth_dir]

Tools

SWA

SWA는 한 모델의 연속된 epoch or iteration 을 저장해 parameter의 가중치를 더한 후 평균 값을 도출

SWA/ 디렉토리에 SWA를 원하는 pth 파일 넣어서 swa.py 실행시 현 경로에 swa.pth 저장

$ python tools/swa.py
ensemble
  • 경로 : /mmsegmentation/tools

    --model_dir : csv파일이 들어있는 경로

    --save_dir : 앙상블한 결과 저장 경로

    --weight : 각 모델의 weight

$ python tools/ensemble.py --model_dir [model_dir : str] --save_dir [save_dir : str] --weight [weight : list]
copy_paste
  • 경로 : /mmsegmentation/tools
$ python tools/ensemble.py 
EDA
  • 경로 : /mmsegmentation/tools
  • .ipynb 파일
make_json
  • 경로 : /mmsegmentation/tools

    --original_json : category를 추출할 json 파일 경로

    --extract_json : 추출된 데이터를 저장할 json 파일 경로

    --category_num : 카테고리 인덱스

$ python tools/make_json.py --original_json {json file} --extract_json {extracted json file} --category_num {num of category}

Reference

About

semantic-segmentation-level2-cv-11 created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •