-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added new files * add files & fixes * fix * activ sigmoid * infer for lungs * tests * models uploaded, code readability * hemor_contrast old recover 1 * hemor_contrast old recover 2 * revert old test changes * refactor rtk to new files * restore old coco files * restore old test file * rename experiments * lung description check * fix tests * fix tests * tests removed * float comparison in tests * remove selfwritten iou * get test back * black * an attempt to pass tests * an attempt to pass tests * test back * Fixed gdcm error * Fixed gdcm error * fix path bug * more tests * fixes and more tests * argparse tests * tests more * remove redund comments --------- Co-authored-by: Ainur Karimov <[email protected]> Co-authored-by: InnopolisU <[email protected]>
- Loading branch information
1 parent
7c0d925
commit 2f8d602
Showing
32 changed files
with
1,630 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
config/datasets/semantic-segmentation/segmentation_brain_complex.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
_target_: innofw.core.datamodules.lightning_datamodules.coco_rtk.DicomCocoComplexingDataModule | ||
date_time: 30.09.2022 | ||
description: stroke segmentation dataset | ||
markup_info: segmentation masks | ||
name: stroke segmentation | ||
task: | ||
- image-segmentation | ||
|
||
test: | ||
source: https://api.blackhole.ai.innopolis.university/public-datasets/stroke/test.zip | ||
target: ./data/stroke/test | ||
train: | ||
source: https://api.blackhole.ai.innopolis.university/public-datasets/stroke/train.zip | ||
target: ./data/stroke/train | ||
infer: | ||
source: https://api.blackhole.ai.innopolis.university/public-datasets/rtk/complex_infer.zip | ||
target: ./data/complex/infer |
17 changes: 17 additions & 0 deletions
17
config/datasets/semantic-segmentation/segmentation_brain_rtk.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
_target_: innofw.core.datamodules.lightning_datamodules.coco_rtk.DicomCocoDataModuleRTK | ||
date_time: 30.09.2022 | ||
description: stroke segmentation dataset | ||
markup_info: segmentation masks | ||
name: stroke segmentation | ||
task: | ||
- image-segmentation | ||
|
||
test: | ||
source: https://api.blackhole.ai.innopolis.university/public-datasets/stroke/test.zip | ||
target: ./data/rtk/test | ||
train: | ||
source: https://api.blackhole.ai.innopolis.university/public-datasets/stroke/train.zip | ||
target: ./data/rtk/train | ||
infer: | ||
source: https://api.blackhole.ai.innopolis.university/public-datasets/rtk/infer.zip | ||
target: ./data/rtk/infer |
17 changes: 17 additions & 0 deletions
17
config/experiments/semantic-segmentation/AK_081224_Yjc97FX_unet_brain_complex.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# @package _global_ | ||
defaults: | ||
- override /models: semantic-segmentation/unet_brain | ||
- override /datasets: semantic-segmentation/segmentation_brain_complex.yaml | ||
- override /augmentations_train: none #segmentation_stroke.yaml | ||
- override /augmentations_val: none | ||
- override /augmentations_test: none | ||
- override /losses: segmentation_losses.yaml | ||
models: | ||
in_channels: 1 | ||
project: "segmentation" | ||
task: "image-segmentation" | ||
random_seed: 42 | ||
stop_param: 10 | ||
epochs: 300 | ||
weights_freq: 1 | ||
batch_size: 10 |
17 changes: 17 additions & 0 deletions
17
config/experiments/semantic-segmentation/AK_081224_gwVOeQ_unet_brain_rtk.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# @package _global_ | ||
defaults: | ||
- override /models: semantic-segmentation/unet_brain | ||
- override /datasets: semantic-segmentation/segmentation_brain_rtk.yaml | ||
- override /augmentations_train: none #segmentation_stroke.yaml | ||
- override /augmentations_val: none | ||
- override /augmentations_test: none | ||
- override /losses: segmentation_losses.yaml | ||
models: | ||
in_channels: 1 | ||
project: "segmentation" | ||
task: "image-segmentation" | ||
random_seed: 42 | ||
stop_param: 10 | ||
epochs: 300 | ||
weights_freq: 1 | ||
batch_size: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
_target_: segmentation_models_pytorch.FPN | ||
description: Base Unet segmentation model with 1 channel input | ||
name: FPN | ||
in_channels: 1 | ||
classes: 4 | ||
encoder_name: 'efficientnet-b7' | ||
encoder_weights: | ||
activation: sigmoid |
10 changes: 9 additions & 1 deletion
10
examples/infer_contrasting_ct_dicom_brain.sh
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
python3 ./innofw/utils/data_utils/preprocessing/CT_hemorrhage_contrast.py | ||
data_path=$1 | ||
out_path=$2 | ||
|
||
if [ -z "$data_path" ]; then | ||
data_path="https://api.blackhole.ai.innopolis.university/public-datasets/rtk/infer.zip" | ||
echo "Using default data path $data_path" | ||
fi | ||
|
||
python innofw/utils/data_utils/preprocessing/CT_hemorrhage_contrast_rtk.py --input "$data_path" --output "$out_path" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
python infer.py experiments=semantic-segmentation/SK_180822_qmciwj41_unet_brain 'ckpt_path=https://api.blackhole.ai.innopolis.university/pretrained/segmentation_unet_brain.pt' | ||
data_path=$1 | ||
experiments="semantic-segmentation/AK_081224_gwVOeQ_unet_brain_rtk" | ||
ckpt_path="https://api.blackhole.ai.innopolis.university/pretrained/segmentation_rtk_brain.pt" | ||
if [ -z "$data_path" ] | ||
then | ||
python infer.py experiments=$experiments \ | ||
"ckpt_path=$ckpt_path" | ||
else | ||
python infer.py experiments=$experiments \ | ||
"ckpt_path=$ckpt_path" \ | ||
"++datasets.infer.target='$data_path'" \ | ||
"++datasets.infer.source='$data_path'" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
python infer.py experiments=semantic-segmentation/SK_180822_qmciwj41_unet_brain 'ckpt_path=https://api.blackhole.ai.innopolis.university/pretrained/segmentation_unet_brain.pt' | ||
data_path=$1 | ||
experiments="semantic-segmentation/AK_081224_gwVOeQ_unet_brain_rtk" | ||
ckpt_path="https://api.blackhole.ai.innopolis.university/pretrained/segmentation_rtk_brain.pt" | ||
|
||
if [ -z "$data_path" ] | ||
then | ||
python infer.py experiments=$experiments \ | ||
"ckpt_path=$ckpt_path" | ||
else | ||
python infer.py experiments=$experiments \ | ||
"ckpt_path=$ckpt_path" \ | ||
"++datasets.infer.target='$data_path'" \ | ||
"++datasets.infer.source='$data_path'" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
python infer.py experiments=semantic-segmentation/SK_100923_uner_brain_mri.yaml 'ckpt_path=https://api.blackhole.ai.innopolis.university/pretrained/segmentation_unet_brain_complex.pt' | ||
data_path=$1 | ||
ckpt_path="https://api.blackhole.ai.innopolis.university/pretrained/segmentation_rtk_brain.pt" | ||
experiments="semantic-segmentation/AK_081224_Yjc97FX_unet_brain_complex.yaml" | ||
|
||
if [ -z "$data_path" ] | ||
then | ||
python infer.py experiments=$experiments \ | ||
"ckpt_path=$ckpt_path" | ||
else | ||
python infer.py experiments=$experiments \ | ||
"++datasets.infer.source='$data_path'" \ | ||
"ckpt_path=$ckpt_path" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
output=$1 | ||
if [ -z "$output" ]; then | ||
output="../innofw/logs/infer/contrast" | ||
output+="/$(ls $output -tr | tail -n 1)" | ||
output+="/$(ls $output -tr | tail -n 1)" | ||
fi | ||
python innofw/utils/data_utils/preprocessing/CT_hemorrhage_contrast_metrics.py -o "$output" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
data_path=$1 | ||
out=$2 | ||
if [ -z "$data_path" ]; then | ||
data_path="../innofw/data/rtk/infer/" | ||
echo "Using default data path $data_path" | ||
fi | ||
|
||
if [ -z "$output" ]; then | ||
output="../innofw/logs/infer/segmentation/semantic-segmentation/AK_081224_gwVOeQ_unet_brain_rtk/" | ||
output+="$(ls $output | tail -n 1)" | ||
echo "Using default output path $output" | ||
fi | ||
|
||
python innofw/utils/data_utils/rtk/CT_hemorrhage_metrics.py -i "$data_path" -o "$output" -t "detection" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
data_path=$1 | ||
output=$2 | ||
if [ -z "$data_path" ]; then | ||
data_path="../innofw/data/rtk/infer/" | ||
echo "Using default data path $data_path" | ||
fi | ||
|
||
if [ -z "$output" ]; then | ||
output="../innofw/logs/infer/segmentation/semantic-segmentation/AK_081224_gwVOeQ_unet_brain_rtk/" | ||
output+="$(ls $output -tr| tail -n 1)" | ||
echo "Using default output path $output" | ||
fi | ||
|
||
python innofw/utils/data_utils/rtk/CT_hemorrhage_metrics.py -i "$data_path" -o "$output" -t "segmentation" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
data_path=$1 | ||
output=$2 | ||
|
||
if [ -z "$data_path" ]; then | ||
data_path="../innofw/data/complex/infer" | ||
echo "Using default data path $data_path" | ||
fi | ||
|
||
if [ -z "$output" ]; then | ||
output="../innofw/logs/infer/segmentation/semantic-segmentation/AK_081224_Yjc97FX_unet_brain_complex.yaml/" | ||
output+="$(ls $output -tr | tail -n 1)" | ||
fi | ||
python innofw/utils/data_utils/rtk/CT_complexing_metrics.py -i $data_path -o $output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
data_path=$1 | ||
if [ -z "$data_path" ]; then | ||
data_path="./data/lung_description/infer/labels.csv" | ||
echo "Using default data path $data_path" | ||
fi | ||
|
||
if [ -z "$output" ]; then | ||
output="./logs/infer/lung_description_decision/classification/AK_130923_fbFMFDe1_lung_description_decision.yaml/" | ||
output+="$(ls $output -tr| tail -n 1)/" | ||
output+="$(ls $output -tr| tail -n 1)" | ||
echo "Using default output path $output" | ||
fi | ||
|
||
python innofw/utils/data_utils/rtk/lungs_description_metrics.py -i "$data_path" -o "$output" |
Oops, something went wrong.