add reuse instruction
Browse files
README.md
CHANGED
@@ -20,6 +20,20 @@ Samples sizes:
|
|
20 |
- Validation: 1,186 slides (955 patients)
|
21 |
- Test: 1,163 slides (955 patients)
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
## Model performance
|
24 |
|
25 |
The model achieved a weighted average AUROC of 0.99 (one-vs-rest).
|
|
|
20 |
- Validation: 1,186 slides (955 patients)
|
21 |
- Test: 1,163 slides (955 patients)
|
22 |
|
23 |
+
## Reusing this model
|
24 |
+
|
25 |
+
To use this model on the command line, see [WSInfer-MIL](https://github.com/kaczmarj/wsinfer-mil).
|
26 |
+
|
27 |
+
Alternatively, you may use PyTorch on ONNX to run the model. First, embed 128um x 128um patches using CTransPath. Then pass the bag of embeddings to the model.
|
28 |
+
|
29 |
+
```python
|
30 |
+
import onnxruntime as ort
|
31 |
+
import numpy as np
|
32 |
+
embedding = np.ones((1_000, 768), dtype="float32")
|
33 |
+
ort_sess = ort.InferenceSession("model.onnx")
|
34 |
+
logits, attention = ort_sess.run(["logits", "attention"], {'input': embedding})
|
35 |
+
```
|
36 |
+
|
37 |
## Model performance
|
38 |
|
39 |
The model achieved a weighted average AUROC of 0.99 (one-vs-rest).
|