|
a |
|
b/code/4_test.py |
|
|
1 |
import config |
|
|
2 |
from utils_model import get_predictions |
|
|
3 |
|
|
|
4 |
# Run the ResNet on the generated patches. |
|
|
5 |
print("\n\n+++++ Running 4_test.py +++++") |
|
|
6 |
print("\n----- Finding validation patch predictions -----") |
|
|
7 |
# Validation patches. |
|
|
8 |
get_predictions(patches_eval_folder=config.args.patches_eval_val, |
|
|
9 |
output_folder=config.args.preds_val, |
|
|
10 |
auto_select=config.args.auto_select, |
|
|
11 |
batch_size=config.args.batch_size, |
|
|
12 |
checkpoints_folder=config.args.checkpoints_folder, |
|
|
13 |
classes=config.classes, |
|
|
14 |
device=config.device, |
|
|
15 |
eval_model=config.eval_model, |
|
|
16 |
num_classes=config.num_classes, |
|
|
17 |
num_layers=config.args.num_layers, |
|
|
18 |
num_workers=config.args.num_workers, |
|
|
19 |
path_mean=config.path_mean, |
|
|
20 |
path_std=config.path_std, |
|
|
21 |
pretrain=config.args.pretrain) |
|
|
22 |
print("----- Finished finding validation patch predictions -----\n") |
|
|
23 |
print("----- Finding test patch predictions -----") |
|
|
24 |
# Test patches. |
|
|
25 |
get_predictions(patches_eval_folder=config.args.patches_eval_test, |
|
|
26 |
output_folder=config.args.preds_test, |
|
|
27 |
auto_select=config.args.auto_select, |
|
|
28 |
batch_size=config.args.batch_size, |
|
|
29 |
checkpoints_folder=config.args.checkpoints_folder, |
|
|
30 |
classes=config.classes, |
|
|
31 |
device=config.device, |
|
|
32 |
eval_model=config.eval_model, |
|
|
33 |
num_classes=config.num_classes, |
|
|
34 |
num_layers=config.args.num_layers, |
|
|
35 |
num_workers=config.args.num_workers, |
|
|
36 |
path_mean=config.path_mean, |
|
|
37 |
path_std=config.path_std, |
|
|
38 |
pretrain=config.args.pretrain) |
|
|
39 |
print("----- Finished finding test patch predictions -----\n") |
|
|
40 |
print("+++++ Finished running 4_test.py +++++\n\n") |