Skip to content

πŸ† 2022 κ΅­λ°© AI κ²½μ§„λŒ€νšŒ πŸ† μ˜ˆμ„  Public 2μœ„/Private 3μœ„ λ³Έμ„  Public 7μœ„/Private 7μœ„

Notifications You must be signed in to change notification settings

taemin6697/MAICON_Competition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

κ΅­λ°© AI κ²½μ§„λŒ€νšŒ μ½”λ“œ μ‚¬μš©λ²•(λ³Έμ„ )

μ‚¬μš©ν•œ λͺ¨λΈ

  • κΉ€νƒœλ―Ό, μž„μ„œν˜„: MPRNet, 26.3(PSNR) github
  • μ •μ‹œν˜„, μ΄μ€€ν˜•: Restomer, 21.2(PSNR) github
  • 데이터 뢄석 및 데이터 μ…‹ μž¬κ΅¬μ„±
    • PSNR 점수둜 ν•™μŠ΅ λ°μ΄ν„°μ˜ 뢄포λ₯Ό 확인후에 2400μž₯으둜 μž¬κ΅¬μ„±.
  • ν›„μ²˜λ¦¬
    • Restomer의 pretrained Deblurring model μ‚¬μš©ν•΄ PSNR 0.5점 λ†’μž„.

κ΅­λ°© AI κ²½μ§„λŒ€νšŒ μ½”λ“œ μ‚¬μš©λ²•(μ˜ˆμ„ )

νŒ€λͺ… : μ€‘μš”ν•œ 건 κΊΎλŠ” 마음

νŒ€μ›: μ •μ‹œν˜„(νŒ€μž₯), μ΄μ€€ν˜•, κΉ€νƒœλ―Ό, μž„μ„œν˜„
sh2298, jjuun, taemin6697, μž„λ¦¬λ‘₯절

  • μ •μ‹œν˜„: λͺ¨λΈ νŒŒμ΄ν”„λΌμΈ ꡬ좕 및 총괄
  • μ΄μ€€ν˜•: 데이터 뢄석 및 λΆˆκ· ν˜• 데이터 증강(cutmix, transform(flip, rotate, crop, gausian blur))
  • κΉ€νƒœλ―Ό, μž„μ„œν˜„: λͺ¨λΈ μ„ μ • 및 tunning(learning rate, batch)

핡심 파일 μ„€λͺ…

  • ν•™μŠ΅ 데이터 경둜: ./data
  • 곡개 Pretrained λͺ¨λΈ 기반으둜 μΆ”κ°€ Fine Tuning ν•™μŠ΅μ„ ν•œ νŒŒλΌλ―Έν„° 1개
    • ./results/train/final-submission
  • ν•™μŠ΅ 메인 μ½”λ“œ: ./train.py
  • ν…ŒμŠ€νŠΈ 메인 μ½”λ“œ: ./predict.py
  • ν…ŒμŠ€νŠΈ 이미지, 마슀크 경둜: ./results/pred/final-submission/mask

μ½”λ“œ ꡬ쑰 μ„€λͺ…

ν•™μŠ΅ μ§„ν–‰ν•˜κΈ° μ „ 이미지 증강을 λ¨Όμ € μ‹€ν–‰ν•˜μ—¬ ν•™μŠ΅ μ‹œκ°„ 단좕

  • μ „μ²˜λ¦¬ Get 1, 2 Labeled Image path

    • python ./modules/get_class_path.py

    Data Upsampling via ChangeFormer Augmentation Methods : ./preprocess/augmentation.py

    • python ./preprocess/augmentation.py

    Data Upsampling via Cutmix using DFS Algorithm only for Label 1, 2 Mixing : ./preprocess/cutmix.py

    • python ./preprocess/cutmix.py

    μ΅œμ’… ν•™μŠ΅ μ‚¬μš© 데이터 (총 17559 μž₯의 이미지 μ‚¬μš©)

    • ./data/train
    • ./data/up
    • ./data/cut
  • λͺ¨λΈ
    nvidia/segformer-b4-finetuned-cityscapes-1024-1024
    λ₯Ό μ‚¬μš©ν•˜μ—¬ ν•™μŠ΅ 및 ν…ŒμŠ€νŠΈν•¨.
    Pretrained Model URL

    # of Steps : 18000 steps

    Hyper-paramerter

    • batch:4
    • val_size: 0.3
    • learning_rate=0.00005
    • eval_accumulation_steps=10
    • epoch : 6

    μ΅œμ’… μ‚¬μš© λͺ¨λΈ : nvidia/segformer-b4-finetuned-cityscapes-1024-1024 (Transfer Learning in 18000 steps lr 0.00005)

  • predict python predict.py

  • μ΅œμ’… 제좜 파일 : ./results/pred/final-submission/mask

  • ν•™μŠ΅λœ κ°€μ€‘μΉ˜ 파일 : ./results/train/final-submission (Huggingface νŠΉμ„±μƒ 폴더 전체λ₯Ό λΆˆλŸ¬μ™€ λͺ¨λΈμ— μ—°κ²°μ‹œν‚΄)

