Spaces:
Runtime error
Runtime error
Anirudh Balaraman commited on
Commit ·
70d0e22
1
Parent(s): b1824d5
update argparse
Browse files- config/config_preprocess.yaml +0 -2
- preprocess_main.py +5 -0
- run_inference.py +6 -0
config/config_preprocess.yaml
CHANGED
|
@@ -2,8 +2,6 @@ t2_dir: /sc-scratch/sc-scratch-cc06-ag-ki-radiologie/prostate_foundation/WSAtten
|
|
| 2 |
dwi_dir: /sc-scratch/sc-scratch-cc06-ag-ki-radiologie/prostate_foundation/WSAttention-Prostate/datatemp/dwi
|
| 3 |
adc_dir: /sc-scratch/sc-scratch-cc06-ag-ki-radiologie/prostate_foundation/WSAttention-Prostate/datatemp/adc
|
| 4 |
output_dir: /sc-scratch/sc-scratch-cc06-ag-ki-radiologie/prostate_foundation/WSAttention-Prostate/datatemp/processed
|
| 5 |
-
project_dir: /sc-scratch/sc-scratch-cc06-ag-ki-radiologie/prostate_foundation/WSAttention-Prostate
|
| 6 |
-
|
| 7 |
|
| 8 |
|
| 9 |
|
|
|
|
| 2 |
dwi_dir: /sc-scratch/sc-scratch-cc06-ag-ki-radiologie/prostate_foundation/WSAttention-Prostate/datatemp/dwi
|
| 3 |
adc_dir: /sc-scratch/sc-scratch-cc06-ag-ki-radiologie/prostate_foundation/WSAttention-Prostate/datatemp/adc
|
| 4 |
output_dir: /sc-scratch/sc-scratch-cc06-ag-ki-radiologie/prostate_foundation/WSAttention-Prostate/datatemp/processed
|
|
|
|
|
|
|
| 5 |
|
| 6 |
|
| 7 |
|
preprocess_main.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import argparse
|
| 2 |
import logging
|
| 3 |
import os
|
|
|
|
| 4 |
|
| 5 |
import yaml
|
| 6 |
|
|
@@ -37,6 +38,7 @@ def parse_args():
|
|
| 37 |
parser.add_argument("--project_dir", default=None, help="Project directory")
|
| 38 |
|
| 39 |
args = parser.parse_args()
|
|
|
|
| 40 |
if args.config:
|
| 41 |
with open(args.config) as config_file:
|
| 42 |
config = yaml.safe_load(config_file)
|
|
@@ -46,6 +48,9 @@ def parse_args():
|
|
| 46 |
|
| 47 |
if __name__ == "__main__":
|
| 48 |
args = parse_args()
|
|
|
|
|
|
|
|
|
|
| 49 |
FUNCTIONS = {
|
| 50 |
"register_and_crop": register_files,
|
| 51 |
"histogram_match": histmatch,
|
|
|
|
| 1 |
import argparse
|
| 2 |
import logging
|
| 3 |
import os
|
| 4 |
+
from pathlib import Path
|
| 5 |
|
| 6 |
import yaml
|
| 7 |
|
|
|
|
| 38 |
parser.add_argument("--project_dir", default=None, help="Project directory")
|
| 39 |
|
| 40 |
args = parser.parse_args()
|
| 41 |
+
|
| 42 |
if args.config:
|
| 43 |
with open(args.config) as config_file:
|
| 44 |
config = yaml.safe_load(config_file)
|
|
|
|
| 48 |
|
| 49 |
if __name__ == "__main__":
|
| 50 |
args = parse_args()
|
| 51 |
+
if args.project_dir is None:
|
| 52 |
+
args.project_dir = Path(__file__).resolve().parent # Set project directory
|
| 53 |
+
|
| 54 |
FUNCTIONS = {
|
| 55 |
"register_and_crop": register_files,
|
| 56 |
"histogram_match": histmatch,
|
run_inference.py
CHANGED
|
@@ -2,6 +2,8 @@ import argparse
|
|
| 2 |
import json
|
| 3 |
import logging
|
| 4 |
import os
|
|
|
|
|
|
|
| 5 |
|
| 6 |
import torch
|
| 7 |
import yaml
|
|
@@ -44,8 +46,12 @@ def parse_args():
|
|
| 44 |
return args
|
| 45 |
|
| 46 |
|
|
|
|
| 47 |
if __name__ == "__main__":
|
| 48 |
args = parse_args()
|
|
|
|
|
|
|
|
|
|
| 49 |
FUNCTIONS = {
|
| 50 |
"register_and_crop": register_files,
|
| 51 |
"histogram_match": histmatch,
|
|
|
|
| 2 |
import json
|
| 3 |
import logging
|
| 4 |
import os
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
|
| 7 |
|
| 8 |
import torch
|
| 9 |
import yaml
|
|
|
|
| 46 |
return args
|
| 47 |
|
| 48 |
|
| 49 |
+
|
| 50 |
if __name__ == "__main__":
|
| 51 |
args = parse_args()
|
| 52 |
+
if args.project_dir is None:
|
| 53 |
+
args.project_dir = Path(__file__).resolve().parent # Set project directory
|
| 54 |
+
|
| 55 |
FUNCTIONS = {
|
| 56 |
"register_and_crop": register_files,
|
| 57 |
"histogram_match": histmatch,
|