Skip to content

Commit

Permalink
update pretrained models
Browse files Browse the repository at this point in the history
  • Loading branch information
KMarshallX committed May 6, 2024
1 parent 8d18aa0 commit 2cf4ceb
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion documentation/tta_readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```


Expand Down
10 changes: 5 additions & 5 deletions notebooks/Module_Prediction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -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"
]
},
{
Expand Down
14 changes: 7 additions & 7 deletions notebooks/Module_TestTimeAdaptation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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 "
]
},
{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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 "
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions tests/test_prediction_module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand All @@ -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:"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tta_module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2cf4ceb

Please sign in to comment.