Skip to content

Commit

Permalink
Move all test data into test_data folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Min-Sheng committed Jul 12, 2022
1 parent 28abed4 commit 4a531d5
Show file tree
Hide file tree
Showing 327 changed files with 139 additions and 24 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
__pycache__/
.ipynb_checkpoints/
*.out
experiments/
experiments/
checkpoints/
.pytest_cache
21 changes: 9 additions & 12 deletions models/tests/test_cut.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
@pytest.fixture()
def config():
config_path = os.path.join(
'/home/vincentwu',
'URUST_exp',
'config_lung_lesion_for_test_cut.yaml'
"./test_data",
"configs",
"config_lung_lesion_for_test_cut.yaml"
)
config = read_yaml_config(config_path)

Expand All @@ -29,7 +29,7 @@ def in_model(config):
model = get_model(
config=config,
model_name=config["MODEL_NAME"],
normalization='in',
normalization="in",
isTrain=False,
)
model.load_networks(config["INFERENCE_SETTING"]["MODEL_VERSION"])
Expand All @@ -42,7 +42,7 @@ def kin_model(config):
model = get_model(
config=config,
model_name=config["MODEL_NAME"],
normalization='kin',
normalization="kin",
isTrain=False,
)
model.load_networks(config["INFERENCE_SETTING"]["MODEL_VERSION"])
Expand Down Expand Up @@ -71,11 +71,10 @@ def dataloader(dataset):
@pytest.fixture()
def in_expected_outputs(config):
expected_output_dir = os.path.join(
config["EXPERIMENT_ROOT_PATH"],
config["INFERENCE_SETTING"]["TEST_DIR_Y"],
config["EXPERIMENT_NAME"],
"test",
"in",
f"{config['INFERENCE_SETTING']['MODEL_VERSION']}_pytest",
f"{config['INFERENCE_SETTING']['MODEL_VERSION']}",

)
expected_output_files = sorted(
Expand All @@ -97,14 +96,12 @@ def in_expected_outputs(config):
@pytest.fixture()
def kin_expected_outputs(config):
expected_output_dir = os.path.join(
config["EXPERIMENT_ROOT_PATH"],
config["INFERENCE_SETTING"]["TEST_DIR_Y"],
config["EXPERIMENT_NAME"],
"test",
"kin",
config["INFERENCE_SETTING"]["MODEL_VERSION"],
f"{config['INFERENCE_SETTING']['KIN_KERNEL']}_"
f"{config['INFERENCE_SETTING']['KIN_PADDING']}_pytest",

f"{config['INFERENCE_SETTING']['KIN_PADDING']}"
)
expected_output_files = sorted(
os.listdir(expected_output_dir)
Expand Down
20 changes: 9 additions & 11 deletions models/tests/test_cyclegan.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
@pytest.fixture()
def config():
config_path = os.path.join(
'/home/vincentwu',
'URUST_exp',
'config_lung_lesion_for_test_cyclegan.yaml'
"./test_data",
"configs",
"config_lung_lesion_for_test_cyclegan.yaml"
)
config = read_yaml_config(config_path)

Expand All @@ -29,7 +29,7 @@ def in_model(config):
model = get_model(
config=config,
model_name=config["MODEL_NAME"],
normalization='in',
normalization="in",
isTrain=False,
)
model.load_networks(config["INFERENCE_SETTING"]["MODEL_VERSION"])
Expand All @@ -42,7 +42,7 @@ def kin_model(config):
model = get_model(
config=config,
model_name=config["MODEL_NAME"],
normalization='kin',
normalization="kin",
isTrain=False,
)
model.load_networks(config["INFERENCE_SETTING"]["MODEL_VERSION"])
Expand Down Expand Up @@ -71,11 +71,10 @@ def dataloader(dataset):
@pytest.fixture()
def in_expected_outputs(config):
expected_output_dir = os.path.join(
config["EXPERIMENT_ROOT_PATH"],
config["INFERENCE_SETTING"]["TEST_DIR_Y"],
config["EXPERIMENT_NAME"],
"test",
"in",
f"{config['INFERENCE_SETTING']['MODEL_VERSION']}_pytest",
f"{config['INFERENCE_SETTING']['MODEL_VERSION']}",

)
expected_output_files = sorted(
Expand All @@ -97,13 +96,12 @@ def in_expected_outputs(config):
@pytest.fixture()
def kin_expected_outputs(config):
expected_output_dir = os.path.join(
config["EXPERIMENT_ROOT_PATH"],
config["INFERENCE_SETTING"]["TEST_DIR_Y"],
config["EXPERIMENT_NAME"],
"test",
"kin",
config["INFERENCE_SETTING"]["MODEL_VERSION"],
f"{config['INFERENCE_SETTING']['KIN_KERNEL']}_"
f"{config['INFERENCE_SETTING']['KIN_PADDING']}_pytest",
f"{config['INFERENCE_SETTING']['KIN_PADDING']}",

)
expected_output_files = sorted(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
EXPERIMENT_ROOT_PATH: "./test_data/checkpoints/lung_lesion"
EXPERIMENT_NAME: "lung_lesion_CUT"
MODEL_NAME: "CUT" # currently only CUT and cycleGAN are support
DEVICE: "cuda"

TRAINING_SETTING:
PAIRED_TRAINING: False
NUM_EPOCHS: 100
LAMBDA_Y: 1
LEARNING_RATE: 0.0002
BATCH_SIZE: 1
NUM_WORKERS: 4
SAVE_MODEL: true
SAVE_MODEL_EPOCH_STEP: 10
VISUALIZATION_STEP: 250
LOAD_MODEL: false
LOAD_EPOCH: 0

INFERENCE_SETTING:
TEST_DIR_X: "./test_data/test_dir_x/lung_lesion/"
TEST_DIR_Y: "./test_data/test_dir_y/lung_lesion"
MODEL_VERSION: "latest"
SAVE_ORIGINAL_IMAGE: False
NORMALIZATION: "kin"
THUMBNAIL: "None" # set to "None" if it's not required
KIN_PADDING: 1 # for kin
KIN_KERNEL: "gaussian" #constant or gaussian
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
EXPERIMENT_ROOT_PATH: "./test_data/checkpoints/lung_lesion"
EXPERIMENT_NAME: "lung_lesion_cycleGAN"
MODEL_NAME: "cycleGAN" # currently only CUT and cycleGAN are support
DEVICE: "cuda"

TRAINING_SETTING:
PAIRED_TRAINING: False
NUM_EPOCHS: 100
LAMBDA_Y: 1
LEARNING_RATE: 0.0002
BATCH_SIZE: 1
NUM_WORKERS: 4
SAVE_MODEL: true
SAVE_MODEL_EPOCH_STEP: 10
VISUALIZATION_STEP: 250
LOAD_MODEL: false
LOAD_EPOCH: 0

INFERENCE_SETTING:
TEST_DIR_X: "./test_data/test_dir_x/lung_lesion/"
TEST_DIR_Y: "./test_data/test_dir_y/lung_lesion"
MODEL_VERSION: "60"
SAVE_ORIGINAL_IMAGE: False
NORMALIZATION: "kin"
THUMBNAIL: "None" # set to "None" if it's not required
KIN_PADDING: 1 # for kin
KIN_KERNEL: "gaussian" #constant or gaussian
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
0_0_0000_0000_29-041-Izd2-w35-He-les1_4096x4096.png,False
0_1_0000_0512_29-041-Izd2-w35-He-les1_4096x4096.png,False
0_2_0000_1024_29-041-Izd2-w35-He-les1_4096x4096.png,False
0_3_0000_1536_29-041-Izd2-w35-He-les1_4096x4096.png,False
0_4_0000_2048_29-041-Izd2-w35-He-les1_4096x4096.png,False
0_5_0000_2560_29-041-Izd2-w35-He-les1_4096x4096.png,False
0_6_0000_3072_29-041-Izd2-w35-He-les1_4096x4096.png,False
0_7_0000_3584_29-041-Izd2-w35-He-les1_4096x4096.png,False
1_0_0512_0000_29-041-Izd2-w35-He-les1_4096x4096.png,False
1_1_0512_0512_29-041-Izd2-w35-He-les1_4096x4096.png,False
1_2_0512_1024_29-041-Izd2-w35-He-les1_4096x4096.png,False
1_3_0512_1536_29-041-Izd2-w35-He-les1_4096x4096.png,False
1_4_0512_2048_29-041-Izd2-w35-He-les1_4096x4096.png,False
1_5_0512_2560_29-041-Izd2-w35-He-les1_4096x4096.png,False
1_6_0512_3072_29-041-Izd2-w35-He-les1_4096x4096.png,False
1_7_0512_3584_29-041-Izd2-w35-He-les1_4096x4096.png,False
2_0_1024_0000_29-041-Izd2-w35-He-les1_4096x4096.png,False
2_1_1024_0512_29-041-Izd2-w35-He-les1_4096x4096.png,False
2_2_1024_1024_29-041-Izd2-w35-He-les1_4096x4096.png,False
2_3_1024_1536_29-041-Izd2-w35-He-les1_4096x4096.png,False
2_4_1024_2048_29-041-Izd2-w35-He-les1_4096x4096.png,False
2_5_1024_2560_29-041-Izd2-w35-He-les1_4096x4096.png,False
2_6_1024_3072_29-041-Izd2-w35-He-les1_4096x4096.png,False
2_7_1024_3584_29-041-Izd2-w35-He-les1_4096x4096.png,False
3_0_1536_0000_29-041-Izd2-w35-He-les1_4096x4096.png,False
3_1_1536_0512_29-041-Izd2-w35-He-les1_4096x4096.png,False
3_2_1536_1024_29-041-Izd2-w35-He-les1_4096x4096.png,False
3_3_1536_1536_29-041-Izd2-w35-He-les1_4096x4096.png,False
3_4_1536_2048_29-041-Izd2-w35-He-les1_4096x4096.png,False
3_5_1536_2560_29-041-Izd2-w35-He-les1_4096x4096.png,False
3_6_1536_3072_29-041-Izd2-w35-He-les1_4096x4096.png,False
3_7_1536_3584_29-041-Izd2-w35-He-les1_4096x4096.png,False
4_0_2048_0000_29-041-Izd2-w35-He-les1_4096x4096.png,False
4_1_2048_0512_29-041-Izd2-w35-He-les1_4096x4096.png,False
4_2_2048_1024_29-041-Izd2-w35-He-les1_4096x4096.png,False
4_3_2048_1536_29-041-Izd2-w35-He-les1_4096x4096.png,False
4_4_2048_2048_29-041-Izd2-w35-He-les1_4096x4096.png,False
4_5_2048_2560_29-041-Izd2-w35-He-les1_4096x4096.png,False
4_6_2048_3072_29-041-Izd2-w35-He-les1_4096x4096.png,False
4_7_2048_3584_29-041-Izd2-w35-He-les1_4096x4096.png,False
5_0_2560_0000_29-041-Izd2-w35-He-les1_4096x4096.png,False
5_1_2560_0512_29-041-Izd2-w35-He-les1_4096x4096.png,False
5_2_2560_1024_29-041-Izd2-w35-He-les1_4096x4096.png,False
5_3_2560_1536_29-041-Izd2-w35-He-les1_4096x4096.png,False
5_4_2560_2048_29-041-Izd2-w35-He-les1_4096x4096.png,False
5_5_2560_2560_29-041-Izd2-w35-He-les1_4096x4096.png,False
5_6_2560_3072_29-041-Izd2-w35-He-les1_4096x4096.png,False
5_7_2560_3584_29-041-Izd2-w35-He-les1_4096x4096.png,False
6_0_3072_0000_29-041-Izd2-w35-He-les1_4096x4096.png,False
6_1_3072_0512_29-041-Izd2-w35-He-les1_4096x4096.png,False
6_2_3072_1024_29-041-Izd2-w35-He-les1_4096x4096.png,False
6_3_3072_1536_29-041-Izd2-w35-He-les1_4096x4096.png,False
6_4_3072_2048_29-041-Izd2-w35-He-les1_4096x4096.png,False
6_5_3072_2560_29-041-Izd2-w35-He-les1_4096x4096.png,False
6_6_3072_3072_29-041-Izd2-w35-He-les1_4096x4096.png,False
6_7_3072_3584_29-041-Izd2-w35-He-les1_4096x4096.png,False
7_0_3584_0000_29-041-Izd2-w35-He-les1_4096x4096.png,False
7_1_3584_0512_29-041-Izd2-w35-He-les1_4096x4096.png,False
7_2_3584_1024_29-041-Izd2-w35-He-les1_4096x4096.png,False
7_3_3584_1536_29-041-Izd2-w35-He-les1_4096x4096.png,False
7_4_3584_2048_29-041-Izd2-w35-He-les1_4096x4096.png,False
7_5_3584_2560_29-041-Izd2-w35-He-les1_4096x4096.png,False
7_6_3584_3072_29-041-Izd2-w35-He-les1_4096x4096.png,False
7_7_3584_3584_29-041-Izd2-w35-He-les1_4096x4096.png,False
Loading

0 comments on commit 4a531d5

Please sign in to comment.