Skip to content

Commit 0074aaf

Browse files
Restore deleted test_brain_image_synthesis_latent_diffusion_model.py
1 parent 8f3bc68 commit 0074aaf

File tree

2 files changed

+48
-5
lines changed

2 files changed

+48
-5
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright (c) MONAI Consortium
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.
11+
12+
import os
13+
import unittest
14+
15+
from monai.bundle import ConfigWorkflow
16+
from parameterized import parameterized
17+
from utils import check_workflow
18+
19+
TEST_CASE_1 = [ # inference
20+
{
21+
"bundle_root": "models/brain_image_synthesis_latent_diffusion_model",
22+
"gender": 1.0,
23+
"age": 0.7,
24+
"ventricular_vol": 0.7,
25+
"brain_vol": 0.5,
26+
}
27+
]
28+
29+
30+
class BrainImageSynthesisLatentDiffusionModel(unittest.TestCase):
31+
@parameterized.expand([TEST_CASE_1])
32+
def test_inference(self, params):
33+
bundle_root = params["bundle_root"]
34+
inference_file = os.path.join(bundle_root, "configs/inference.json")
35+
trainer = ConfigWorkflow(
36+
workflow_type="inference",
37+
config_file=inference_file,
38+
logging_file=os.path.join(bundle_root, "configs/logging.conf"),
39+
meta_file=os.path.join(bundle_root, "configs/metadata.json"),
40+
**params,
41+
)
42+
check_workflow(trainer, check_properties=True)
43+
44+
45+
if __name__ == "__main__":
46+
loader = unittest.TestLoader()
47+
unittest.main(testLoader=loader)

models/CoronSegmentator/configs/logging.conf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,4 @@ formatter=fullFormatter
1818
args=(sys.stdout,)
1919

2020
[formatter_fullFormatter]
21-
<<<<<<< HEAD
22-
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
23-
=======
24-
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
25-
>>>>>>> c8b3ad0a5842cf425f0ffb9355bfcb67ce994382
21+
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s

0 commit comments

Comments
 (0)