Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 136 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
aabe95d
Setting up GitHub Classroom Feedback
github-classroom[bot] Nov 8, 2024
ea4ca7a
Create README.md
Soy17 Nov 11, 2024
130e8b9
Update README.md
Soy17 Nov 11, 2024
4646554
Update README.md
Soy17 Nov 12, 2024
7f095f1
[#2] pull request template update
Soy17 Nov 12, 2024
638a6eb
Update Dataset info in README.md
Soy17 Nov 13, 2024
fd0c947
Merge pull request #4 from boostcampaitech7/Feature/Pr
Yoon0717 Nov 13, 2024
1ceed5f
[#5] add basecode
Yoon0717 Nov 13, 2024
3068fee
Merge pull request #6 from boostcampaitech7/Feature/resnet
Soy17 Nov 13, 2024
8d5eaa4
[#8] Issue Template/gitignore update
wonjeongjeong Nov 13, 2024
118b7a2
Merge pull request #10 from boostcampaitech7/Feature/Issuetem
june21a Nov 13, 2024
f9277d3
[Feature] : streamlit 시각화
sejongmin Nov 13, 2024
c72f06a
[Refactor] : 코드 리펙토링
sejongmin Nov 13, 2024
8baf875
[Feature]:add module base
Yoon0717 Nov 13, 2024
a95a727
[Feature]:add module base2
Yoon0717 Nov 13, 2024
3c661c3
Merge pull request #15 from boostcampaitech7/feature/module
june21a Nov 13, 2024
345ffbf
Merge pull request #12 from boostcampaitech7/feat/streamlit
june21a Nov 13, 2024
5676b6c
[Feature] : modularize base code3
Yoon0717 Nov 14, 2024
a7b662c
[Feature] : streamlit CSV 시각화 옵션 추가
wonjeongjeong Nov 14, 2024
0ed7556
[Comment] : 주석 수정
wonjeongjeong Nov 14, 2024
bed0e9c
[Feature]:add code for mmsegmentation and util function for mmseg dat…
june21a Nov 14, 2024
3015224
[Feat] : 이미지 시각화 개수 추가
sejongmin Nov 14, 2024
99196d0
[Refactor] : plotly를 cv2로 시각화
sejongmin Nov 14, 2024
30cc75f
[Feature]:add new config for mask2former
june21a Nov 14, 2024
1dd792e
[Refactor] : add model.py
Yoon0717 Nov 14, 2024
b520e28
[Refactor] : modified (train.py, inference.py)
Yoon0717 Nov 14, 2024
69b145d
[Feature] : model types select outputs
Yoon0717 Nov 15, 2024
31e6d93
[Feature] : 시각화 편의성 추가
sejongmin Nov 15, 2024
f321857
[Refactor]:mmsegmentation custom config folder structure refactoring
june21a Nov 16, 2024
b878505
[Feature]:add kfold_split with grouping same patient
june21a Nov 16, 2024
f239286
Merge pull request #19 from boostcampaitech7/feature/module
Yoon0717 Nov 18, 2024
3a77148
[#21] Feature : add transform.py
Yoon0717 Nov 18, 2024
753ec52
[#21] Refactor : modify train, inference
Yoon0717 Nov 18, 2024
077880b
[Remove] : copy all png 파일 제거
sejongmin Nov 18, 2024
99a8f02
[#21] Refator : modify python files
Yoon0717 Nov 18, 2024
7f45b8b
[#21] Feature : use config.yaml
Yoon0717 Nov 18, 2024
bcf44a2
[Feature]:]Merge branch 'feature/module' of https://github.com/boostc…
june21a Nov 19, 2024
9095335
[#21] Refactor : debugging
Yoon0717 Nov 19, 2024
519febb
[#21] Refactor : complete debugging
Yoon0717 Nov 19, 2024
c2940a3
[#21] Feature : add LossSelector
Yoon0717 Nov 19, 2024
f8d1019
[#21] Feature : validation optimal
Yoon0717 Nov 19, 2024
554e9b8
Merge pull request #33 from boostcampaitech7/feature/module
june21a Nov 20, 2024
746345d
[#21] Feature & Refactor: add wandb, modify wandb_train.py to fit the…
Yoon0717 Nov 20, 2024
37078a3
[#38] Fix : debugging wandb_train.py
Yoon0717 Nov 20, 2024
d45b731
Merge pull request #28 from boostcampaitech7/feat/streamlit
Soy17 Nov 20, 2024
cc43f1a
[Feature] : Merge branch 'dev' of https://github.com/boostcampaitech7…
june21a Nov 20, 2024
c2b0aa8
[Fix] : fix error dataloader get wrong mask
june21a Nov 20, 2024
f8890aa
[Feature] : add sam2 unet base
sejongmin Nov 20, 2024
fb9188f
[Feature] : now inference will predict maximum 2 classes per pixel
june21a Nov 20, 2024
42f9adc
[Feature]: add new head for segnext
june21a Nov 20, 2024
bd6e2a2
[Feature]:add result visualization and add metric for multi label
june21a Nov 20, 2024
9fcd454
[Feature] : add validation
sejongmin Nov 20, 2024
e581702
[Fix]:revise some error based on mmengine 0.10.5 docs
june21a Nov 20, 2024
b2f7f11
[Feature]:add segformer config
june21a Nov 20, 2024
1a939a4
[Feature]:git ignore nohup.out
june21a Nov 20, 2024
485aa83
[Feature]:add baselind
june21a Nov 20, 2024
f03e91e
[Fix] : bug fix
sejongmin Nov 21, 2024
a89cd6a
[Fix}:fix error in inference of baseline code
june21a Nov 21, 2024
d2e18fe
[Feature] : add wandb
sejongmin Nov 21, 2024
f068bef
add dice loss
Yoon0717 Nov 21, 2024
1ee5c6b
[#21, #39] Feature : add scheduler
Yoon0717 Nov 21, 2024
c3a6ef5
[Refactor]:refactorization the structure of config
june21a Nov 21, 2024
48e20be
[Fix}:remake dataset config to have same image size at train and vali…
june21a Nov 21, 2024
a4f2324
[Feature] : scheduler update
sejongmin Nov 21, 2024
5624f2e
Merge pull request #43 from boostcampaitech7/feature/module
Yoon0717 Nov 21, 2024
97228c4
[Feature] : add scaler
sejongmin Nov 21, 2024
a4a024d
[Refactor]:refactor code to set image, label root in config
june21a Nov 21, 2024
7266178
[Refactor]:Refactor the baseline code into infer and train
june21a Nov 21, 2024
e17fb62
[#21] Feature : optimal
Yoon0717 Nov 21, 2024
c037026
Merge remote-tracking branch 'origin/feature/feature-16' into develop
june21a Nov 21, 2024
f4e27c9
Merge pull request #44 from boostcampaitech7/feature/feature-16
june21a Nov 21, 2024
3673244
[Refactor] : edit
sejongmin Nov 22, 2024
a7be6a1
[#21] Feature : save parameter
Yoon0717 Nov 22, 2024
e94ccf3
[Feature] : edit outlier
sejongmin Nov 22, 2024
ffdebc3
[Feature] : offline augmentation horizantal flip
sejongmin Nov 22, 2024
d5b6f9f
[Fix] : edit steplr parameter
sejongmin Nov 22, 2024
54eb5a3
[Feature]: add TTA and fix auigmentation error
june21a Nov 24, 2024
f81df65
[#21, #42] Feature : add focal loss
Yoon0717 Nov 24, 2024
0e72051
Merge pull request #49 from boostcampaitech7/feature/module
Yoon0717 Nov 24, 2024
0062011
[#21] Fix : debugging
Yoon0717 Nov 24, 2024
f229d54
[Comment] : config 주석 추가
sejongmin Nov 24, 2024
64a5eb6
[Feature] : psnr
sejongmin Nov 24, 2024
f241342
[Feature] : csv to train pngs and jsons
sejongmin Nov 25, 2024
cfcd837
[Fix] : Edit array dimention
sejongmin Nov 25, 2024
8589052
[feature]: add some config for 2048 models
june21a Nov 25, 2024
e8466a7
refine
Yoon0717 Nov 25, 2024
5a03586
[#21] Feature : add optimizer.py
Yoon0717 Nov 25, 2024
89fcae1
Merge pull request #58 from boostcampaitech7/feature/module
Yoon0717 Nov 25, 2024
3caa7fc
[#21] Feature : add gradient accumulation
Yoon0717 Nov 26, 2024
dce04e9
[Feature] : add label smoothing
sejongmin Nov 26, 2024
d6f2127
[Refactor] : refactoring
sejongmin Nov 26, 2024
d514d4d
[#37] Feature : stratified group k-fold
wonjeongjeong Nov 26, 2024
9fb6505
[Refactor] : loss, dice
sejongmin Nov 27, 2024
c3fc3c0
[Feature]: add dataset for cleansed data.
june21a Nov 27, 2024
65892f7
[Refactor] : dataset 코드 효율적으로 수정
sejongmin Nov 27, 2024
ff70bfa
[Fix] : files path
sejongmin Nov 27, 2024
ebca880
[#11] UNet++ code update
Soy17 Nov 27, 2024
da7e76e
Merge pull request #60 from boostcampaitech7/feature/stratified_kfold
june21a Nov 27, 2024
ee042fc
[Feature]: add config for decoder head threshold
june21a Nov 27, 2024
0aba7b3
[#21] Feature : add MixupDataset
Yoon0717 Nov 28, 2024
efb17ee
modified
Yoon0717 Nov 28, 2024
a768365
[#21] mujisung commit
Yoon0717 Nov 28, 2024
cc01d07
Merge pull request #62 from boostcampaitech7/feature/module
Yoon0717 Nov 28, 2024
9d62e2a
[Refactor] : refactoring
sejongmin Nov 28, 2024
c728133
Merge branch 'dev' of https://github.com/boostcampaitech7/level2-cv-s…
sejongmin Nov 28, 2024
6103475
[Feature] : find image name
sejongmin Nov 28, 2024
a1cdc7d
[Feature]:add inference and train code for mmseg
june21a Nov 29, 2024
ecdc41a
[Refactor]:change path to custom_inference.py
june21a Nov 29, 2024
aecedf2
Merge branch 'dev' of https://github.com/boostcampaitech7/level2-cv-s…
june21a Nov 29, 2024
4dfee22
[Refactor]: delete baseline code
june21a Nov 29, 2024
ab49af2
[Refactor]:Delete mmsegmentation library code except for custom code
june21a Nov 29, 2024
a219e99
Merge pull request #63 from boostcampaitech7/feature/feature-16
june21a Nov 29, 2024
6bd9641
[Fix]:rename unvalid file name
june21a Nov 29, 2024
87af80a
Merge pull request #64 from boostcampaitech7/feature/feature-16
june21a Nov 29, 2024
adc4dd6
[#21] Refactor : final code
Yoon0717 Nov 29, 2024
6916e12
Merge pull request #65 from boostcampaitech7/feature/module
Yoon0717 Nov 29, 2024
24e2e24
Merge branch 'dev' of https://github.com/boostcampaitech7/level2-cv-s…
june21a Nov 29, 2024
5618f51
[Feature]:add hard voting ensemble code
june21a Nov 29, 2024
baea1ba
Merge pull request #67 from boostcampaitech7/feature/feature-66
june21a Nov 29, 2024
b39d65a
[Feature]:add code for morphology post process
june21a Nov 29, 2024
846c218
Merge pull request #69 from boostcampaitech7/feature/feature-68
june21a Nov 29, 2024
c8ceb1f
[Refactor] : edit default config
sejongmin Nov 29, 2024
2ee2a6b
Merge pull request #73 from boostcampaitech7/feat/streamlit
june21a Nov 29, 2024
c4cbbfb
Merge pull request #74 from boostcampaitech7/feature/augmentation
june21a Nov 29, 2024
1800d6f
Merge pull request #72 from boostcampaitech7/feature/sam2unet
june21a Nov 29, 2024
6bd95f4
Merge pull request #75 from boostcampaitech7/feature/pseudo-labeling
june21a Dec 2, 2024
9fb82d0
[#11] Feature : unet + Read me UPDATE
Soy17 Dec 2, 2024
83140c3
Merge branch 'dev' into Feature/UNet
Soy17 Dec 2, 2024
9e000e6
[Docs] Update README.md
june21a Dec 2, 2024
fdc7a66
Merge branch 'dev' into Feature/UNet
Soy17 Dec 2, 2024
b9af61f
Merge pull request #76 from boostcampaitech7/Feature/UNet
june21a Dec 2, 2024
5ccfede
[docs] Update README.md
june21a Dec 2, 2024
8416884
Merge pull request #77 from boostcampaitech7/dev
june21a Dec 2, 2024
e0e8484
[Docs] : Update README.md
sejongmin Dec 4, 2024
3be090b
Update README.md
minrongtic Dec 5, 2024
820e53a
Update README.md
minrongtic Dec 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/-title----body.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: "title/ body"
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

### Issue 타입(하나 이상의 Issue 타입을 선택해주세요)
- [ ] Feat : 새로운 기능 추가
- [ ] Remove : 파일 및 기능 삭제
- [ ] Test : 테스트 코드 추가
- [ ] Fix : 버그 수정
- [ ] Docs : 문서 수정
- [ ] Refactor : 코드 리펙토링
- [ ] Style : 코드 포맷팅, 세미콜론 누락, 코드 변경이 없는 경우, 주석 추가

### 상세 내용
- [ ] ex) Github 소셜 로그인 기능이 필요합니다.

### 추가사항
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## 🤔 Motivation 🤔
-

<br/>

## 💡Content 💡
-

<br/>

## 🅾️ Metric ❎
-

<br/>

## 👩🏻‍💻 How To Apply 🧑🏻‍💻
-

---

- close
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 모델 checkpoint 제외
*.pt
*.pkl
*.pth


# 결과 파일 제외
*.yaml
*.csv

# python cache 제외
__pycache__
*.pyc
*.pyd

# dataset 제외
*.jpg
*.png
*.json
*.tar.gz
*.xlsx

# wandb
wandb/

# mmsegmentation 제외
.out
170 changes: 170 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
# 📋 Project Overview


뼈는 우리 몸의 구조와 기능에 중요한 영향을 미치기 때문에, 정확한 뼈 분할은 의료 진단 및 치료 계획을 개발하는 데 필수적입니다.

Bone Segmentation은 인공지능 분야에서 중요한 응용 분야 중 하나로, 특히, 딥러닝 기술을 이용한 뼈 Segmentation은 많은 연구가 이루어지고 있으며, 다양한 목적으로 도움을 줄 수 있습니다.

- 질병 진단의 목적으로 뼈의 형태나 위치가 변형되거나 부러지거나 골절 등이 있을 경우, 그 부위에서 발생하는 문제를 정확하게 파악하여 적절한 치료를 시행할 수 있습니다.

- 수술 계획을 세우는데 도움이 됩니다. 의사들은 뼈 구조를 분석하여 어떤 종류의 수술이 필요한지, 어떤 종류의 재료가 사용될 수 있는지 등을 결정할 수 있습니다.

- 의료장비 제작에 필요한 정보를 제공합니다. 예를 들어, 인공 관절이나 치아 임플란트를 제작할 때 뼈 구조를 분석하여 적절한 크기와 모양을 결정할 수 있습니다.

- 의료 교육에서도 활용될 수 있습니다. 의사들은 병태 및 부상에 대한 이해를 높이고 수술 계획을 개발하는 데 필요한 기술을 연습할 수 있습니다.
<br/>


- Input :
- hand bone x-ray 객체가 담긴 이미지가 모델의 인풋으로 사용됩니다.
- segmentation annotation은 json file로 제공됩니다.

- Output :

- 모델은 각 클래스(29개)에 대한 확률 맵을 갖는 멀티채널 예측을 수행하고, 이를 기반으로 각 픽셀을 해당 클래스에 할당합니다.
- 최종적으로 예측된 결과를 Run-Length Encoding(RLE) 형식으로 변환하여 csv 파일로 제출합니다.

<br/>
<br/>

# 🗃️ Dataset

- 이미지 크기 : (2048 x 2048), 3 channel

![image](https://github.com/user-attachments/assets/7a596f2c-e7e2-415f-872a-d812a7b47825)

- image, target 시각화 및 pixel 별로 예측해야할 29개의 classes

<br/>
<br/>
<br/>

# 📁 Project Structure
```plaintext
.
├── .github/
├── augmentation/
│ ├── copy_data.py
│ ├── hflip.py
│ ├── outlier.py
│ ├── psnr.py
├── UNet++/
│ ├── cv/
│ ├── requirements.txt
├── mmsegmentation/
│ ├── configs/
│ ├── mmseg/
│ ├── tools/
│ ├── baseline.py
│ ├── custom_inference.py
│ ├── custom_train.py
├── module_base/
│ ├── config.yaml
│ ├── dataset.py
│ ├── inference.py
│ ├── loss.py
│ ├── model.py
│ ├── optimizer.py
│ ├── scheduler.py
│ ├── train.py
│ ├── transform.py
│ ├── wandb_logger.py
│ ├── wandb_train.py
├── sam2_unet/
│ ├── sam2/
│ ├── sam2_configs/
│ ├── utils/
│ ├── SAM2UNet.py
│ ├── config.yaml
│ ├── test.py
│ ├── train.py
│ ├── trainer.py
├── streamlit/
│ ├── compare.py
│ ├── load.py
│ ├── main.py
│ ├── visualize.py
│ ├── visualize_rle.py
├── utils/
│ ├── .gitignore
│ ├── README.md
│ ├── meta_data_set.py
│ ├── pseudo_labeling.py
```

# How To Use

## MMSegmentation
- MMSegmentation Install 후 본 Project 폴더를 그대로 Copy & Paste하여 활용
```plaintext
# train
python custom_train.py --config_path {path_to_your_config} --work_dir {path_to_your_save_dir_for_logging}

# inference
python custom_inference.py --config_path {path_to_your_config} --checkpoint_path {path_to_your_weights} --work_dir {path_to_your_save_dir_for_logging} --submission_path {where_to_save_your_submission_csv} --tta
```

## SAM2Unet
```plaintext
# train
python train.py --config {path_to_your_config}

# inference
python test.py --config {path_to_your_config} --checkpoint {path_to_your_checkpoint}
```

## Module_base
```plaintext
```

# 😄 Team Member

<table align="center">
<tr align="center">
<td><img src="https://github.com/user-attachments/assets/337d06ce-6a68-4ff9-9638-b54b2d17e9e9" width="200" height="120"></td>
<td><img src="https://github.com/user-attachments/assets/f962dbc4-1ac0-49c1-bc1a-b999e01fa67f" width="200" height="120"></td>
<td><img src="https://github.com/user-attachments/assets/dcd46b40-5117-437c-a8a0-8217cffcb487" width="200" height="120"></td>
<td><img src="https://github.com/user-attachments/assets/9b936eca-2463-48d2-b01b-3196761e738e" width="200" height="120"></td>
<td><img src="https://github.com/user-attachments/assets/4a8f05bf-9635-47f7-b90e-39bb7c6f6824" width="200" height="120"></td>
<td><img src="https://github.com/user-attachments/assets/78c78353-ba3b-494d-ba94-429c4f838cd1" width="200" height="120"></td>
</tr>
<tr align="center">
<td><a href="https://github.com/minrongtic" target="_blank">김민영</a></td>
<td><a href="https://github.com/june21a" target="_blank">박준일</a></td>
<td><a href="https://github.com/sejongmin" target="_blank">오종민</a></td>
<td><a href="https://github.com/Soy17" target="_blank">이소영</a></td>
<td><a href="https://github.com/wonjeongjeong" target="_blank">정원정</a></td>
<td><a href="https://github.com/Yoon0717" target="_blank">한승윤</a></td>
</tr>
<tr align="center">
<td>T7173</td>
<td>T7154</td>
<td>T7207</td>
<td>T7222</td>
<td>T7272</td>
<td>T7261</td>
</tr>
</table>

<br/>
<br/>

# 🏆 Project Result

**_<p align=center>Public Leader Board</p>_**
<img src="https://github.com/user-attachments/assets/94bd97fc-518d-4c69-b45e-69466d8e3bb1" alt="Public Leader Board" >


<br>

**_<p align=center>Private Leader Board</p>_**
<img src="https://github.com/user-attachments/assets/85c200c3-30db-48d1-a2a7-3f5d15eed143" alt="Private Leader Board" >

<br>

## 🔗 Reference

### [📎 Segmentation Notion](https://typhoon-jackal-68b.notion.site/Hand-Bone-Image-Segmentation-13bcb8c4237680f0baeef241f0f6856b?pvs=4)

<br>

59 changes: 59 additions & 0 deletions UNet++/cv/configs/base_train.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# data 관련 설정
image_root: /data/ephemeral/home/data/train/DCM
label_root: /data/ephemeral/home/data/train/outputs_json

# 모델명 및 사전 학습 여부
model_name: Unet
model_parameter:
encoder_name: efficientnet-b4
classes: 29

# batch_size
train_batch_size: 2
val_batch_size: 2

# image resize
image_size: &image_size 1024

# transform 관련
transform:
Resize:
width: *image_size
height: *image_size

# 학습 관련 하이퍼파라미터
lr: 1e-3
weight_decay: 1e-6

max_epoch: &max_epoch 60

# loss 관련 설정
loss_name: BCEWithLogitsLoss

# loss에 필요한 parameter -> dict 형태로 작성
loss_parameter: {}

# scheduler 관련 설정
scheduler_name: CosineAnnealingLR

# scheduler 필요한 parameter -> dict 형태로 작성
scheduler_parameter:
T_max: *max_epoch
eta_min: 1e-6

# random seed값
seed: 42

# validation 관련 인자
val_fold: 0
val_interval: 2
threshold: 0.5

# checkpoint 저장 경로
save_dir: ./checkpoints/Unet

# wandb
api_key: 7363797140af326caa051190a07bd49ce5341c67
team_name: cv19-eternalpaperbox
project_name: UNet
experiment_detail: cos_2048_epo60
Loading