kaggle-uwmgit
code for kaggle: UW-Madison GI Tract Image Segmentation
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (5.8%) to scientific vocabulary
Repository
code for kaggle: UW-Madison GI Tract Image Segmentation
Basic Info
- Host: GitHub
- Owner: CarnoZhao
- License: apache-2.0
- Language: Python
- Default Branch: kaggle_tractseg
- Size: 10.5 MB
Statistics
- Stars: 93
- Watchers: 1
- Forks: 18
- Open Issues: 4
- Releases: 0
Metadata Files
README.md
Introduction
Hello!
Below you can find a outline of how to reproduce my solution for the UW-Madison GI Tract Image Segmentation | Kaggle
If you run into any trouble with the setup/code or have any questions please contact me at 273806108@qq.com
Contents
sh
preprocess.py: data preprocessing codes
inference.py: inferencing codes
other: necessary codes for `mmsegmentation` and `monai` toolboxes
Hardware
sh
Ubuntu 16.04 LTS (512 GB boot disk)
48 x Intel(R) Xeon(R) Gold 5118 CPU @ 2.30GHz
126 GB Memory
4 x NVIDIA Titan RTX
Software
sh
python==3.7.10
CUDA==10.2
cudnn==7.6.5
nvidia-drivers==440.4
(other refer to ./requirements.txt)
Data setup
```sh
DOWNLOAD DATA
kaggle competitions download -c uw-madison-gi-tract-image-segmentation
mkdir -p ./data/tract mv uw-madison-gi-tract-image-segmentation.zip ./data/tract
cd ./data/tract unzip uw-madison-gi-tract-image-segmentation.zip cd ../.. ```
The expected after unzip should be:
sh
./data/tract
├── sample_submission.csv
├── test
├── train
├── train.csv
Install base requirements, mmsegmentation and monai toolboxes
```sh
INSTALL PYTHON REQUIREMENTS
pip install -r requirements.txt pip install "monai[ignite,skimage,nibabel]==0.8.1" pip install mmcv-full==1.3.17 --force-reinstall -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.10.0/index.html pip install -v -e . ```
Data preprocess
sh
python data_preprocess.py
Training
NOTE: make sure internet connection for public pretrained weights downloading
```sh mkdir -p savedweights/cls savedweights/seg saved_weights/3d
DOWNLOAD PRETRAINED WEIGHTS
mkdir weights cd weights wget https://dl.fbaipublicfiles.com/convnext/ade20k/convnextbase22k224.pth wget https://dl.fbaipublicfiles.com/convnext/ade20k/convnextsmall1k224_ema.pth cd ..
TRAIN CLASSIFICATION MODELS
id=1 for config in $(find ./workconfigs/tract/finalsolution/classificationconfigs/cls*.py | sort); do ./tools/disttrain.sh $config 2 lastworkdir=$(ls ./workdirs/tract/ -rt | tail -n 1) lastweight=$(ls ./workdirs/tract/$lastworkdir/*.pth -rt | tail -n 1) lastconfig=$(ls ./workdirs/tract/$lastworkdir/*.py -rt | tail -n 1) mv ./workdirs/tract/$lastworkdir/$lastweight ./savedweights/cls/cls${id}.pth mv ./workdirs/tract/$lastworkdir/$lastconfig ./savedweights/cls/cls_${id}.py id=$[id+1] done
TRAIN SEGMENTATION MODELS
id=1 for config in $(find ./workconfigs/tract/finalsolution/segmentationconfigs/seg*.py | sort); do ./tools/disttrain.sh $config 2 lastworkdir=$(ls ./workdirs/tract/ -rt | tail -n 1) lastweight=$(ls ./workdirs/tract/$lastworkdir/*.pth -rt | tail -n 1) lastconfig=$(ls ./workdirs/tract/$lastworkdir/*.py -rt | tail -n 1) mv ./workdirs/tract/$lastworkdir/$lastweight ./savedweights/seg/seg${id}.pth mv ./workdirs/tract/$lastworkdir/$lastconfig ./savedweights/seg/seg_${id}.py id=$[id+1] done
TRAIN 3D MODELS
cd ./monai fold=-1 for n in (12 20 32); do mkdir -p ./output/segres${n}all/all python multilabeltrain.py \ -c segres${n}all \ -f $fold \ > ./output/segres${n}all/all/output.txt
mkdir -p ./output/segres${n}_all_round2/all
python multilabel_train.py \
-c segres${n}_all_round2 \
-f $fold \
-w ./output/segres${n}_all/all/last.pth \
> ./output/segres${n}_all_round2/all/output.txt
mv ./output/segres${n}_all_round2/all/last.pth ../saved_weights/3d/segres${n}.pth
done cd .. ```
Inferencing
python inference.py
Owner
- Name: Carno Zhao
- Login: CarnoZhao
- Kind: user
- Location: China
- Company: UCAS
- Repositories: 6
- Profile: https://github.com/CarnoZhao
Deep Learning
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - name: "MMSegmentation Contributors" title: "OpenMMLab Semantic Segmentation Toolbox and Benchmark" date-released: 2020-07-10 url: "https://github.com/open-mmlab/mmsegmentation" license: Apache-2.0
GitHub Events
Total
- Watch event: 4
Last Year
- Watch event: 4
Dependencies
- docutils ==0.16.0
- myst-parser *
- sphinx ==4.0.2
- sphinx_copybutton *
- sphinx_markdown_tables *
- mmcv-full >=1.3.1,<=1.4.0
- cityscapesscripts *
- mmcv *
- prettytable *
- torch *
- torchvision *
- matplotlib *
- numpy *
- packaging *
- prettytable *
- codecov * test
- flake8 * test
- interrogate * test
- isort ==4.3.21 test
- pytest * test
- xdoctest >=0.10.0 test
- yapf * test
- actions/checkout v2 composite
- actions/setup-python v2 composite
- codecov/codecov-action v1.0.10 composite
- codecov/codecov-action v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- Pillow ==9.1.1
- PyWavelets ==1.1.1
- albumentations ==1.0.3
- einops ==0.3.2
- ignite ==1.1.0
- imgaug ==0.4.0
- mmcv ==1.3.17
- mmcv-full ==1.3.17
- nibabel ==3.2.2
- numpy ==1.20.3
- opencv-python ==4.6.0.66
- opencv-python-headless ==4.5.3.56
- pandas ==1.2.4
- pretrainedmodels ==0.7.4
- prettytable ==2.2.0
- pytorch-ignite ==0.4.8
- pytorch-lightning ==1.5.10
- scikit-image ==0.18.2
- scikit-learn ==1.0.1
- segmentation-models-pytorch ==0.2.1
- tensorboard ==2.7.0
- terminaltables ==3.1.0
- thop ==0.0.31.post2005241907
- timm ==0.5.4
- torch ==1.10.0
- torchaudio ==0.10.0
- torchinfo ==1.7.0
- torchmetrics ==0.8.2
- torchvision ==0.11.1
- yapf ==0.32.0