From 2cf4cebbc4ad52487fd6ae3c9427b1e3ac5d3be7 Mon Sep 17 00:00:00 2001 From: KMarshallX Date: Mon, 6 May 2024 12:32:17 +1000 Subject: [PATCH] update pretrained models --- README.md | 2 +- documentation/tta_readme.md | 2 +- notebooks/Module_Prediction.ipynb | 10 +++++----- notebooks/Module_TestTimeAdaptation.ipynb | 14 +++++++------- tests/test_prediction_module.sh | 8 ++++---- tests/test_tta_module.sh | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index ea7525e..552f2d3 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ To predict vessel segmentation using your data and the latest version of VesselB ```bash ml vesselboost path_to_model=/cvmfs/neurodesk.ardc.edu.au/containers/vesselboost_0.9.4_20240404/vesselboost_0.9.4_20240404.simg/opt/VesselBoost/saved_models -prediction.py --ds_path /path/ --out_path /path/ --pretrained "$path_to_model"/manual_ep1000_1029 --prep_mode 4 +prediction.py --ds_path /path/ --out_path /path/ --pretrained "$path_to_model"/manual_0429 --prep_mode 4 ``` For more information, please check our [notebooks](https://github.com/KMarshallX/VesselBoost/tree/master/notebooks). diff --git a/documentation/tta_readme.md b/documentation/tta_readme.md index a5fbf9c..fc1a74c 100644 --- a/documentation/tta_readme.md +++ b/documentation/tta_readme.md @@ -11,7 +11,7 @@ mkdir ./pretrained_models/ Download the pre-trained model from osf: ```bash -osf -p abk4p fetch /osfstorage/pretrained_models/manual_ep1000_1029 ./pretrained_models/manual_ep1000_1029 +osf -p abk4p fetch /osfstorage/pretrained_models/manual_0429 ./pretrained_models/manual_0429 ``` diff --git a/notebooks/Module_Prediction.ipynb b/notebooks/Module_Prediction.ipynb index b9be0f4..cc1c1f6 100644 --- a/notebooks/Module_Prediction.ipynb +++ b/notebooks/Module_Prediction.ipynb @@ -30,9 +30,9 @@ "os.mkdir('./../saved_models/')\n", "os.chdir('./../saved_models/')\n", "\n", - "!osf -p abk4p fetch /pretrained_models/manual_ep1000_1029 ./manual_ep1000_1029\n", - "# !osf -p abk4p fetch /pretrained_models/om1_ep1000_1029 ./om1_ep1000_1029\n", - "# !osf -p abk4p fetch /pretrained_models/om2_ep1000_1029 ./om2_ep1000_1029" + "!osf -p abk4p fetch /pretrained_models/manual_0429 ./manual_0429\n", + "# !osf -p abk4p fetch /pretrained_models/omelette1_0429 ./omelette1_0429\n", + "# !osf -p abk4p fetch /pretrained_models/omelette2_0429 ./omelette2_0429" ] }, { @@ -96,7 +96,7 @@ ], "source": [ "!mkdir -p ./../saved_imgs/generated_label/\n", - "!python ./../prediction.py --ds_path ./../data/img/ --out_path ./../saved_imgs/generated_label/ --pretrained ./../saved_models/manual_ep1000_1029 --prep_mode 4" + "!python ./../prediction.py --ds_path ./../data/img/ --out_path ./../saved_imgs/generated_label/ --pretrained ./../saved_models/manual_0429 --prep_mode 4" ] }, { @@ -184,7 +184,7 @@ "source": [ "!mkdir -p ./../data/preprocessed/\n", "!mkdir -p ./../saved_imgs/generated_label_2/\n", - "!python ./../prediction.py --ds_path ./../data/img/ --ps_path ./../data/preprocessed/ --out_path ./../saved_imgs/generated_label_2/ --pretrained ./../saved_models/manual_ep1000_1029 --prep_mode 1" + "!python ./../prediction.py --ds_path ./../data/img/ --ps_path ./../data/preprocessed/ --out_path ./../saved_imgs/generated_label_2/ --pretrained ./../saved_models/manual_0429 --prep_mode 1" ] }, { diff --git a/notebooks/Module_TestTimeAdaptation.ipynb b/notebooks/Module_TestTimeAdaptation.ipynb index 6b5d150..eeee336 100644 --- a/notebooks/Module_TestTimeAdaptation.ipynb +++ b/notebooks/Module_TestTimeAdaptation.ipynb @@ -30,9 +30,9 @@ "os.mkdir('./../saved_models/')\n", "os.chdir('./../saved_models/')\n", "\n", - "!osf -p abk4p fetch /pretrained_models/manual_ep1000_1029 ./manual_ep1000_1029\n", - "# !osf -p abk4p fetch /pretrained_models/om1_ep1000_1029 ./om1_ep1000_1029\n", - "# !osf -p abk4p fetch /pretrained_models/om2_ep1000_1029 ./om2_ep1000_1029" + "!osf -p abk4p fetch /pretrained_models/manual_0429 ./manual_0429\n", + "# !osf -p abk4p fetch /pretrained_models/omelette1_0429 ./omelette1_0429\n", + "# !osf -p abk4p fetch /pretrained_models/omelette2_0429 ./omelette2_0429" ] }, { @@ -90,7 +90,7 @@ "\n", "Proxies are provided!\n", "Running with CPU\n", - "The chosen model is: ./../saved_models/manual_ep1000_1029\n", + "The chosen model is: ./../saved_models/manual_0429\n", "Finetuning procedure starts!\n", "Epoch: [1/5], Loss: 0.3448, Current learning rate: 0.00100000 \n", "Epoch: [2/5], Loss: 0.7636, Current learning rate: 0.00100000 \n", @@ -127,7 +127,7 @@ ], "source": [ "!mkdir -p ./../saved_imgs/generated_tta_label/\n", - "!python ./../test_time_adaptation.py --ds_path ./../data/img/ --out_path ./../saved_imgs/generated_tta_label/ --pretrained ./../saved_models/manual_ep1000_1029 --prep_mode 4 --ep 5 --lr 1e-3 " + "!python ./../test_time_adaptation.py --ds_path ./../data/img/ --out_path ./../saved_imgs/generated_tta_label/ --pretrained ./../saved_models/manual_0429 --prep_mode 4 --ep 5 --lr 1e-3 " ] }, { @@ -197,7 +197,7 @@ "\n", "Proxies are provided!\n", "Running with CPU\n", - "The chosen model is: ./../saved_models/manual_ep1000_1029\n", + "The chosen model is: ./../saved_models/manual_0429\n", "Finetuning procedure starts!\n", "Epoch: [1/5], Loss: 0.3694, Current learning rate: 0.00100000 \n", "Epoch: [2/5], Loss: 0.8265, Current learning rate: 0.00100000 \n", @@ -234,7 +234,7 @@ ], "source": [ "!mkdir ./../saved_imgs/generated_tta_label_3/ \n", - "!python ./../test_time_adaptation.py --ds_path ./../data/img/ --px_path ./../saved_imgs/generated_tta_label/proxies/ --out_path ./../saved_imgs/generated_tta_label_3/ --pretrained ./../saved_models/manual_ep1000_1029 --prep_mode 4 --ep 5 --lr 1e-3 " + "!python ./../test_time_adaptation.py --ds_path ./../data/img/ --px_path ./../saved_imgs/generated_tta_label/proxies/ --out_path ./../saved_imgs/generated_tta_label_3/ --pretrained ./../saved_models/manual_0429 --prep_mode 4 --ep 5 --lr 1e-3 " ] }, { diff --git a/tests/test_prediction_module.sh b/tests/test_prediction_module.sh index 598c2f0..2e4227c 100644 --- a/tests/test_prediction_module.sh +++ b/tests/test_prediction_module.sh @@ -41,9 +41,9 @@ mkdir ./pretrained_models/ pip install osfclient osf -p nr6gc fetch /osfstorage/twoEchoTOF/raw/GRE_3D_400um_TR20_FA18_TE7p5_14_sli52_FCY_GMP_BW200_32.nii ./data/images/sub-001.nii #pretrained model download -osf -p abk4p fetch /osfstorage/pretrained_models/manual_ep1000_1029 ./pretrained_models/manual_ep1000_1029 -osf -p abk4p fetch /osfstorage/pretrained_models/om1_ep1000_1029 ./pretrained_models/om1_ep1000_1029 -osf -p abk4p fetch /osfstorage/pretrained_models/om2_ep1000_1029 ./pretrained_models/om2_ep1000_1029 +osf -p abk4p fetch /osfstorage/pretrained_models/manual_0429 ./pretrained_models/manual_0429 +osf -p abk4p fetch /osfstorage/pretrained_models/omelette1_0429 ./pretrained_models/omelette1_0429 +osf -p abk4p fetch /osfstorage/pretrained_models/omelette2_0429 ./pretrained_models/omelette2_0429 path_to_images="./data/images/" @@ -55,7 +55,7 @@ echo "Path to output: "$path_to_output"" path_to_preprocessed_images="./data/preprocessed_imgs/" echo "Path to preprocessed images: "$path_to_preprocessed_images"" -path_to_pretrained_model="./pretrained_models/manual_ep1000_1029" +path_to_pretrained_model="./pretrained_models/manual_0429" echo "Path to pretrained model: "$path_to_pretrained_model"" echo "[DEBUG]: testing prediction module without preprocessing:" diff --git a/tests/test_tta_module.sh b/tests/test_tta_module.sh index bc49c4f..fcbf45f 100644 --- a/tests/test_tta_module.sh +++ b/tests/test_tta_module.sh @@ -59,7 +59,7 @@ echo "Path to proxy labels: "$path_to_proxy_labels"" path_to_preprocessed_images="./data/preprocessed_imgs/" echo "Path to preprocessed images: "$path_to_preprocessed_images"" -path_to_pretrained_model="./pretrained_models/manual_ep1000_1029" +path_to_pretrained_model="./pretrained_models/manual_0429" echo "Path to pretrained model: "$path_to_pretrained_model"" n_epochs=5