μ£Όμš” μ„€μΉ˜ library

  • torch==1.12.1
  • torchvision==0.13.1
  • transformers
  • datasets
  • pickle5
  • pyyaml
  • scikit-learn
  • numpy
  • pandas
  • evaluate
  • pillow
  • opencv-python
  • matplotlib

How to use step by step

1. μ²˜μŒλΆ€ν„° ν•™μŠ΅ 및 μΆ”λ‘ ν•˜κΈ°

data 폴더 μ•ˆμ— train, test 이미지 λ„£κΈ°

pip install -r requirements.txt
python ./modules/get_class_path.py
python ./preprocess/augmentation.py
python ./preprocess/cutmix.py

./config/train.yaml μ—μ„œ train_folder λ₯Ό μ›ν•˜λŠ” μ΄λ¦„μœΌλ‘œ μˆ˜μ •
./config/predict.yaml μ—μ„œ train_folder λ₯Ό μœ„μ™€ 같은 μ΄λ¦„μœΌλ‘œ μˆ˜μ •

python train.py

ν•™μŠ΅μ΄ μ „λΆ€ λλ‚œ ν›„
python predict.py

2. μ΅œμ’… 제좜 κ°€μ€‘μΉ˜ 파일둜 μΆ”λ‘ ν•˜κΈ°

μ½”λ“œ μˆ˜μ •μ—†μ΄
data 폴더 μ•ˆμ— train, test 이미지 λ„£κΈ°

pip install -r requirements.txt
python ./modules/get_class_path.py
python ./preprocess/augmentation.py
python ./preprocess/cutmix.py


python predict.py

Architecture

army-ai
β”œβ”€ config
β”‚  β”œβ”€ predict.yaml
β”‚  └─ train.yaml
| data
|  β”œβ”€ up
|  β”œβ”€ cut
|  β”œβ”€ train
|  β”œβ”€ pickle
|  └─ test
β”œβ”€ models
β”‚  └─ utils.py
β”œβ”€ modules
β”‚  β”œβ”€ EDA.py
β”‚  β”œβ”€ datasets.py
β”‚  β”œβ”€ earlystoppers.py
β”‚  β”œβ”€ get_class_path.py
β”‚  β”œβ”€ losses.py
β”‚  β”œβ”€ metrics.py
β”‚  β”œβ”€ optimizers.py
β”‚  β”œβ”€ recorders.py
β”‚  β”œβ”€ scalers.py
β”‚  β”œβ”€ schedulers.py
β”‚  β”œβ”€ trainer.py
β”‚  └─ utils.py
β”œβ”€ preprocess
β”‚  β”œβ”€ augmentation.py
β”‚  β”œβ”€ class1.csv
β”‚  β”œβ”€ class2.csv
β”‚  └─ cutmix.py
β”œβ”€ results
β”‚  β”œβ”€ pred
β”‚  β”‚  └─ final-submission
β”‚  β”‚     β”œβ”€ mask
β”‚  β”‚     β”œβ”€ pred.log
β”‚  β”‚     β”œβ”€ predict_config.yml
β”‚  β”‚     └─ train_config.yml
β”‚  └─ train
β”‚     └─ final-submission
β”‚        └─ checkpoint-18000
β”‚           β”œβ”€ config.json
β”‚           β”œβ”€ optimizer.pt
β”‚           β”œβ”€ pytorch_model.bin
β”‚           β”œβ”€ rng_state.pth
β”‚           β”œβ”€ scheduler.pt
β”‚           β”œβ”€ trainer_state.json
β”‚           └─ training_args.bin
β”œβ”€ Final-submit-mask.zip
β”œβ”€ README.md
β”œβ”€ predict.py
β”œβ”€ requirements.txt
└─ train.py

About

πŸ† 2022 κ΅­λ°© AI κ²½μ§„λŒ€νšŒ πŸ† μ˜ˆμ„  Public 2μœ„/Private 3μœ„ λ³Έμ„  Public 7μœ„/Private 7μœ„

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages