-
Notifications
You must be signed in to change notification settings - Fork 60
/
conftest.py
50 lines (44 loc) · 2.2 KB
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from pathlib import Path
from tempfile import TemporaryDirectory
import urllib.request
import os
import urllib.request
import zipfile
import subprocess
import datetime
MODEL_INFO = {'latest':{'model':'DeepLIIF', # cli.py train looks for subfolder "train" under dataroot
'dir_input_train':['Datasets/Sample_Dataset'],
'dir_input_testpy':['Datasets/Sample_Dataset'],
'dir_input_inference':['Datasets/Sample_Dataset/test_cli'],
'dir_model':['../checkpoints/DeepLIIF_Latest_Model'],
'modalities_no': [4],
'seg_gen':[True],
'tile_size':512},
'ext':{'model':'DeepLIIFExt',
'dir_input_train':['Datasets/Sample_Dataset_ext_withseg','Datasets/Sample_Dataset_ext_noseg'],
'dir_input_testpy':['Datasets/Sample_Dataset_ext_withseg','Datasets/Sample_Dataset_ext_noseg'],
'dir_input_inference':['Datasets/Sample_Dataset_ext_withseg/test_cli','Datasets/Sample_Dataset_ext_noseg/test_cli'],
'dir_model':['../checkpoints/deepliif_extension_LN_Tonsil_4mod_400epochs','../checkpoints/HER2_5mod_400epochs'],
'modalities_no':[4,5],
'seg_gen':[True,False],
'tile_size':1024},
'sdg':{'model':'SDG',
'dir_input_train':['Datasets/Sample_Dataset_sdg'],
'dir_input_testpy':['Datasets/Sample_Dataset_sdg'],
'dir_input_inference':['Datasets/Sample_Dataset/test_cli'],
'dir_model':['../checkpoints/sdg_20240104'],
'modalities_no': [4],
'seg_gen':[False],
'tile_size':512}}
def pytest_addoption(parser):
parser.addoption("--model_type", action="store", default="latest")
import pytest
@pytest.fixture(scope="session")
def model_type(pytestconfig):
return pytestconfig.getoption("model_type")
@pytest.fixture(scope="session")
def model_info(model_type):
return MODEL_INFO[model_type]
@pytest.fixture(scope="session")
def model_dir(model_info):
return model_info['dir_model']