diff --git a/models/pathology_nuclick_annotation/configs/inference.json b/models/pathology_nuclick_annotation/configs/inference.json index c21e9c89..bb3e4661 100644 --- a/models/pathology_nuclick_annotation/configs/inference.json +++ b/models/pathology_nuclick_annotation/configs/inference.json @@ -1,12 +1,18 @@ { "imports": [ "$import glob", + "$import numpy", "$import json", "$import pathlib", "$import os" ], "bundle_root": ".", + "image_key": "image", "output_dir": "$@bundle_root + '/eval'", + "output_ext": ".png", + "output_dtype": "$numpy.float32", + "output_postfix": "trans", + "separate_folder": true, "dataset_dir": "/workspace/data/CoNSePNuclei", "images": "$list(sorted(glob.glob(@dataset_dir + '/Test/Images/*.png')))[:1]", "centroids": "$list(sorted(glob.glob(@dataset_dir + '/Test/Centroids/*.txt')))[:1]", @@ -32,17 +38,17 @@ "transforms": [ { "_target_": "LoadImaged", - "keys": "image", + "keys": "@image_key", "dtype": "uint8", "image_only": false }, { "_target_": "EnsureChannelFirstd", - "keys": "image" + "keys": "@image_key" }, { "_target_": "ScaleIntensityRanged", - "keys": "image", + "keys": "@image_key", "a_min": 0.0, "a_max": 255.0, "b_min": -1.0, @@ -50,13 +56,13 @@ }, { "_target_": "AddClickSignalsd", - "image": "image", + "image": "@image_key", "foreground": "foreground", "gaussian": false }, { "_target_": "SqueezeDimd", - "keys": "image" + "keys": "@image_key" } ] }, @@ -97,18 +103,14 @@ "keys": "pred", "meta_keys": "pred_meta_dict", "output_dir": "@output_dir", - "output_ext": ".png" + "output_ext": "@output_ext", + "output_dtype": "@output_dtype", + "output_postfix": "@output_postfix", + "separate_folder": "@separate_folder" } ] }, "handlers": [ - { - "_target_": "CheckpointLoader", - "load_path": "$@bundle_root + '/models/model.pt'", - "load_dict": { - "model": "@network" - } - }, { "_target_": "StatsHandler", "iteration_log": false @@ -124,10 +126,18 @@ "val_handlers": "@handlers", "amp": true }, + "checkpointloader": { + "_target_": "CheckpointLoader", + "load_path": "$@bundle_root + '/models/model.pt'", + "load_dict": { + "model": "@network" + } + }, "initialize": [ "$import sys", "$sys.path.append(@bundle_root)", - "$monai.utils.set_determinism(seed=123)" + "$monai.utils.set_determinism(seed=123)", + "$@checkpointloader(@evaluator)" ], "run": [ "$@evaluator.run()" diff --git a/models/pathology_nuclick_annotation/configs/inference_trt.json b/models/pathology_nuclick_annotation/configs/inference_trt.json index 23c2c168..5d6bb807 100644 --- a/models/pathology_nuclick_annotation/configs/inference_trt.json +++ b/models/pathology_nuclick_annotation/configs/inference_trt.json @@ -6,7 +6,11 @@ "$import os", "$import torch_tensorrt" ], - "handlers#0#_disabled_": true, "network_def": "$torch.jit.load(@bundle_root + '/models/model_trt.ts')", - "evaluator#amp": false + "evaluator#amp": false, + "initialize": [ + "$import sys", + "$sys.path.append(@bundle_root)", + "$monai.utils.set_determinism(seed=123)" + ] } diff --git a/models/pathology_nuclick_annotation/configs/metadata.json b/models/pathology_nuclick_annotation/configs/metadata.json index a02729f1..1dfafe62 100644 --- a/models/pathology_nuclick_annotation/configs/metadata.json +++ b/models/pathology_nuclick_annotation/configs/metadata.json @@ -1,7 +1,8 @@ { "schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_20220324.json", - "version": "0.1.6", + "version": "0.1.7", "changelog": { + "0.1.7": "add checkpoint loader for infer", "0.1.6": "set image_only to False", "0.1.5": "add support for TensorRT conversion and inference", "0.1.4": "fix the wrong GPU index issue of multi-node",