Skip to content

Commit

Permalink
add nuclick anno
Browse files Browse the repository at this point in the history
Signed-off-by: Yiheng Wang <[email protected]>
  • Loading branch information
yiheng-wang-nv committed Feb 22, 2024
1 parent 4f41bba commit 1483125
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 17 deletions.
38 changes: 24 additions & 14 deletions models/pathology_nuclick_annotation/configs/inference.json
Original file line number Diff line number Diff line change
@@ -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]",
Expand All @@ -32,31 +38,31 @@
"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,
"b_max": 1.0
},
{
"_target_": "AddClickSignalsd",
"image": "image",
"image": "@image_key",
"foreground": "foreground",
"gaussian": false
},
{
"_target_": "SqueezeDimd",
"keys": "image"
"keys": "@image_key"
}
]
},
Expand Down Expand Up @@ -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
Expand All @@ -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": [
"[email protected]()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
}
3 changes: 2 additions & 1 deletion models/pathology_nuclick_annotation/configs/metadata.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 1483125

Please sign in to comment.