Skip to content

Commit

Permalink
Merge branch 'xray_classifier_port' of https://github.com/virginiafde…
Browse files Browse the repository at this point in the history
…z/model-zoo into xray_classifier_port
  • Loading branch information
Virginia committed Dec 12, 2024
2 parents 315276b + f2a5c1a commit 887c472
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Description

A diffusion model to synthetise X-Ray images based on radiological report impressions.
A diffusion model to synthetise X-Ray images based on radiological report impressions.

# Model Overview
This model is trained from scratch using the Latent Diffusion Model architecture [1] and is used for the synthesis of
Expand All @@ -26,7 +26,7 @@ transformers package (https://github.com/huggingface/transformers) (pretrained m
"stabilityai/stable-diffusion-2-1-base") and then encoded using CLIPTextModel from the same package and pretrained
model.

# Examples of inference
# Examples of inference

Here we included a few examples of commands to sample images from the model and save them as .jpg files. The available
arguments for this task are: "--prompt" (str) text prompt to condition the model on; "--guidance_scale" (float), the
Expand Down Expand Up @@ -54,7 +54,7 @@ $ python -m monai.bundle run --config_file configs/inference.json --prompt "Card
## Using a new version of the model

If you want to use the checkpoints from a newly fine-tuned model, you need to set parameter load_old to 0 when you run inference,
to avoid the function load_old_state_dict being called instead of load_state_dict to be called, currently default, as it is
to avoid the function load_old_state_dict being called instead of load_state_dict to be called, currently default, as it is
required to load the checkpoint from the original GenerativeModels repository.

```shell
Expand Down
19 changes: 19 additions & 0 deletions models/maisi_ct_generative/configs/inference_trt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"+imports": [
"$from monai.networks import trt_compile"
],
"c_trt_args": {
"export_args": {
"dynamo": "$False",
"report": "$True"
},
"output_lists": [
[
-1
],
[]
]
},
"controlnet": "$trt_compile(@controlnet_def.to(@device), @trained_controlnet_path, @c_trt_args)",
"diffusion_unet": "$trt_compile(@diffusion_unet_def.to(@device), @trained_diffusion_path)"
}
3 changes: 2 additions & 1 deletion models/maisi_ct_generative/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_generator_ldm_20240318.json",
"version": "0.4.5",
"version": "0.4.6",
"changelog": {
"0.4.6": "add TensorRT support",
"0.4.5": "update README",
"0.4.4": "update issue for IgniteInfo",
"0.4.3": "remove download large files, add weights_only when loading weights and add label_dict to large files",
Expand Down
4 changes: 4 additions & 0 deletions models/model_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -1794,5 +1794,9 @@
"vista3d_v0.5.7": {
"checksum": "f534e27e952c4f6ffafc2d912b5b1c867e75d585",
"source": "https://api.ngc.nvidia.com/v2/models/nvidia/monaihosting/vista3d/versions/0.5.7/files/vista3d_v0.5.7.zip"
},
"maisi_ct_generative_v0.4.6": {
"checksum": "95c9552e4bc421d1533872c7cb9d27969cec685f",
"source": "https://api.ngc.nvidia.com/v2/models/nvidia/monaihosting/maisi_ct_generative/versions/0.4.6/files/maisi_ct_generative_v0.4.6.zip"
}
}

0 comments on commit 887c472

Please sign in to comment.