Update README.md
Browse files
README.md
CHANGED
@@ -65,15 +65,13 @@ import transformers
|
|
65 |
|
66 |
# Paths:
|
67 |
physionet_dir = '/.../physionet.org/files' # Where MIMIC-CXR, MIMIC-CXR-JPG, and MIMIC-IV-ED are stored.
|
68 |
-
|
69 |
-
database_path = '/.../database/cxrmate_ed.db' # The DuckDB database used to manage the tables of the dataset will be saved here.
|
70 |
|
71 |
# Prepare the MIMIC-CXR & MIMIC-IV-ED dataset:
|
72 |
model = transformers.AutoModel.from_pretrained('aehrc/cxrmate-ed', trust_remote_code=True)
|
73 |
model.prepare_data(
|
74 |
physionet_dir=physionet_dir,
|
75 |
-
|
76 |
-
database_path=database_path,
|
77 |
)
|
78 |
```
|
79 |
|
@@ -94,9 +92,7 @@ from torchvision.utils import make_grid
|
|
94 |
# Device and paths:
|
95 |
device = 'cuda'
|
96 |
physionet_dir = '/.../physionet.org/files' # Where MIMIC-CXR, MIMIC-CXR-JPG, and MIMIC-IV-ED are stored.
|
97 |
-
|
98 |
-
database_path = '/.../database/cxrmate_ed.db' # The DuckDB database used to manage the tables of the dataset will be saved here.
|
99 |
-
mimic_cxr_jpg_dir = '/.../physionet.org/files/mimic-cxr-jpg/2.0.0/files' # The path to the JPG images of MIMIC-CXR-JPG. This could be different to physionet_dir to leverage faster storage.
|
100 |
|
101 |
# Download model checkpoint:
|
102 |
model = transformers.AutoModel.from_pretrained('aehrc/cxrmate-ed', trust_remote_code=True).to(device=device)
|
@@ -125,12 +121,11 @@ test_transforms = v2.Compose(
|
|
125 |
# Prepare the MIMIC-CXR & MIMIC-IV-ED dataset:
|
126 |
model.prepare_data(
|
127 |
physionet_dir=physionet_dir,
|
128 |
-
|
129 |
-
database_path=database_path,
|
130 |
)
|
131 |
|
132 |
# Get the test set dataset & dataloader:
|
133 |
-
test_set = model.get_dataset('test', test_transforms,
|
134 |
test_dataloader = DataLoader(
|
135 |
test_set,
|
136 |
batch_size=1,
|
|
|
65 |
|
66 |
# Paths:
|
67 |
physionet_dir = '/.../physionet.org/files' # Where MIMIC-CXR, MIMIC-CXR-JPG, and MIMIC-IV-ED are stored.
|
68 |
+
database_dir = '/.../database/cxrmate_ed' # The LMDB database for the JPGs and the DuckDB database for the tables will be saved here.
|
|
|
69 |
|
70 |
# Prepare the MIMIC-CXR & MIMIC-IV-ED dataset:
|
71 |
model = transformers.AutoModel.from_pretrained('aehrc/cxrmate-ed', trust_remote_code=True)
|
72 |
model.prepare_data(
|
73 |
physionet_dir=physionet_dir,
|
74 |
+
database_dir=database_dir,
|
|
|
75 |
)
|
76 |
```
|
77 |
|
|
|
92 |
# Device and paths:
|
93 |
device = 'cuda'
|
94 |
physionet_dir = '/.../physionet.org/files' # Where MIMIC-CXR, MIMIC-CXR-JPG, and MIMIC-IV-ED are stored.
|
95 |
+
database_dir = '/.../database/cxrmate_ed' # The LMDB database for the JPGs and the DuckDB database for the tables will be saved here.
|
|
|
|
|
96 |
|
97 |
# Download model checkpoint:
|
98 |
model = transformers.AutoModel.from_pretrained('aehrc/cxrmate-ed', trust_remote_code=True).to(device=device)
|
|
|
121 |
# Prepare the MIMIC-CXR & MIMIC-IV-ED dataset:
|
122 |
model.prepare_data(
|
123 |
physionet_dir=physionet_dir,
|
124 |
+
database_dir=database_dir,
|
|
|
125 |
)
|
126 |
|
127 |
# Get the test set dataset & dataloader:
|
128 |
+
test_set = model.get_dataset(split='test', transforms=test_transforms, database_dir=database_dir)
|
129 |
test_dataloader = DataLoader(
|
130 |
test_set,
|
131 |
batch_size=1,
|